aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim.RegionServer/world/Avatar.cs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim.RegionServer/world/Avatar.cs54
1 files changed, 45 insertions, 9 deletions
diff --git a/OpenSim.RegionServer/world/Avatar.cs b/OpenSim.RegionServer/world/Avatar.cs
index 2ae9992..7b79378 100644
--- a/OpenSim.RegionServer/world/Avatar.cs
+++ b/OpenSim.RegionServer/world/Avatar.cs
@@ -41,10 +41,10 @@ namespace OpenSim.world
41 m_clientThreads = clientThreads; 41 m_clientThreads = clientThreads;
42 m_regionName = regionName; 42 m_regionName = regionName;
43 m_regionHandle = regionHandle; 43 m_regionHandle = regionHandle;
44 44
45 OpenSim.Framework.Console.MainConsole.Instance.WriteLine("Avatar.cs - Loading details from grid (DUMMY)"); 45 OpenSim.Framework.Console.MainConsole.Instance.WriteLine("Avatar.cs - Loading details from grid (DUMMY)");
46 ControllingClient = TheClient; 46 ControllingClient = TheClient;
47 localid = 8880000 + (m_world._localNumber++); 47 localid = 8880000 + (this.m_world._localNumber++);
48 position = new LLVector3(100.0f, 100.0f, 30.0f); 48 position = new LLVector3(100.0f, 100.0f, 30.0f);
49 position.Z = m_world.LandMap[(int)position.Y * 256 + (int)position.X] + 1; 49 position.Z = m_world.LandMap[(int)position.Y * 256 + (int)position.X] + 1;
50 visualParams = new byte[218]; 50 visualParams = new byte[218];
@@ -61,7 +61,7 @@ namespace OpenSim.world
61 this.Wearables[0].ItemID = LLUUID.Random(); 61 this.Wearables[0].ItemID = LLUUID.Random();
62 62
63 this.avatarAppearanceTexture = new LLObject.TextureEntry(new LLUUID("00000000-0000-0000-5005-000000000005")); 63 this.avatarAppearanceTexture = new LLObject.TextureEntry(new LLUUID("00000000-0000-0000-5005-000000000005"));
64 64
65 } 65 }
66 66
67 public PhysicsActor PhysActor 67 public PhysicsActor PhysActor
@@ -82,7 +82,10 @@ namespace OpenSim.world
82 { 82 {
83 NewForce force = this.forcesList[i]; 83 NewForce force = this.forcesList[i];
84 PhysicsVector phyVector = new PhysicsVector(force.X, force.Y, force.Z); 84 PhysicsVector phyVector = new PhysicsVector(force.X, force.Y, force.Z);
85 this._physActor.Velocity = phyVector; 85 lock (m_world.LockPhysicsEngine)
86 {
87 this._physActor.Velocity = phyVector;
88 }
86 this.updateflag = true; 89 this.updateflag = true;
87 this.velocity = new LLVector3(force.X, force.Y, force.Z); //shouldn't really be doing this 90 this.velocity = new LLVector3(force.X, force.Y, force.Z); //shouldn't really be doing this
88 // but as we are setting the velocity (rather than using real forces) at the moment it is okay. 91 // but as we are setting the velocity (rather than using real forces) at the moment it is okay.
@@ -181,7 +184,7 @@ namespace OpenSim.world
181 AgentMovementCompletePacket mov = new AgentMovementCompletePacket(); 184 AgentMovementCompletePacket mov = new AgentMovementCompletePacket();
182 mov.AgentData.SessionID = this.ControllingClient.SessionID; 185 mov.AgentData.SessionID = this.ControllingClient.SessionID;
183 mov.AgentData.AgentID = this.ControllingClient.AgentID; 186 mov.AgentData.AgentID = this.ControllingClient.AgentID;
184 mov.Data.RegionHandle = m_regionHandle; 187 mov.Data.RegionHandle = this.m_regionHandle;
185 // TODO - dynamicalise this stuff 188 // TODO - dynamicalise this stuff
186 mov.Data.Timestamp = 1172750370; 189 mov.Data.Timestamp = 1172750370;
187 mov.Data.Position = new LLVector3(100f, 100f, 23f); 190 mov.Data.Position = new LLVector3(100f, 100f, 23f);
@@ -475,7 +478,12 @@ namespace OpenSim.world
475 ani.AnimationList[0] = new AvatarAnimationPacket.AnimationListBlock(); 478 ani.AnimationList[0] = new AvatarAnimationPacket.AnimationListBlock();
476 ani.AnimationList[0].AnimID = this.current_anim; 479 ani.AnimationList[0].AnimID = this.current_anim;
477 ani.AnimationList[0].AnimSequenceID = this.anim_seq; 480 ani.AnimationList[0].AnimSequenceID = this.anim_seq;
478 ControllingClient.OutPacket(ani); 481
482 //ControllingClient.OutPacket(ani);
483 foreach (SimClient client in m_clientThreads.Values)
484 {
485 client.OutPacket(ani);
486 }
479 } 487 }
480 488
481 //should be moved somewhere else 489 //should be moved somewhere else
@@ -522,7 +530,11 @@ namespace OpenSim.world
522 ImprovedTerseObjectUpdatePacket.ObjectDataBlock dat = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock(); 530 ImprovedTerseObjectUpdatePacket.ObjectDataBlock dat = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock();
523 531
524 dat.TextureEntry = new byte[0];// AvatarTemplate.TextureEntry; 532 dat.TextureEntry = new byte[0];// AvatarTemplate.TextureEntry;
525 libsecondlife.LLVector3 pos2 = new LLVector3(this._physActor.Position.X, this._physActor.Position.Y, this._physActor.Position.Z); 533 libsecondlife.LLVector3 pos2 = new LLVector3(0, 0, 0);
534 lock (m_world.LockPhysicsEngine)
535 {
536 pos2 = new LLVector3(this._physActor.Position.X, this._physActor.Position.Y, this._physActor.Position.Z);
537 }
526 538
527 uint ID = this.localid; 539 uint ID = this.localid;
528 540
@@ -542,8 +554,11 @@ namespace OpenSim.world
542 ushort InternVelocityX; 554 ushort InternVelocityX;
543 ushort InternVelocityY; 555 ushort InternVelocityY;
544 ushort InternVelocityZ; 556 ushort InternVelocityZ;
545 557 Axiom.MathLib.Vector3 internDirec = new Axiom.MathLib.Vector3(0, 0, 0);
546 Axiom.MathLib.Vector3 internDirec = new Axiom.MathLib.Vector3(this._physActor.Velocity.X, this._physActor.Velocity.Y, this._physActor.Velocity.Z); 558 lock (m_world.LockPhysicsEngine)
559 {
560 internDirec = new Axiom.MathLib.Vector3(this._physActor.Velocity.X, this._physActor.Velocity.Y, this._physActor.Velocity.Z);
561 }
547 internDirec = internDirec / 128.0f; 562 internDirec = internDirec / 128.0f;
548 internDirec.x += 1; 563 internDirec.x += 1;
549 internDirec.y += 1; 564 internDirec.y += 1;
@@ -596,6 +611,27 @@ namespace OpenSim.world
596 Avatar.Animations = new AvatarAnimations(); 611 Avatar.Animations = new AvatarAnimations();
597 Avatar.Animations.LoadAnims(); 612 Avatar.Animations.LoadAnims();
598 } 613 }
614
615 public override void LandRenegerated()
616 {
617 position = new LLVector3(100.0f, 100.0f, 30.0f);
618 position.Z = this.m_world.LandMap[(int)position.Y * 256 + (int)position.X] + 50;
619 if (this._physActor != null)
620 {
621 try
622 {
623 lock (this.m_world.LockPhysicsEngine)
624 {
625
626 this._physActor.Position = new PhysicsVector(position.X, position.Y, position.Z);
627 }
628 }
629 catch (Exception e)
630 {
631 Console.WriteLine(e.Message);
632 }
633 }
634 }
599 } 635 }
600 636
601 public class NewForce 637 public class NewForce