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

In geometry, a tetrahedron is a polyhedron composed of four triangular faces, six straight edges, and four vertex corners. The tetrahedron is the simplest of all the ordinary convex polyhedra and the only one that has fewer than 5 faces.

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

const tetrahedron = new WHS.Tetrahedron({
  geometry: {
    radius: 2,
    detail: 1
  },

  mass: 10,

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

  position: {
    x: 0,
    y: 100,
    z: 0
  }
});

tetrahedron.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']
}