* Now at least we're not creating physActors for child agents.

afrisby
lbsa71 2007-09-18 22:12:16 +00:00
parent c8f51836b8
commit f71b315592
2 changed files with 20 additions and 10 deletions

View File

@ -703,7 +703,7 @@ namespace OpenSim.Region.Environment.Scenes
{ {
SubscribeToClientEvents(client); SubscribeToClientEvents(client);
m_estateManager.sendRegionHandshake(client); m_estateManager.sendRegionHandshake(client);
CreateAndAddScenePresence(client); CreateAndAddScenePresence(client, child );
m_LandManager.sendParcelOverlay(client); m_LandManager.sendParcelOverlay(client);
commsManager.UserProfiles.AddNewUser(client.AgentId); commsManager.UserProfiles.AddNewUser(client.AgentId);
commsManager.TransactionsManager.AddUser(client.AgentId); commsManager.TransactionsManager.AddUser(client.AgentId);
@ -768,19 +768,29 @@ namespace OpenSim.Region.Environment.Scenes
EventManager.TriggerOnNewClient(client); EventManager.TriggerOnNewClient(client);
} }
protected ScenePresence CreateAndAddScenePresence(IClientAPI client) protected ScenePresence CreateAndAddScenePresence(IClientAPI client, bool child )
{ {
ScenePresence newAvatar = null; ScenePresence newAvatar = null;
MainLog.Instance.Verbose("World.cs:AddViewerAgent() - Creating new avatar for remote viewer agent");
newAvatar = new ScenePresence(client, this, m_regInfo); newAvatar = new ScenePresence(client, this, m_regInfo);
MainLog.Instance.Verbose("World.cs:AddViewerAgent() - Adding new avatar to world"); newAvatar.childAgent = child;
MainLog.Instance.Verbose("World.cs:AddViewerAgent() - Starting RegionHandshake ");
PhysicsVector pVec = new PhysicsVector(newAvatar.AbsolutePosition.X, newAvatar.AbsolutePosition.Y, newAvatar.AbsolutePosition.Z); if (child)
lock (m_syncRoot)
{ {
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) lock (Entities)
@ -805,7 +815,7 @@ namespace OpenSim.Region.Environment.Scenes
Avatars.Add(client.AgentId, newAvatar); Avatars.Add(client.AgentId, newAvatar);
} }
} }
newAvatar.OnSignificantClientMovement += m_LandManager.handleSignificantClientMovement;
return newAvatar; return newAvatar;
} }

View File

@ -66,7 +66,7 @@ namespace SimpleApp
{ {
SubscribeToClientEvents(client); SubscribeToClientEvents(client);
ScenePresence avatar = CreateAndAddScenePresence(client); ScenePresence avatar = CreateAndAddScenePresence(client, child );
avatar.AbsolutePosition = new LLVector3(128, 128, 26); avatar.AbsolutePosition = new LLVector3(128, 128, 26);
LLVector3 pos = new LLVector3(128, 128, 128); LLVector3 pos = new LLVector3(128, 128, 128);