diff options
author | UbitUmarov | 2012-04-24 23:13:57 +0100 |
---|---|---|
committer | UbitUmarov | 2012-04-24 23:13:57 +0100 |
commit | 3da613adf5c803edfcca41f260017b96b1d80fb5 (patch) | |
tree | 4fb2c7213c562fd764a3cc51477e806ea8538198 | |
parent | SOG bug fix in UI object changes (diff) | |
download | opensim-SC-3da613adf5c803edfcca41f260017b96b1d80fb5.zip opensim-SC-3da613adf5c803edfcca41f260017b96b1d80fb5.tar.gz opensim-SC-3da613adf5c803edfcca41f260017b96b1d80fb5.tar.bz2 opensim-SC-3da613adf5c803edfcca41f260017b96b1d80fb5.tar.xz |
fix chODE loosing some part positions when doing isPhysical false
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Physics/ChOdePlugin/ODEPrim.cs | 45 | ||||
-rw-r--r-- | OpenSim/Region/Physics/UbitOdePlugin/ODEPrim.cs | 8 |
2 files changed, 42 insertions, 11 deletions
diff --git a/OpenSim/Region/Physics/ChOdePlugin/ODEPrim.cs b/OpenSim/Region/Physics/ChOdePlugin/ODEPrim.cs index 77ea2af..5b743e8 100644 --- a/OpenSim/Region/Physics/ChOdePlugin/ODEPrim.cs +++ b/OpenSim/Region/Physics/ChOdePlugin/ODEPrim.cs | |||
@@ -461,6 +461,13 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
461 | } | 461 | } |
462 | } | 462 | } |
463 | 463 | ||
464 | public override bool IsVolumeDtc | ||
465 | { | ||
466 | set { return; } | ||
467 | get { return m_isVolumeDetect; } | ||
468 | |||
469 | } | ||
470 | |||
464 | public override bool Phantom | 471 | public override bool Phantom |
465 | { | 472 | { |
466 | get { return m_isphantom; } | 473 | get { return m_isphantom; } |
@@ -598,6 +605,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
598 | } | 605 | } |
599 | } | 606 | } |
600 | 607 | ||
608 | |||
601 | public override Vector3 CenterOfMass | 609 | public override Vector3 CenterOfMass |
602 | { | 610 | { |
603 | get { return Vector3.Zero; } | 611 | get { return Vector3.Zero; } |
@@ -1372,6 +1380,25 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1372 | } | 1380 | } |
1373 | } | 1381 | } |
1374 | 1382 | ||
1383 | |||
1384 | private void UpdateDataFromGeom() | ||
1385 | { | ||
1386 | if (prim_geom != IntPtr.Zero) | ||
1387 | { | ||
1388 | d.Quaternion qtmp; | ||
1389 | d.GeomCopyQuaternion(prim_geom, out qtmp); | ||
1390 | _orientation.W = qtmp.W; | ||
1391 | _orientation.X = qtmp.X; | ||
1392 | _orientation.Y = qtmp.Y; | ||
1393 | _orientation.Z = qtmp.Z; | ||
1394 | |||
1395 | d.Vector3 lpos = d.GeomGetPosition(prim_geom); | ||
1396 | _position.X = lpos.X; | ||
1397 | _position.Y = lpos.Y; | ||
1398 | _position.Z = lpos.Z; | ||
1399 | } | ||
1400 | } | ||
1401 | |||
1375 | public void disableBody() | 1402 | public void disableBody() |
1376 | { | 1403 | { |
1377 | //this kills the body so things like 'mesh' can re-create it. | 1404 | //this kills the body so things like 'mesh' can re-create it. |
@@ -1400,25 +1427,31 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1400 | } | 1427 | } |
1401 | } | 1428 | } |
1402 | 1429 | ||
1403 | d.BodyDestroy(Body); | 1430 | UpdateDataFromGeom(); |
1431 | |||
1404 | lock (childrenPrim) | 1432 | lock (childrenPrim) |
1405 | { | 1433 | { |
1406 | if (childrenPrim.Count > 0) | 1434 | if (childrenPrim.Count > 0) |
1407 | { | 1435 | { |
1408 | foreach (OdePrim prm in childrenPrim) | 1436 | foreach (OdePrim prm in childrenPrim) |
1409 | { | 1437 | { |
1410 | if (prm.m_NoColide && prm.prim_geom != IntPtr.Zero) | 1438 | if (prm.prim_geom != IntPtr.Zero) |
1411 | { | 1439 | { |
1412 | d.GeomSetCategoryBits(prm.prim_geom, 0); | 1440 | if (prm.m_NoColide) |
1413 | d.GeomSetCollideBits(prm.prim_geom, 0); | 1441 | { |
1414 | d.GeomDisable(prm.prim_geom); | 1442 | d.GeomSetCategoryBits(prm.prim_geom, 0); |
1443 | d.GeomSetCollideBits(prm.prim_geom, 0); | ||
1444 | d.GeomDisable(prm.prim_geom); | ||
1445 | |||
1446 | } | ||
1447 | prm.UpdateDataFromGeom(); | ||
1415 | } | 1448 | } |
1416 | |||
1417 | _parent_scene.remActivePrim(prm); | 1449 | _parent_scene.remActivePrim(prm); |
1418 | prm.Body = IntPtr.Zero; | 1450 | prm.Body = IntPtr.Zero; |
1419 | } | 1451 | } |
1420 | } | 1452 | } |
1421 | } | 1453 | } |
1454 | d.BodyDestroy(Body); | ||
1422 | Body = IntPtr.Zero; | 1455 | Body = IntPtr.Zero; |
1423 | } | 1456 | } |
1424 | } | 1457 | } |
diff --git a/OpenSim/Region/Physics/UbitOdePlugin/ODEPrim.cs b/OpenSim/Region/Physics/UbitOdePlugin/ODEPrim.cs index dc6c18d..2d587ab 100644 --- a/OpenSim/Region/Physics/UbitOdePlugin/ODEPrim.cs +++ b/OpenSim/Region/Physics/UbitOdePlugin/ODEPrim.cs | |||
@@ -2467,15 +2467,14 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
2467 | { | 2467 | { |
2468 | if (prim_geom != IntPtr.Zero) | 2468 | if (prim_geom != IntPtr.Zero) |
2469 | { | 2469 | { |
2470 | d.Quaternion qtmp = new d.Quaternion { }; | 2470 | d.Quaternion qtmp; |
2471 | d.GeomCopyQuaternion(prim_geom, out qtmp); | 2471 | d.GeomCopyQuaternion(prim_geom, out qtmp); |
2472 | _orientation.W = qtmp.W; | 2472 | _orientation.W = qtmp.W; |
2473 | _orientation.X = qtmp.X; | 2473 | _orientation.X = qtmp.X; |
2474 | _orientation.Y = qtmp.Y; | 2474 | _orientation.Y = qtmp.Y; |
2475 | _orientation.Z = qtmp.Z; | 2475 | _orientation.Z = qtmp.Z; |
2476 | 2476 | ||
2477 | d.Vector3 lpos; | 2477 | d.Vector3 lpos = d.GeomGetPosition(prim_geom); |
2478 | d.GeomCopyPosition(prim_geom, out lpos); | ||
2479 | _position.X = lpos.X; | 2478 | _position.X = lpos.X; |
2480 | _position.Y = lpos.Y; | 2479 | _position.Y = lpos.Y; |
2481 | _position.Z = lpos.Z; | 2480 | _position.Z = lpos.Z; |
@@ -3565,8 +3564,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
3565 | { | 3564 | { |
3566 | bool lastZeroFlag = _zeroFlag; | 3565 | bool lastZeroFlag = _zeroFlag; |
3567 | 3566 | ||
3568 | d.Vector3 lpos; | 3567 | d.Vector3 lpos = d.GeomGetPosition(prim_geom); |
3569 | d.GeomCopyPosition(prim_geom, out lpos); // root position that is seem by rest of simulator | ||
3570 | 3568 | ||
3571 | d.Quaternion ori; | 3569 | d.Quaternion ori; |
3572 | d.GeomCopyQuaternion(prim_geom, out ori); | 3570 | d.GeomCopyQuaternion(prim_geom, out ori); |