diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Physics/UbitOdePlugin/OdeScene.cs | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/OpenSim/Region/Physics/UbitOdePlugin/OdeScene.cs b/OpenSim/Region/Physics/UbitOdePlugin/OdeScene.cs index 7c00600..d426112 100644 --- a/OpenSim/Region/Physics/UbitOdePlugin/OdeScene.cs +++ b/OpenSim/Region/Physics/UbitOdePlugin/OdeScene.cs | |||
@@ -60,6 +60,29 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
60 | public int lastframe; | 60 | public int lastframe; |
61 | } | 61 | } |
62 | 62 | ||
63 | public class ODEPhysRepData | ||
64 | { | ||
65 | public PhysicsActor actor; | ||
66 | public IntPtr geo = IntPtr.Zero; | ||
67 | public IntPtr triMeshData = IntPtr.Zero; | ||
68 | public IMesh mesh; | ||
69 | public IntPtr curSpace = IntPtr.Zero; | ||
70 | public PrimitiveBaseShape pbs; | ||
71 | |||
72 | public Vector3 size = Vector3.Zero; | ||
73 | public Vector3 OBB = Vector3.Zero; | ||
74 | public Vector3 OBBOffset = Vector3.Zero; | ||
75 | |||
76 | public float volume; | ||
77 | |||
78 | public float physCost = 0.0f; | ||
79 | public float streamCost = 0; | ||
80 | public byte shapetype = 0; | ||
81 | public bool canColide = true; | ||
82 | public bool hasOBB = false; | ||
83 | public bool hasMeshVolume = false; | ||
84 | } | ||
85 | |||
63 | // colision flags of things others can colide with | 86 | // colision flags of things others can colide with |
64 | // rays, sensors, probes removed since can't be colided with | 87 | // rays, sensors, probes removed since can't be colided with |
65 | // The top space where things are placed provided further selection | 88 | // The top space where things are placed provided further selection |
@@ -297,6 +320,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
297 | public IntPtr TopSpace; // the global space | 320 | public IntPtr TopSpace; // the global space |
298 | public IntPtr ActiveSpace; // space for active prims | 321 | public IntPtr ActiveSpace; // space for active prims |
299 | public IntPtr StaticSpace; // space for the static things around | 322 | public IntPtr StaticSpace; // space for the static things around |
323 | public IntPtr WorkSpace; // no collisions work space | ||
300 | 324 | ||
301 | // some speedup variables | 325 | // some speedup variables |
302 | private int spaceGridMaxX; | 326 | private int spaceGridMaxX; |
@@ -369,6 +393,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
369 | // now the major subspaces | 393 | // now the major subspaces |
370 | ActiveSpace = d.HashSpaceCreate(TopSpace); | 394 | ActiveSpace = d.HashSpaceCreate(TopSpace); |
371 | StaticSpace = d.HashSpaceCreate(TopSpace); | 395 | StaticSpace = d.HashSpaceCreate(TopSpace); |
396 | WorkSpace = d.HashSpaceCreate(TopSpace); | ||
372 | } | 397 | } |
373 | catch | 398 | catch |
374 | { | 399 | { |
@@ -378,10 +403,12 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
378 | d.HashSpaceSetLevels(TopSpace, -2, 8); | 403 | d.HashSpaceSetLevels(TopSpace, -2, 8); |
379 | d.HashSpaceSetLevels(ActiveSpace, -2, 8); | 404 | d.HashSpaceSetLevels(ActiveSpace, -2, 8); |
380 | d.HashSpaceSetLevels(StaticSpace, -2, 8); | 405 | d.HashSpaceSetLevels(StaticSpace, -2, 8); |
406 | d.HashSpaceSetLevels(WorkSpace, -2, 8); | ||
381 | 407 | ||
382 | // demote to second level | 408 | // demote to second level |
383 | d.SpaceSetSublevel(ActiveSpace, 1); | 409 | d.SpaceSetSublevel(ActiveSpace, 1); |
384 | d.SpaceSetSublevel(StaticSpace, 1); | 410 | d.SpaceSetSublevel(StaticSpace, 1); |
411 | d.SpaceSetSublevel(WorkSpace, 1); | ||
385 | 412 | ||
386 | d.GeomSetCategoryBits(ActiveSpace, (uint)(CollisionCategories.Space | | 413 | d.GeomSetCategoryBits(ActiveSpace, (uint)(CollisionCategories.Space | |
387 | CollisionCategories.Geom | | 414 | CollisionCategories.Geom | |
@@ -399,6 +426,9 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
399 | )); | 426 | )); |
400 | d.GeomSetCollideBits(StaticSpace, 0); | 427 | d.GeomSetCollideBits(StaticSpace, 0); |
401 | 428 | ||
429 | d.GeomSetCategoryBits(WorkSpace, 0); | ||
430 | d.GeomSetCollideBits(WorkSpace, 0); | ||
431 | |||
402 | contactgroup = d.JointGroupCreate(0); | 432 | contactgroup = d.JointGroupCreate(0); |
403 | //contactgroup | 433 | //contactgroup |
404 | 434 | ||
@@ -478,7 +508,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
478 | } | 508 | } |
479 | } | 509 | } |
480 | 510 | ||
481 | m_meshWorker = new ODEMeshWorker(this, m_log, meshmerizer, physicsconfig); | 511 | m_meshWorker = new ODEMeshWorker(this, m_log, meshmerizer, WorkSpace, physicsconfig); |
482 | 512 | ||
483 | HalfOdeStep = ODE_STEPSIZE * 0.5f; | 513 | HalfOdeStep = ODE_STEPSIZE * 0.5f; |
484 | odetimestepMS = (int)(1000.0f * ODE_STEPSIZE +0.5f); | 514 | odetimestepMS = (int)(1000.0f * ODE_STEPSIZE +0.5f); |