BodyDef constructor

BodyDef({
  1. BodyType type = BodyType.static,
  2. Object? userData,
  3. Vector2? position,
  4. double angle = 0.0,
  5. Vector2? linearVelocity,
  6. double angularVelocity = 0.0,
  7. double linearDamping = 0.0,
  8. double angularDamping = 0.0,
  9. bool allowSleep = true,
  10. bool isAwake = true,
  11. bool fixedRotation = false,
  12. bool bullet = false,
  13. bool active = true,
  14. Vector2? gravityOverride,
  15. Vector2? gravityScale,
})

Implementation

BodyDef({
  this.type = BodyType.static,
  this.userData,
  Vector2? position,
  this.angle = 0.0,
  Vector2? linearVelocity,
  this.angularVelocity = 0.0,
  this.linearDamping = 0.0,
  this.angularDamping = 0.0,
  this.allowSleep = true,
  this.isAwake = true,
  this.fixedRotation = false,
  this.bullet = false,
  this.active = true,
  this.gravityOverride,
  this.gravityScale,
})  : position = position ?? Vector2.zero(),
      linearVelocity = linearVelocity ?? Vector2.zero();