Dart Documentationbox2dFrictionJointDef

FrictionJointDef class

class FrictionJointDef extends JointDef {
 /** The local anchor point relative to bodyA's origin. */
 final Vector localAnchorA;

 /** The local anchor point relative to bodyB's origin. */
 final Vector localAnchorB;

 /** The maximum friction force in N. */
 num maxForce;

 /** The maximum friction torque in N-m. */
 num maxTorque;

 FrictionJointDef()
     : super(),
       localAnchorA = new Vector(0.0, 0.0),
       localAnchorB = new Vector(0.0, 0.0),
       maxForce = 0.0,
       maxTorque = 0.0 {
   type = JointType.FRICTION;
 }

 void initialize(Body bA, Body bB, Vector anchor) {
   bodyA = bA;
   bodyB = bB;
   bA.getLocalPointToOut(anchor, localAnchorA);
   bB.getLocalPointToOut(anchor, localAnchorB);
 }
}

Extends

JointDef > FrictionJointDef

Constructors

new FrictionJointDef() #

FrictionJointDef()
   : super(),
     localAnchorA = new Vector(0.0, 0.0),
     localAnchorB = new Vector(0.0, 0.0),
     maxForce = 0.0,
     maxTorque = 0.0 {
 type = JointType.FRICTION;
}

Properties

Body bodyA #

inherited from JointDef
bodyA

Body bodyB #

inherited from JointDef
bodyB

bool collideConnected #

inherited from JointDef
collideConnected

final Vector localAnchorA #

localAnchorA

final Vector localAnchorB #

localAnchorB

num maxForce #

maxForce

num maxTorque #

maxTorque

int type #

inherited from JointDef
type

Object userData #

inherited from JointDef
userData

Methods

void initialize(Body bA, Body bB, Vector anchor) #

void initialize(Body bA, Body bB, Vector anchor) {
 bodyA = bA;
 bodyB = bB;
 bA.getLocalPointToOut(anchor, localAnchorA);
 bB.getLocalPointToOut(anchor, localAnchorB);
}