anselm Hexicola Posted May 14, 2014 Share Posted May 14, 2014 Can someone enlighten me?Say I have a single-prim object in a linkset's Inventory.I define an offset, ( let's say <x,y,z> ).OK I then get my single-prim object to pop up using:-llRezObject(llGetInventoryName(INVENTORY_OBJECT,0),llGetPos()+ <x,y,z>,ZERO_VECTOR,rez_rot,start_param); All fine; then the newly rezzed object gets linked to the parent linkset using:-llCreateLink(id,TRUE); I get all that done OK;but when I ask where the rezzed and subsequently linked object is..vector added_prim_pos= llList2Vector(llGetLinkPrimitiveParams(added_prim,[PRIM_POS_LOCAL]),0); llOwnerSay((string)added_prim_pos); ... themessage I get in Chat is "<p,q,r>".Now I was expecting <p,q,r> to be the same as <x,y,z>, but it isn't!My understanding would have been that the PRIM_POS_LOCAL vector returned by llGetLinkPrimitiveParams should have been the same as the offset used in llRezObject (assuming that nothing had altered position in the meantime); but no ...I know I am missing something, but have puzzled at for a couple of sessions now and just cant figure it out. Link to comment Share on other sites More sharing options...
Jenny Siddeley Posted May 15, 2014 Share Posted May 15, 2014 I assume you made sure "added_prim" is the correct value for the link number so the only thing I can think of is the rotation of the rezzing prim/linkset, if it is rotated even just slightly, it might be the reason. Don't forget the position in llRezObject is relative to the world (ZERO_ROTATION), while PRIM_POS_LOCAL will give a position relative to the linkset rotation value, so chances are it's gonna be different if you rotated the linkset. Link to comment Share on other sites More sharing options...
anselm Hexicola Posted May 15, 2014 Author Share Posted May 15, 2014 Ah yes; you were spot-on. vector added_prim_pos= llList2Vector(llGetLinkPrimitiveParams(added_prim,[PRIM_POS_LOCAL]),0);vector adjusted_pos=added_prim_pos*llGetRot();llOwnerSay((string)adjusted_pos); Now the vector given in Chat is the same as the original offset added to llGetPos() used in llRezObject. Blindingly obvious now you have pointed it out! Thanks. (The linkset was a mesh upload, and I hadn't even noticed that it wasn't at ZERO_ROTATION; which was something I should have sorted in Blender before export and upload to SL; but that's another story ....) Link to comment Share on other sites More sharing options...
Dora Gustafson Posted May 15, 2014 Share Posted May 15, 2014 Consider using llRezAtRoot() for llRezObject() If the rezzed object is a single prim there is no difference but a link set has center at a position different from the root position, mostly :smileysurprised::smileyvery-happy: Link to comment Share on other sites More sharing options...
Recommended Posts
Please take a moment to consider if this thread is worth bumping.
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now