未验证 提交 c2ecf3b8 编写于 作者: M Mr.doob 提交者: GitHub

Merge pull request #18987 from WestLangley/dev_helper_type

Helpers: Properly specify the type property
......@@ -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;
......
......@@ -106,6 +106,8 @@ function LightProbeHelper( lightProbe, size ) {
Mesh.call( this, geometry, material );
this.type = 'LightProbeHelper';
this.onBeforeRender();
}
......
......@@ -27,6 +27,8 @@ function PositionalAudioHelper( audio, range, divisionsInnerAngle, divisionsOute
Line.call( this, geometry, [ materialOuterAngle, materialInnerAngle ] );
this.type = 'PositionalAudioHelper';
this.update();
}
......
......@@ -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 ];
......
......@@ -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;
......
......@@ -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;
......
......@@ -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;
......
......@@ -32,6 +32,8 @@ function AxesHelper( size ) {
LineSegments.call( this, geometry, material );
this.type = 'AxesHelper';
}
AxesHelper.prototype = Object.create( LineSegments.prototype );
......
......@@ -29,6 +29,8 @@ function Box3Helper( box, color ) {
LineSegments.call( this, geometry, new LineBasicMaterial( { color: color, toneMapped: false } ) );
this.type = 'Box3Helper';
this.geometry.computeBoundingSphere();
}
......
......@@ -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();
......
......@@ -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();
......
......@@ -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 ), {
......
......@@ -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 ];
......
......@@ -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;
......
......@@ -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 );
......
......@@ -73,6 +73,8 @@ function SkeletonHelper( object ) {
LineSegments.call( this, geometry, material );
this.type = 'SkeletonHelper';
this.root = object;
this.bones = bones;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册