Original Post
hey All,
I''ve got a little problem where some Vector math is involved
I have a simple 3d game where you can shoot monsters, pick up ammo etc. etc.There is some collision detection currently involved but only on a real basic level. Like assuming the player is always on the same height, no obstacles and such and whenever the player hits a wall he''s stuck in it( no sliding ) cause all that the collisionDetection does is giving back a "bool", so when false no further movement is allowed.
But what I want is to add gravity and sliding along walls to the game.
So I have this worked out, in the hope it works:
The whole time there''s a (constant) gravity:
x , y(gravity), z
Vector gravity( 0.57, -0.57 , 0.57 );
this is constantly pulling at the player.
We have a Vertex where the player is at the moment:
position( posX, posY, posZ );
We have a Vector where the player is currently Moving at:
moveDir( moveX, moveY, MoveZ )
But my question is can I multiply the moveDir and the Gravity vector? That results in a new vector, let''s say the "force" Vector? And normalize that and calculate a new position for the player?
In shourt should I first calculate the gravity and after that calculate the direction movement or can I easily combine it?
I hope the problem is understandable
cheers,
Paul