Sign in to follow this  
Sigvatr

Positional and Direction Vectors in GLM

Recommended Posts

Hi there,

I'm using GLM as the backbone of the 3d mathematics in my game engine.

Right now I have a "mob3" class that is simply two vector3s, one for the position and another for the direction. I am having no problems rotating the mob3 or using it as a camera in OpenGL, but I am trying to figure out how to move the mob3 based on the direction it is facing.

I want to have functions for 6 generic directions in three dimensional space (forward, backward, left, right, up, down). Depending on how I implement these functions, the mob3 could move, return a new positional vector3 or mob3 based on where the current one is to move to, or both.

And I have full GLM functionality, so I could use quaternions and matrices for all this crap if I wanted to (I'm still vague on quaternions though).

Any ideas?

Thanks.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this