diff options
Diffstat (limited to 'OpenSim/OpenSim.RegionServer/world/Entity.cs')
-rw-r--r-- | OpenSim/OpenSim.RegionServer/world/Entity.cs | 151 |
1 files changed, 0 insertions, 151 deletions
diff --git a/OpenSim/OpenSim.RegionServer/world/Entity.cs b/OpenSim/OpenSim.RegionServer/world/Entity.cs deleted file mode 100644 index 5c653c7..0000000 --- a/OpenSim/OpenSim.RegionServer/world/Entity.cs +++ /dev/null | |||
@@ -1,151 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://www.openmetaverse.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 OpenSim 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 System; | ||
29 | using System.Collections.Generic; | ||
30 | using System.Text; | ||
31 | using Axiom.MathLib; | ||
32 | using OpenSim.Physics.Manager; | ||
33 | using OpenSim.types; | ||
34 | using libsecondlife; | ||
35 | using OpenSim.RegionServer.world.scripting; | ||
36 | |||
37 | namespace OpenSim.world | ||
38 | { | ||
39 | public abstract class Entity : IScriptReadonlyEntity | ||
40 | { | ||
41 | public libsecondlife.LLUUID uuid; | ||
42 | public uint localid; | ||
43 | public LLVector3 velocity; | ||
44 | public Quaternion rotation; | ||
45 | protected List<Entity> children; | ||
46 | |||
47 | protected string m_name; | ||
48 | public virtual string Name | ||
49 | { | ||
50 | get { return m_name; } | ||
51 | } | ||
52 | |||
53 | protected LLVector3 m_pos; | ||
54 | protected PhysicsActor _physActor; | ||
55 | protected World m_world; | ||
56 | |||
57 | public virtual LLVector3 Pos | ||
58 | { | ||
59 | get | ||
60 | { | ||
61 | if (this._physActor != null) | ||
62 | { | ||
63 | m_pos.X = _physActor.Position.X; | ||
64 | m_pos.Y = _physActor.Position.Y; | ||
65 | m_pos.Z = _physActor.Position.Z; | ||
66 | } | ||
67 | |||
68 | return m_pos; | ||
69 | } | ||
70 | set | ||
71 | { | ||
72 | if (this._physActor != null) | ||
73 | { | ||
74 | try | ||
75 | { | ||
76 | lock (this.m_world.LockPhysicsEngine) | ||
77 | { | ||
78 | |||
79 | this._physActor.Position = new PhysicsVector(value.X, value.Y, value.Z); | ||
80 | } | ||
81 | } | ||
82 | catch (Exception e) | ||
83 | { | ||
84 | Console.WriteLine(e.Message); | ||
85 | } | ||
86 | } | ||
87 | |||
88 | m_pos = value; | ||
89 | } | ||
90 | } | ||
91 | |||
92 | /// <summary> | ||
93 | /// Creates a new Entity (should not occur on it's own) | ||
94 | /// </summary> | ||
95 | public Entity() | ||
96 | { | ||
97 | uuid = new libsecondlife.LLUUID(); | ||
98 | localid = 0; | ||
99 | m_pos = new LLVector3(); | ||
100 | velocity = new LLVector3(); | ||
101 | rotation = new Quaternion(); | ||
102 | m_name = "(basic entity)"; | ||
103 | children = new List<Entity>(); | ||
104 | } | ||
105 | |||
106 | public virtual void addForces() | ||
107 | { | ||
108 | foreach (Entity child in children) | ||
109 | { | ||
110 | child.addForces(); | ||
111 | } | ||
112 | } | ||
113 | |||
114 | /// <summary> | ||
115 | /// Performs any updates that need to be done at each frame. This function is overridable from it's children. | ||
116 | /// </summary> | ||
117 | public virtual void update() { | ||
118 | // Do any per-frame updates needed that are applicable to every type of entity | ||
119 | foreach (Entity child in children) | ||
120 | { | ||
121 | child.update(); | ||
122 | } | ||
123 | } | ||
124 | |||
125 | /// <summary> | ||
126 | /// Returns a mesh for this object and any dependents | ||
127 | /// </summary> | ||
128 | /// <returns>The mesh of this entity tree</returns> | ||
129 | public virtual Mesh getMesh() | ||
130 | { | ||
131 | Mesh mesh = new Mesh(); | ||
132 | |||
133 | foreach (Entity child in children) | ||
134 | { | ||
135 | mesh += child.getMesh(); | ||
136 | } | ||
137 | |||
138 | return mesh; | ||
139 | } | ||
140 | |||
141 | public virtual void BackUp() | ||
142 | { | ||
143 | |||
144 | } | ||
145 | |||
146 | public virtual void LandRenegerated() | ||
147 | { | ||
148 | |||
149 | } | ||
150 | } | ||
151 | } | ||