Dart Documentationbox2dManifoldPoint

ManifoldPoint class

class ManifoldPoint {
 /**
  * Usage depends on manifold type. For circles, is the local center of
  * circleB. For faceA, is the local center of CircleB or the clip point of
  * polygonB. For faceB, is the clip point of polygonA.
  */
 final vec2 localPoint;

 /** The non-penetration impulse. */
 num normalImpulse;

 /** The friction impulse. */
 num tangentImpulse;

 /** Unique identifier for a contact point between two shapes. */
 final ContactID id;

 /**
  * Constructs a new ManifoldPoint.
  */
 ManifoldPoint() :
   localPoint = new vec2.zero(),
   tangentImpulse = 0,
   normalImpulse = 0,
   id = new ContactID() { }

 /**
  * Constructs a new ManifoldPoint that is a copy of the given point.
  */
 ManifoldPoint.copy(ManifoldPoint other) :
   localPoint = new vec2.copy(other.localPoint),
   normalImpulse = other.normalImpulse,
   tangentImpulse = other.tangentImpulse,
   id = new ContactID.copy(other.id) { }

 /**
  * Sets this ManifoldPoint to be equal to the given point.
  */
 void setFrom(ManifoldPoint other) {
   localPoint.copyFrom(other.localPoint);
   normalImpulse = other.normalImpulse;
   tangentImpulse = other.tangentImpulse;
   id.setFrom(other.id);
 }
}

Constructors

new ManifoldPoint() #

Constructs a new ManifoldPoint.

ManifoldPoint() :
 localPoint = new vec2.zero(),
 tangentImpulse = 0,
 normalImpulse = 0,
 id = new ContactID() { }

new ManifoldPoint.copy(ManifoldPoint other) #

Constructs a new ManifoldPoint that is a copy of the given point.

ManifoldPoint.copy(ManifoldPoint other) :
 localPoint = new vec2.copy(other.localPoint),
 normalImpulse = other.normalImpulse,
 tangentImpulse = other.tangentImpulse,
 id = new ContactID.copy(other.id) { }

Properties

final ContactID id #

id

final vec2 localPoint #

localPoint

num normalImpulse #

normalImpulse

num tangentImpulse #

tangentImpulse

Methods

void setFrom(ManifoldPoint other) #

Sets this ManifoldPoint to be equal to the given point.

void setFrom(ManifoldPoint other) {
 localPoint.copyFrom(other.localPoint);
 normalImpulse = other.normalImpulse;
 tangentImpulse = other.tangentImpulse;
 id.setFrom(other.id);
}