I sort of do this with all my entities anyway. Every entity that moves in my games has a pivot called physics_pivot.
I apply all the forces that are acting on the entity on the physics pivot...
The pivot starts at 0,0,0
There is a forward force on the entity
etc
Then the location of the physics pivot is the resultant force on the entity... so you then just...
I have a pivot called middle that always stays at 0,0,0
So to get the speed:
Anyway, there's Rob 'no math' coding 101 for you!
I apply all the forces that are acting on the entity on the physics pivot...
The pivot starts at 0,0,0
There is a forward force on the entity
rotateentity physicspivot,entitypitch(player),entityyaw(player),entitypitch(player) moveentity physics_pivot,0,0,2gravity
translateentity physics_pivot,0,-.98,0wind from the east...
translateentity physics_pibot,-.5,0,0etc
etc
Then the location of the physics pivot is the resultant force on the entity... so you then just...
translateentity player,entityx(physics_pivot),entityy(physics_pivot),entityz(physics_pivot)If you want to know the total speed of the player...
I have a pivot called middle that always stays at 0,0,0
So to get the speed:
speed=entitydistance(physics_pivot,middle)Oh, and with the middle pivot you can dampen all the forces...
pointentity physics_pivot,middle moveentity physics_pivot,0,0,speed*.9will reduce all the forces to 90%
Anyway, there's Rob 'no math' coding 101 for you!