API Docs for: GoblinPhysics
Show:

World Class

Module: Goblin

Manages the physics simulation

Constructor

World

(
  • broadphase
  • nearphase
)

Parameters:

  • broadphase Goblin.Broadphase

    the broadphase used by the world to find possible contacts

  • nearphase Goblin.NearPhase

    the nearphase used by the world to generate valid contacts

Methods

addConstraint

(
  • constraint
)

adds a constraint to the world

Parameters:

  • constraint Goblin.Constraint

    constraint to be added

addForceGenerator

(
  • force_generator
)

Adds a force generator to the world

Parameters:

  • force_generator Goblin.ForceGenerator

    force generator object to be added

addRigidBody

(
  • rigid_body
)

Adds a rigid body to the world

Parameters:

  • rigid_body Goblin.RigidBody

    rigid body to add to the world

removeConstraint

(
  • constraint
)

removes a constraint from the world

Parameters:

  • constraint Goblin.Constraint

    constraint to be removed

removeForceGenerator

(
  • force_generatorv
)

removes a force generator from the world

Parameters:

  • force_generatorv Goblin.ForceGenerator

    force generator object to be removed

removeRigidBody

(
  • rigid_body
)

Removes a rigid body from the world

Parameters:

  • rigid_body Goblin.RigidBody

    rigid body to remove from the world

step

(
  • time_delta
  • [max_step]
)

Steps the physics simulation according to the time delta

Parameters:

  • time_delta Number

    amount of time to simulate, in seconds

  • [max_step] Number optional

    maximum time step size, in seconds

Properties

broadphase

Goblin.Broadphase

The broadphase used by the world to find possible contacts

end {vec3{ end point of the segment

Vec3

Checks if a ray segment intersects with objects in the world

force_generators

Array private

array of force generators in the world

Default: []

gravity

Vec3

the world's gravity, applied by default to all objects in the world

Default: [ 0, -9.8, 0 ]

nearphasee

Goblin.NearPhase

The nearphase used by the world to generate valid contacts

rigid_bodies

Array private

Array of rigid_bodies in the world

Default: []

solver

Unknown

The contact solver used by the world to calculate and apply impulses resulting from contacts

ticks

Number

How many time steps have been simulated. If the steps are always the same length then total simulation time = world.ticks * time_step