Skip to content

Commit 851b868

Browse files
committed
BoxHelper: Clean up.
1 parent 2e1581f commit 851b868

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

docs/api/extras/helpers/BoxHelper.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,18 @@ <h1>[name]</h1>
1818
<h2>Example</h2>
1919

2020
<code>var sphere = new THREE.SphereGeometry();
21-
var object = new THREE.Mesh( sphere, new THREE.MeshBasicMaterial(0xff0000) );
21+
var object = new THREE.Mesh( sphere, new THREE.MeshBasicMaterial( 0xff0000 ) );
2222
var box = new THREE.BoxHelper( object );
2323
scene.add( box );
2424
</code>
2525

2626

2727
<h2>Constructor</h2>
2828

29-
<h3>[name]( [page:Object3D object], [page:Number hex] )</h3>
29+
<h3>[name]( [page:Object3D object], [page:Color color] )</h3>
3030
<div>
3131
object -- Object3D -- the object3D to show the world-axis-aligned boundingbox.<br />
32-
hex -- hexadecimal value to define color ex:0xffff00
32+
color -- The color of the helper. This can be a [page:Color], a hexadecimal value and an CSS-Color name. Default is 0xffff00
3333
</div>
3434
<div>Creates a new wireframe box matching the size of the passed box.</div>
3535

src/extras/helpers/BoxHelper.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,12 @@
22
* @author mrdoob / http://mrdoob.com/
33
*/
44

5-
THREE.BoxHelper = function ( object, hex ) {
5+
THREE.BoxHelper = function ( object, color ) {
6+
7+
if ( color === undefined ) color = 0xffff00;
68

79
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 ] );
810
var positions = new Float32Array( 8 * 3 );
9-
var color = ( hex !== undefined ) ? hex : 0xffff00;
1011

1112
var geometry = new THREE.BufferGeometry();
1213
geometry.setIndex( new THREE.BufferAttribute( indices, 1 ) );

0 commit comments

Comments
 (0)