fix let other phys plugins work.. broken when added feetOffset

avinationmerge
UbitUmarov 2012-12-11 17:14:32 +00:00
parent 9a253c7c04
commit 28ea08c3e2
3 changed files with 8 additions and 13 deletions

View File

@ -147,15 +147,9 @@ namespace OpenSim.Region.Physics.Manager
return ret; return ret;
} }
public virtual PhysicsActor AddAvatar(string avName, Vector3 position, Vector3 size,float feetOffset, bool isFlying) public virtual PhysicsActor AddAvatar(uint localID, string avName, Vector3 position, Vector3 size, float feetOffset, bool isFlying)
{ {
return null; PhysicsActor ret = AddAvatar(localID, avName, position, size, isFlying);
}
public virtual PhysicsActor AddAvatar(uint localID,string avName, Vector3 position, Vector3 size, float feetOffset, bool isFlying)
{
PhysicsActor ret = AddAvatar(avName, position, size,feetOffset, isFlying);
if (ret != null) ret.LocalID = localID;
return ret; return ret;
} }

View File

@ -165,9 +165,10 @@ namespace OpenSim.Region.Physics.OdePlugin
public OdeCharacter(String avName, OdeScene parent_scene, Vector3 pos, Vector3 pSize, float pfeetOffset, float density, float walk_divisor, float rundivisor) public OdeCharacter(uint localID, String avName, OdeScene parent_scene, Vector3 pos, Vector3 pSize, float pfeetOffset, float density, float walk_divisor, float rundivisor)
{ {
m_uuid = UUID.Random(); m_uuid = UUID.Random();
m_localID = localID;
timeStep = parent_scene.ODE_STEPSIZE; timeStep = parent_scene.ODE_STEPSIZE;
invtimeStep = 1 / timeStep; invtimeStep = 1 / timeStep;
@ -1209,7 +1210,7 @@ namespace OpenSim.Region.Physics.OdePlugin
d.AABB aabb; d.AABB aabb;
d.GeomGetAABB(feetbox, out aabb); d.GeomGetAABB(feetbox, out aabb);
float chrminZ = aabb.MinZ - 0.02f; // move up a bit float chrminZ = aabb.MinZ; ; // move up a bit
Vector3 posch = localpos; Vector3 posch = localpos;
float ftmp; float ftmp;
@ -1252,7 +1253,7 @@ namespace OpenSim.Region.Physics.OdePlugin
contact.PenetrationDepth = depth; contact.PenetrationDepth = depth;
contact.Position.X = localpos.X; contact.Position.X = localpos.X;
contact.Position.Y = localpos.Y; contact.Position.Y = localpos.Y;
contact.Position.Z = chrminZ; contact.Position.Z = terrainheight;
contact.SurfaceNormal.X = 0.0f; contact.SurfaceNormal.X = 0.0f;
contact.SurfaceNormal.Y = 0.0f; contact.SurfaceNormal.Y = 0.0f;
contact.SurfaceNormal.Z = -1f; contact.SurfaceNormal.Z = -1f;

View File

@ -1251,13 +1251,13 @@ namespace OpenSim.Region.Physics.OdePlugin
#region Add/Remove Entities #region Add/Remove Entities
public override PhysicsActor AddAvatar(string avName, Vector3 position, Vector3 size, float feetOffset, bool isFlying) public override PhysicsActor AddAvatar(uint localID, string avName, Vector3 position, Vector3 size, float feetOffset, bool isFlying)
{ {
Vector3 pos; Vector3 pos;
pos.X = position.X; pos.X = position.X;
pos.Y = position.Y; pos.Y = position.Y;
pos.Z = position.Z; pos.Z = position.Z;
OdeCharacter newAv = new OdeCharacter(avName, this, pos, size, feetOffset, avDensity, avMovementDivisorWalk, avMovementDivisorRun); OdeCharacter newAv = new OdeCharacter(localID,avName, this, pos, size, feetOffset, avDensity, avMovementDivisorWalk, avMovementDivisorRun);
newAv.Flying = isFlying; newAv.Flying = isFlying;
newAv.MinimumGroundFlightOffset = minimumGroundFlightOffset; newAv.MinimumGroundFlightOffset = minimumGroundFlightOffset;