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

WHS.Plane class is used for creating planes by it's width and height.

const plane = new WHS.Plane({
  geometry: {
    width: 20,
    height: 30
  },

  mass: 0,

  material: {
    color: 0xff0000,
    kind: 'basic'
  }
});

plane.addTo(world);

Parameters

Geometry defaults

{
  // ...

  geometry: {
    width: 10, // Number
    height: 10, // Number
    wSegments: 32, // Number
    hSegments: 32 // Number
  }
}

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

Instructions

{
  // ...

  geometry: ['width', 'height', 'wSegments', 'hSegments']
}