aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/world/Entity.cs
diff options
context:
space:
mode:
authorgareth2007-02-27 23:00:49 +0000
committergareth2007-02-27 23:00:49 +0000
commit09dd4bd6834861791008e66652826a66724efa0e (patch)
treeae2b10c3b6ce3fab4c516c6710d4fa0adafedb77 /src/world/Entity.cs
parentRemoved old trunk code (diff)
downloadopensim-SC_OLD-09dd4bd6834861791008e66652826a66724efa0e.zip
opensim-SC_OLD-09dd4bd6834861791008e66652826a66724efa0e.tar.gz
opensim-SC_OLD-09dd4bd6834861791008e66652826a66724efa0e.tar.bz2
opensim-SC_OLD-09dd4bd6834861791008e66652826a66724efa0e.tar.xz
Brought in code from branches/gareth
Diffstat (limited to 'src/world/Entity.cs')
-rw-r--r--src/world/Entity.cs53
1 files changed, 53 insertions, 0 deletions
diff --git a/src/world/Entity.cs b/src/world/Entity.cs
new file mode 100644
index 0000000..ab07fd6
--- /dev/null
+++ b/src/world/Entity.cs
@@ -0,0 +1,53 @@
1using System;
2using System.Collections.Generic;
3using System.Text;
4using Axiom.MathLib;
5using OpenSim.types;
6
7namespace OpenSim.world
8{
9 public class Entity
10 {
11 protected libsecondlife.LLUUID uuid;
12 protected Vector3 position;
13 protected Vector3 velocity;
14 protected Quaternion rotation;
15 protected string name;
16 protected List<Entity> children;
17
18 public Entity()
19 {
20 uuid = new libsecondlife.LLUUID();
21 position = new Vector3();
22 velocity = new Vector3();
23 rotation = new Quaternion();
24 name = "(basic entity)";
25 children = new List<Entity>();
26 }
27
28 public virtual void update() {
29 // Do any per-frame updates needed that are applicable to every type of entity
30 foreach (Entity child in children)
31 {
32 child.update();
33 }
34 }
35
36 public virtual string getName()
37 {
38 return name;
39 }
40
41 public virtual Mesh getMesh()
42 {
43 Mesh mesh = new Mesh();
44
45 foreach (Entity child in children)
46 {
47 mesh += child.getMesh();
48 }
49
50 return mesh;
51 }
52 }
53}