Jump to content

Rez object in the correct position no matter what rotation?


Rhowin
 Share

Recommended Posts

Hello again, all! I know I'm doing something stupid here and I cannot for the life of me figure out what it is I'm doing. My goal is to have the rezzed object show up in the same position, no matter what direction the object is rotated. For context, this is going in a linked, non-root prim. Any ideas?

list faces = [0,1,2,3,4,5];
list pos = [<0.234131, -3.655060, 2.104248>, <0.207886, -2.201080, 2.099121>, <0.229492, -0.728729, 2.103272>, <0.203216, 0.725525, 2.098145>, <0.248108, 2.197052, 2.106934>, <0.221832, 3.651031, 2.101807>];

default
{
    touch_start(integer i)
    {
        integer face = llDetectedTouchFace(0);
        integer index = llListFindList(faces, (list)face);
        if (index != -1)
        {
            llRezObject(llGetInventoryName(INVENTORY_OBJECT, 0), (llGetPos() + llList2Vector(pos, index) * llGetRot()), <0,0,0>, <-0.112348, -0.002013, 0.005497, 0.993652> * llGetRot(), 0);
        }
    }
}

 

Edited by Rhowin
Link to comment
Share on other sites

Thank you so much for the tip, Quistess!
For anyone interested, the following is the line I ended up using to achieve the effect I wanted:

llRezObject(llGetInventoryName(INVENTORY_OBJECT, 0), (llGetPos() + (llList2Vector(pos, index) * llGetRootRotation())), <0,0,0>, llEuler2Rot(<0.0, -21.89999, -270.00000> * DEG_TO_RAD) * llGetRootRotation(), 0);

 

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...