aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Physics/ChOdePlugin/ODEPrim.cs
diff options
context:
space:
mode:
authorUbitUmarov2012-04-24 23:13:57 +0100
committerUbitUmarov2012-04-24 23:13:57 +0100
commit3da613adf5c803edfcca41f260017b96b1d80fb5 (patch)
tree4fb2c7213c562fd764a3cc51477e806ea8538198 /OpenSim/Region/Physics/ChOdePlugin/ODEPrim.cs
parentSOG bug fix in UI object changes (diff)
downloadopensim-SC_OLD-3da613adf5c803edfcca41f260017b96b1d80fb5.zip
opensim-SC_OLD-3da613adf5c803edfcca41f260017b96b1d80fb5.tar.gz
opensim-SC_OLD-3da613adf5c803edfcca41f260017b96b1d80fb5.tar.bz2
opensim-SC_OLD-3da613adf5c803edfcca41f260017b96b1d80fb5.tar.xz
fix chODE loosing some part positions when doing isPhysical false
Diffstat (limited to 'OpenSim/Region/Physics/ChOdePlugin/ODEPrim.cs')
-rw-r--r--OpenSim/Region/Physics/ChOdePlugin/ODEPrim.cs45
1 files changed, 39 insertions, 6 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 }