UNPKG

three

Version:

JavaScript 3D library

30 lines (21 loc) 860 B
/** * @author mrdoob / http://mrdoob.com/ * based on http://papervision3d.googlecode.com/svn/trunk/as3/trunk/src/org/papervision3d/objects/primitives/Cube.as */ THREE.BoxGeometry = function ( width, height, depth, widthSegments, heightSegments, depthSegments ) { THREE.Geometry.call( this ); this.type = 'BoxGeometry'; this.parameters = { width: width, height: height, depth: depth, widthSegments: widthSegments, heightSegments: heightSegments, depthSegments: depthSegments }; this.fromBufferGeometry( new THREE.BoxBufferGeometry( width, height, depth, widthSegments, heightSegments, depthSegments ) ); this.mergeVertices(); }; THREE.BoxGeometry.prototype = Object.create( THREE.Geometry.prototype ); THREE.BoxGeometry.prototype.constructor = THREE.BoxGeometry; THREE.CubeGeometry = THREE.BoxGeometry;