ubOde fix contact relative velocity sign

LSLKeyTest
UbitUmarov 2016-07-24 21:16:14 +01:00
parent d6d3e14f29
commit 574b97d93d
1 changed files with 31 additions and 30 deletions

View File

@ -1079,44 +1079,45 @@ namespace OpenSim.Region.PhysicsModule.ubOde
{ {
case ActorTypes.Agent: case ActorTypes.Agent:
case ActorTypes.Prim: case ActorTypes.Prim:
{
switch ((ActorTypes)p2.PhysicsActorType)
{ {
switch ((ActorTypes)p2.PhysicsActorType) case ActorTypes.Agent:
{ case ActorTypes.Prim:
case ActorTypes.Agent: if (p2events)
case ActorTypes.Prim: {
if (p2events) AddCollisionEventReporting(p2);
{ p2.AddCollisionEvent(p1.ParentActor.LocalID, contact);
AddCollisionEventReporting(p2); }
p2.AddCollisionEvent(p1.ParentActor.LocalID, contact); obj2LocalID = p2.ParentActor.LocalID;
} break;
obj2LocalID = p2.ParentActor.LocalID;
break;
case ActorTypes.Ground: case ActorTypes.Ground:
case ActorTypes.Unknown: case ActorTypes.Unknown:
default: default:
obj2LocalID = 0; obj2LocalID = 0;
break; break;
}
if (p1events)
{
contact.SurfaceNormal = -contact.SurfaceNormal;
AddCollisionEventReporting(p1);
p1.AddCollisionEvent(obj2LocalID, contact);
}
break;
} }
if (p1events)
{
contact.SurfaceNormal = -contact.SurfaceNormal;
contact.RelativeSpeed = -contact.RelativeSpeed;
AddCollisionEventReporting(p1);
p1.AddCollisionEvent(obj2LocalID, contact);
}
break;
}
case ActorTypes.Ground: case ActorTypes.Ground:
case ActorTypes.Unknown: case ActorTypes.Unknown:
default: default:
{
if (p2events && !p2.IsVolumeDtc)
{ {
if (p2events && !p2.IsVolumeDtc) AddCollisionEventReporting(p2);
{ p2.AddCollisionEvent(0, contact);
AddCollisionEventReporting(p2);
p2.AddCollisionEvent(0, contact);
}
break;
} }
break;
}
} }
} }