Class enchant.gl.physics.World
- Defined in: physics.gl.enchant.js
Constructor Attributes | Constructor Name and Description |
---|---|
World in which physical calculator is used.
|
Method Summary
Method Attributes | Method Name and Description |
---|---|
addRigid(Rigid)
Add rigid body to World.
|
|
contactPairTest(rigid1, rigid2)
Judges whether or not two rigid objects have collided.
|
|
removeRigid(Rigid)
Delete rigid body form world.
|
|
setGravity(gx, gy, gz)
Set gravity of World.
|
|
stepSimulation(Amount, maxSubSteps, fixedTimeStep)
Continue World time.
|
Class Detail
enchant.gl.physics.World()
World in which physical calculator is used.
Here we add a rigid object, and by proceeding forward in time physical calculation will be processed.
Method Detail
-
addRigid(Rigid)Add rigid body to World.
- Parameters:
- {enchant.gl.physics.Rigid} Rigid
- Rigid body object to be added.
-
{Boolean} contactPairTest(rigid1, rigid2)Judges whether or not two rigid objects have collided.
- Parameters:
- {enchant.gl.physics.Rigid} rigid1
- Rigid1 to be judged.
- {enchant.gl.physics.Rigid} rigid2
- Rigid2 to be judged.
- Returns:
- {Boolean} bool Collison presence or absence.
-
removeRigid(Rigid)Delete rigid body form world.
- Parameters:
- {enchant.gl.physics.Rigid} Rigid
- Rigid body to be deleted.
-
setGravity(gx, gy, gz)Set gravity of World.
- Parameters:
- {Number} gx
- x axis gravity.
- {Number} gy
- y axis gravity.
- {Number} gz
- z axis gravity.
-
{Number} stepSimulation(Amount, maxSubSteps, fixedTimeStep)Continue World time. When timeStep is bigger than fixedTimeStep, you continue the number of times set in maxSubStep and continue with time.
- Parameters:
- {Number} Amount
- of time you wish to proceed. Units are in seconds.
- {Number} maxSubSteps
- Maximum number of repetitions to be added to simulation.
- {Number} fixedTimeStep
- Standard time. The default level is 1/60.
- Returns:
- {Number} subStepsNum