This repository has been archived on 2022-12-05. You can view files and clone it, but cannot push or open issues or pull requests.
GeometryDash3D/js/Cone.js

28 lines
667 B
JavaScript
Raw Permalink Normal View History

2022-11-24 21:01:59 +01:00
import { Element } from "./Element.js";
export class Size {
2022-12-03 23:32:14 +01:00
static little = { radius: 0.5, height: 0.5, radialSegments: 5 };
static big = { radius: 0.5, height: 0.8, radialSegments: 12 };
2022-11-24 21:01:59 +01:00
}
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;
}
}