Alexander Buzin 94281dae50 v2.2.0-alpha.0
Former-commit-id: a9cb3cebf19b298c5f08c87b208f26bfe5c5dfa4
2018-05-19 01:24:51 +03:00

50 lines
866 B
JavaScript

import * as UTILS from '@utils';
const app = new WHS.App([
...UTILS.appModules()
]);
const sphere = new WHS.Sphere({ // Create sphere comonent.
geometry: {
radius: 3,
widthSegments: 32,
heightSegments: 32
},
modules: [
new PHYSICS.SphereModule({
mass: 10 // Mass of physics object.
})
],
material: new THREE.MeshLambertMaterial({
color: UTILS.$colors.mesh
}),
position: [0, 100, 0]
});
const box = new WHS.Box({ // Create sphere comonent.
geometry: [2, 2, 2],
modules: [
new PHYSICS.BoxModule({
mass: 10 // Mass of physics object.
})
],
material: new THREE.MeshLambertMaterial({
color: UTILS.$colors.mesh
}),
position: [2, -3, 2]
});
box.addTo(sphere);
sphere.addTo(app);
UTILS.addPlane(app);
UTILS.addBasicLights(app);
app.start(); // Start animations and physics simulation.]