Join us in Outworldz at www.outworldz.com:9000 or follow us:

Search dozens of selected web sites for OpenSim and LSL script

New! Script Meta-Search will search thousands of scripts here and at other sites for LSL or Opensim scripts.
Loading

Want to add a script or a project? Upload it and a half million people will see it and your name here this year.

Home   Show All
Category: Contributor: Creator
Door Simple_door_swinger_works_at_any_an  

Simple_door_swinger_works_at_any_an

Simple_door_swinger_works_at_any_an

Category: Door
By : Void SInger
Created: 2012-03-24 Edited: 2012-03-24
Worlds: Second Life

the Zip file

Download all files for Simple_door_swinger_works_at_any_an
Contents are in zip format, with .LSL (text) source code and LSLEdit (text + Solution) formats.
Get file # 1. Simple_door_swinger_works_at_any_an_1.lsl
1 /*//( v7-D Simple Hinge Action )--//*/
2 /*//-- Works At ANY Angle --//*/
3
4 /*//-- NOTES:
5 works in ANY single prim door, linked or un-linked
6 works in multi-prim doors NOT linked to a larger structure
7 Never needs reset (even after rotating)
8 //*/
9
10 /*//-- REQUIREMENTS:
11 Root must either be a cylinder (to represent a hinge) or
12 cut prim; I suggest cube, pathcut start=.125, end=.625
13 //*/
14
15 /*//-- CAVEAT:
16 Single prim doors are limited to 5m width
17 Treats current position as closed when reset
18 //*/
19
20 /*//-- USERS MODIFY HERE v --//*/
21 integer gIntSwing = 90;
22 /*//-- use -# to reverse the direction of swing, eg. -90; --//*/
23 rotation gRotSwing;
24
25 default{
27 gRotSwing = llEuler2Rot( <0.0, 0.0, (float)gIntSwing * DEG_TO_RAD> );
28 }
29
30 touch_end( integer vIntNul ){
31 llSetLocalRot( (gRotSwing = (ZERO_ROTATION / gRotSwing)) * llGetLocalRot() );
32 }
33 }
34
35 /*//-- IF Redistributing as-is:
36 Please leave script full permissions & include all comments so that others may learn and use
37 //*/
38
39 /*//-- Anti-License Text --//*/
40 /*// Contributed Freely to the Public Domain without limitation. //*/
41 /*// 2009 (CC0) //*/
42 /*// Void Singer //*/

Back to the Best Free Tools in Second Life and OpenSim.