diff options
Diffstat (limited to 'OpenSim/Region/ScriptEngine/XMREngine/XMRInstSorpra.cs')
-rw-r--r-- | OpenSim/Region/ScriptEngine/XMREngine/XMRInstSorpra.cs | 76 |
1 files changed, 76 insertions, 0 deletions
diff --git a/OpenSim/Region/ScriptEngine/XMREngine/XMRInstSorpra.cs b/OpenSim/Region/ScriptEngine/XMREngine/XMRInstSorpra.cs new file mode 100644 index 0000000..dd60cb2 --- /dev/null +++ b/OpenSim/Region/ScriptEngine/XMREngine/XMRInstSorpra.cs | |||
@@ -0,0 +1,76 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://opensimulator.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSimulator Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | */ | ||
27 | |||
28 | using OpenMetaverse; | ||
29 | using OpenSim.Framework; | ||
30 | using OpenSim.Region.Framework.Scenes; | ||
31 | using OpenSim.Region.ScriptEngine.Shared; | ||
32 | using System; | ||
33 | |||
34 | using LSL_Float = OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLFloat; | ||
35 | using LSL_Integer = OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLInteger; | ||
36 | using LSL_Key = OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLString; | ||
37 | using LSL_List = OpenSim.Region.ScriptEngine.Shared.LSL_Types.list; | ||
38 | using LSL_Rotation = OpenSim.Region.ScriptEngine.Shared.LSL_Types.Quaternion; | ||
39 | using LSL_String = OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLString; | ||
40 | using LSL_Vector = OpenSim.Region.ScriptEngine.Shared.LSL_Types.Vector3; | ||
41 | |||
42 | namespace OpenSim.Region.ScriptEngine.XMREngine | ||
43 | { | ||
44 | public partial class XMRInstance | ||
45 | { | ||
46 | /** | ||
47 | * @brief If RegionCrossing trapping is enabled, any attempt to move the object | ||
48 | * outside its current region will cause the event to fire and the object | ||
49 | * will remain in its current region. | ||
50 | */ | ||
51 | public override void xmrTrapRegionCrossing (int en) | ||
52 | { } | ||
53 | |||
54 | /** | ||
55 | * @brief Move object to new position and rotation asynchronously. | ||
56 | * Can move object across region boundary. | ||
57 | * @param pos = new position within current region (same coords as llGetPos()) | ||
58 | * @param rot = new rotation within current region (same coords as llGetRot()) | ||
59 | * @param options = not used | ||
60 | * @param evcode = not used | ||
61 | * @param evargs = arguments to pass to event handler | ||
62 | * @returns false: completed synchronously, no event will be queued | ||
63 | */ | ||
64 | public const double Sorpra_MIN_CROSS = 1.0 / 512.0; // ie, ~2mm | ||
65 | public const int Sorpra_TIMEOUT_MS = 30000; // ie, 30sec | ||
66 | public override bool xmrSetObjRegPosRotAsync (LSL_Vector pos, LSL_Rotation rot, int options, int evcode, LSL_List evargs) | ||
67 | { | ||
68 | // do the move | ||
69 | SceneObjectGroup sog = m_Part.ParentGroup; | ||
70 | sog.UpdateGroupRotationPR (pos, rot); | ||
71 | |||
72 | // it is always synchronous | ||
73 | return false; | ||
74 | } | ||
75 | } | ||
76 | } | ||