mirror of
https://github.com/WhitestormJS/whs.js.git
synced 2025-12-08 20:26:23 +00:00
36 lines
620 B
JavaScript
36 lines
620 B
JavaScript
import * as UTILS from '@utils';
|
|
|
|
const app = new WHS.App([
|
|
...UTILS.appModules()
|
|
]);
|
|
|
|
const sphere = new WHS.Cylinder({ // Create sphere comonent.
|
|
geometry: {
|
|
radiusTop: 1,
|
|
radiusBottom: 1,
|
|
height: 2,
|
|
radiusSegments: 32,
|
|
heightSegments: 32,
|
|
},
|
|
|
|
modules: [
|
|
new PHYSICS.CylinderModule({
|
|
mass: 2,
|
|
restitution: 1
|
|
})
|
|
],
|
|
|
|
material: new THREE.MeshPhongMaterial({
|
|
color: UTILS.$colors.mesh
|
|
}),
|
|
|
|
position: new THREE.Vector3(0, 20, 0)
|
|
});
|
|
|
|
sphere.addTo(app);
|
|
|
|
UTILS.addBoxPlane(app);
|
|
UTILS.addBasicLights(app);
|
|
|
|
app.start(); // Start animations and physics simulation.
|