aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Physics/UbitOdePlugin/OdeScene.cs
diff options
context:
space:
mode:
authorUbitUmarov2012-12-03 17:05:05 +0000
committerMelanie2012-12-03 19:45:45 +0100
commit8aa5fdb6a3f1e4b349757df5d9fcc06ab8dfdb64 (patch)
treebf524671cc1eefd0b20930fefcdf4b73fe8e7258 /OpenSim/Region/Physics/UbitOdePlugin/OdeScene.cs
parentfix vertex rounding direction (diff)
downloadopensim-SC_OLD-8aa5fdb6a3f1e4b349757df5d9fcc06ab8dfdb64.zip
opensim-SC_OLD-8aa5fdb6a3f1e4b349757df5d9fcc06ab8dfdb64.tar.gz
opensim-SC_OLD-8aa5fdb6a3f1e4b349757df5d9fcc06ab8dfdb64.tar.bz2
opensim-SC_OLD-8aa5fdb6a3f1e4b349757df5d9fcc06ab8dfdb64.tar.xz
*TEST* diferent avatar collider
Diffstat (limited to 'OpenSim/Region/Physics/UbitOdePlugin/OdeScene.cs')
-rw-r--r--OpenSim/Region/Physics/UbitOdePlugin/OdeScene.cs69
1 files changed, 49 insertions, 20 deletions
diff --git a/OpenSim/Region/Physics/UbitOdePlugin/OdeScene.cs b/OpenSim/Region/Physics/UbitOdePlugin/OdeScene.cs
index 54bc29f..003a91c 100644
--- a/OpenSim/Region/Physics/UbitOdePlugin/OdeScene.cs
+++ b/OpenSim/Region/Physics/UbitOdePlugin/OdeScene.cs
@@ -840,6 +840,8 @@ namespace OpenSim.Region.Physics.OdePlugin
840 { 840 {
841 case (int)ActorTypes.Agent: 841 case (int)ActorTypes.Agent:
842 { 842 {
843 dop1foot = true;
844
843 AvanormOverride = true; 845 AvanormOverride = true;
844 Vector3 tmp = p2.Position - p1.Position; 846 Vector3 tmp = p2.Position - p1.Position;
845 normoverride = p2.Velocity - p1.Velocity; 847 normoverride = p2.Velocity - p1.Velocity;
@@ -883,6 +885,10 @@ namespace OpenSim.Region.Physics.OdePlugin
883 switch (p2.PhysicsActorType) 885 switch (p2.PhysicsActorType)
884 { 886 {
885 case (int)ActorTypes.Agent: 887 case (int)ActorTypes.Agent:
888
889
890 dop2foot = true;
891
886 AvanormOverride = true; 892 AvanormOverride = true;
887 893
888 Vector3 tmp = p2.Position - p1.Position; 894 Vector3 tmp = p2.Position - p1.Position;
@@ -1017,6 +1023,7 @@ namespace OpenSim.Region.Physics.OdePlugin
1017 IntPtr Joint; 1023 IntPtr Joint;
1018 1024
1019 int i = 0; 1025 int i = 0;
1026 int ncontacts = 0;
1020 while(true) 1027 while(true)
1021 { 1028 {
1022 1029
@@ -1031,7 +1038,28 @@ namespace OpenSim.Region.Physics.OdePlugin
1031 else 1038 else
1032 1039
1033 { 1040 {
1041 if(dop1foot)
1042 {
1043 if (!(((OdeCharacter)p1).Collide(g1,false, ref curContact)))
1044 {
1045 if (++i >= count)
1046 break;
1047 else
1048 continue;
1049 }
1050 }
1051 else if(dop2foot)
1052 {
1053 if(!(((OdeCharacter) p2).Collide(g2,true,ref curContact)))
1054 {
1055 if (++i >= count)
1056 break;
1057 else
1058 continue;
1059 }
1060 }
1034 1061
1062/*
1035 if (AvanormOverride) 1063 if (AvanormOverride)
1036 { 1064 {
1037 if (curContact.depth > 0.3f) 1065 if (curContact.depth > 0.3f)
@@ -1081,34 +1109,31 @@ namespace OpenSim.Region.Physics.OdePlugin
1081 { 1109 {
1082 float sz = p2.Size.Z; 1110 float sz = p2.Size.Z;
1083 Vector3 vtmp = p2.Position; 1111 Vector3 vtmp = p2.Position;
1084 float ppos = curContact.pos.Z - vtmp.Z + (sz - avCapRadius) * 0.5f; 1112 vtmp.Z -= sz * 0.5f;
1113 vtmp.Z += 0.5f;
1114 float ppos = vtmp.Z - curContact.pos.Z;
1085 if (ppos > 0f) 1115 if (ppos > 0f)
1086 { 1116 {
1087 if (!p2.Flying) 1117 if (!p2.Flying)
1088 { 1118 {
1089 d.AABB aabb;
1090 d.GeomGetAABB(g1, out aabb);
1091 float tmp = vtmp.Z - sz * .18f; 1119 float tmp = vtmp.Z - sz * .18f;
1092 1120 vtmp.X = curContact.pos.X - vtmp.X;
1093 if (aabb.MaxZ < tmp) 1121 vtmp.Y = curContact.pos.Y - vtmp.Y;
1094 { 1122 vtmp.Z = curContact.pos.Z - vtmp.Z;
1095 vtmp.X = curContact.pos.X - vtmp.X; 1123 vtmp.Normalize();
1096 vtmp.Y = curContact.pos.Y - vtmp.Y; 1124 curContact.normal.X = vtmp.X;
1097 vtmp.Z = -0.2f; 1125 curContact.normal.Y = vtmp.Y;
1098 vtmp.Normalize(); 1126 curContact.normal.Z = vtmp.Z;
1099 curContact.normal.X = vtmp.X;
1100 curContact.normal.Y = vtmp.Y;
1101 curContact.normal.Z = vtmp.Z;
1102 }
1103 } 1127 }
1104 } 1128 }
1105 else 1129// else
1106 p2.IsColliding = true; 1130 p2.IsColliding = true;
1107 1131
1108 } 1132 }
1109 } 1133 }
1110 } 1134 }
1111 1135*/
1136 ncontacts++;
1112 Joint = CreateContacJoint(ref curContact, mu, bounce, cfm, erpscale, dscale); 1137 Joint = CreateContacJoint(ref curContact, mu, bounce, cfm, erpscale, dscale);
1113 d.JointAttach(Joint, b1, b2); 1138 d.JointAttach(Joint, b1, b2);
1114 1139
@@ -1134,7 +1159,8 @@ namespace OpenSim.Region.Physics.OdePlugin
1134 } 1159 }
1135 } 1160 }
1136 1161
1137 collision_accounting_events(p1, p2, maxDepthContact); 1162 if(ncontacts > 0)
1163 collision_accounting_events(p1, p2, maxDepthContact);
1138 1164
1139/* 1165/*
1140 if (notskipedcount > geomContactPointsStartthrottle) 1166 if (notskipedcount > geomContactPointsStartthrottle)
@@ -1234,14 +1260,17 @@ namespace OpenSim.Region.Physics.OdePlugin
1234 { 1260 {
1235 foreach (OdeCharacter chr in _characters) 1261 foreach (OdeCharacter chr in _characters)
1236 { 1262 {
1237 if (chr == null || chr.Shell == IntPtr.Zero || chr.Body == IntPtr.Zero) 1263 if (chr == null || chr.Body == IntPtr.Zero)
1238 continue; 1264 continue;
1239 1265
1240 chr.IsColliding = false; 1266 chr.IsColliding = false;
1241 // chr.CollidingGround = false; not done here 1267 // chr.CollidingGround = false; not done here
1242 chr.CollidingObj = false; 1268 chr.CollidingObj = false;
1243 // do colisions with static space 1269 // do colisions with static space
1244 d.SpaceCollide2(StaticSpace, chr.Shell, IntPtr.Zero, nearCallback); 1270 d.SpaceCollide2(StaticSpace, chr.topbox, IntPtr.Zero, nearCallback);
1271 d.SpaceCollide2(StaticSpace, chr.midbox, IntPtr.Zero, nearCallback);
1272 d.SpaceCollide2(StaticSpace, chr.feetbox, IntPtr.Zero, nearCallback);
1273 d.SpaceCollide2(StaticSpace, chr.bonebox, IntPtr.Zero, nearCallback);
1245 // no coll with gnd 1274 // no coll with gnd
1246 } 1275 }
1247 } 1276 }
@@ -1334,7 +1363,7 @@ namespace OpenSim.Region.Physics.OdePlugin
1334 pos.X = position.X; 1363 pos.X = position.X;
1335 pos.Y = position.Y; 1364 pos.Y = position.Y;
1336 pos.Z = position.Z; 1365 pos.Z = position.Z;
1337 OdeCharacter newAv = new OdeCharacter(avName, this, pos, size, avPIDD, avPIDP, avCapRadius, avDensity, avMovementDivisorWalk, avMovementDivisorRun); 1366 OdeCharacter newAv = new OdeCharacter(avName, this, pos, size, avPIDD, avPIDP, avDensity, avMovementDivisorWalk, avMovementDivisorRun);
1338 newAv.Flying = isFlying; 1367 newAv.Flying = isFlying;
1339 newAv.MinimumGroundFlightOffset = minimumGroundFlightOffset; 1368 newAv.MinimumGroundFlightOffset = minimumGroundFlightOffset;
1340 1369