Jump to content

Double doors


Tattooshop
 Share

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

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

Recommended Posts

Hey!
I am trying to convert a script for one door to a script for double doors so that when you click on any of them, they open at the same time. The frame is the root and the script itself is placed in it. You need to click on the doors themselves.

That's what is used for opening and closing:

        llSetLinkPrimitiveParamsFast(DOOR_PRIM_1, [PRIM_ROT_LOCAL, gRotationClosed, PRIM_POS_LOCAL, gPositionClosed]);
        llSetLinkPrimitiveParamsFast(DOOR_PRIM_2, [PRIM_ROT_LOCAL, gRotationClosed, PRIM_POS_LOCAL, gPositionClosed]);

... some stuff ...

        llSetLinkPrimitiveParamsFast(DOOR_PRIM_1, [PRIM_ROT_LOCAL, rotationOpened, PRIM_POS_LOCAL, positionOpened]);
        llSetLinkPrimitiveParamsFast(DOOR_PRIM_2, [PRIM_ROT_LOCAL, rotationOpened, PRIM_POS_LOCAL, positionOpened]);

 

How do I get a negative value applied to the second door? I don't want to duplicate the entire script! :D

The logic is not entirely clear. Maybe there is another way? 🤔

Thank's for any help!

Link to comment
Share on other sites

The inverse of a vector (v) is -v; the inverse of a rotation (r) is ZERO_ROTATION/r (or if you want to be clever, invert a rotation with r.s=-r.s)

to mirror a vector, you generally want to set things up such that the plane of symmetry is the x,y,or z plane, so you can just invert the x,y,or z component. (vector.z=-vector.z)

Making any specific script requires a bit of knowledge about the intrinsic rotations of your door models.

Edited by Quistess Alpha
  • Thanks 1
Link to comment
Share on other sites

2 hours ago, Quistess Alpha said:

The inverse of a vector (v) is -v; the inverse of a rotation (r) is ZERO_ROTATION/r (or if you want to be clever, invert a rotation with r.s=-r.s)

to mirror a vector, you generally want to set things up such that the plane of symmetry is the x,y,or z plane, so you can just invert the x,y,or z component. (vector.z=-vector.z)

Making any specific script requires a bit of knowledge about the intrinsic rotations of your door models.

Thank you very much! It works! :)👍

3 hours ago, Rolig Loon said:

Start here ...

You can adapt that approach to your favorite method of opening a door.

Thank you! :)

 

Link to comment
Share on other sites

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