Jump to content

llSetLinkPrimitiveParamsFast Calcs


Creative Starfall
 Share

You are about to reply to a thread that has been inactive for 1249 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

Hi:

Can you please help with these calculations?

Quote

 

vector localPos = <0.13982,-0.02822,1.79004>;
vector localRot = <0,0,22>;

vector AdjustPos = <0.0,0.0,0.5>;
vector AdjustRot = <0.0,0.0,-6.05>;

HOW TO MAKE THESE CALCULATIONS? <-------------
setLocalPos = localPos - AdjustPos;
setLocalRot = localRot - AdjustRot;

llSetLinkPrimitiveParamsFast(linkNr, [PRIM_POS_LOCAL, setLocalPos, PRIM_ROT_LOCAL, setLocalRot]);

 

Thank you!

Link to comment
Share on other sites

1 hour ago, Rolig Loon said:

Well, first use legitimate rotations.  The values you are using are all vectors.  So, either replace them with rotations or use llEuler2Rot to convert them.

Ty for reply Rolig!

 

Can you please tell me if this code is ok?

Quote

 

            vector t_Pos = (((llList2Vector(PosInit, i)-llList2Vector(AdjP, i))-llGetRootPosition())) / llGetRootRotation();
            t_Pos = llGetRootPosition() + t_Pos * llGetRootRotation();
            
            rotation childRot = llEuler2Rot(llList2Vector(RotInit, i) * DEG_TO_RAD) / llEuler2Rot(llList2Vector(AdjR, i) * DEG_TO_RAD);
            rotation t_Rot = childRot / llGetRootRotation();
            t_Rot = t_Rot * llGetRootRotation();

            llSetLinkPrimitiveParamsFast(llList2Integer(BDLnk, i), [PRIM_POS_LOCAL, t_Pos, PRIM_ROT_LOCAL, t_Rot]);

 

I'm not sure about / or * signs!

Link to comment
Share on other sites

It looks reasonable, although you should be using llGetRot instead of llGetRootRot.  The best way to find out whether it is doing what you hope is to try it out and see.  In the end, that's the test you want to satisfy

Edited by Rolig Loon
  • Like 1
  • Thanks 1
Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 1249 days.

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
 Share

×
×
  • Create New...