It wasn't me who messed up flying when adding a test NPC class. (honestly!)

afrisby
MW 2007-07-15 22:11:03 +00:00
parent f2c449f10e
commit 4dbad04b9f
4 changed files with 16 additions and 10 deletions

View File

@ -84,7 +84,7 @@ namespace OpenSim.Region.Communications.OGS1
// Initialise the background listeners // Initialise the background listeners
RegionCommsListener regListener = new RegionCommsListener(); RegionCommsListener regListener = new RegionCommsListener();
if (this.listeners.ContainsKey(regionInfo.RegionHandle)) if (!this.listeners.ContainsKey(regionInfo.RegionHandle))
{ {
this.listeners.Add(regionInfo.RegionHandle, regListener); this.listeners.Add(regionInfo.RegionHandle, regListener);
} }

View File

@ -75,7 +75,7 @@ namespace OpenSim.Region.Environment.Scenes
DIR_CONTROL_FLAG_LEFT = MainAvatar.ControlFlags.AGENT_CONTROL_LEFT_POS, DIR_CONTROL_FLAG_LEFT = MainAvatar.ControlFlags.AGENT_CONTROL_LEFT_POS,
DIR_CONTROL_FLAG_RIGHT = MainAvatar.ControlFlags.AGENT_CONTROL_LEFT_NEG, DIR_CONTROL_FLAG_RIGHT = MainAvatar.ControlFlags.AGENT_CONTROL_LEFT_NEG,
DIR_CONTROL_FLAG_UP = MainAvatar.ControlFlags.AGENT_CONTROL_UP_POS, DIR_CONTROL_FLAG_UP = MainAvatar.ControlFlags.AGENT_CONTROL_UP_POS,
DIR_CONTROL_FLAG_DOWN = MainAvatar.ControlFlags.AGENT_CONTROL_AT_NEG DIR_CONTROL_FLAG_DOWN = MainAvatar.ControlFlags.AGENT_CONTROL_UP_NEG
} }
/// <summary> /// <summary>
/// Position at which a significant movement was made /// Position at which a significant movement was made

View File

@ -20,6 +20,7 @@ namespace SimpleApp
private uint movementDirection = 0; private uint movementDirection = 0;
private bool fly = true; private bool fly = true;
private LLQuaternion bodyDirection = LLQuaternion.Identity; private LLQuaternion bodyDirection = LLQuaternion.Identity;
private short count = 0;
public event ImprovedInstantMessage OnInstantMessage; public event ImprovedInstantMessage OnInstantMessage;
public event ChatFromViewer OnChatFromViewer; public event ChatFromViewer OnChatFromViewer;
@ -144,13 +145,12 @@ namespace SimpleApp
{ {
Timer timer = new Timer(); Timer timer = new Timer();
timer.Enabled = true; timer.Enabled = true;
timer.Interval = 10000; timer.Interval = 500;
timer.Elapsed += new ElapsedEventHandler(this.Heartbeat); timer.Elapsed += new ElapsedEventHandler(this.Heartbeat);
} }
public void Heartbeat(object sender, EventArgs e) public void Heartbeat(object sender, EventArgs e)
{ {
Encoding enc = Encoding.ASCII; Encoding enc = Encoding.ASCII;
this.OnAgentUpdate(this, movementDirection, bodyDirection); this.OnAgentUpdate(this, movementDirection, bodyDirection);
@ -165,10 +165,13 @@ namespace SimpleApp
movementDirection = (uint)MainAvatar.ControlFlags.AGENT_CONTROL_FLY | (uint)MainAvatar.ControlFlags.AGENT_CONTROL_UP_POS; movementDirection = (uint)MainAvatar.ControlFlags.AGENT_CONTROL_FLY | (uint)MainAvatar.ControlFlags.AGENT_CONTROL_UP_POS;
fly = true; fly = true;
} }
if (count >= 40)
{
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); 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);
count = -1;
}
count++;
} }
} }
} }

View File

@ -47,6 +47,9 @@ namespace SimpleApp
AssetCache assetCache = new AssetCache(assetServer); AssetCache assetCache = new AssetCache(assetServer);
ScenePresence.LoadTextureFile("avatar-texture.dat");
ScenePresence.PhysicsEngineFlying = true;
PhysicsManager physManager = new PhysicsManager(); PhysicsManager physManager = new PhysicsManager();
physManager.LoadPlugins(); physManager.LoadPlugins();
@ -81,6 +84,8 @@ namespace SimpleApp
world.ParcelManager.NoParcelDataFromStorage(); world.ParcelManager.NoParcelDataFromStorage();
} }
world.StartTimer();
PrimitiveBaseShape shape = PrimitiveBaseShape.DefaultBox(); PrimitiveBaseShape shape = PrimitiveBaseShape.DefaultBox();
shape.Scale = new LLVector3(0.5f, 0.5f, 0.5f); shape.Scale = new LLVector3(0.5f, 0.5f, 0.5f);
LLVector3 pos = new LLVector3(138, 129, 27); LLVector3 pos = new LLVector3(138, 129, 27);
@ -91,8 +96,6 @@ namespace SimpleApp
m_character = new MyNpcCharacter(); m_character = new MyNpcCharacter();
world.AddNewClient(m_character, false); world.AddNewClient(m_character, false);
world.StartTimer();
m_log.WriteLine(LogPriority.NORMAL, "Press enter to quit."); m_log.WriteLine(LogPriority.NORMAL, "Press enter to quit.");
m_log.ReadLine(); m_log.ReadLine();