These docs are for v1.2. Click to read the latest docs for v2-beta.x.

In geometry, an octahedron is a polyhedron with eight faces. A regular octahedron is a Platonic solid composed of eight equilateral triangles, four of which meet at each vertex.

WHS.Octahedron creates Octahedron object by it's radius and detail.

const octahedron = new WHS.Octahedron({
  geometry: {
    radius: 2,
    detail: 1
  },

  mass: 10,

  material: {
    color: 0xffffff,
    kind: 'basic'
  },

  position: [0, 100, 0]
});

octahedron.addTo(world);

Parameters

Geometry defaults

{
  // ...

  geometry: {
    radius: 1, // Number
    detail: 0 // Number
  }
}

These defaults are additional, there are also defaults filled by MeshComponent, etc.

Instructions

{
  // ...

  geometry: ['radius', 'detail']
}