diff options
author | Melanie | 2012-05-28 02:19:29 +0200 |
---|---|---|
committer | Melanie | 2012-05-28 02:19:29 +0200 |
commit | c5e73c0cb872a2c2679f7685a0244d4d49e971d6 (patch) | |
tree | f0c227e516d5113eaff4b84cc7dafadb550a2c97 | |
parent | Modify SceneManeger to use a DoubleDictionary and work without locks. (diff) | |
parent | Let OOB information usable outside ubitode (diff) | |
download | opensim-SC_OLD-c5e73c0cb872a2c2679f7685a0244d4d49e971d6.zip opensim-SC_OLD-c5e73c0cb872a2c2679f7685a0244d4d49e971d6.tar.gz opensim-SC_OLD-c5e73c0cb872a2c2679f7685a0244d4d49e971d6.tar.bz2 opensim-SC_OLD-c5e73c0cb872a2c2679f7685a0244d4d49e971d6.tar.xz |
Merge branch 'ubitwork' into avination
-rw-r--r-- | OpenSim/Region/Physics/Manager/PhysicsActor.cs | 29 | ||||
-rw-r--r-- | OpenSim/Region/Physics/UbitOdePlugin/ODECharacter.cs | 23 | ||||
-rw-r--r-- | OpenSim/Region/Physics/UbitOdePlugin/ODEPrim.cs | 14 | ||||
-rw-r--r-- | OpenSim/Region/Physics/UbitOdePlugin/OdeScene.cs | 82 |
4 files changed, 110 insertions, 38 deletions
diff --git a/OpenSim/Region/Physics/Manager/PhysicsActor.cs b/OpenSim/Region/Physics/Manager/PhysicsActor.cs index fb90887..aaeae86 100644 --- a/OpenSim/Region/Physics/Manager/PhysicsActor.cs +++ b/OpenSim/Region/Physics/Manager/PhysicsActor.cs | |||
@@ -294,6 +294,34 @@ namespace OpenSim.Region.Physics.Manager | |||
294 | public abstract Vector3 GeometricCenter { get; } | 294 | public abstract Vector3 GeometricCenter { get; } |
295 | public abstract Vector3 CenterOfMass { get; } | 295 | public abstract Vector3 CenterOfMass { get; } |
296 | 296 | ||
297 | public virtual Vector3 OOBsize | ||
298 | { | ||
299 | get | ||
300 | { | ||
301 | Vector3 s=Size; | ||
302 | s.X *=0.5f; | ||
303 | s.Y *=0.5f; | ||
304 | s.Z *=0.5f; | ||
305 | return s; | ||
306 | } | ||
307 | } | ||
308 | |||
309 | public virtual Vector3 OOBoffset | ||
310 | { | ||
311 | get | ||
312 | { | ||
313 | return Vector3.Zero; | ||
314 | } | ||
315 | } | ||
316 | |||
317 | public virtual float OOBRadiusSQ | ||
318 | { | ||
319 | get | ||
320 | { | ||
321 | return Size.LengthSquared() * 0.25f; // ((0.5^2) | ||
322 | } | ||
323 | } | ||
324 | |||
297 | /// <summary> | 325 | /// <summary> |
298 | /// Velocity of this actor. | 326 | /// Velocity of this actor. |
299 | /// </summary> | 327 | /// </summary> |
@@ -429,7 +457,6 @@ namespace OpenSim.Region.Physics.Manager | |||
429 | 457 | ||
430 | public override void VehicleFloatParam(int param, float value) | 458 | public override void VehicleFloatParam(int param, float value) |
431 | { | 459 | { |
432 | |||
433 | } | 460 | } |
434 | 461 | ||
435 | public override void VehicleVectorParam(int param, Vector3 value) | 462 | public override void VehicleVectorParam(int param, Vector3 value) |
diff --git a/OpenSim/Region/Physics/UbitOdePlugin/ODECharacter.cs b/OpenSim/Region/Physics/UbitOdePlugin/ODECharacter.cs index 1084b0e..6fb54cb 100644 --- a/OpenSim/Region/Physics/UbitOdePlugin/ODECharacter.cs +++ b/OpenSim/Region/Physics/UbitOdePlugin/ODECharacter.cs | |||
@@ -522,29 +522,6 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
522 | } | 522 | } |
523 | } | 523 | } |
524 | 524 | ||
525 | //UBit mess | ||
526 | /* for later use | ||
527 | public override Vector3 PrimOOBsize | ||
528 | { | ||
529 | get | ||
530 | { | ||
531 | Vector3 s=Size; | ||
532 | s.X *=0.5f; | ||
533 | s.Y *=0.5f; | ||
534 | s.Z *=0.5f; | ||
535 | return s; | ||
536 | } | ||
537 | } | ||
538 | |||
539 | public override Vector3 PrimOOBoffset | ||
540 | { | ||
541 | get | ||
542 | { | ||
543 | return Vector3.Zero; | ||
544 | } | ||
545 | } | ||
546 | */ | ||
547 | |||
548 | public override PrimitiveBaseShape Shape | 525 | public override PrimitiveBaseShape Shape |
549 | { | 526 | { |
550 | set { return; } | 527 | set { return; } |
diff --git a/OpenSim/Region/Physics/UbitOdePlugin/ODEPrim.cs b/OpenSim/Region/Physics/UbitOdePlugin/ODEPrim.cs index 62fd279..1bfe08b 100644 --- a/OpenSim/Region/Physics/UbitOdePlugin/ODEPrim.cs +++ b/OpenSim/Region/Physics/UbitOdePlugin/ODEPrim.cs | |||
@@ -504,8 +504,8 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
504 | } | 504 | } |
505 | } | 505 | } |
506 | } | 506 | } |
507 | /* | 507 | |
508 | public override Vector3 PrimOOBsize | 508 | public override Vector3 OOBsize |
509 | { | 509 | { |
510 | get | 510 | get |
511 | { | 511 | { |
@@ -513,7 +513,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
513 | } | 513 | } |
514 | } | 514 | } |
515 | 515 | ||
516 | public override Vector3 PrimOOBoffset | 516 | public override Vector3 OOBoffset |
517 | { | 517 | { |
518 | get | 518 | get |
519 | { | 519 | { |
@@ -521,14 +521,14 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
521 | } | 521 | } |
522 | } | 522 | } |
523 | 523 | ||
524 | public override float PrimOOBRadiusSQ | 524 | public override float OOBRadiusSQ |
525 | { | 525 | { |
526 | get | 526 | get |
527 | { | 527 | { |
528 | return primOOBradiusSQ; | 528 | return primOOBradiusSQ; |
529 | } | 529 | } |
530 | } | 530 | } |
531 | */ | 531 | |
532 | public override PrimitiveBaseShape Shape | 532 | public override PrimitiveBaseShape Shape |
533 | { | 533 | { |
534 | set | 534 | set |
@@ -1482,6 +1482,8 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1482 | if (!haveMesh) | 1482 | if (!haveMesh) |
1483 | m_NoColide = true; | 1483 | m_NoColide = true; |
1484 | } | 1484 | } |
1485 | else if(_pbs.SculptEntry) | ||
1486 | m_NoColide = true; // also don't colide if is a sculp or mesh and meshing is off | ||
1485 | 1487 | ||
1486 | if (!haveMesh) | 1488 | if (!haveMesh) |
1487 | { | 1489 | { |
@@ -2562,10 +2564,10 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
2562 | { | 2564 | { |
2563 | d.Quaternion qtmp; | 2565 | d.Quaternion qtmp; |
2564 | d.GeomCopyQuaternion(prim_geom, out qtmp); | 2566 | d.GeomCopyQuaternion(prim_geom, out qtmp); |
2565 | _orientation.W = qtmp.W; | ||
2566 | _orientation.X = qtmp.X; | 2567 | _orientation.X = qtmp.X; |
2567 | _orientation.Y = qtmp.Y; | 2568 | _orientation.Y = qtmp.Y; |
2568 | _orientation.Z = qtmp.Z; | 2569 | _orientation.Z = qtmp.Z; |
2570 | _orientation.W = qtmp.W; | ||
2569 | 2571 | ||
2570 | d.Vector3 lpos = d.GeomGetPosition(prim_geom); | 2572 | d.Vector3 lpos = d.GeomGetPosition(prim_geom); |
2571 | _position.X = lpos.X; | 2573 | _position.X = lpos.X; |
diff --git a/OpenSim/Region/Physics/UbitOdePlugin/OdeScene.cs b/OpenSim/Region/Physics/UbitOdePlugin/OdeScene.cs index bfcfd21..d5968fc 100644 --- a/OpenSim/Region/Physics/UbitOdePlugin/OdeScene.cs +++ b/OpenSim/Region/Physics/UbitOdePlugin/OdeScene.cs | |||
@@ -1006,16 +1006,82 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1006 | else | 1006 | else |
1007 | 1007 | ||
1008 | { | 1008 | { |
1009 | if (dop1foot && (p1.Position.Z - curContact.pos.Z) > (p1.Size.Z - avCapRadius) * 0.5f) | ||
1010 | p1.IsColliding = true; | ||
1011 | if (dop2foot && (p2.Position.Z - curContact.pos.Z) > (p2.Size.Z - avCapRadius) * 0.5f) | ||
1012 | p2.IsColliding = true; | ||
1013 | 1009 | ||
1014 | if (AvanormOverride && curContact.depth > 0.3f) | 1010 | if (AvanormOverride) |
1015 | { | 1011 | { |
1016 | curContact.normal.X = normoverride.X; | 1012 | if (curContact.depth > 0.3f) |
1017 | curContact.normal.Y = normoverride.Y; | 1013 | { |
1018 | curContact.normal.Z = normoverride.Z; | 1014 | if (dop1foot && (p1.Position.Z - curContact.pos.Z) > (p1.Size.Z - avCapRadius) * 0.5f) |
1015 | p1.IsColliding = true; | ||
1016 | if (dop2foot && (p2.Position.Z - curContact.pos.Z) > (p2.Size.Z - avCapRadius) * 0.5f) | ||
1017 | p2.IsColliding = true; | ||
1018 | curContact.normal.X = normoverride.X; | ||
1019 | curContact.normal.Y = normoverride.Y; | ||
1020 | curContact.normal.Z = normoverride.Z; | ||
1021 | } | ||
1022 | |||
1023 | else | ||
1024 | { | ||
1025 | if (dop1foot) | ||
1026 | { | ||
1027 | float sz = p1.Size.Z; | ||
1028 | Vector3 vtmp = p1.Position; | ||
1029 | float ppos = curContact.pos.Z - vtmp.Z + (sz - avCapRadius) * 0.5f; | ||
1030 | if (ppos > 0f) | ||
1031 | { | ||
1032 | if (!p1.Flying) | ||
1033 | { | ||
1034 | d.AABB aabb; | ||
1035 | d.GeomGetAABB(g2, out aabb); | ||
1036 | float tmp = vtmp.Z - sz * .25f; | ||
1037 | |||
1038 | if (aabb.MaxZ < tmp) | ||
1039 | { | ||
1040 | vtmp.X = curContact.pos.X - vtmp.X; | ||
1041 | vtmp.Y = curContact.pos.Y - vtmp.Y; | ||
1042 | vtmp.Z = -0.2f; | ||
1043 | vtmp.Normalize(); | ||
1044 | curContact.normal.X = vtmp.X; | ||
1045 | curContact.normal.Y = vtmp.Y; | ||
1046 | curContact.normal.Z = vtmp.Z; | ||
1047 | } | ||
1048 | } | ||
1049 | } | ||
1050 | else | ||
1051 | p1.IsColliding = true; | ||
1052 | |||
1053 | } | ||
1054 | |||
1055 | if (dop2foot) | ||
1056 | { | ||
1057 | float sz = p2.Size.Z; | ||
1058 | Vector3 vtmp = p2.Position; | ||
1059 | float ppos = curContact.pos.Z - vtmp.Z + (sz - avCapRadius) * 0.5f; | ||
1060 | if (ppos > 0f) | ||
1061 | { | ||
1062 | if (!p2.Flying) | ||
1063 | { | ||
1064 | d.AABB aabb; | ||
1065 | d.GeomGetAABB(g1, out aabb); | ||
1066 | float tmp = vtmp.Z - sz * .25f; | ||
1067 | |||
1068 | if (aabb.MaxZ < tmp) | ||
1069 | { | ||
1070 | vtmp.X = curContact.pos.X - vtmp.X; | ||
1071 | vtmp.Y = curContact.pos.Y - vtmp.Y; | ||
1072 | vtmp.Z = -0.2f; | ||
1073 | vtmp.Normalize(); | ||
1074 | curContact.normal.X = vtmp.X; | ||
1075 | curContact.normal.Y = vtmp.Y; | ||
1076 | curContact.normal.Z = vtmp.Z; | ||
1077 | } | ||
1078 | } | ||
1079 | } | ||
1080 | else | ||
1081 | p2.IsColliding = true; | ||
1082 | |||
1083 | } | ||
1084 | } | ||
1019 | } | 1085 | } |
1020 | 1086 | ||
1021 | Joint = CreateContacJoint(ref curContact, mu, bounce, cfm, erpscale, dscale); | 1087 | Joint = CreateContacJoint(ref curContact, mu, bounce, cfm, erpscale, dscale); |