diff --git a/docs/api/extras/helpers/BoxHelper.html b/docs/api/extras/helpers/BoxHelper.html index 6ca37c520e14374aa9b516271876d80358990067..1ade404e26551ff1750cbdd26634e431d9646f57 100644 --- a/docs/api/extras/helpers/BoxHelper.html +++ b/docs/api/extras/helpers/BoxHelper.html @@ -18,7 +18,7 @@

Example

var sphere = new THREE.SphereGeometry(); - var object = new THREE.Mesh( sphere, new THREE.MeshBasicMaterial(0xff0000) ); + var object = new THREE.Mesh( sphere, new THREE.MeshBasicMaterial( 0xff0000 ) ); var box = new THREE.BoxHelper( object ); scene.add( box ); @@ -26,10 +26,10 @@

Constructor

-

[name]( [page:Object3D object], [page:Number hex] )

+

[name]( [page:Object3D object], [page:Color color] )

object -- Object3D -- the object3D to show the world-axis-aligned boundingbox.
- hex -- hexadecimal value to define color ex:0xffff00 + color -- The color of the helper. This can be a [page:Color], a hexadecimal value and an CSS-Color name. Default is 0xffff00
Creates a new wireframe box matching the size of the passed box.
diff --git a/src/extras/helpers/BoxHelper.js b/src/extras/helpers/BoxHelper.js index 18c6c79a94f52ec5c30d8e1947280ff0482a1920..8733f9e1b83b03a05fd68bd6cd4b9b187e391be1 100644 --- a/src/extras/helpers/BoxHelper.js +++ b/src/extras/helpers/BoxHelper.js @@ -2,11 +2,12 @@ * @author mrdoob / http://mrdoob.com/ */ -THREE.BoxHelper = function ( object, hex ) { +THREE.BoxHelper = function ( object, color ) { + + if ( color === undefined ) color = 0xffff00; var indices = new Uint16Array( [ 0, 1, 1, 2, 2, 3, 3, 0, 4, 5, 5, 6, 6, 7, 7, 4, 0, 4, 1, 5, 2, 6, 3, 7 ] ); var positions = new Float32Array( 8 * 3 ); - var color = ( hex !== undefined ) ? hex : 0xffff00; var geometry = new THREE.BufferGeometry(); geometry.setIndex( new THREE.BufferAttribute( indices, 1 ) );