Options
All
  • Public
  • Public/Protected
  • All
Menu

Module Physics

Physics simulation properties and methods.

Note: To use physics on an item, enable physics with the item inspector. By default, items ignore physics collisions and forces.

Index

Variables

Let gravityAcceleration

gravityAcceleration: number

Defines the gravity acceleration of the physics simulation. Negative values cause items to fall 'up'.

returns

gravity acceleration.

Let gravityDirection

gravityDirection: Vector3

Defines gravity direction of the Scene.

returns

gravity direction.

Let paused

paused: boolean

Toggles physics simulation. If false, no physics are simulated in the Scene.

returns

paused state of physics simulation.

Let physicsSpeed

physicsSpeed: number

Defines simulation speed of the physics engine.

Low values (below 1) allow you to create slow-motion simulations.

returns

simulation speed.

Let realTime

realTime: boolean

Toggles real-time simulation of the physics engine.

If set to true, physics is calculated using delta time, causing results to be independent to the device performance.

returns

real time simulation state.

Functions

addSceneItems

  • addSceneItems(): void
  • Enables physics on all items in this Scene

    Returns void

createExplosion

  • createExplosion(origin: Vector3, radius: number, power: number): void
  • Creates an explosion force that is applied to all physics-enabled items within radius from the origin. If power is negative, the force attracts items instead.

    Parameters

    • origin: Vector3

      origin of explosion.

    • radius: number

      radius of explosion.

    • power: number

      strength of explosion.

    Returns void

removeSceneItems

  • removeSceneItems(): void
  • Disables physics on all items in this Scene

    Returns void

Generated using TypeDoc