|
The following three functions are only relevant when the chase type of
the object is CHASE_PHYSICS. For example if your object is a billiard ball
then the engine will automatically calculate its direction when it
hits the tables edges. If you cancel collision test then the engine would
still calculate the speed and the friction etc ... but when the ball would hit
the the table edge it will continue moving as if it was air.
So why would you want to cancel the automatic collision detection ?
You will want to cancel it when you do your own checking.
Say for example that your object is a missile, that is planed to blow up
when it is near the target. For this case you have to do your own test ...
The default is: enabled
Canceling the collision check also improves performaces so if you don't realy need the collision detection
then we would recommend to cancel it.
Important:
Canceling the collision detection also changes the speed units to UNITS_PER_RENDER(this is a design bug in the engine that wasn't fix in order
to maintain backwards compatibility). To make life easier we recommend of the following:
A) After loading the world call STATE_object_set_speed_units(UNITS_PER_RENDER)
B) In order to have your program run the same on all computers and have the same speed in all parts of your world
do factor=STATE_engine_get_computer_speed_factor() in every render cycle. Factor all your objects spped like that
new_speed=original_speed*factor;
C) Cancel STATE_object_cancel_collision_test_for_chase_physics() for object that do not need a constant collision detection.
Going according to our recommendation will give you the following benefits:
1) Your program will be faster.
2) The object will move smoother.
3) Your program will move at the same speed in all parts of your world
and in all computers.
4) Calling STATE_object_cancel_collision_test_for_chase_physics() will have no undesired effect on the speed units.
For more details about this please see STATE_object_set_speed_units()
|