| 880 | } |
| 881 | |
| 882 | void Friction(float& speed, float friction, float accel, float deltaT) |
| 883 | { |
| 884 | speed += accel * deltaT; |
| 885 | if (speed * friction > 0) |
| 886 | { // friction must oppose speed |
| 887 | float oSpeed = speed; |
| 888 | speed -= friction * deltaT; |
| 889 | if (oSpeed * speed <= 0) |
| 890 | { |
| 891 | speed = 0; |
| 892 | } |
| 893 | } |
| 894 | } |
| 895 | |
| 896 | void Friction(Vector3& speed, Vector3Par friction, Vector3Par accel, float deltaT) |
| 897 | { |
no outgoing calls
no test coverage detected