Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

move object along local axis

paulie Femto
Into the dark
Join date: 13 Sep 2003
Posts: 1,098
03-23-2006 13:15
What's the formula for moving an object along a local axis? I saw it once and now I'm danged if I can remember it. Thanks!
_____________________
REUTERS on SL: "Thirty-five thousand people wearing their psyches on the outside and all the attendant unfettered freakishness that brings."
Nepenthes Ixchel
Broadly Offended.
Join date: 6 Dec 2005
Posts: 696
03-23-2006 13:43
From: paulie Femto
What's the formula for moving an object along a local axis? I saw it once and now I'm danged if I can remember it. Thanks!


Multiply the movement vector by the objects rotation.

force=localVector*llGetRot();


Or, for non-phys movement
llSetPos(llGetPos()+movement*llGetRot());
Eloise Pasteur
Curious Individual
Join date: 14 Jul 2004
Posts: 1,952
03-23-2006 13:43
vector move = original vector * llGetLocalRot() or similar.
SuezanneC Baskerville
Forums Rock!
Join date: 22 Dec 2003
Posts: 14,229
03-23-2006 13:45
These might be something along the lines of what you are looking for.

They only work for distances 10 meters or less. To go farther you would need to add a loop that terminates when it gets close enough.
CODE
movex( float d ) 
{ llSetPos( llGetPos() + (llRot2Fwd( llGetRot() ) * d) ) ;
}


movey(float d )
{ llSetPos( llGetPos() + (llRot2Left( llGetRot() ) * d) ) ;
}

movez(float d )
{ llSetPos( llGetPos() + (llRot2Up( llGetRot() ) * d ) ) ;
}
_____________________
-

So long to these forums, the vBulletin forums that used to be at forums.secondlife.com. I will miss them.

I can be found on the web by searching for "SuezanneC Baskerville", or go to

http://www.google.com/profiles/suezanne

-

http://lindenlab.tribe.net/ created on 11/19/03.

Members: Ben, Catherine, Colin, Cory, Dan, Doug, Jim, Philip, Phoenix, Richard,
Robin, and Ryan

-
Seagel Neville
Far East User
Join date: 2 Jan 2005
Posts: 1,476
03-23-2006 14:45
From: paulie Femto
What's the formula for moving an object along a local axis? I saw it once and now I'm danged if I can remember it. Thanks!
Yes, I remember you saw it once here. :D
_____________________
:) Seagel Neville :)
paulie Femto
Into the dark
Join date: 13 Sep 2003
Posts: 1,098
mwaha
03-23-2006 14:58
From: someone
Seagel: Yes, I remember you saw it once here: /54/ab/44724/1.html.


That's teh funniest. :) I should bookmark that page for when I ferget again. Now, I just have to remember that I've bookmarked it...
_____________________
REUTERS on SL: "Thirty-five thousand people wearing their psyches on the outside and all the attendant unfettered freakishness that brings."
Seagel Neville
Far East User
Join date: 2 Jan 2005
Posts: 1,476
03-24-2006 04:57
Use advanced search of this forum. Click on "Search" and select "Advanced Search".
1. Input your name in the User Name field.
2. Keyword(s) is "axis".
3. Select "Scripting tips" in the Search in Forum(s).
You'll get just three theads. :)
_____________________
:) Seagel Neville :)