I have a vehicle class that a Vector3 velocity. How could I figure out the velocity in it's forward direction? (forward as in front of the vehicle's rotation)
Create a matrix from your rotation, multiply the vector with the matrix, get the axis that represents the forward direction.
Fortunately I already have the matrix. That does sound very logical, but unfortunately this does not seem to return any logical values.
car.transform.transformVector(car.velocity).z; //actionscript3 matrix/vector3D classesEDIT:
seemed like I needed to invert the matrix first, not sure why, but it does the trick!