diff options
author | UbitUmarov | 2012-05-19 00:17:37 +0100 |
---|---|---|
committer | UbitUmarov | 2012-05-19 00:17:37 +0100 |
commit | a7ece8c688a44c0d0b05162dbb1e98a1ea4e95ff (patch) | |
tree | 2a35bca621caa62a5e9d514d1711df57f0f03bac /OpenSim/Region/Physics | |
parent | removed redundant colision sounds. Temporary muted sounds ( returns at top o... (diff) | |
download | opensim-SC_OLD-a7ece8c688a44c0d0b05162dbb1e98a1ea4e95ff.zip opensim-SC_OLD-a7ece8c688a44c0d0b05162dbb1e98a1ea4e95ff.tar.gz opensim-SC_OLD-a7ece8c688a44c0d0b05162dbb1e98a1ea4e95ff.tar.bz2 opensim-SC_OLD-a7ece8c688a44c0d0b05162dbb1e98a1ea4e95ff.tar.xz |
add colliders relative velocity projected in collision direction to collisions report information.
Diffstat (limited to 'OpenSim/Region/Physics')
-rw-r--r-- | OpenSim/Region/Physics/Manager/PhysicsActor.cs | 2 | ||||
-rw-r--r-- | OpenSim/Region/Physics/UbitOdePlugin/ODECharacter.cs | 1 | ||||
-rw-r--r-- | OpenSim/Region/Physics/UbitOdePlugin/OdeScene.cs | 11 |
3 files changed, 13 insertions, 1 deletions
diff --git a/OpenSim/Region/Physics/Manager/PhysicsActor.cs b/OpenSim/Region/Physics/Manager/PhysicsActor.cs index b66d7f1..fb90887 100644 --- a/OpenSim/Region/Physics/Manager/PhysicsActor.cs +++ b/OpenSim/Region/Physics/Manager/PhysicsActor.cs | |||
@@ -59,12 +59,14 @@ namespace OpenSim.Region.Physics.Manager | |||
59 | public Vector3 Position; | 59 | public Vector3 Position; |
60 | public Vector3 SurfaceNormal; | 60 | public Vector3 SurfaceNormal; |
61 | public float PenetrationDepth; | 61 | public float PenetrationDepth; |
62 | public float RelativeSpeed; | ||
62 | 63 | ||
63 | public ContactPoint(Vector3 position, Vector3 surfaceNormal, float penetrationDepth) | 64 | public ContactPoint(Vector3 position, Vector3 surfaceNormal, float penetrationDepth) |
64 | { | 65 | { |
65 | Position = position; | 66 | Position = position; |
66 | SurfaceNormal = surfaceNormal; | 67 | SurfaceNormal = surfaceNormal; |
67 | PenetrationDepth = penetrationDepth; | 68 | PenetrationDepth = penetrationDepth; |
69 | RelativeSpeed = 0f; // for now let this one be set explicity | ||
68 | } | 70 | } |
69 | } | 71 | } |
70 | 72 | ||
diff --git a/OpenSim/Region/Physics/UbitOdePlugin/ODECharacter.cs b/OpenSim/Region/Physics/UbitOdePlugin/ODECharacter.cs index b0711d7..bfff3d4 100644 --- a/OpenSim/Region/Physics/UbitOdePlugin/ODECharacter.cs +++ b/OpenSim/Region/Physics/UbitOdePlugin/ODECharacter.cs | |||
@@ -903,6 +903,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
903 | contact.SurfaceNormal.X = 0f; | 903 | contact.SurfaceNormal.X = 0f; |
904 | contact.SurfaceNormal.Y = 0f; | 904 | contact.SurfaceNormal.Y = 0f; |
905 | contact.SurfaceNormal.Z = -1f; | 905 | contact.SurfaceNormal.Z = -1f; |
906 | contact.RelativeSpeed = -vel.Z; | ||
906 | AddCollisionEvent(0, contact); | 907 | AddCollisionEvent(0, contact); |
907 | 908 | ||
908 | vec.Z *= 0.5f; | 909 | vec.Z *= 0.5f; |
diff --git a/OpenSim/Region/Physics/UbitOdePlugin/OdeScene.cs b/OpenSim/Region/Physics/UbitOdePlugin/OdeScene.cs index ddfdea4..11638d7 100644 --- a/OpenSim/Region/Physics/UbitOdePlugin/OdeScene.cs +++ b/OpenSim/Region/Physics/UbitOdePlugin/OdeScene.cs | |||
@@ -1064,7 +1064,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1064 | obj2LocalID = 0; | 1064 | obj2LocalID = 0; |
1065 | bool p1events = p1.SubscribedEvents(); | 1065 | bool p1events = p1.SubscribedEvents(); |
1066 | bool p2events = p2.SubscribedEvents(); | 1066 | bool p2events = p2.SubscribedEvents(); |
1067 | 1067 | ||
1068 | if (p1.IsVolumeDtc) | 1068 | if (p1.IsVolumeDtc) |
1069 | p2events = false; | 1069 | p2events = false; |
1070 | if (p2.IsVolumeDtc) | 1070 | if (p2.IsVolumeDtc) |
@@ -1073,6 +1073,15 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1073 | if (!(p2events || p1events)) | 1073 | if (!(p2events || p1events)) |
1074 | return; | 1074 | return; |
1075 | 1075 | ||
1076 | Vector3 vel = Vector3.Zero; | ||
1077 | if (p2 != null && p2.IsPhysical) | ||
1078 | vel = p2.Velocity; | ||
1079 | |||
1080 | if (p1 != null && p1.IsPhysical) | ||
1081 | vel -= p1.Velocity; | ||
1082 | |||
1083 | contact.RelativeSpeed = Vector3.Dot(vel, contact.SurfaceNormal); | ||
1084 | |||
1076 | switch ((ActorTypes)p1.PhysicsActorType) | 1085 | switch ((ActorTypes)p1.PhysicsActorType) |
1077 | { | 1086 | { |
1078 | case ActorTypes.Agent: | 1087 | case ActorTypes.Agent: |