Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Touch Rez object, Setting rotation around parent prim.

JR Breed
Registered User
Join date: 17 Jan 2006
Posts: 49
09-18-2006 04:15
Hello all. Here is my question and I'll try my best to explain.

Im trying to give a object that rezzes a local rotation around the object it was rezzed from. Make since? On touch it will rez a object. I want the object that rezzed to have a local rotation around the object it was rezzed from. Still a little more complicated. It must find its new rotation cus the object it rezzes from changes location and rotation.

Here is a visual reference example to help explain what I mean.

Lets say you have a car. The car you can touch and it will temp rez a prim that lets out a cloud of smoke from the engine.

Im basicly having trouble figuring out how to get the object that rezzes to appear at the engine location I set it to once the object is rotated. So lets say the car rotated 45 degrees and I tried to rez the object, the object will still rez at 0 rotation.

Any help is greatly apprecaited.
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
09-19-2006 01:04
Use llGetRot() to get your parent prim rotation.
You will then need to apply this to the child.

CODE

vector pos = llGetPos();
rotation rot = llGetRot();
// Add offsets
// Rez object
llRezObject("object", pos, <0,0,0>,rot, 0);



However if the child is rezed at a positional offset you will also need to calculate the rotational vector.

Not 100% sure you actually need to do this though, at least not for the example you have given. The child object could be a linked prim within the parent object so it would automatically rotate as the parent rotates. It woudl just be a case of triggering the required effect on touch.