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
2022-12-03 23:32:14 +01:00

27 lines
667 B
JavaScript

import { Element } from "./Element.js";
export class Size {
static little = { radius: 0.5, height: 0.5, radialSegments: 5 };
static big = { radius: 0.5, height: 0.8, 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;
}
}