|
@@ -9,18 +9,18 @@
|
|
|
* dir - Vector3
|
|
|
* origin - Vector3
|
|
|
* length - Number
|
|
|
- * hex - color in hex value
|
|
|
+ * color - color in hex value
|
|
|
* headLength - Number
|
|
|
* headWidth - Number
|
|
|
*/
|
|
|
|
|
|
-THREE.ArrowHelper = function ( dir, origin, length, hex, headLength, headWidth ) {
|
|
|
+THREE.ArrowHelper = function ( dir, origin, length, color, headLength, headWidth ) {
|
|
|
|
|
|
// dir is assumed to be normalized
|
|
|
|
|
|
THREE.Object3D.call( this );
|
|
|
|
|
|
- if ( hex === undefined ) hex = 0xffff00;
|
|
|
+ if ( color === undefined ) color = 0xffff00;
|
|
|
if ( length === undefined ) length = 1;
|
|
|
if ( headLength === undefined ) headLength = 0.2 * length;
|
|
|
if ( headWidth === undefined ) headWidth = 0.2 * headLength;
|
|
@@ -31,14 +31,14 @@ THREE.ArrowHelper = function ( dir, origin, length, hex, headLength, headWidth )
|
|
|
lineGeometry.vertices.push( new THREE.Vector3( 0, 0, 0 ) );
|
|
|
lineGeometry.vertices.push( new THREE.Vector3( 0, 1, 0 ) );
|
|
|
|
|
|
- this.line = new THREE.Line( lineGeometry, new THREE.LineBasicMaterial( { color: hex } ) );
|
|
|
+ this.line = new THREE.Line( lineGeometry, new THREE.LineBasicMaterial( { color: color } ) );
|
|
|
this.line.matrixAutoUpdate = false;
|
|
|
this.add( this.line );
|
|
|
|
|
|
var coneGeometry = new THREE.CylinderGeometry( 0, 0.5, 1, 5, 1 );
|
|
|
coneGeometry.applyMatrix( new THREE.Matrix4().makeTranslation( 0, - 0.5, 0 ) );
|
|
|
|
|
|
- this.cone = new THREE.Mesh( coneGeometry, new THREE.MeshBasicMaterial( { color: hex } ) );
|
|
|
+ this.cone = new THREE.Mesh( coneGeometry, new THREE.MeshBasicMaterial( { color: color } ) );
|
|
|
this.cone.matrixAutoUpdate = false;
|
|
|
this.add( this.cone );
|
|
|
|
|
@@ -94,9 +94,9 @@ THREE.ArrowHelper.prototype.setLength = function ( length, headLength, headWidth
|
|
|
|
|
|
};
|
|
|
|
|
|
-THREE.ArrowHelper.prototype.setColor = function ( hex ) {
|
|
|
+THREE.ArrowHelper.prototype.setColor = function ( color ) {
|
|
|
|
|
|
- this.line.material.color.setHex( hex );
|
|
|
- this.cone.material.color.setHex( hex );
|
|
|
+ this.line.material.color.set( color );
|
|
|
+ this.cone.material.color.set( color );
|
|
|
|
|
|
};
|