World Class
Manages the physics simulation
Constructor
World
-
broadphase
-
nearphase
Parameters:
-
broadphase
Goblin.Broadphasethe broadphase used by the world to find possible contacts
-
nearphase
Goblin.NearPhasethe nearphase used by the world to generate valid contacts
Item Index
Methods
Methods
addConstraint
-
constraint
adds a constraint to the world
Parameters:
-
constraint
Goblin.Constraintconstraint to be added
addForceGenerator
-
force_generator
Adds a force generator to the world
Parameters:
-
force_generator
Goblin.ForceGeneratorforce generator object to be added
addRigidBody
-
rigid_body
Adds a rigid body to the world
Parameters:
-
rigid_body
Goblin.RigidBodyrigid body to add to the world
removeConstraint
-
constraint
removes a constraint from the world
Parameters:
-
constraint
Goblin.Constraintconstraint to be removed
removeForceGenerator
-
force_generatorv
removes a force generator from the world
Parameters:
-
force_generatorv
Goblin.ForceGeneratorforce generator object to be removed
removeRigidBody
-
rigid_body
Removes a rigid body from the world
Parameters:
-
rigid_body
Goblin.RigidBodyrigid body to remove from the world
step
-
time_delta
-
[max_step]
Steps the physics simulation according to the time delta
Parameters:
-
time_delta
Numberamount of time to simulate, in seconds
-
[max_step]
Number optionalmaximum 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