Options
All
  • Public
  • Public/Protected
  • All
Menu

PhysicsShape class. This class is useful for creating a physics shape that can be used in a physics engine. A Physic Shape determine how collision are computed. It must be attached to a body.

Hierarchy

Index

Constructors

  • new PhysicsShape(type: number, options: undefined | PhysicsShapeParameters, scene: Scene): PhysicsShape
  • Constructs a new physics shape.

    Parameters

    • type: number

      The type of the shape.

    • options: undefined | PhysicsShapeParameters

      The options of the shape.

    • scene: Scene

      The scene the shape belongs to.

      This code is useful for creating a new physics shape with the given type, options, and scene. It also checks that the physics engine and plugin version are correct. If not, it throws an error. This ensures that the shape is created with the correct parameters and is compatible with the physics engine.

    Returns PhysicsShape

Properties

_pluginData: any

V2 Physics plugin private data for single shape

Accessors

  • get type(): ShapeType
  • Returns ShapeType

Methods

  • dispose(): void
  • Returns void

  • Returns BoundingBox

  • getDensity(): number
  • Returns number

  • getFilterLayer(): number
  • Returns number

  • Returns undefined | PhysicsMaterial

  • getNumChildren(): number
  • Returns number

  • removeChild(childIndex: number): void
  • Parameters

    • childIndex: number

    Returns void

  • setDensity(density: number): void
  • Parameters

    • density: number

    Returns void

  • setFilterLayer(layer: number): void
  • Parameters

    • layer: number

    Returns void

  • Parameters

    Returns void

Legend

  • Constructor
  • Property
  • Method
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Property
  • Method
  • Static method

Settings

Theme