aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Examples/SimpleApp
diff options
context:
space:
mode:
authorMW2007-07-15 22:11:03 +0000
committerMW2007-07-15 22:11:03 +0000
commit4dbad04b9f00924eb58fa371887ab8901faa6ab7 (patch)
treeec976cc11cbf04ad21d65c5599755f8621bab86b /OpenSim/Region/Examples/SimpleApp
parent* Added new scripting related events, in particular a new event which is trig... (diff)
downloadopensim-SC-4dbad04b9f00924eb58fa371887ab8901faa6ab7.zip
opensim-SC-4dbad04b9f00924eb58fa371887ab8901faa6ab7.tar.gz
opensim-SC-4dbad04b9f00924eb58fa371887ab8901faa6ab7.tar.bz2
opensim-SC-4dbad04b9f00924eb58fa371887ab8901faa6ab7.tar.xz
It wasn't me who messed up flying when adding a test NPC class. (honestly!)
Diffstat (limited to 'OpenSim/Region/Examples/SimpleApp')
-rw-r--r--OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs13
-rw-r--r--OpenSim/Region/Examples/SimpleApp/Program.cs9
2 files changed, 14 insertions, 8 deletions
diff --git a/OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs b/OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs
index 1c267c6..e6bc715 100644
--- a/OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs
+++ b/OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs
@@ -20,6 +20,7 @@ namespace SimpleApp
20 private uint movementDirection = 0; 20 private uint movementDirection = 0;
21 private bool fly = true; 21 private bool fly = true;
22 private LLQuaternion bodyDirection = LLQuaternion.Identity; 22 private LLQuaternion bodyDirection = LLQuaternion.Identity;
23 private short count = 0;
23 24
24 public event ImprovedInstantMessage OnInstantMessage; 25 public event ImprovedInstantMessage OnInstantMessage;
25 public event ChatFromViewer OnChatFromViewer; 26 public event ChatFromViewer OnChatFromViewer;
@@ -144,13 +145,12 @@ namespace SimpleApp
144 { 145 {
145 Timer timer = new Timer(); 146 Timer timer = new Timer();
146 timer.Enabled = true; 147 timer.Enabled = true;
147 timer.Interval = 10000; 148 timer.Interval = 500;
148 timer.Elapsed += new ElapsedEventHandler(this.Heartbeat); 149 timer.Elapsed += new ElapsedEventHandler(this.Heartbeat);
149 } 150 }
150 151
151 public void Heartbeat(object sender, EventArgs e) 152 public void Heartbeat(object sender, EventArgs e)
152 { 153 {
153
154 Encoding enc = Encoding.ASCII; 154 Encoding enc = Encoding.ASCII;
155 155
156 this.OnAgentUpdate(this, movementDirection, bodyDirection); 156 this.OnAgentUpdate(this, movementDirection, bodyDirection);
@@ -165,10 +165,13 @@ namespace SimpleApp
165 movementDirection = (uint)MainAvatar.ControlFlags.AGENT_CONTROL_FLY | (uint)MainAvatar.ControlFlags.AGENT_CONTROL_UP_POS; 165 movementDirection = (uint)MainAvatar.ControlFlags.AGENT_CONTROL_FLY | (uint)MainAvatar.ControlFlags.AGENT_CONTROL_UP_POS;
166 fly = true; 166 fly = true;
167 } 167 }
168 if (count >= 40)
169 {
170 this.OnChatFromViewer(enc.GetBytes("Kind of quiet around here isn't it! \0"), 2, new LLVector3(128, 128, 26), this.FirstName + " " + this.LastName, this.AgentId);
171 count = -1;
172 }
168 173
169 this.OnChatFromViewer(enc.GetBytes("Kind of quiet around here isn't it! \0"), 2, new LLVector3(128, 128, 26), this.FirstName + " " + this.LastName, this.AgentId); 174 count++;
170
171
172 } 175 }
173 } 176 }
174} 177}
diff --git a/OpenSim/Region/Examples/SimpleApp/Program.cs b/OpenSim/Region/Examples/SimpleApp/Program.cs
index 0c688ba..3e4bfee 100644
--- a/OpenSim/Region/Examples/SimpleApp/Program.cs
+++ b/OpenSim/Region/Examples/SimpleApp/Program.cs
@@ -47,6 +47,9 @@ namespace SimpleApp
47 47
48 AssetCache assetCache = new AssetCache(assetServer); 48 AssetCache assetCache = new AssetCache(assetServer);
49 49
50 ScenePresence.LoadTextureFile("avatar-texture.dat");
51 ScenePresence.PhysicsEngineFlying = true;
52
50 PhysicsManager physManager = new PhysicsManager(); 53 PhysicsManager physManager = new PhysicsManager();
51 physManager.LoadPlugins(); 54 physManager.LoadPlugins();
52 55
@@ -65,7 +68,7 @@ namespace SimpleApp
65 68
66 world = new MyWorld( regionInfo, m_circuitManager, communicationsManager, assetCache, storeMan, httpServer); 69 world = new MyWorld( regionInfo, m_circuitManager, communicationsManager, assetCache, storeMan, httpServer);
67 world.PhysScene = physManager.GetPhysicsScene("basicphysics"); //PhysicsScene.Null; 70 world.PhysScene = physManager.GetPhysicsScene("basicphysics"); //PhysicsScene.Null;
68 71
69 world.LoadWorldMap(); 72 world.LoadWorldMap();
70 world.PhysScene.SetTerrain(world.Terrain.getHeights1D()); 73 world.PhysScene.SetTerrain(world.Terrain.getHeights1D());
71 74
@@ -81,6 +84,8 @@ namespace SimpleApp
81 world.ParcelManager.NoParcelDataFromStorage(); 84 world.ParcelManager.NoParcelDataFromStorage();
82 } 85 }
83 86
87 world.StartTimer();
88
84 PrimitiveBaseShape shape = PrimitiveBaseShape.DefaultBox(); 89 PrimitiveBaseShape shape = PrimitiveBaseShape.DefaultBox();
85 shape.Scale = new LLVector3(0.5f, 0.5f, 0.5f); 90 shape.Scale = new LLVector3(0.5f, 0.5f, 0.5f);
86 LLVector3 pos = new LLVector3(138, 129, 27); 91 LLVector3 pos = new LLVector3(138, 129, 27);
@@ -91,8 +96,6 @@ namespace SimpleApp
91 m_character = new MyNpcCharacter(); 96 m_character = new MyNpcCharacter();
92 world.AddNewClient(m_character, false); 97 world.AddNewClient(m_character, false);
93 98
94 world.StartTimer();
95
96 m_log.WriteLine(LogPriority.NORMAL, "Press enter to quit."); 99 m_log.WriteLine(LogPriority.NORMAL, "Press enter to quit.");
97 m_log.ReadLine(); 100 m_log.ReadLine();
98 101