addPointVec method

void addPointVec(
  1. Vec3 pos, [
  2. Vec3? norm,
  3. double penetration = 0,
  4. bool flip = false,
])

Add a point into this manifold.

pos position of the manifold

norm Normal vector of the point

penetration depth of the contact

flip flip direction of contact

Implementation

void addPointVec(Vec3 pos, [Vec3? norm, double penetration = 0, bool flip = false]) {
  ManifoldPoint p = points[numPoints++];

  p.position.copy(pos);
  p.localPoint1.sub(pos, body1!.position).applyMatrix3(body1!.rotation );
  p.localPoint2.sub(pos, body2!.position).applyMatrix3(body2!.rotation );

  if(norm != null){
    p.normal.copy(norm);
  }

  if(flip){
    p.normal.inverse();
  }

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