Gwyneth Llewelyn

March 2nd, 2008 at 6:30 pm

This simple door script uses three states — “default”, to set the initial rotation, and “open” and “closed” to switch to that status. Note that the prim for the door needs to have Path Cut Begin at 0.375 and end at 0.875 for this to work.

It’s part of a series of LSL scripts I’m using for give some training courses on LSL :)

rotation rotInitial;

default
{
    state_entry()
    {
        rotInitial = llGetRot();
        state closed;
    }
}

state closed
{
    touch_start(integer total_number)
    {
        llSetRot(rotInitial * llEuler2Rot(<0, 0, PI_BY_TWO>));
        state open;
    }
}

state open
{
    touch_start(integer total_number)
    {
        llSetRot(rotInitial);
        state closed;
    }
}


No Comments »

No comments yet.

RSS feed for comments on this post.

TrackBack URI

Leave a comment

Login Method

OpenID

Anonymous

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>






Fatal error: Call to undefined function akst_share_form() in /home/.ginny/gwyneth/gwynethllewelyn.net/wp-content/themes/blossom-20/footer.php on line 10