Added RemoveAvatar() method to physics plugins, should be called on log out (needs doing) and when downgrading a client to a child-avatar (should be working)

zircon^2
MW 2007-05-15 21:26:10 +00:00
parent ccf046e8e2
commit 7f2fdb8054
6 changed files with 36 additions and 1 deletions

View File

@ -84,7 +84,17 @@ namespace OpenSim.Physics.BasicPhysicsPlugin
_actors.Add(act);
return act;
}
public override void RemoveAvatar(PhysicsActor actor)
{
BasicActor act = (BasicActor)actor;
if(_actors.Contains(act))
{
_actors.Remove(act);
}
}
public override PhysicsActor AddPrim(PhysicsVector position, PhysicsVector size)
{
return null;

View File

@ -44,6 +44,8 @@ namespace OpenSim.Physics.Manager
public abstract PhysicsActor AddAvatar(PhysicsVector position);
public abstract void RemoveAvatar(PhysicsActor actor);
public abstract PhysicsActor AddPrim(PhysicsVector position, PhysicsVector size);
public abstract void Simulate(float timeStep);
@ -70,6 +72,11 @@ namespace OpenSim.Physics.Manager
return PhysicsActor.Null;
}
public override void RemoveAvatar(PhysicsActor actor)
{
}
public override PhysicsActor AddPrim(PhysicsVector position, PhysicsVector size)
{
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(LogPriority.VERBOSE, "NullPhysicsScene : AddPrim({0},{1})", position, size);

View File

@ -131,6 +131,11 @@ namespace OpenSim.Physics.OdePlugin
return newAv;
}
public override void RemoveAvatar(PhysicsActor actor)
{
}
public override PhysicsActor AddPrim(PhysicsVector position, PhysicsVector size)
{
PhysicsVector pos = new PhysicsVector();

View File

@ -121,6 +121,11 @@ namespace OpenSim.Physics.PhysXPlugin
_characters.Add(act);
return act;
}
public override void RemoveAvatar(PhysicsActor actor)
{
}
public override PhysicsActor AddPrim(PhysicsVector position, PhysicsVector size)
{

View File

@ -72,6 +72,10 @@ namespace OpenSim.world
{
this._physActor = value;
}
get
{
return _physActor;
}
}
public override void addForces()

View File

@ -600,6 +600,10 @@ namespace OpenSim.world
{
Avatars.Remove(agentClient.AgentID);
}
if (agentClient.ClientAvatar.PhysActor != null)
{
this.phyScene.RemoveAvatar(agentClient.ClientAvatar.PhysActor);
}
}
catch (Exception e)
{