The purpose of this example is to demonstrate the EPhysics Sleeping Threshold usage - The code apply sleeping threshold in two cubes.
For this example we'll have an EPhysics_World, and two basic EPhysics_Bodys.
The basic concepts like - defining an EPhysics_World, render geometry, physics limiting boundaries, add an EPhysics_Body, associate it to evas objects, change restitution, friction and impulse properties, were already covered in EPhysics - Bouncing Ball
Concept of velocity were already covered in EPhysics - Velocity
Setting the max sleeping time determines how long(in seconds) a rigid body under the linear and angular threshold is supposed to be marked as sleeping.
Here we set EPhysics_Bodys linear and angular sleeping threshold. These factors are used to determine whenever a rigid body is supposed to increment the sleeping time.
After every tick the sleeping time is incremented. After reaching the max sleeping time the body is market to sleep, that means the rigid body is to be deactivated.
We can get the EPhysics_Bodys linear and angular sleeping threshold as well.
Here we set EPhysics_Bodys linear and angular damping values.The damping is a force synchronous with the velocity of the object but in opposite direction - like air resistance.
Here we finish the example. The full source code can be found at test_sleeping_threshold.c.