浏览代码

Updating PolarGridHelper per code review changes requested

Hectate 8 年之前
父节点
当前提交
f5e7e679e1
共有 1 个文件被更改,包括 9 次插入10 次删除
  1. 9 10
      src/extras/helpers/PolarGridHelper.js

+ 9 - 10
src/extras/helpers/PolarGridHelper.js

@@ -1,10 +1,9 @@
 import { LineSegments } from '../../objects/LineSegments';
 import { VertexColors } from '../../constants';
 import { LineBasicMaterial } from '../../materials/LineBasicMaterial';
-import { Float32Attribute } from '../../core/BufferAttribute';
+import { Float32BufferAttribute } from '../../core/BufferAttribute';
 import { BufferGeometry } from '../../core/BufferGeometry';
 import { Color } from '../../math/Color';
-import { _Math as Math } from '../../math/Math';
 
 /**
  * @author mrdoob / http://mrdoob.com/
@@ -18,8 +17,8 @@ function PolarGridHelper( radius, radials, circles, divisions, color1, color2 )
     radials = radials || 16;
     circles = circles || 8;
     divisions = divisions || 50;
-    color1 = new THREE.Color( color1 !== undefined ? color1 : 0x444444 );
-    color2 = new THREE.Color( color2 !== undefined ? color2 : 0x888888 );
+    color1 = new Color( color1 !== undefined ? color1 : 0x444444 );
+    color2 = new Color( color2 !== undefined ? color2 : 0x888888 );
 
     var vertices = [];
     var colors = [];
@@ -80,15 +79,15 @@ function PolarGridHelper( radius, radials, circles, divisions, color1, color2 )
 
     }
 
-    var geometry = new THREE.BufferGeometry();
-    geometry.addAttribute( 'position', new THREE.Float32Attribute( vertices, 3 ) );
-    geometry.addAttribute( 'color', new THREE.Float32Attribute( colors, 3 ) );
+    var geometry = new BufferGeometry();
+    geometry.addAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) );
+    geometry.addAttribute( 'color', new Float32BufferAttribute( colors, 3 ) );
 
-    var material = new THREE.LineBasicMaterial( { vertexColors: THREE.VertexColors } );
+    var material = new LineBasicMaterial( { vertexColors: VertexColors } );
 
-    THREE.LineSegments.call( this, geometry, material );
+    LineSegments.call( this, geometry, material );
 
 }
 
-PolarGridHelper.prototype = Object.create( THREE.LineSegments.prototype );
+PolarGridHelper.prototype = Object.create( LineSegments.prototype );
 PolarGridHelper.prototype.constructor = PolarGridHelper;