avatar collisions fix

avinationmerge
UbitUmarov 2014-07-21 23:54:53 +01:00
parent 5cdd205ee7
commit 0239c7ba1c
1 changed files with 53 additions and 50 deletions

View File

@ -833,13 +833,7 @@ namespace OpenSim.Region.Physics.OdePlugin
switch (p2.PhysicsActorType) switch (p2.PhysicsActorType)
{ {
case (int)ActorTypes.Agent: case (int)ActorTypes.Agent:
p1.CollidingObj = true;
p2.CollidingObj = true;
break;
case (int)ActorTypes.Prim: case (int)ActorTypes.Prim:
if (p2.Velocity.LengthSquared() > 0.0f)
p2.CollidingObj = true;
break; break;
default: default:
@ -850,14 +844,11 @@ namespace OpenSim.Region.Physics.OdePlugin
} }
case (int)ActorTypes.Prim: case (int)ActorTypes.Prim:
{
switch (p2.PhysicsActorType) switch (p2.PhysicsActorType)
{ {
case (int)ActorTypes.Agent: case (int)ActorTypes.Agent:
dop2ava = true; dop2ava = true;
if (p1.Velocity.LengthSquared() > 0.0f)
p1.CollidingObj = true;
break; break;
case (int)ActorTypes.Prim: case (int)ActorTypes.Prim:
@ -886,7 +877,7 @@ namespace OpenSim.Region.Physics.OdePlugin
if (Math.Abs(p1.Velocity.X) > 0.1f || Math.Abs(p1.Velocity.Y) > 0.1f) if (Math.Abs(p1.Velocity.X) > 0.1f || Math.Abs(p1.Velocity.Y) > 0.1f)
mu *= frictionMovementMult; mu *= frictionMovementMult;
p1.CollidingGround = true; p1.CollidingGround = true;
/* /*
if (d.GeomGetClass(g1) == d.GeomClassID.TriMeshClass) if (d.GeomGetClass(g1) == d.GeomClassID.TriMeshClass)
{ {
if (curContact.side1 > 0) if (curContact.side1 > 0)
@ -900,6 +891,7 @@ namespace OpenSim.Region.Physics.OdePlugin
ignore = true; ignore = true;
break; break;
} }
}
break; break;
case (int)ActorTypes.Ground: case (int)ActorTypes.Ground:
@ -950,14 +942,25 @@ namespace OpenSim.Region.Physics.OdePlugin
bool noskip = true; bool noskip = true;
if (dop1ava) if (dop1ava)
{ {
if (!(((OdeCharacter)p1).Collide(g1,g2, false, ref curContact, ref FeetCollision))) if (!(((OdeCharacter)p1).Collide(g1, g2, false, ref curContact, ref FeetCollision)))
noskip = false; noskip = false;
else
{
if(p2.PhysicsActorType == (int)ActorTypes.Agent)
{
p1.CollidingObj = true;
p2.CollidingObj = true;
}
else if (p2.Velocity.LengthSquared() > 0.0f)
p2.CollidingObj = true;
}
} }
else if (dop2ava) else if (dop2ava)
{ {
if (!(((OdeCharacter)p2).Collide(g2,g1, true, ref curContact, ref FeetCollision))) if (!(((OdeCharacter)p2).Collide(g2,g1, true, ref curContact, ref FeetCollision)))
noskip = false; noskip = false;
else if (p1.Velocity.LengthSquared() > 0.0f)
p1.CollidingObj = true;
} }
if (noskip) if (noskip)