Shape constructor

Shape({
  1. ShapeType type = ShapeType.sphere,
  2. bool collisionResponse = true,
  3. int collisionFilterGroup = -1,
  4. int collisionFilterMask = -1,
  5. double boundingSphereRadius = 0,
  6. Material? material,
  7. Body? body,
})

Implementation

Shape({
  /**
   * The type of this shape.
   */
  this.type =ShapeType.sphere,
  /**
   * Whether to produce contact forces when in contact with other bodies.
   * @default true
   */
  this.collisionResponse = true,
  /**
   * @default 1
   */
  this.collisionFilterGroup = -1,
  /**
   * @default -1
   */
  this.collisionFilterMask = -1,
  /**
   * Optional material of the shape that regulates contact properties.
   * @default null
   * @todo check this, the material is passed to the body, right?
   */
  this.boundingSphereRadius = 0,
  this.material,
  this.body
}) {
  id = Shape.idCounter++;
}