mirror of
https://github.com/opensim/opensim.git
synced 2026-08-08 10:15:33 +08:00
add colliders relative velocity projected in collision direction to collisions report information.
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user