ソースを参照

Merge pull request #18987 from WestLangley/dev_helper_type

Helpers: Properly specify the type property
Mr.doob 5 年 前
コミット
c2ecf3b8bc

+ 2 - 0
examples/jsm/helpers/FaceNormalsHelper.js

@@ -54,6 +54,8 @@ function FaceNormalsHelper( object, size, hex, linewidth ) {
 
 	LineSegments.call( this, geometry, new LineBasicMaterial( { color: color, linewidth: width } ) );
 
+	this.type = 'FaceNormalsHelper';
+
 	//
 
 	this.matrixAutoUpdate = false;

+ 2 - 0
examples/jsm/helpers/LightProbeHelper.js

@@ -106,6 +106,8 @@ function LightProbeHelper( lightProbe, size ) {
 
 	Mesh.call( this, geometry, material );
 
+	this.type = 'LightProbeHelper';
+
 	this.onBeforeRender();
 
 }

+ 2 - 0
examples/jsm/helpers/PositionalAudioHelper.js

@@ -27,6 +27,8 @@ function PositionalAudioHelper( audio, range, divisionsInnerAngle, divisionsOute
 
 	Line.call( this, geometry, [ materialOuterAngle, materialInnerAngle ] );
 
+	this.type = 'PositionalAudioHelper';
+
 	this.update();
 
 }

+ 2 - 2
examples/jsm/helpers/RectAreaLightHelper.js

@@ -18,8 +18,6 @@ import {
 
 function RectAreaLightHelper( light, color ) {
 
-	this.type = 'RectAreaLightHelper';
-
 	this.light = light;
 
 	this.color = color; // optional hardwired color for the helper
@@ -34,6 +32,8 @@ function RectAreaLightHelper( light, color ) {
 
 	Line.call( this, geometry, material );
 
+	this.type = 'RectAreaLightHelper';
+
 	//
 
 	var positions2 = [ 1, 1, 0, - 1, 1, 0, - 1, - 1, 0, 1, 1, 0, - 1, - 1, 0, 1, - 1, 0 ];

+ 2 - 0
examples/jsm/helpers/VertexNormalsHelper.js

@@ -53,6 +53,8 @@ function VertexNormalsHelper( object, size, hex, linewidth ) {
 
 	LineSegments.call( this, geometry, new LineBasicMaterial( { color: color, linewidth: width } ) );
 
+	this.type = 'VertexNormalsHelper';
+
 	//
 
 	this.matrixAutoUpdate = false;

+ 2 - 0
examples/jsm/helpers/VertexTangentsHelper.js

@@ -46,6 +46,8 @@ function VertexTangentsHelper( object, size, hex, linewidth ) {
 
 	LineSegments.call( this, geometry, new LineBasicMaterial( { color: color, linewidth: width } ) );
 
+	this.type = 'VertexTangentsHelper';
+
 	//
 
 	this.matrixAutoUpdate = false;

+ 2 - 0
src/helpers/ArrowHelper.js

@@ -33,6 +33,8 @@ function ArrowHelper( dir, origin, length, color, headLength, headWidth ) {
 
 	Object3D.call( this );
 
+	this.type = 'ArrowHelper';
+
 	if ( dir === undefined ) dir = new Vector3( 0, 0, 1 );
 	if ( origin === undefined ) origin = new Vector3( 0, 0, 0 );
 	if ( length === undefined ) length = 1;

+ 2 - 0
src/helpers/AxesHelper.js

@@ -32,6 +32,8 @@ function AxesHelper( size ) {
 
 	LineSegments.call( this, geometry, material );
 
+	this.type = 'AxesHelper';
+
 }
 
 AxesHelper.prototype = Object.create( LineSegments.prototype );

+ 2 - 0
src/helpers/Box3Helper.js

@@ -29,6 +29,8 @@ function Box3Helper( box, color ) {
 
 	LineSegments.call( this, geometry, new LineBasicMaterial( { color: color, toneMapped: false } ) );
 
+	this.type = 'Box3Helper';
+
 	this.geometry.computeBoundingSphere();
 
 }

+ 2 - 0
src/helpers/BoxHelper.js

@@ -26,6 +26,8 @@ function BoxHelper( object, color ) {
 
 	LineSegments.call( this, geometry, new LineBasicMaterial( { color: color, toneMapped: false } ) );
 
+	this.type = 'BoxHelper';
+
 	this.matrixAutoUpdate = false;
 
 	this.update();

+ 2 - 0
src/helpers/CameraHelper.js

@@ -111,6 +111,8 @@ function CameraHelper( camera ) {
 
 	LineSegments.call( this, geometry, material );
 
+	this.type = 'CameraHelper';
+
 	this.camera = camera;
 	if ( this.camera.updateProjectionMatrix ) this.camera.updateProjectionMatrix();
 

+ 2 - 0
src/helpers/GridHelper.js

@@ -43,6 +43,8 @@ function GridHelper( size, divisions, color1, color2 ) {
 
 	LineSegments.call( this, geometry, material );
 
+	this.type = 'GridHelper';
+
 }
 
 GridHelper.prototype = Object.assign( Object.create( LineSegments.prototype ), {

+ 2 - 2
src/helpers/PlaneHelper.js

@@ -13,8 +13,6 @@ import { FrontSide, BackSide } from '../constants.js';
 
 function PlaneHelper( plane, size, hex ) {
 
-	this.type = 'PlaneHelper';
-
 	this.plane = plane;
 
 	this.size = ( size === undefined ) ? 1 : size;
@@ -29,6 +27,8 @@ function PlaneHelper( plane, size, hex ) {
 
 	Line.call( this, geometry, new LineBasicMaterial( { color: color, toneMapped: false } ) );
 
+	this.type = 'PlaneHelper';
+
 	//
 
 	var positions2 = [ 1, 1, 1, - 1, 1, 1, - 1, - 1, 1, 1, 1, 1, - 1, - 1, 1, 1, - 1, 1 ];

+ 2 - 0
src/helpers/PointLightHelper.js

@@ -19,6 +19,8 @@ function PointLightHelper( light, sphereSize, color ) {
 
 	Mesh.call( this, geometry, material );
 
+	this.type = 'PointLightHelper';
+
 	this.matrix = this.light.matrixWorld;
 	this.matrixAutoUpdate = false;
 

+ 2 - 0
src/helpers/PolarGridHelper.js

@@ -86,6 +86,8 @@ function PolarGridHelper( radius, radials, circles, divisions, color1, color2 )
 
 	LineSegments.call( this, geometry, material );
 
+	this.type = 'PolarGridHelper';
+
 }
 
 PolarGridHelper.prototype = Object.create( LineSegments.prototype );

+ 2 - 0
src/helpers/SkeletonHelper.js

@@ -73,6 +73,8 @@ function SkeletonHelper( object ) {
 
 	LineSegments.call( this, geometry, material );
 
+	this.type = 'SkeletonHelper';
+
 	this.root = object;
 	this.bones = bones;