source: other-projects/playing-in-the-street/summer-2013/trunk/Playing-in-the-Street-WPF/Content/Web/mrdoob-three.js-4862f5f/src/extras/helpers/BoundingBoxHelper.js@ 28897

Last change on this file since 28897 was 28897, checked in by davidb, 10 years ago

GUI front-end to server base plus web page content

File size: 675 bytes
Line 
1/**
2 * @author WestLangley / http://github.com/WestLangley
3 */
4
5// a helper to show the world-axis-aligned bounding box for an object
6
7THREE.BoundingBoxHelper = function ( object, hex ) {
8
9 var color = ( hex !== undefined ) ? hex : 0x888888;
10
11 this.object = object;
12
13 this.box = new THREE.Box3();
14
15 THREE.Mesh.call( this, new THREE.CubeGeometry( 1, 1, 1 ), new THREE.MeshBasicMaterial( { color: color, wireframe: true } ) );
16
17};
18
19THREE.BoundingBoxHelper.prototype = Object.create( THREE.Mesh.prototype );
20
21THREE.BoundingBoxHelper.prototype.update = function () {
22
23 this.box.setFromObject( this.object );
24
25 this.box.size( this.scale );
26
27 this.box.center( this.position );
28
29};
Note: See TracBrowser for help on using the repository browser.