From 726b91d74d5644afe9aeefa1dfa91be87316bdb7 Mon Sep 17 00:00:00 2001 From: jmalthus Date: Wed, 14 Feb 2007 02:36:25 +0000 Subject: [PATCH] Patch Applied regarding Bug #51 --- Agent_Manager.cs | 27 +++++++++++++++++++++++++++ Controller.cs | 5 +++++ 2 files changed, 32 insertions(+) diff --git a/Agent_Manager.cs b/Agent_Manager.cs index a143bdac65..11b523e524 100644 --- a/Agent_Manager.cs +++ b/Agent_Manager.cs @@ -195,6 +195,28 @@ namespace OpenSim ani.AnimationList[0].AnimSequenceID = AgentList[userInfo.AgentID].AnimSequenceID; Console.WriteLine("Agenct_Manager.cs: UpdateAnim(UserAgentInfo userInfo): Sent Animation to client - " + AgentManager.AnimsNames[ani.AnimationList[0].AnimID]); _server.SendPacket(ani, true, userInfo); + + // update other agents as appropiate + Axiom.MathLib.Sphere BoundingSphere; + foreach (KeyValuePair kp in this.AgentList) + { + if(kp.Key!=userInfo.AgentID) { + // Make a bounding sphere for the other avatar + BoundingSphere = new Sphere(new Vector3(kp.Value.Position.X,kp.Value.Position.Y,kp.Value.Position.Z), kp.Value.far); + + // If it intersects with our position, send an update packet + if(BoundingSphere.Intersects(new Vector3(this.AgentList[userInfo.AgentID].Position.X,this.AgentList[userInfo.AgentID].Position.Y,this.AgentList[userInfo.AgentID].Position.Z))) { + ani.AnimationSourceList[0].ObjectID = userInfo.AgentID; + ani.Sender = new AvatarAnimationPacket.SenderBlock(); + ani.Sender.ID = userInfo.AgentID; + ani.AnimationList = new AvatarAnimationPacket.AnimationListBlock[1]; + ani.AnimationList[0] = new AvatarAnimationPacket.AnimationListBlock(); + ani.AnimationList[0].AnimID = AgentList[userInfo.AgentID].AnimID; + ani.AnimationList[0].AnimSequenceID = AgentList[userInfo.AgentID].AnimSequenceID; + _server.SendPacket(ani, true, kp.Value.NetInfo); + } + } + } } /// /// @@ -816,6 +838,11 @@ namespace OpenSim public LLUUID BaseFolder; public LLUUID AnimID; public int AnimSequenceID; + public float far; + public libsecondlife.LLVector3 CameraAtAxis; + public libsecondlife.LLVector3 CameraCenter; + public libsecondlife.LLVector3 CameraLeftAxis; + public libsecondlife.LLVector3 CameraUpAxis; public AvatarData() { diff --git a/Controller.cs b/Controller.cs index 1c3b89122f..d0a17cf421 100644 --- a/Controller.cs +++ b/Controller.cs @@ -232,6 +232,11 @@ namespace OpenSim AgentUpdatePacket agent = (AgentUpdatePacket)pack; uint mask = agent.AgentData.ControlFlags & (1); AvatarData avatar = _agentManager.GetAgent(userInfo.AgentID); + avatar.CameraAtAxis = agent.AgentData.CameraAtAxis; + avatar.CameraUpAxis = agent.AgentData.CameraUpAxis; + avatar.CameraCenter = agent.AgentData.CameraCenter; + avatar.far = agent.AgentData.Far; + if (avatar != null) { if (avatar.Started)