From f71b315592b9f7e81ed6344d731495c2a69bca30 Mon Sep 17 00:00:00 2001 From: lbsa71 Date: Tue, 18 Sep 2007 22:12:16 +0000 Subject: * Now at least we're not creating physActors for child agents. --- OpenSim/Region/Environment/Scenes/Scene.cs | 28 +++++++++++++++++++--------- OpenSim/Region/Examples/SimpleApp/MyWorld.cs | 2 +- 2 files changed, 20 insertions(+), 10 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index 09992fd..d763fe3 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs @@ -703,7 +703,7 @@ namespace OpenSim.Region.Environment.Scenes { SubscribeToClientEvents(client); m_estateManager.sendRegionHandshake(client); - CreateAndAddScenePresence(client); + CreateAndAddScenePresence(client, child ); m_LandManager.sendParcelOverlay(client); commsManager.UserProfiles.AddNewUser(client.AgentId); commsManager.TransactionsManager.AddUser(client.AgentId); @@ -768,19 +768,29 @@ namespace OpenSim.Region.Environment.Scenes EventManager.TriggerOnNewClient(client); } - protected ScenePresence CreateAndAddScenePresence(IClientAPI client) + protected ScenePresence CreateAndAddScenePresence(IClientAPI client, bool child ) { ScenePresence newAvatar = null; - MainLog.Instance.Verbose("World.cs:AddViewerAgent() - Creating new avatar for remote viewer agent"); newAvatar = new ScenePresence(client, this, m_regInfo); - MainLog.Instance.Verbose("World.cs:AddViewerAgent() - Adding new avatar to world"); - MainLog.Instance.Verbose("World.cs:AddViewerAgent() - Starting RegionHandshake "); + newAvatar.childAgent = child; - PhysicsVector pVec = new PhysicsVector(newAvatar.AbsolutePosition.X, newAvatar.AbsolutePosition.Y, newAvatar.AbsolutePosition.Z); - lock (m_syncRoot) + if (child) { - newAvatar.PhysActor = phyScene.AddAvatar(pVec); + MainLog.Instance.Verbose(this.RegionInfo.RegionName + ": Creating new child agent."); + } + else + { + newAvatar.OnSignificantClientMovement += m_LandManager.handleSignificantClientMovement; + + MainLog.Instance.Verbose(this.RegionInfo.RegionName + ": Creating new root agent."); + MainLog.Instance.Verbose(this.RegionInfo.RegionName + ": Adding Physical agent."); + + PhysicsVector pVec = new PhysicsVector(newAvatar.AbsolutePosition.X, newAvatar.AbsolutePosition.Y, newAvatar.AbsolutePosition.Z); + lock (m_syncRoot) + { + newAvatar.PhysActor = phyScene.AddAvatar(pVec); + } } lock (Entities) @@ -805,7 +815,7 @@ namespace OpenSim.Region.Environment.Scenes Avatars.Add(client.AgentId, newAvatar); } } - newAvatar.OnSignificantClientMovement += m_LandManager.handleSignificantClientMovement; + return newAvatar; } diff --git a/OpenSim/Region/Examples/SimpleApp/MyWorld.cs b/OpenSim/Region/Examples/SimpleApp/MyWorld.cs index cf71389..1f62c88 100644 --- a/OpenSim/Region/Examples/SimpleApp/MyWorld.cs +++ b/OpenSim/Region/Examples/SimpleApp/MyWorld.cs @@ -66,7 +66,7 @@ namespace SimpleApp { SubscribeToClientEvents(client); - ScenePresence avatar = CreateAndAddScenePresence(client); + ScenePresence avatar = CreateAndAddScenePresence(client, child ); avatar.AbsolutePosition = new LLVector3(128, 128, 26); LLVector3 pos = new LLVector3(128, 128, 128); -- cgit v1.1