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:
@ -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:
@ -951,13 +943,24 @@ namespace OpenSim.Region.Physics.OdePlugin
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)