Swing Door Opener BRIGADOON-0006
This script controls the opening and closing of a door (or window)
Loading...
Searching...
No Matches
swing_door_open.lsl File Reference

Go to the source code of this file.

Classes

class  default
 

Functions

 rdSwingDoor ()
 Swing the Door/Window between Open and Closed.
 

Variables

integer COMMAND_CHANNEL_NUMBER = 0x80FFFF08
 This is the channel where the script accepts remote commands.
 
string UNLOCK_NAME = "UNLOCK"
 The string for the Unlock Command.
 
string OPEN_NAME = "OPEN"
 The string for Open Windws Command.
 
string CLOSE_NAME = "CLOSE"
 
string LOCK_NAME = "LOCK"
 The string for the Lock Command.
 
integer UNLOCK_STATE = 0
 Flag indicating the dooe/window is unlocked.
 
integer OPEN_STATE = 1
 Flag indicating the dooe/window is open.
 
integer CLOSE_STATE = 2
 Flag indicating the dooe/window is closed.
 
integer LOCK_STATE = 3
 Flag indicating the dooe/window is locked.
 
integer door_locked
 Value indicating if the door/window is currently locked or unlocked.
 
integer intSwing =-90
 Angle the door/window will swing.
 
rotation rotSwing
 Swing angle in a rotation vector.
 
vector vOffset
 The movement offset of the door/window when opened.
 
float closed_angle
 The Angle that the door/window will be in the Open State.
 
integer listen_handle
 Listen handle.
 

Function Documentation

◆ rdSwingDoor()

rdSwingDoor ( )

Swing the Door/Window between Open and Closed.

This function takes the current position of the door/window and swings it to the opposite position. The routine updates the data to ensure that the direction of the movement swaps after each movement.

Definition at line 120 of file swing_door_open.lsl.

121{
122 list l = llGetPrimitiveParams([PRIM_POS_LOCAL,PRIM_ROT_LOCAL]);
123 vector v = llList2Vector(l,0);
124 rotation r = llList2Rot(l,1);
125 llSetPrimitiveParams([PRIM_POS_LOCAL,v-(vOffset-vOffset * rotSwing)*r, PRIM_ROT_LOCAL,rotSwing*r]);
126 rotSwing.s*=-1;
127}
vector vOffset
The movement offset of the door/window when opened.
rotation rotSwing
Swing angle in a rotation vector.

References rotSwing, and vOffset.

Referenced by default::collision_start(), default::listen(), and default::touch_start().

Here is the caller graph for this function:

Variable Documentation

◆ CLOSE_NAME

string CLOSE_NAME = "CLOSE"

Definition at line 43 of file swing_door_open.lsl.

Referenced by default::listen().

◆ CLOSE_STATE

integer CLOSE_STATE = 2

Flag indicating the dooe/window is closed.

Definition at line 67 of file swing_door_open.lsl.

◆ closed_angle

float closed_angle

The Angle that the door/window will be in the Open State.

Definition at line 103 of file swing_door_open.lsl.

Referenced by default::collision_start(), default::listen(), and default::state_entry().

◆ COMMAND_CHANNEL_NUMBER

integer COMMAND_CHANNEL_NUMBER = 0x80FFFF08

This is the channel where the script accepts remote commands.

The command channel should be unique if a script within shout range of this door is being used to reduce any chance that this script may receive erronous commands.

Definition at line 21 of file swing_door_open.lsl.

Referenced by default::state_entry().

◆ door_locked

integer door_locked

Value indicating if the door/window is currently locked or unlocked.

Definition at line 79 of file swing_door_open.lsl.

Referenced by default::collision_start(), default::listen(), default::state_entry(), and default::touch_start().

◆ intSwing

integer intSwing =-90

Angle the door/window will swing.

Definition at line 85 of file swing_door_open.lsl.

Referenced by default::state_entry().

◆ listen_handle

integer listen_handle

Listen handle.

The handle for the commumnication channel for external operation

Definition at line 111 of file swing_door_open.lsl.

Referenced by default::state_entry().

◆ LOCK_NAME

string LOCK_NAME = "LOCK"

The string for the Lock Command.

Definition at line 49 of file swing_door_open.lsl.

Referenced by default::listen().

◆ LOCK_STATE

integer LOCK_STATE = 3

Flag indicating the dooe/window is locked.

Definition at line 73 of file swing_door_open.lsl.

◆ OPEN_NAME

string OPEN_NAME = "OPEN"

The string for Open Windws Command.

Definition at line 37 of file swing_door_open.lsl.

Referenced by default::listen().

◆ OPEN_STATE

integer OPEN_STATE = 1

Flag indicating the dooe/window is open.

Definition at line 61 of file swing_door_open.lsl.

◆ rotSwing

rotation rotSwing

Swing angle in a rotation vector.

Definition at line 91 of file swing_door_open.lsl.

Referenced by default::collision_start(), default::listen(), rdSwingDoor(), and default::state_entry().

◆ UNLOCK_NAME

string UNLOCK_NAME = "UNLOCK"

The string for the Unlock Command.

This command string when received will unlock the door/window, allowing it to be opened or closed by touch (or collision, if enabled).

Definition at line 30 of file swing_door_open.lsl.

Referenced by default::listen().

◆ UNLOCK_STATE

integer UNLOCK_STATE = 0

Flag indicating the dooe/window is unlocked.

Definition at line 55 of file swing_door_open.lsl.

◆ vOffset

vector vOffset

The movement offset of the door/window when opened.

Definition at line 97 of file swing_door_open.lsl.

Referenced by rdSwingDoor(), and default::state_entry().