Options
All
  • Public
  • Public/Protected
  • All
Menu

Namespace 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

gravityAcceleration: number

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

returns

gravity acceleration.

gravityDirection: Vector3

Defines gravity direction of the Scene.

returns

gravity direction.

paused: boolean

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

returns

paused state of physics simulation.

physicsSpeed: number

Defines simulation speed of the physics engine.

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

returns

simulation speed.

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(): void
  • Enables physics on all items in this Scene

    Returns void

  • 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(): void
  • Disables physics on all items in this Scene

    Returns void