How do i get direction ?

ross
Posts: 6
Joined: Wed Sep 26, 2012 10:46 pm

How do i get direction ?

Post by ross »

Hi just need to know how i can get the direction of an object I.E a Sphere
as i intend to use accelerometers so when cam follows and it turns left i need to adjust the angle as forward now become left back becomes right and so on. then i can adjust the accelerometers to the angle i need to steer.
many thanks in advance.
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA

Re: How do i get direction ?

Post by Erwin Coumans »

It is not clear what you mean by "direction". You might want to use the linear velocity of the object, using getLinearVelocity(), to get the direction the object is moving towards.
ross
Posts: 6
Joined: Wed Sep 26, 2012 10:46 pm

Re: How do i get direction ?

Post by ross »

yep thank you work it out I should of closed the thread having one of them silly code'ing days