The body to which the shape is added to.
The local bounding sphere radius of this shape.
Whether to produce contact forces when in contact with other bodies. Note that contacts will be generated, but they will be disabled.
faceNormals
Array of integer arrays, indicating which vertices each face consists of
Identifier of the Shape.
Optional material of the shape that regulates contact properties.
The type of this shape. Must be set to an int > 0 by subclasses.
If given, these locally defined, normalized axes are the only ones being checked when doing separating axis check.
uniqueEdges
vertices
worldFaceNormals
worldFaceNormalsNeedsUpdate
worldVertices
worldVerticesNeedsUpdate
All the Shape types.
calculateLocalInertia
calculateWorldAABB
Clip a face against a hull.
An array of Vec3 with vertices in the world frame.
Distance clamping
Computes uniqueEdges
Compute the normals of the faces.
Will reuse existing Vec3 objects in the faceNormals
array if they exist.
Updates worldVertices
and sets worldVerticesNeedsUpdate
to false.
Updates .worldVertices
and sets .worldVerticesNeedsUpdate
to false.
Find the separating axis between this hull and another
The target vector to save the axis in
Returns false if a separation is found, else true
Compute the normal of a face from its vertices
Checks whether p is inside the polyhedra. Must be in local coords. The point lies outside of the convex hull of the other points if and only if the direction of all the vectors from it to those other points are on less than one half of a sphere around it.
A point given in local coordinates
Test separating axis against two hulls. Both hulls are projected onto the axis and the overlap size is returned if there is one.
The overlap depth, or FALSE if no penetration.
Transform all local points. Will change the .vertices
updateBoundingSphereRadius
Get approximate convex volume
Get max and min dot product of a convex hull at position (pos,quat) projected onto an axis. Results are saved in the array maxmin.
result[0] and result[1] will be set to maximum and minimum, respectively.
A set of polygons describing a convex shape.
The shape MUST be convex for the code to work properly. No polygons may be coplanar (contained in the same 3D plane), instead these should be merged into one polygon.
qiao / https://github.com/qiao (original author, see https://github.com/qiao/three.js/commit/85026f0c769e4000148a67d45a9e9b9c5108836f)
schteppe / https://github.com/schteppe
https://www.altdevblogaday.com/2011/05/13/contact-generation-between-3d-convex-meshes/
Move the clipping functions to ContactGenerator?
Automatically merge coplanar polygons in constructor.