1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 | import { Geometry } from '../core/Geometry.js';
|
7 | import { PolyhedronBufferGeometry } from './PolyhedronGeometry.js';
|
8 |
|
9 |
|
10 |
|
11 | function TetrahedronGeometry( radius, detail ) {
|
12 |
|
13 | Geometry.call( this );
|
14 |
|
15 | this.type = 'TetrahedronGeometry';
|
16 |
|
17 | this.parameters = {
|
18 | radius: radius,
|
19 | detail: detail
|
20 | };
|
21 |
|
22 | this.fromBufferGeometry( new TetrahedronBufferGeometry( radius, detail ) );
|
23 | this.mergeVertices();
|
24 |
|
25 | }
|
26 |
|
27 | TetrahedronGeometry.prototype = Object.create( Geometry.prototype );
|
28 | TetrahedronGeometry.prototype.constructor = TetrahedronGeometry;
|
29 |
|
30 |
|
31 |
|
32 | function TetrahedronBufferGeometry( radius, detail ) {
|
33 |
|
34 | var vertices = [
|
35 | 1, 1, 1, - 1, - 1, 1, - 1, 1, - 1, 1, - 1, - 1
|
36 | ];
|
37 |
|
38 | var indices = [
|
39 | 2, 1, 0, 0, 3, 2, 1, 3, 0, 2, 3, 1
|
40 | ];
|
41 |
|
42 | PolyhedronBufferGeometry.call( this, vertices, indices, radius, detail );
|
43 |
|
44 | this.type = 'TetrahedronBufferGeometry';
|
45 |
|
46 | this.parameters = {
|
47 | radius: radius,
|
48 | detail: detail
|
49 | };
|
50 |
|
51 | }
|
52 |
|
53 | TetrahedronBufferGeometry.prototype = Object.create( PolyhedronBufferGeometry.prototype );
|
54 | TetrahedronBufferGeometry.prototype.constructor = TetrahedronBufferGeometry;
|
55 |
|
56 |
|
57 | export { TetrahedronGeometry, TetrahedronBufferGeometry };
|