Browse Source

Examples: Clean up. (#25181)

Michael Herzog 2 years ago
parent
commit
42620fb40c

+ 1 - 1
examples/jsm/nodes/accessors/CubeTextureNode.js

@@ -24,7 +24,7 @@ class CubeTextureNode extends TextureNode {
 
 	getDefaultUV() {
 
-		defaultUV ||= new ReflectVectorNode();
+		defaultUV || ( defaultUV = new ReflectVectorNode() );
 
 		return defaultUV;
 

+ 2 - 2
examples/jsm/nodes/accessors/TextureNode.js

@@ -30,7 +30,7 @@ class TextureNode extends UniformNode {
 
 	getDefaultUV() {
 
-		defaultUV ||= new UVNode();
+		defaultUV || ( defaultUV = new UVNode() );
 
 		return defaultUV;
 
@@ -50,7 +50,7 @@ class TextureNode extends UniformNode {
 
 		}
 
-		uvNode ||= this.getDefaultUV();
+		uvNode || ( uvNode = this.getDefaultUV() );
 
 		//
 

+ 1 - 1
examples/jsm/nodes/core/NodeBuilder.js

@@ -473,7 +473,7 @@ class NodeBuilder {
 
 		const nodeData = this.getDataFromNode( node, shaderStage );
 
-		nodeData.properties ||= { outputNode: null };
+		nodeData.properties || ( nodeData.properties = { outputNode: null } );
 
 		return nodeData.properties;
 

+ 1 - 1
examples/jsm/nodes/core/VaryingNode.js

@@ -40,7 +40,7 @@ class VaryingNode extends Node {
 		const nodeVarying = builder.getVaryingFromNode( this, type );
 
 		// this property can be used to check if the varying can be optimized for a var
-		nodeVarying.needsInterpolation ||= builder.shaderStage === 'fragment';
+		nodeVarying.needsInterpolation || ( nodeVarying.needsInterpolation = ( builder.shaderStage === 'fragment' ) );
 
 		if ( name !== null ) {
 

+ 1 - 1
examples/jsm/nodes/display/ViewportNode.js

@@ -55,7 +55,7 @@ class ViewportNode extends Node {
 
 		if ( scope === ViewportNode.RESOLUTION ) {
 
-			resolution ||= new Vector2();
+			resolution || ( resolution = new Vector2() );
 
 			output = uniform( resolution );
 

+ 2 - 2
examples/jsm/nodes/functions/light/getDirectionVector.js

@@ -4,13 +4,13 @@ let vector3;
 
 const getDirectionVector = ( light, camera, directionVector ) => {
 
-	vector3 ||= new Vector3();
+	vector3 || ( vector3 = new Vector3() );
 
 	directionVector.setFromMatrixPosition( light.matrixWorld );
 	vector3.setFromMatrixPosition( light.target.matrixWorld );
 	directionVector.sub( vector3 );
 	directionVector.transformDirection( camera.matrixWorldInverse );
 
-}
+};
 
 export default getDirectionVector;