Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Which way to apply impulse when object is rotated?

Jack Digeridoo
machinimaniac
Join date: 29 Jul 2003
Posts: 1,170
07-17-2004 07:37
I'm pretty bad at math. I hope someone can help me with this rotations question.


I have an object sitting at ZERO_ROTATION. I apply an impulse and it works fine. However, when the objects rotation is not at ZERO, the same impulse I applied sends the object off in a different direction.

How can I always send my object moving in the same direction, regardless of it's initial rotation?

(at the moment I have to set the objects rotation to zero before I apply the impulse but there is too much delay)
_____________________
If you'll excuse me, it's, it's time to make the world safe for democracy.
Rysidian Rubio
Ruby Red Head
Join date: 14 Jan 2004
Posts: 263
07-17-2004 07:47
Using false for the local parameter should make the push relative to the sim, not relative to the object, so it will move the same no matter what it's rotation is.

llApplyImpulse(vector push, integer local);

so use
llApplyImpulse(<0,0,10>, FALSE);
and the impulse will push the object upwards no matter what it's rotation.
Jack Digeridoo
machinimaniac
Join date: 29 Jul 2003
Posts: 1,170
07-17-2004 08:56
That works great, thx Rysidian :)
_____________________
If you'll excuse me, it's, it's time to make the world safe for democracy.