Jump to content

llGetPrimitiveParams llSetPrimitiveParams


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

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

Recommended Posts

I want an operator to be able to set out a prim and record a "home" rotation.  It will be rotated thru a contol panel, and then thru a routine return it to that "home" position.

I'm having difficulty getting "llGetPrimitiveParams  llSetPrimitiveParams" to work.  

Home()

{
    llGetPrimitiveParams([ PRIM_ROTATION ]);
    llWhisper(0,"Home Rotation Set");
}

This routine when called simply set the prim rotations to 0,0,0 instead of the "home" position I am loking for.

Center()
{
    llSetPrimitiveParams([PRIM_ROTATION, rot]);  
}

I've been thru the Wiki pages and am not getting anywhere,  I figure I am not using "rot" correctly or something on that order.

Thanks

Link to post
Share on other sites

What you need to use is called a Global variable.

At the beginning of the script, specify 'rotation rStored;' (for example. You can name it anything, though best to keep it relevant)

This sets up a variable (script attribute, referenced by the variable name. Think of it being like algebra, where x = ..., only with the variable as x) that you can call from any point in the script.

So what you'll need to do is:-

Where you currently have llGetPrimitiveParams---

rStored = llList2Rot(llGetPrimitiveParams([ PRIM_ROTATION ]),0);

Where you currently have llSetPrimitiveParams---

llSetPrimitiveParams([PRIM_ROTATION, rStored]);

---

This 'sets' rStored (your variable) to the rotation specified in llGetPrimitiveParams. The llList2Rot segment ensures the data is returned as a 'rotation'-type variable, retriving it from llGetPrimitiveParams (which returns a list).

And then 'sets' the PrimitiveParams to rStored.

More info:- 

http://wiki.secondlife.com/wiki/Category:LSL_Types

http://wiki.secondlife.com/wiki/LSL_Variables

http://wiki.secondlife.com/wiki/LlSetPrimitiveParams




Link to post
Share on other sites
You are about to reply to a thread that has been inactive for 3254 days.

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...