add colliders relative velocity projected in collision direction to collisions report information.

This commit is contained in:
UbitUmarov
2012-05-19 00:17:37 +01:00
parent 0d0c472181
commit a7ece8c688
3 changed files with 13 additions and 1 deletions

View File

@@ -1064,7 +1064,7 @@ namespace OpenSim.Region.Physics.OdePlugin
obj2LocalID = 0;
bool p1events = p1.SubscribedEvents();
bool p2events = p2.SubscribedEvents();
if (p1.IsVolumeDtc)
p2events = false;
if (p2.IsVolumeDtc)
@@ -1073,6 +1073,15 @@ namespace OpenSim.Region.Physics.OdePlugin
if (!(p2events || p1events))
return;
Vector3 vel = Vector3.Zero;
if (p2 != null && p2.IsPhysical)
vel = p2.Velocity;
if (p1 != null && p1.IsPhysical)
vel -= p1.Velocity;
contact.RelativeSpeed = Vector3.Dot(vel, contact.SurfaceNormal);
switch ((ActorTypes)p1.PhysicsActorType)
{
case ActorTypes.Agent: