mirror of
https://github.com/WhitestormJS/whs.js.git
synced 2026-01-18 16:03:24 +00:00
34 lines
593 B
JavaScript
34 lines
593 B
JavaScript
import * as UTILS from '../../globals';
|
|
|
|
const world = new WHS.App([
|
|
...UTILS.appModules()
|
|
]);
|
|
|
|
const sphere = new WHS.Sphere({ // Create sphere comonent.
|
|
geometry: {
|
|
radius: 5,
|
|
widthSegments: 32,
|
|
heightSegments: 32
|
|
},
|
|
|
|
modules: [
|
|
new PHYSICS.SphereModule({
|
|
mass: 10,
|
|
restitution: 1
|
|
})
|
|
],
|
|
|
|
material: new THREE.MeshPhongMaterial({
|
|
color: UTILS.$colors.mesh
|
|
}),
|
|
|
|
position: new THREE.Vector3(0, 20, 0)
|
|
});
|
|
|
|
sphere.addTo(world);
|
|
|
|
UTILS.addBoxPlane(world);
|
|
UTILS.addBasicLights(world);
|
|
|
|
world.start(); // Start animations and physics simulation.
|