WHS.Ring
class makes a circle or just 2D WHS.Torus
that doesn't support physics.
const ring = new WHS.Ring({
geometry: {
innerRadius: 5,
outerRadius: 2
},
material: new THREE.MeshLambertMaterial({
color: 0xffffff,
side THREE.DoubleSide
}),
position: [0, 8, 0],
rotation: {
x: Math.PI/4
}
});
ring.addTo(world);
Parameters
Geometry defaults
{
// ...
geometry: {
innerRadius: 0, // Number.
outerRadius: 50, // Number.
thetaSegments: 8, // Number.
phiSegments: 8, // Number.
thetaStart: 0, // Number.
thetaLength: Math.PI * 2 // Number.
}
}
These defaults are additional, there are also defaults filled by
MeshComponent
, etc.
Instructions
{
// ...
geometry: [
'innerRadius',
'outerRadius',
'thetaSegments',
'phiSegments',
'thetaStart',
'thetaLength'
]
}
Updated almost 8 years ago