Polyhedron()

Base class for polyhedra. It is primarily designed for the internal usage in Yuka. Objects of this class are always build up from faces. The edges, vertices and the polyhedron's centroid have to be derived from a valid face definition with the respective methods.

new Polyhedron()

Constructs a new polyhedron.

Author:

Members

centroid :Vector3

The centroid of this polyhedron.

edges :Array.<HalfEdge>

A list of unique edges (no opponent half edges).

faces :Array.<Polygon>

The faces of this polyhedron.

vertices :Array.<Vector3>

A list of unique vertices.

Methods

computeCentroid() → {Polyhedron}

Computes the centroid of this polyhedron. Assumes its faces have valid centroids.

Returns:
Polyhedron -

A reference to this polyhedron.

computeUniqueEdges() → {Polyhedron}

Computes unique edges of this polyhedron. Assumes Polyhedron#faces is properly set.

Returns:
Polyhedron -

A reference to this polyhedron.

computeUniqueVertices() → {Polyhedron}

Computes unique vertices of this polyhedron. Assumes Polyhedron#faces is properly set.

Returns:
Polyhedron -

A reference to this polyhedron.

fromAABB() → {Polyhedron}

Configures this polyhedron so it does represent the given AABB.

Returns:
Polyhedron -

A reference to this polyhedron.