As told on WHS.Component
definition, while you can pass any of the inherited params for this component construction, you will need to
pass specific parameters to build this mesh as a geometry object.
This shape can be set as a softbody object.
const box = new WHS.Box({
geometry: {
width: 2,
height: 2,
depth: 2
},
material: new THREE.MeshBasicMaterial({
color: 0xffffff
}),
position: [50, 60, 70]
});
box.addTo(world);
Parameters
Geometry defaults
{
// ...
geometry: {
width: 1, // Number
height: 1, // Number
depth: 1 // Number
}
}
These defaults are additional, there are also defaults filled by
MeshComponent
, etc.
Instructions
{
// ...
geometry: ['width', 'height', 'depth']
}
Updated almost 8 years ago