addPoint method

void addPoint(
  1. double x,
  2. double y,
  3. double z,
  4. double nx,
  5. double ny,
  6. double nz,
  7. double penetration,
  8. bool flip,
)

Add a point into this manifold.

x x position

y y position

z z position

nx normal x

ny normal y

nz normal z

penetration depth of the point

flip need to be flipped

Implementation

void addPoint(double x,double y,double z,double nx,double ny,double nz,double penetration,bool flip){
  ManifoldPoint p = points[numPoints++];

  p.position.set( x, y, z );
  p.localPoint1.sub( p.position, body1!.position ).applyMatrix3(body1!.rotation );
  p.localPoint2.sub( p.position, body2!.position ).applyMatrix3(body2!.rotation );

  p.normalImpulse = 0;

  p.normal.set( nx, ny, nz );
  if( flip ) p.normal.inverse();

  p.penetration = penetration;
  p.warmStarted = false;
}