Iv'e added a gravity function to start off my physics engine, however it produces a result that nicely simulates an earthquake.

The jittering is caused by the code in bold I believe; that is, the pushing back of the position on a collision. The problem is, I don't know how to fix it.Code:vector3d generic::gravity(vector3d pos, vector3d dir, vector3d v) { if(_ceCollision->checkcollision(pos)==false) { speed = sqrt(v.x*v.x + v.y*v.y + v.z*v.z); v.x += (((dir.x*(9.81))/233.3333333)-(glbAirRes*v.x*speed))*dt; v.y += (((dir.y*(9.81))/233.3333333)-(glbAirRes*v.y*speed))*dt; v.z += (((dir.z*(9.81))/233.3333333)-(glbAirRes*v.z*speed))*dt; pos = v; }else { speed = sqrt(v.x*v.x + v.y*v.y + v.z*v.z); v.x += (((dir.x*(9.81))/233.3333333)-(glbAirRes*v.x*speed))*dt; v.y += (((dir.y*(9.81))/233.3333333)-(glbAirRes*v.y*speed))*dt; v.z += (((dir.z*(9.81))/233.3333333)-(glbAirRes*v.z*speed))*dt; pos.x = -v.x; pos.y = -v.y; pos.z = -v.z; }return pos; }

thanx

-psychopath