API Docs for: 0.3.0
Show:

Convex Class

Extends Shape

Convex shape class.

Constructor

Convex

(
  • vertices
)

Parameters:

  • vertices Array

    An array of Float32Array vertices that span this shape. Vertices are given in counter-clockwise (CCW) direction.

Methods

conputeMomentOfInertia

(
  • mass
)
Number

Compute the mass moment of inertia of the Convex.

Parameters:

  • mass Number

Returns:

Number:

updateArea

()

Update the .area

updateBoundingRadius

()

Updates the .boundingRadius property

updateCenterOfMass

()

Update the .centerOfMass property.

updateTriangles

()

Update the .triangles property

Properties

boundingRadius

Number

The bounding radius of the convex

centerOfMass

Float32Array

The center of mass of the Convex

triangles

Array

Triangulated version of this convex. The structure is Array of 3-Arrays, and each subarray contains 3 integers, referencing the vertices.

vertices

Array

Vertices defined in the local frame.