TetrahedronGeometry.js 893 字节
Newer Older
1 2 3 4 5 6 7
/**
 * @author timothypratley / https://github.com/timothypratley
 */

THREE.TetrahedronGeometry = function ( radius, detail ) {

	var vertices = [
8
		 1,  1,  1,   - 1, - 1,  1,   - 1,  1, - 1,    1, - 1, - 1
9 10
	];

M
Mr.doob 已提交
11 12
	var indices = [
		 2,  1,  0,    0,  3,  2,    1,  3,  0,    2,  3,  1
13 14
	];

M
Mr.doob 已提交
15
	THREE.PolyhedronGeometry.call( this, vertices, indices, radius, detail );
16

17 18 19 20 21 22 23
	this.type = 'TetrahedronGeometry';

	this.parameters = {
		radius: radius,
		detail: detail
	};

24
};
25

D
dubejf 已提交
26
THREE.TetrahedronGeometry.prototype = Object.create( THREE.PolyhedronGeometry.prototype );
27
THREE.TetrahedronGeometry.prototype.constructor = THREE.TetrahedronGeometry;
D
dubejf 已提交
28 29 30 31 32 33 34 35

THREE.TetrahedronGeometry.prototype.clone = function () {

	var geometry = new THREE.TetrahedronGeometry(
		this.parameters.radius,
		this.parameters.detail
	);

36
	THREE.PolyhedronGeometry.prototype._copyFrom.call( geometry, this );
D
dubejf 已提交
37 38 39 40

	return geometry;

};