|
Relevant only when CHASE_PHYSICS or CHASE_TRACK is used.
Set the size of the speed.
Read the example below to learn how it all works.
Example:
STATE_camera_set_speed(camera, 0,10,0);
speed_size=STATE_camera_get_absolute_speed(camera);
speed_size is now 10
STATE_camera_set_absolute_speed(camera, 100);
double speed[3];
STATE_camera_get_speed(camera, speed);
speed is now { 0, 100, 0}
Advanced:
In physics speed is a vector it has a size and a direction
Q: If the speed vector is 6,8,0 ( STATE_camera_set_speed(camera, 6,8,0) );
what is the size of the speed (what will STATE_camera_get_absolute_speed(camera) return ?)
A: Let calculate the vector size according to Pythagoras Theorem
speed size= Square root of ( A*A+ B*B+ C*C ) = square root of ( 6*6 + 8*8 + 0*0) = Square root of (100) == 10
|