A manifold point is a contact point belonging to a contact manifold. It holds details related to the geometry and dynamics of the contact points. The local point usage depends on the manifold type:
  • e_circles: the local center of circleB
  • e_faceA: the local center of cirlceB or the clip point of polygonB
  • e_faceB: the clip point of polygonA
This structure is stored across time steps, so we keep it small.
Note: the impulses are used for internal caching and may not provide reliable contact forces, especially for high speed collisions.
Example #1
0
 /// <summary>
 ///  Sets this manifold point form the given one
 /// </summary>
 /// <param name="cp">the point to copy from</param>
 public void Set(ManifoldPoint cp)
 {
     LocalPoint.Set(cp.LocalPoint);
     NormalImpulse  = cp.NormalImpulse;
     TangentImpulse = cp.TangentImpulse;
     Id.Set(cp.Id);
 }
Example #2
0
 /// <summary>
 /// Creates a manifold point as a copy of the given point
 /// </summary>
 /// <param name="cp">point to copy from</param>
 public ManifoldPoint(ManifoldPoint cp)
 {
     LocalPoint     = cp.LocalPoint.Clone();
     NormalImpulse  = cp.NormalImpulse;
     TangentImpulse = cp.TangentImpulse;
     Id             = new ContactID(cp.Id);
 }
Example #3
0
 /// <summary>
 /// creates a manifold with 0 points, with it's points array full of instantiated ManifoldPoints.
 /// </summary>
 public Manifold()
 {
     Points = new ManifoldPoint[Settings.MAX_MANIFOLD_POINTS];
     for (int i = 0; i < Settings.MAX_MANIFOLD_POINTS; i++)
     {
         Points[i] = new ManifoldPoint();
     }
     LocalNormal = new Vec2();
     LocalPoint  = new Vec2();
     PointCount  = 0;
 }
Example #4
0
 /// <summary> creates a manifold with 0 points, with it's points array full of instantiated ManifoldPoints.</summary>
 public Manifold()
 {
     points = new ManifoldPoint[Settings.maxManifoldPoints];
     for (int i = 0; i < Settings.maxManifoldPoints; i++)
     {
         points[i] = new ManifoldPoint();
     }
     localNormal = new Vec2();
     localPoint = new Vec2();
     pointCount = 0;
 }
Example #5
0
 /// <summary>
 /// Creates this manifold as a copy of the other
 /// </summary>
 /// <param name="other"></param>
 public Manifold(Manifold other)
 {
     Points      = new ManifoldPoint[Settings.MAX_MANIFOLD_POINTS];
     LocalNormal = other.LocalNormal.Clone();
     LocalPoint  = other.LocalPoint.Clone();
     PointCount  = other.PointCount;
     Type        = other.Type;
     // djm: this is correct now
     for (int i = 0; i < Settings.MAX_MANIFOLD_POINTS; i++)
     {
         Points[i] = new ManifoldPoint(other.Points[i]);
     }
 }
Example #6
0
 /// <summary>
 /// Creates this manifold as a copy of the other
 /// </summary>
 /// <param name="other"></param>
 public Manifold(Manifold other)
 {
     points = new ManifoldPoint[Settings.maxManifoldPoints];
     localNormal = other.localNormal.Clone();
     localPoint = other.localPoint.Clone();
     pointCount = other.pointCount;
     type = other.type;
     // djm: this is correct now
     for (int i = 0; i < Settings.maxManifoldPoints; i++)
     {
         points[i] = new ManifoldPoint(other.points[i]);
     }
 }
Example #7
0
 /// <summary>
 ///  Sets this manifold point form the given one
 /// </summary>
 /// <param name="cp">the point to copy from</param>
 public void Set(ManifoldPoint cp)
 {
     LocalPoint.Set(cp.LocalPoint);
     NormalImpulse = cp.NormalImpulse;
     TangentImpulse = cp.TangentImpulse;
     Id.Set(cp.Id);
 }
Example #8
0
 /// <summary>
 /// Creates a manifold point as a copy of the given point
 /// </summary>
 /// <param name="cp">point to copy from</param>
 public ManifoldPoint(ManifoldPoint cp)
 {
     LocalPoint = cp.LocalPoint.Clone();
     NormalImpulse = cp.NormalImpulse;
     TangentImpulse = cp.TangentImpulse;
     Id = new ContactID(cp.Id);
 }
Example #9
0
 /// <summary> 
 /// creates a manifold with 0 points, with it's points array full of instantiated ManifoldPoints.
 /// </summary>
 public Manifold()
 {
     Points = new ManifoldPoint[Settings.MAX_MANIFOLD_POINTS];
     for (int i = 0; i < Settings.MAX_MANIFOLD_POINTS; i++)
     {
         Points[i] = new ManifoldPoint();
     }
     LocalNormal = new Vec2();
     LocalPoint = new Vec2();
     PointCount = 0;
 }
Example #10
0
 /// <summary>
 /// Creates this manifold as a copy of the other
 /// </summary>
 /// <param name="other"></param>
 public Manifold(Manifold other)
 {
     Points = new ManifoldPoint[Settings.MAX_MANIFOLD_POINTS];
     LocalNormal = other.LocalNormal.Clone();
     LocalPoint = other.LocalPoint.Clone();
     PointCount = other.PointCount;
     Type = other.Type;
     // djm: this is correct now
     for (int i = 0; i < Settings.MAX_MANIFOLD_POINTS; i++)
     {
         Points[i] = new ManifoldPoint(other.Points[i]);
     }
 }
Example #11
0
 /// <summary>Creates a manifold point as a copy of the given point</summary>
 /// <param name="cp">point to copy from</param>
 public ManifoldPoint(ManifoldPoint cp)
 {
     localPoint = cp.localPoint.Clone();
     normalImpulse = cp.normalImpulse;
     tangentImpulse = cp.tangentImpulse;
     id = new ContactID(cp.id);
 }
Example #12
0
 /// <summary> Sets this manifold point form the given one</summary>
 /// <param name="cp">the point to copy from
 /// </param>
 public virtual void set_Renamed(ManifoldPoint cp)
 {
     localPoint.set_Renamed(cp.localPoint);
     normalImpulse = cp.normalImpulse;
     tangentImpulse = cp.tangentImpulse;
     id.set_Renamed(cp.id);
 }