aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Physics/ChOdePlugin/ODEPrim.cs
diff options
context:
space:
mode:
authorUbitUmarov2012-03-21 12:57:46 +0000
committerUbitUmarov2012-03-21 12:57:46 +0000
commit316f272b621741e694f2b522910594a0e5879634 (patch)
tree54cf9f0069ed9b53b29ea625c1354a9fb9000879 /OpenSim/Region/Physics/ChOdePlugin/ODEPrim.cs
parentMerge branch 'master' of ssh://3dhosting.de/var/git/careminster into ubitwork (diff)
downloadopensim-SC-316f272b621741e694f2b522910594a0e5879634.zip
opensim-SC-316f272b621741e694f2b522910594a0e5879634.tar.gz
opensim-SC-316f272b621741e694f2b522910594a0e5879634.tar.bz2
opensim-SC-316f272b621741e694f2b522910594a0e5879634.tar.xz
shapetype support on chOde so it can also request a simple convex hull 'mesh'
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Physics/ChOdePlugin/ODEPrim.cs36
1 files changed, 34 insertions, 2 deletions
diff --git a/OpenSim/Region/Physics/ChOdePlugin/ODEPrim.cs b/OpenSim/Region/Physics/ChOdePlugin/ODEPrim.cs
index f9548d2..4cf88d8 100644
--- a/OpenSim/Region/Physics/ChOdePlugin/ODEPrim.cs
+++ b/OpenSim/Region/Physics/ChOdePlugin/ODEPrim.cs
@@ -179,6 +179,9 @@ namespace OpenSim.Region.Physics.OdePlugin
179 public bool m_outofBounds; 179 public bool m_outofBounds;
180 private float m_density = 10.000006836f; // Aluminum g/cm3; 180 private float m_density = 10.000006836f; // Aluminum g/cm3;
181 181
182 private byte m_shapetype;
183 private byte m_taintshapetype;
184
182 public bool _zeroFlag; // if body has been stopped 185 public bool _zeroFlag; // if body has been stopped
183 private bool m_lastUpdateSent; 186 private bool m_lastUpdateSent;
184 187
@@ -315,7 +318,8 @@ namespace OpenSim.Region.Physics.OdePlugin
315 } 318 }
316 319
317 public OdePrim(String primName, OdeScene parent_scene, Vector3 pos, Vector3 size, 320 public OdePrim(String primName, OdeScene parent_scene, Vector3 pos, Vector3 size,
318 Quaternion rotation, IMesh mesh, PrimitiveBaseShape pbs, bool pisPhysical,bool pisPhantom, CollisionLocker dode, uint localid) 321 Quaternion rotation, IMesh mesh, PrimitiveBaseShape pbs, bool pisPhysical,
322 bool pisPhantom,byte shapetype, CollisionLocker dode, uint localid)
319 { 323 {
320 m_localID = localid; 324 m_localID = localid;
321 ode = dode; 325 ode = dode;
@@ -360,6 +364,8 @@ namespace OpenSim.Region.Physics.OdePlugin
360 m_taintrot = _orientation; 364 m_taintrot = _orientation;
361 _mesh = mesh; 365 _mesh = mesh;
362 _pbs = pbs; 366 _pbs = pbs;
367 m_shapetype = shapetype;
368 m_taintshapetype = shapetype;
363 369
364 _parent_scene = parent_scene; 370 _parent_scene = parent_scene;
365 m_targetSpace = (IntPtr)0; 371 m_targetSpace = (IntPtr)0;
@@ -605,6 +611,19 @@ namespace OpenSim.Region.Physics.OdePlugin
605 } 611 }
606 } 612 }
607 613
614 public override byte PhysicsShapeType
615 {
616 get
617 {
618 return m_shapetype;
619 }
620 set
621 {
622 m_taintshapetype = value;
623 _parent_scene.AddPhysicsActorTaint(this);
624 }
625 }
626
608 public override Vector3 Velocity 627 public override Vector3 Velocity
609 { 628 {
610 get 629 get
@@ -1535,6 +1554,12 @@ namespace OpenSim.Region.Physics.OdePlugin
1535 changesize(timestep); 1554 changesize(timestep);
1536 // 1555 //
1537 1556
1557 if(m_taintshapetype != m_shapetype)
1558 {
1559 m_shapetype = m_taintshapetype;
1560 changeshape(timestep);
1561 }
1562
1538 if (m_taintshape) 1563 if (m_taintshape)
1539 changeshape(timestep); 1564 changeshape(timestep);
1540 // 1565 //
@@ -2476,9 +2501,16 @@ namespace OpenSim.Region.Physics.OdePlugin
2476 2501
2477 if (IsPhysical) 2502 if (IsPhysical)
2478 meshlod = _parent_scene.MeshSculptphysicalLOD; 2503 meshlod = _parent_scene.MeshSculptphysicalLOD;
2504
2505 bool convex;
2506 if (m_shapetype == 2)
2507 convex = true;
2508 else
2509 convex = false;
2510
2479 try 2511 try
2480 { 2512 {
2481 mesh = _parent_scene.mesher.CreateMesh(oldname, _pbs, _size, (int)LevelOfDetail.High, true); 2513 mesh = _parent_scene.mesher.CreateMesh(oldname, _pbs, _size, (int)LevelOfDetail.High, true, convex);
2482 } 2514 }
2483 catch 2515 catch
2484 { 2516 {