diff options
author | gareth | 2007-03-22 10:11:15 +0000 |
---|---|---|
committer | gareth | 2007-03-22 10:11:15 +0000 |
commit | 7daa3955bc3a1918e40962851f9e8d38597a245e (patch) | |
tree | bee3e1372a7eed0c1b220a8a49f7bee7d29a6b91 /OpenSim.RegionServer/world/Entity.cs | |
parent | Load XML for neighbourinfo from grid (diff) | |
download | opensim-SC-7daa3955bc3a1918e40962851f9e8d38597a245e.zip opensim-SC-7daa3955bc3a1918e40962851f9e8d38597a245e.tar.gz opensim-SC-7daa3955bc3a1918e40962851f9e8d38597a245e.tar.bz2 opensim-SC-7daa3955bc3a1918e40962851f9e8d38597a245e.tar.xz |
brought zircon branch into trunk
Diffstat (limited to 'OpenSim.RegionServer/world/Entity.cs')
-rw-r--r-- | OpenSim.RegionServer/world/Entity.cs | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/OpenSim.RegionServer/world/Entity.cs b/OpenSim.RegionServer/world/Entity.cs new file mode 100644 index 0000000..780f3a0 --- /dev/null +++ b/OpenSim.RegionServer/world/Entity.cs | |||
@@ -0,0 +1,67 @@ | |||
1 | using System; | ||
2 | using System.Collections.Generic; | ||
3 | using System.Text; | ||
4 | using Axiom.MathLib; | ||
5 | using OpenSim.types; | ||
6 | using libsecondlife; | ||
7 | |||
8 | namespace OpenSim.world | ||
9 | { | ||
10 | public class Entity | ||
11 | { | ||
12 | public libsecondlife.LLUUID uuid; | ||
13 | public uint localid; | ||
14 | public LLVector3 position; | ||
15 | public LLVector3 velocity; | ||
16 | public Quaternion rotation; | ||
17 | protected string name; | ||
18 | protected List<Entity> children; | ||
19 | |||
20 | public Entity() | ||
21 | { | ||
22 | uuid = new libsecondlife.LLUUID(); | ||
23 | localid = 0; | ||
24 | position = new LLVector3(); | ||
25 | velocity = new LLVector3(); | ||
26 | rotation = new Quaternion(); | ||
27 | name = "(basic entity)"; | ||
28 | children = new List<Entity>(); | ||
29 | } | ||
30 | public virtual void addForces() | ||
31 | { | ||
32 | foreach (Entity child in children) | ||
33 | { | ||
34 | child.addForces(); | ||
35 | } | ||
36 | } | ||
37 | public virtual void update() { | ||
38 | // Do any per-frame updates needed that are applicable to every type of entity | ||
39 | foreach (Entity child in children) | ||
40 | { | ||
41 | child.update(); | ||
42 | } | ||
43 | } | ||
44 | |||
45 | public virtual string getName() | ||
46 | { | ||
47 | return name; | ||
48 | } | ||
49 | |||
50 | public virtual Mesh getMesh() | ||
51 | { | ||
52 | Mesh mesh = new Mesh(); | ||
53 | |||
54 | foreach (Entity child in children) | ||
55 | { | ||
56 | mesh += child.getMesh(); | ||
57 | } | ||
58 | |||
59 | return mesh; | ||
60 | } | ||
61 | |||
62 | public virtual void BackUp() | ||
63 | { | ||
64 | |||
65 | } | ||
66 | } | ||
67 | } | ||