Jump to content

Left/Right is reversed


Paul Hexem
 Share

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

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

Recommended Posts

Sorry.  You said you were dealing with a vehicle so I assumed incorrectly that it was a physical vehicle with a banking problem.  I'm clearly not visualizing what you are wrestling with.

If you were dealing with a physical vehicle, then one answer to your question about keeping child prims level would be to use llSetSatus(STATUS_ROTATE_X | STATUS_ROTATE_Y, FALSE);  But that doesn't seem to fit what you are doing.

/me goes back to sleep.

Link to comment
Share on other sites

So, if I understand this correctly, you have a flying vehicle with gimbaled (or maybe better described as hinged) engines that are not moving as you wish during a turn. That they're moving at all suggests you're already using llSetLocalRot to move them, so you're asking for the proper coordinate conversion to make them go as you wish?

Did I get that right?

Link to comment
Share on other sites

The fact that nobody gets me tells me that I may have found something impossible to do in SL...

Look at an V-22 Osprey. http://upload.wikimedia.org/wikipedia/commons/f/f5/US_Navy_080220-N-5180F-015_A_Marine_Corps_MV-22_Osprey_prepares_to_land_aboard_the_amphibious_assault_ship_USS_Nassau_(LHA_4).jpg

Imagine those engines and rotors had to stay level, even while the nose is tilting up and down.

My object isn't going to bank; I'm not worried about that. It's not using a vehicle script, it's using llMoveToTarget and llLookAt(or llSetRot, I haven't decided yet).

Link to comment
Share on other sites


Madelaine McMasters wrote:

So, if I understand this correctly, you have a flying vehicle with gimbaled (or maybe better described as hinged) engines that are not moving as you wish during a turn. That they're moving at all suggests you're already using llSetLocalRot to move them, so you're asking for the proper coordinate conversion to make them go as you wish?

Did I get that right?

Basically, yes.

Link to comment
Share on other sites


steph Arnott wrote:

integer     DIRECTION   = 1;// - for opp direction

rot = llGetLocalRot(); delta = llEuler2Rot(<0, DIRECTION * PI, 0>); rot = delta * rot;

 

That's got it rotating like a helicopter rotor, doesn't attempt to stay level on any axis.

Link to comment
Share on other sites

list body_list;rotation body_rot;vector body_euler;list engine_list;rotation engine_rot;vector engine_euler;get_rots(){    integer num = llGetNumberOfPrims();    integer i;    for (i=1; i < num + 1; i++)    {        if(llGetLinkName(i) == "body")        {            body_list = llGetLinkPrimitiveParams(i, [PRIM_ROTATION]);            body_rot = llList2Rot(body_list, 0);            body_euler = llRot2Euler(body_rot);            //llSay(0, "body: " + (string)body_euler);        }        if(llGetLinkName(i) == "engine")        {            engine_list = llGetLinkPrimitiveParams(i, [PRIM_ROTATION]);            engine_rot = llList2Rot(engine_list, 0);            engine_euler = llRot2Euler(engine_rot);            //llSay(0, "engine: " + (string)engine_euler);        }    }}set_rots(){    integer num = llGetNumberOfPrims();    integer i;    for (i=1; i < num + 1; i++)    {        if(llGetLinkName(i) == "engine")        {            engine_list = llGetLinkPrimitiveParams(i, [PRIM_ROTATION]);            engine_rot = llList2Rot(engine_list, 0);            engine_euler = llRot2Euler(engine_rot);            llSetLinkPrimitiveParamsFast(i, [PRIM_ROT_LOCAL, llEuler2Rot(<PI/2, body_euler.y, 0.0>)/body_rot]);            //llSay(0, "engine: " + (string)engine_euler);        }    }}default{    state_entry()    {        llSetTimerEvent(2.5);    }    timer()    {        get_rots();        set_rots();    }}

 That's what I'm using right now.

When I tilt the nose up or down, the engines stay level.

When the whole thing is level and I turn it right or left, they turn right or left correctly.

When I tilt the nose down, then turn it right or left, the engines stay level, but they turn in a seemingly unrelated direction.

Link to comment
Share on other sites


Gadget Portal wrote:

It's a 22 prim linkset, and the tail and nose are separate prims. The entire linkset has to move together- only the engines can tilt. If I try to pitch just the body prim, it'll make a huge mess of the linkset.

OK, some of your prims make up your engines and some make up the body then, yes? And you want the whole of it to perform the same as a VTOL- where the engines swivel in place on the wings but otherwise stay in the same relative position to the rest of the linkset as it flies around, right?

 

What you're trying to do in that case is called hierarchical object composition and, though not directly supported in SL, https://wiki.secondlife.com/wiki/Prim_and_Object_Hierarchy, can be implemented in code, https://wiki.secondlife.com/wiki/Hierarchics.

  • Like 1
Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 3908 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...