mirror of
https://github.com/jiawanlong/Cesium-Examples.git
synced 2025-07-06 08:17:31 +00:00
28 lines
505 B
JavaScript
28 lines
505 B
JavaScript
import Node, { addNodeClass } from '../core/Node.js';
|
|
import { nodeImmutable, float } from '../shadernode/ShaderNode.js';
|
|
|
|
class FrontFacingNode extends Node {
|
|
|
|
constructor() {
|
|
|
|
super( 'bool' );
|
|
|
|
this.isFrontFacingNode = true;
|
|
|
|
}
|
|
|
|
generate( builder ) {
|
|
|
|
return builder.getFrontFacing();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
export default FrontFacingNode;
|
|
|
|
export const frontFacing = nodeImmutable( FrontFacingNode );
|
|
export const faceDirection = float( frontFacing ).mul( 2.0 ).sub( 1.0 );
|
|
|
|
addNodeClass( FrontFacingNode );
|