Variable PhysicsConst

Physics: {
    createBoxBody: ((inst, mass, material?, offset?) => Body);
    createPlaneBody: ((inst, mass, material?) => Body);
    createSphereBody: ((inst, mass, material?, offset?) => Body);
} = ...

Type declaration

  • createBoxBody: ((inst, mass, material?, offset?) => Body)
      • (inst, mass, material?, offset?): Body
      • Create a new cube/box CANNON.Body enclosing the provided instance. It will attempt fit the box to the instance as best a possible, otherwise will fall back to a 1x1x1 box

        Parameters

        • inst: Instance

          Instance to create body for

        • mass: number

          Mass of the body

        • Optional material: Material

          Optional CANNON.Material to use

        • offset: XYZ = ...

          Optional offset to apply to the body, useful when models are not centered on origin

        Returns Body

  • createPlaneBody: ((inst, mass, material?) => Body)
      • (inst, mass, material?): Body
      • Create a new CANNON.Body for a plane, will link the body to the instance

        Parameters

        • inst: Instance

          Instance to create body for

        • mass: number

          Mass of the body

        • Optional material: Material

          Optional CANNON.Material to use

        Returns Body

  • createSphereBody: ((inst, mass, material?, offset?) => Body)
      • (inst, mass, material?, offset?): Body
      • Create a new CANNON.Body for a sphere, will link the body to the instance

        Parameters

        • inst: Instance

          Instance to create body for

        • mass: number

          Mass of the body

        • Optional material: Material

          Optional CANNON.Material to use

        • offset: XYZ = ...

        Returns Body

Generated using TypeDoc