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:17:30 +01:00

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;
}
}