From 9685c65901445218d8e523f48d8b1e481ee65280 Mon Sep 17 00:00:00 2001 From: MW Date: Sun, 15 Jul 2007 23:39:52 +0000 Subject: Couple of small changes to NPC test character. --- .../Region/Examples/SimpleApp/MyNpcCharacter.cs | 24 ++++++++++++++-------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs b/OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs index e6bc715..6b332eb 100644 --- a/OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs +++ b/OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs @@ -17,8 +17,8 @@ namespace SimpleApp { public class MyNpcCharacter : IClientAPI { - private uint movementDirection = 0; - private bool fly = true; + private uint movementFlag = 0; + private short flyState = 0; private LLQuaternion bodyDirection = LLQuaternion.Identity; private short count = 0; @@ -153,21 +153,27 @@ namespace SimpleApp { Encoding enc = Encoding.ASCII; - this.OnAgentUpdate(this, movementDirection, bodyDirection); + this.OnAgentUpdate(this, movementFlag, bodyDirection); - if (this.fly) + if (this.flyState == 0) { - movementDirection = (uint)MainAvatar.ControlFlags.AGENT_CONTROL_FLY | (uint)MainAvatar.ControlFlags.AGENT_CONTROL_UP_NEG; - fly = false; + movementFlag = (uint)MainAvatar.ControlFlags.AGENT_CONTROL_FLY | (uint)MainAvatar.ControlFlags.AGENT_CONTROL_UP_NEG; + flyState = 1; + } + else if (this.flyState == 1) + { + movementFlag = (uint)MainAvatar.ControlFlags.AGENT_CONTROL_FLY | (uint)MainAvatar.ControlFlags.AGENT_CONTROL_UP_POS; + flyState = 2; } else { - movementDirection = (uint)MainAvatar.ControlFlags.AGENT_CONTROL_FLY | (uint)MainAvatar.ControlFlags.AGENT_CONTROL_UP_POS; - fly = true; + movementFlag = (uint)MainAvatar.ControlFlags.AGENT_CONTROL_FLY; + flyState = 0; } + 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; } -- cgit v1.1