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

floorHeight: number

Defines height of this Scene used as the "floor" for physics-enabled items.

Default floor height is 0.

returns

floor height.

See Physics.sceneSize

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.

rotationFriction: boolean

Toggles rotational friction in physics simulation, causing items to lose energy by rolling.

returns

rotation friction state.

sceneSize: number

Defines collision boundaries of this Scene. Collision boundaries prevent items from moving indefinitely.

Default size is 85.

returns

boundary size.

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