Jump to content

Prim for scripted door


Recommended Posts

Rez a box, adjust the cut-begin and cut-end values in the edit-window until it's only "half there" (begin 0.125 and end 0.675 if I remember rightly).  Then make it thin so the axis (centre point) is on the side of what looks like a door.  Texture as required.

As prims rotate around their centre-point this makes it appear as if the door is actually rotating around it's "hinge" edge

Link to comment
Share on other sites

Doing a 50% path cut works, as Peter suggests.

If you have a thicker door, or are a little obsessive about detail, a 25% path cut works better, as it puts the hinge on the corner, not the middle of that side.  Use one of the following path cuts if you'd prefer that:

B=0.125, E=0.375

B=0.375, E=0.625

B=0.625, E=0.875

Link to comment
Share on other sites

And I might as well give you the simplest script for a hinge.....

integer  gFltDeg = 90; //-- rotation in degrees.rotation gRotRad;      //-- rotation in radians.default{    state_entry(){        gRotRad = llEuler2Rot( <0.0, 0.0, gFltDeg * DEG_TO_RAD> );    }        touch_end( integer vIntTch ){        llSetLocalRot( (gRotRad = ZERO_ROTATION / gRotRad) * llGetLocalRot() );    }}

stretch doors on the x axis, stretch cabinents/lids on the y axis, z axis is always height.

settings always: box, path cut 0.5 +/- 0.125 (AKA [0.375/0.625])

works at any angle, linked or not, flip the object in edit if you need a hinge that goes the opposite way

caveat: door should be closed when the script is added or if you manually reset the script.

 

ETA:
might help if I consistently named variables.

ETA:
might help even more if I actually tested it instead of trying to write from memory... fixed

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...