|
Swing Door Opener BRIGADOON-0006
This script controls the opening and closing of a door (or window)
|
Private Member Functions | |
| state_entry () | |
| Initialise the Door/Window swing parameters. | |
| listen (integer ChannelNumber, string Name, key Id, string Message) | |
| Listen to the channel selected in state_entry() and process any commands received. | |
| touch_start (integer total_number) | |
| Process when a touch is detected. | |
| collision_start (integer total_number) | |
| Process collisions with the door/window. | |
/note To make it simplier for doxygen to document the script without special pre-processing, the default state is commented out during documetation processing
/note To make it simplier for doxygen to document the script without special pre-processing, the default function definition is uncommented during documetation processing
Definition at line 137 of file swing_door_open.lsl.
|
inlineprivate |
Process collisions with the door/window.
| total_number | Total number of collision starts detected |
This function detects when a collision with the door/window. If the door/window is open, the script issues a warning that the door/window is already open, but does nothing to the door/window.
If the door/window is closed, the script checks if the door is not locked or it is the owner that has collided with the object. If either of these two conditions is true, the door will swing open.
If the door/window is closed, but door is locked and it is not the owner, the script will issue a warning that door is locked.
Definition at line 237 of file swing_door_open.lsl.
References closed_angle, door_locked, rdSwingDoor(), and rotSwing.
|
inlineprivate |
Listen to the channel selected in state_entry() and process any commands received.
| ChannelNumber | The Channel Number from where the message came. |
| Name | Name of the Prim or Avatar from where the message came. |
| Id | Prim or Avatar UUID. |
| Message | What was "spoken" in the message. |
This script receives messages to the door/window's script and decodes that message. If the command in the message is "OPEN" and the door/window is not locked, the door/window will open. If the command in the message is "CLOSE" and the door/window is not locked, the door/window will close. If the command in the message is "LOCK", the door/window will be locked in its current state. If the command in the message is "UNLOCK", the door/window will be unlocked in its current state.
Definition at line 177 of file swing_door_open.lsl.
References CLOSE_NAME, closed_angle, door_locked, LOCK_NAME, OPEN_NAME, rdSwingDoor(), rotSwing, and UNLOCK_NAME.
|
inlineprivate |
Initialise the Door/Window swing parameters.
This script assumes that the door/window is in the closed position when the the script enter the default state. It is used the closed position and the angle that the door/window will swing by to calculate the swing parameters. The door/window also defaults to being unlocked. Finally, the channel that will receive remote comamnds is opened.
Definition at line 149 of file swing_door_open.lsl.
References closed_angle, COMMAND_CHANNEL_NUMBER, door_locked, intSwing, listen_handle, rotSwing, and vOffset.
|
inlineprivate |
Process when a touch is detected.
| total_number | The total number of touch_start events detected |
This routine detects when the door/window is touched. If the door is not locked of the owner of the object is touching the door, the door will swing to its other position.
If the door is not swung, the script issues a warning that the door is curently locked.
Definition at line 209 of file swing_door_open.lsl.
References door_locked, and rdSwingDoor().