27 lines
668 B
JavaScript
27 lines
668 B
JavaScript
import { Element } from "./Element.js";
|
|
|
|
export class Size {
|
|
static little = { radius: 0.2, height: 0.4, radialSegments: 12 };
|
|
static big = { radius: 0.5, height: 0.7, radialSegments: 12 };
|
|
}
|
|
|
|
export class Cone extends Element {
|
|
constructor(color, level) {
|
|
super();
|
|
|
|
this.data = new THREE.Mesh(
|
|
new THREE.ConeGeometry(
|
|
level.radius,
|
|
level.height,
|
|
level.radialSegments
|
|
),
|
|
new THREE.MeshPhongMaterial({ color: color })
|
|
);
|
|
|
|
// Create shadows
|
|
this.data.castShadow = true;
|
|
|
|
// Move up
|
|
this.data.position.y = 0.2;
|
|
}
|
|
}
|