Bladeren bron

Examples: Clean up.

Mugen87 4 jaren geleden
bovenliggende
commit
22b24b2d0b

+ 21 - 5
examples/jsm/loaders/3DMLoader.js

@@ -442,9 +442,13 @@ Rhino3dmLoader.prototype = Object.assign( Object.create( Loader.prototype ), {
 				var points = new Points( geometry, material );
 				var points = new Points( geometry, material );
 				points.userData[ 'attributes' ] = attributes;
 				points.userData[ 'attributes' ] = attributes;
 				points.userData[ 'objectType' ] = obj.objectType;
 				points.userData[ 'objectType' ] = obj.objectType;
-				if( attributes.name ) {
+
+				if ( attributes.name ) {
+
 					points.name = attributes.name;
 					points.name = attributes.name;
+
 				}
 				}
+
 				return points;
 				return points;
 
 
 			case 'Mesh':
 			case 'Mesh':
@@ -471,8 +475,11 @@ Rhino3dmLoader.prototype = Object.assign( Object.create( Loader.prototype ), {
 				mesh.receiveShadow = attributes.receivesShadows;
 				mesh.receiveShadow = attributes.receivesShadows;
 				mesh.userData[ 'attributes' ] = attributes;
 				mesh.userData[ 'attributes' ] = attributes;
 				mesh.userData[ 'objectType' ] = obj.objectType;
 				mesh.userData[ 'objectType' ] = obj.objectType;
-				if( attributes.name ) {
+
+				if ( attributes.name ) {
+
 					mesh.name = attributes.name;
 					mesh.name = attributes.name;
+
 				}
 				}
 
 
 				return mesh;
 				return mesh;
@@ -494,8 +501,11 @@ Rhino3dmLoader.prototype = Object.assign( Object.create( Loader.prototype ), {
 
 
 				brepObject.userData[ 'attributes' ] = attributes;
 				brepObject.userData[ 'attributes' ] = attributes;
 				brepObject.userData[ 'objectType' ] = obj.objectType;
 				brepObject.userData[ 'objectType' ] = obj.objectType;
-				if( attributes.name ) {
+
+				if ( attributes.name ) {
+
 					brepObject.name = attributes.name;
 					brepObject.name = attributes.name;
+
 				}
 				}
 
 
 				return brepObject;
 				return brepObject;
@@ -513,8 +523,11 @@ Rhino3dmLoader.prototype = Object.assign( Object.create( Loader.prototype ), {
 				var lines = new Line( geometry, material );
 				var lines = new Line( geometry, material );
 				lines.userData[ 'attributes' ] = attributes;
 				lines.userData[ 'attributes' ] = attributes;
 				lines.userData[ 'objectType' ] = obj.objectType;
 				lines.userData[ 'objectType' ] = obj.objectType;
-				if( attributes.name ) {
+
+				if ( attributes.name ) {
+
 					lines.name = attributes.name;
 					lines.name = attributes.name;
+
 				}
 				}
 
 
 				return lines;
 				return lines;
@@ -558,8 +571,11 @@ Rhino3dmLoader.prototype = Object.assign( Object.create( Loader.prototype ), {
 
 
 				sprite.userData[ 'attributes' ] = attributes;
 				sprite.userData[ 'attributes' ] = attributes;
 				sprite.userData[ 'objectType' ] = obj.objectType;
 				sprite.userData[ 'objectType' ] = obj.objectType;
-				if( attributes.name ) {
+
+				if ( attributes.name ) {
+
 					sprite.name = attributes.name;
 					sprite.name = attributes.name;
+
 				}
 				}
 
 
 				return sprite;
 				return sprite;

+ 0 - 1
examples/jsm/loaders/ColladaLoader.d.ts

@@ -1,5 +1,4 @@
 import {
 import {
-	AnimationClip,
 	Loader,
 	Loader,
 	LoadingManager,
 	LoadingManager,
 	Scene
 	Scene

+ 14 - 16
examples/jsm/modifiers/CurveModifier.js

@@ -132,18 +132,18 @@ export function modifyShader( material, uniforms, numberOfCurves = 1 ) {
 		${shader.vertexShader}
 		${shader.vertexShader}
 		`
 		`
 		// chunk import moved in front of modified shader below
 		// chunk import moved in front of modified shader below
-		.replace('#include <beginnormal_vertex>', ``)
+			.replace( '#include <beginnormal_vertex>', `` )
 
 
-		// vec3 transformedNormal declaration overriden below
-		.replace('#include <defaultnormal_vertex>', ``)
+			// vec3 transformedNormal declaration overriden below
+			.replace( '#include <defaultnormal_vertex>', `` )
 
 
-		// vec3 transformed declaration overriden below
-		.replace('#include <begin_vertex>', ``)
+			// vec3 transformed declaration overriden below
+			.replace( '#include <begin_vertex>', `` )
 
 
-		// shader override
-		.replace(
-			/void\s*main\s*\(\)\s*\{/,
-`
+			// shader override
+			.replace(
+				/void\s*main\s*\(\)\s*\{/,
+				`
 void main() {
 void main() {
 #include <beginnormal_vertex>
 #include <beginnormal_vertex>
 
 
@@ -180,13 +180,11 @@ vec3 transformed = basis
 	+ spinePos;
 	+ spinePos;
 
 
 vec3 transformedNormal = normalMatrix * (basis * objectNormal);
 vec3 transformedNormal = normalMatrix * (basis * objectNormal);
-`).replace(
-	'#include <project_vertex>',
-`
-vec4 mvPosition = modelViewMatrix * vec4( transformed, 1.0 );
-gl_Position = projectionMatrix * mvPosition;
-`
-);
+			` ).replace(
+				'#include <project_vertex>',
+				`vec4 mvPosition = modelViewMatrix * vec4( transformed, 1.0 );
+				gl_Position = projectionMatrix * mvPosition;`
+			);
 
 
 		shader.vertexShader = vertexShader;
 		shader.vertexShader = vertexShader;
 
 

+ 11 - 9
examples/jsm/postprocessing/SSAOPass.d.ts

@@ -13,6 +13,15 @@ import {
 
 
 import { Pass } from './Pass';
 import { Pass } from './Pass';
 
 
+export enum OUTPUT {
+	Default,
+	SSAO,
+	Blur,
+	Beauty,
+	Depth,
+	Normal
+}
+
 export class SSAOPass extends Pass {
 export class SSAOPass extends Pass {
 
 
 	constructor( scene: Scene, camera: Camera, width?: number, height?: number );
 	constructor( scene: Scene, camera: Camera, width?: number, height?: number );
@@ -25,7 +34,7 @@ export class SSAOPass extends Pass {
 	kernelSize: number;
 	kernelSize: number;
 	kernel: Vector3[];
 	kernel: Vector3[];
 	noiseTexture: DataTexture;
 	noiseTexture: DataTexture;
-	output: number;
+	output: OUTPUT;
 	minDistance: number;
 	minDistance: number;
 	maxDistance: number;
 	maxDistance: number;
 	beautyRenderTarget: WebGLRenderTarget;
 	beautyRenderTarget: WebGLRenderTarget;
@@ -40,14 +49,7 @@ export class SSAOPass extends Pass {
 	fsQuad: object;
 	fsQuad: object;
 	originalClearColor: Color;
 	originalClearColor: Color;
 
 
-	static OUTPUT: {
-		Default: number;
-		SSAO: number;
-		Blur: number;
-		Beauty: number;
-		Depth: number;
-		Normal: number;
-	};
+	static OUTPUT: OUTPUT;
 
 
 	dipose(): void;
 	dipose(): void;
 	generateSampleKernel(): Vector3[];
 	generateSampleKernel(): Vector3[];