瀏覽代碼

Merge pull request #13670 from giorgiomarcias/fix-computeLineDistances

import `Float32BufferAttribute` since `THREE` is not defined
Mr.doob 7 年之前
父節點
當前提交
e7ac19c16d
共有 2 個文件被更改,包括 4 次插入2 次删除
  1. 2 1
      src/objects/Line.js
  2. 2 1
      src/objects/LineSegments.js

+ 2 - 1
src/objects/Line.js

@@ -6,6 +6,7 @@ import { Vector3 } from '../math/Vector3.js';
 import { LineBasicMaterial } from '../materials/LineBasicMaterial.js';
 import { LineBasicMaterial } from '../materials/LineBasicMaterial.js';
 import { BufferGeometry } from '../core/BufferGeometry.js';
 import { BufferGeometry } from '../core/BufferGeometry.js';
 import { LineSegments } from './LineSegments.js';
 import { LineSegments } from './LineSegments.js';
+import { Float32BufferAttribute } from '../core/BufferAttribute';
 
 
 /**
 /**
  * @author mrdoob / http://mrdoob.com/
  * @author mrdoob / http://mrdoob.com/
@@ -63,7 +64,7 @@ Line.prototype = Object.assign( Object.create( Object3D.prototype ), {
 
 
 					}
 					}
 
 
-					geometry.addAttribute( 'lineDistance', new THREE.Float32BufferAttribute( lineDistances, 1 ) );
+					geometry.addAttribute( 'lineDistance', new Float32BufferAttribute( lineDistances, 1 ) );
 
 
 				} else {
 				} else {
 
 

+ 2 - 1
src/objects/LineSegments.js

@@ -1,5 +1,6 @@
 import { Line } from './Line.js';
 import { Line } from './Line.js';
 import { Vector3 } from '../math/Vector3.js';
 import { Vector3 } from '../math/Vector3.js';
+import { Float32BufferAttribute } from '../core/BufferAttribute';
 
 
 /**
 /**
  * @author mrdoob / http://mrdoob.com/
  * @author mrdoob / http://mrdoob.com/
@@ -47,7 +48,7 @@ LineSegments.prototype = Object.assign( Object.create( Line.prototype ), {
 
 
 					}
 					}
 
 
-					geometry.addAttribute( 'lineDistance', new THREE.Float32BufferAttribute( lineDistances, 1 ) );
+					geometry.addAttribute( 'lineDistance', new Float32BufferAttribute( lineDistances, 1 ) );
 
 
 				} else {
 				} else {