The physics simulation world. This manages entire the dynamic simulation. You can add rigid bodies and joints to the world to simulate them.
Constructor
Methods
aabbTest(aabb:Aabb, callback:AabbTestCallback):Void
Performs an AABB query. callback.process
is called for all shapes that their
AABB and aabb
intersect.
convexCast(convex:ConvexGeometry, begin:Transform, translation:Vec3, callback:RayCastCallback):Void
Performs a convex casting. callback.process
is called for all shapes the convex geometry
convex
hits. The convex geometry translates by translation
starting from the beginning
transform begin
.
debugDraw():Void
Draws the simulation world for debugging. Call World.setDebugDraw
to set the debug draw interface.
inlinegetNumPositionIterations():Int
Returns the number of position iterations of constraint solvers.
inlinegetNumVelocityIterations():Int
Returns the number of velocity iterations of constraint solvers.
rayCast(begin:Vec3, end:Vec3, callback:RayCastCallback):Void
Performs a ray casting. callback.process
is called for all shapes the ray
from begin
to end
hits.
removeRigidBody(rigidBody:RigidBody):Void
Removes the rigid body rigidBody
from the simulation world.
inlinesetDebugDraw(debugDraw:DebugDraw):Void
Sets the debug draw interface to debugDraw
. Call World.debugDraw
to draw the simulation world.
inlinesetGravity(gravity:Vec3):Void
Sets the gravitational acceleration of the simulation world to gravity
.
inlinesetNumPositionIterations(numPositionIterations:Int):Void
Sets the number of position iterations of constraint solvers to numPositionIterations
.
inlinesetNumVelocityIterations(numVelocityIterations:Int):Void
Sets the number of velocity iterations of constraint solvers to numVelocityIterations
.