aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/world/Avatar.cs
diff options
context:
space:
mode:
authorgareth2007-03-04 01:57:52 +0000
committergareth2007-03-04 01:57:52 +0000
commit412d7e098c424745c0c2ae1a6526c5b5d58b3180 (patch)
treeadf1e02de27534503dcb3f7b4619d89366c2b8a5 /src/world/Avatar.cs
parentKeeping the MSVC project file up to date (diff)
downloadopensim-SC_OLD-412d7e098c424745c0c2ae1a6526c5b5d58b3180.zip
opensim-SC_OLD-412d7e098c424745c0c2ae1a6526c5b5d58b3180.tar.gz
opensim-SC_OLD-412d7e098c424745c0c2ae1a6526c5b5d58b3180.tar.bz2
opensim-SC_OLD-412d7e098c424745c0c2ae1a6526c5b5d58b3180.tar.xz
Fixed up bugs from patch in PREV:
Slow movement of avatar FIXED Constant TerseObjectUpdates FIXED Moving out of sim FIXED
Diffstat (limited to 'src/world/Avatar.cs')
-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 }