Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Question about llRezobject and getpos

Cito Karu
Registered User
Join date: 23 Jul 2008
Posts: 229
11-19-2008 11:17
Not advanced enough to figure this part out. But I have a prim that rezz's objects in it's inventory using llRezobject and getpos then offset set to 2 for height to rez 2 meters above the object.

How do I keep the rotation of the object rez'd the same as the current rotation of the object that does the rezzing?

cause I can rotate the main object how i need it but when it rezzes it's inventory I need to get it to somehow face the same direction as the main object.

if that is understandable i hope.

any help would be appreciated.
Meade Paravane
Hedgehog
Join date: 21 Nov 2006
Posts: 4,845
11-19-2008 12:00
Maybe...

rotation rot = llGetRot();

llRezObject ("thingy", llGetPos() + (<2.0, 0.0, 2.0> * rot), ZERO_VECTOR, rot, 0);

Leave out the "+(<2,0,0> * rot)" bit if you don't want the rezzed position to be changed by the main objects rotation.
_____________________
Tired of shouting clubs and lucky chairs? Vote for llParcelSay!!!
- Go here: http://jira.secondlife.com/browse/SVC-1224
- If you see "if you were logged in.." on the left, click it and log in
- Click the "Vote for it" link on the left
Cappy Frantisek
Open Source is the Devil!
Join date: 27 Oct 2006
Posts: 400
11-19-2008 12:03
From: Cito Karu
Not advanced enough to figure this part out. But I have a prim that rezz's objects in it's inventory using llRezobject and getpos then offset set to 2 for height to rez 2 meters above the object.

How do I keep the rotation of the object rez'd the same as the current rotation of the object that does the rezzing?

cause I can rotate the main object how i need it but when it rezzes it's inventory I need to get it to somehow face the same direction as the main object.

if that is understandable i hope.

any help would be appreciated.

Use the main objects rotation in the llRezObject function

ie.
llRezObject( "object", llGetPos()+offset, ZERO_VECTOR, llGetRot(), 0 );
Cito Karu
Registered User
Join date: 23 Jul 2008
Posts: 229
11-19-2008 13:02
thanks thats actually all I needed!
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
11-19-2008 19:18
leave out the last 'rot' if you want the object to always rez aligned to the world (or tos in a custom rot if you need it to rez in a specific orientation) also changing that las one to customRot * rot will align it to the rezzors alighment with it's own tweaked alignment
_____________________
|
| . "Cat-Like Typing Detected"
| . This post may contain errors in logic, spelling, and
| . grammar known to the SL populace to cause confusion
|
| - Please Use PHP tags when posting scripts/code, Thanks.
| - Can't See PHP or URL Tags Correctly? Check Out This Link...
| -