aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/world/Avatar.cs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/world/Avatar.cs15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/world/Avatar.cs b/src/world/Avatar.cs
index 68606c4..fbd78b7 100644
--- a/src/world/Avatar.cs
+++ b/src/world/Avatar.cs
@@ -13,7 +13,10 @@ namespace OpenSim.world
13 public string firstname; 13 public string firstname;
14 public string lastname; 14 public string lastname;
15 public OpenSimClient ControllingClient; 15 public OpenSimClient ControllingClient;
16 public LLVector3 oldvel;
17 public LLVector3 oldpos;
16 public uint CurrentKeyMask; 18 public uint CurrentKeyMask;
19 public bool walking;
17 20
18 private libsecondlife.Packets.ObjectUpdatePacket.ObjectDataBlock AvatarTemplate; 21 private libsecondlife.Packets.ObjectUpdatePacket.ObjectDataBlock AvatarTemplate;
19 22
@@ -30,18 +33,22 @@ namespace OpenSim.world
30 base.update(); 33 base.update();
31 34
32 Console.WriteLine("KeyMask: " + this.CurrentKeyMask); 35 Console.WriteLine("KeyMask: " + this.CurrentKeyMask);
33 36
37 oldvel=this.velocity;
38 oldpos=this.position;
34 if((this.CurrentKeyMask & (uint)MainAvatar.AgentUpdateFlags.AGENT_CONTROL_AT_POS) != 0) { 39 if((this.CurrentKeyMask & (uint)MainAvatar.AgentUpdateFlags.AGENT_CONTROL_AT_POS) != 0) {
35 Vector3 tmpVelocity = this.rotation * new Vector3(1.0f,0.0f,0.0f); 40 Vector3 tmpVelocity = this.rotation * new Vector3(1.0f,0.0f,0.0f);
36 tmpVelocity.Normalize(); tmpVelocity = tmpVelocity * 0.3f; 41 tmpVelocity.Normalize(); tmpVelocity = tmpVelocity * 0.5f;
37 this.velocity.X = tmpVelocity.x; 42 this.velocity.X = tmpVelocity.x;
38 this.velocity.Y = tmpVelocity.y; 43 this.velocity.Y = tmpVelocity.y;
39 this.velocity.Z = tmpVelocity.z; 44 this.velocity.Z = tmpVelocity.z;
40 Console.WriteLine("Walking at "+ this.velocity.ToString()); 45 Console.WriteLine("Walking at "+ this.velocity.ToString());
46 this.walking=true;
41 } else { 47 } else {
42 this.velocity.X=0; 48 this.velocity.X=0;
43 this.velocity.Y=0; 49 this.velocity.Y=0;
44 this.velocity.Z=0; 50 this.velocity.Z=0;
51 this.walking=false;
45 } 52 }
46 } 53 }
47 } 54 }
@@ -238,10 +245,8 @@ namespace OpenSim.world
238 245
239 public void HandleAgentUpdate(AgentUpdatePacket update) { 246 public void HandleAgentUpdate(AgentUpdatePacket update) {
240 lock(this) { 247 lock(this) {
241 // FIXME: shouldn't update these direction
242 this.rotation = new Quaternion(update.AgentData.BodyRotation.W, update.AgentData.BodyRotation.X, update.AgentData.BodyRotation.Y, update.AgentData.BodyRotation.Z);
243
244 this.CurrentKeyMask = update.AgentData.ControlFlags; 248 this.CurrentKeyMask = update.AgentData.ControlFlags;
249 this.rotation = new Quaternion(update.AgentData.BodyRotation.W, update.AgentData.BodyRotation.X, update.AgentData.BodyRotation.Y, update.AgentData.BodyRotation.Z);
245 this.needupdate = true; 250 this.needupdate = true;
246 } 251 }
247 } 252 }