Dart Documentationbox2dFrictionJointDef

FrictionJointDef class

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

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

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

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

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

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

Extends

JointDef > FrictionJointDef

Constructors

new FrictionJointDef() #

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

Properties

Body bodyA #

inherited from JointDef

The first attached body.

Body bodyA

Body bodyB #

inherited from JointDef

The second attached body.

Body bodyB

bool collideConnected #

inherited from JointDef

Set this flag to true if the attached bodies should collide.

bool collideConnected

final vec2 localAnchorA #

The local anchor point relative to bodyA's origin.

final vec2 localAnchorA

final vec2 localAnchorB #

The local anchor point relative to bodyB's origin.

final vec2 localAnchorB

num maxForce #

The maximum friction force in N.

num maxForce

num maxTorque #

The maximum friction torque in N-m.

num maxTorque

int type #

inherited from JointDef

The joint type is set automatically for concrete joint types.

int type

Object userData #

inherited from JointDef

Use this to attach application specific data to your joints.

Object userData

Methods

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

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