BodySettings3D constructor

BodySettings3D({
  1. Vector3? position,
  2. Quaternion? rotation,
  3. Vector3? linearVelocity,
  4. Vector3? angularVelocity,
  5. BodyType3D type = BodyType3D.dynamic,
  6. MotionQuality3D motionQuality = MotionQuality3D.discrete,
  7. int layer = 0,
  8. bool isSensor = false,
  9. bool allowSleeping = true,
  10. bool lockRotation = false,
  11. double friction = 0.5,
  12. double restitution = 0.0,
  13. double linearDamping = 0.05,
  14. double angularDamping = 0.05,
  15. double gravityFactor = 1.0,
  16. double mass = 0.0,
  17. int userData = 0,
})

A body with the given settings; the defaults are a dynamic body on layer 0 that may sleep.

Implementation

BodySettings3D({
  Vector3? position,
  Quaternion? rotation,
  Vector3? linearVelocity,
  Vector3? angularVelocity,
  this.type = BodyType3D.dynamic,
  this.motionQuality = MotionQuality3D.discrete,
  this.layer = 0,
  this.isSensor = false,
  this.allowSleeping = true,
  this.lockRotation = false,
  this.friction = 0.5,
  this.restitution = 0.0,
  this.linearDamping = 0.05,
  this.angularDamping = 0.05,
  this.gravityFactor = 1.0,
  this.mass = 0.0,
  this.userData = 0,
}) : position = position ?? Vector3.zero(),
     rotation = rotation ?? Quaternion.identity(),
     linearVelocity = linearVelocity ?? Vector3.zero(),
     angularVelocity = angularVelocity ?? Vector3.zero();