• Public
  • Public/Protected
  • All

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.




  • Constructs a new physics shape.


    • options: PhysicShapeOptions

      The options for the physics shape. These are:

      • type: The type of the shape. This can be one of the following: SPHERE, BOX, CAPSULE, CYLINDER, CONVEX_HULL, MESH, HEIGHTFIELD, CONTAINER
      • parameters: The parameters of the shape.
      • pluginData: The plugin data of the shape. This is used if you already have a reference to the object on the plugin side. You need to specify either type or pluginData.
    • 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


_pluginData: any

V2 Physics plugin private data for single shape


  • get type(): ShapeType
  • Returns ShapeType


  • 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


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