About Store Forum Documentation Contact
Donations:
169$/mo



Post Reply 
Vector question
Author Message
xzessmedia Offline
Member

Post: #1
Vector question
Hi there,
can anybody tell me how to get the bodies direction?
i have the desired speed which i applied on to the body.
works fine of course but using the z axis the force will always be on the absolute z axis. i want it to be relative so it always applies into the direction..

i guess i need to combine the actors matrix (direction) with the force vector !? but how can i do this?

thanks in advice!
02-13-2014 05:26 AM
Find all posts by this user Quote this message in a reply
Rubeus Offline
Member

Post: #2
RE: Vector question
Multiply the vector by the transformation matrix(matrix.orn I think it is). The vector will then be relative to the objects orientation.
02-13-2014 03:10 PM
Find all posts by this user Quote this message in a reply
xzessmedia Offline
Member

Post: #3
RE: Vector question
works perfect thank you rubeus!
Code:
Vec mf = Vec(0, 0, speed).mul(actor.matrix().orn());
actor.addVel(mf);
02-14-2014 12:10 PM
Find all posts by this user Quote this message in a reply
Post Reply