Dart Documentationbox2dFixtureDef

FixtureDef class

class FixtureDef {
 /**
  * The shape to use in the fixture. This must be set.
  */
 Shape shape;

 /**
  * Use this to store application specific fixture data.
  */
 dynamic userData;

 /**
  * The friction coefficient, usually in the range [0,1].
  */
 num friction;

 /**
  * The restitution (elasticity) usually in the range [0,1].
  */
 num restitution;

 /**
  * The density, usually in kg/m^2
  */
 num density;

 /**
  * A sensor shape collects contact information but never generates a collision
  * response.
  */
 bool isSensor;

 /**
  * Contact filtering data;
  */
 Filter filter;

 /**
  * Constructs a new FixtureDef with default values.
  */
 FixtureDef() :
   shape = null,
   userData = null,
   friction = 0.2,
   restitution = 0,
   density = 0,
   filter = new Filter(),
   isSensor = false {
   // Setup the filter.
   filter.categoryBits = 0x0001;
   filter.maskBits = 0xFFFF;
   filter.groupIndex = 0;
 }
}

Constructors

new FixtureDef() #

Constructs a new FixtureDef with default values.

FixtureDef() :
 shape = null,
 userData = null,
 friction = 0.2,
 restitution = 0,
 density = 0,
 filter = new Filter(),
 isSensor = false {
 // Setup the filter.
 filter.categoryBits = 0x0001;
 filter.maskBits = 0xFFFF;
 filter.groupIndex = 0;
}

Properties

num density #

The density, usually in kg/m^2

num density

Filter filter #

Contact filtering data;

Filter filter

num friction #

The friction coefficient, usually in the range 0,1.

num friction

bool isSensor #

A sensor shape collects contact information but never generates a collision response.

bool isSensor

num restitution #

The restitution (elasticity) usually in the range 0,1.

num restitution

Shape shape #

The shape to use in the fixture. This must be set.

Shape shape

var userData #

Use this to store application specific fixture data.

dynamic userData