aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Physics/BulletSPlugin/BSApiTemplate.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Physics/BulletSPlugin/BSApiTemplate.cs')
-rw-r--r--OpenSim/Region/Physics/BulletSPlugin/BSApiTemplate.cs35
1 files changed, 31 insertions, 4 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSApiTemplate.cs b/OpenSim/Region/Physics/BulletSPlugin/BSApiTemplate.cs
index 5765b0d..6cdc112 100644
--- a/OpenSim/Region/Physics/BulletSPlugin/BSApiTemplate.cs
+++ b/OpenSim/Region/Physics/BulletSPlugin/BSApiTemplate.cs
@@ -70,6 +70,8 @@ public enum BSPhysicsShapeType
70 SHAPE_COMPOUND = 22, 70 SHAPE_COMPOUND = 22,
71 SHAPE_HEIGHTMAP = 23, 71 SHAPE_HEIGHTMAP = 23,
72 SHAPE_AVATAR = 24, 72 SHAPE_AVATAR = 24,
73 SHAPE_CONVEXHULL= 25,
74 SHAPE_GIMPACT = 26,
73}; 75};
74 76
75// The native shapes have predefined shape hash keys 77// The native shapes have predefined shape hash keys
@@ -191,6 +193,21 @@ public struct ConfigurationParameters
191 public const float numericFalse = 0f; 193 public const float numericFalse = 0f;
192} 194}
193 195
196// Parameters passed for the conversion of a mesh to a hull using Bullet's HACD library.
197[StructLayout(LayoutKind.Sequential)]
198public struct HACDParams
199{
200 // usual default values
201 public float maxVerticesPerHull; // 100
202 public float minClusters; // 2
203 public float compacityWeight; // 0.1
204 public float volumeWeight; // 0.0
205 public float concavity; // 100
206 public float addExtraDistPoints; // false
207 public float addNeighboursDistPoints; // false
208 public float addFacesPoints; // false
209 public float shouldAdjustCollisionMargin; // false
210}
194 211
195// The states a bullet collision object can have 212// The states a bullet collision object can have
196public enum ActivationState : uint 213public enum ActivationState : uint
@@ -282,7 +299,7 @@ public abstract class BSAPITemplate
282{ 299{
283// Returns the name of the underlying Bullet engine 300// Returns the name of the underlying Bullet engine
284public abstract string BulletEngineName { get; } 301public abstract string BulletEngineName { get; }
285public abstract string BulletEngineVersion { get; protected set;} 302public abstract string BulletEngineVersion { get; protected set;}
286 303
287// Initialization and simulation 304// Initialization and simulation
288public abstract BulletWorld Initialize(Vector3 maxPosition, ConfigurationParameters parms, 305public abstract BulletWorld Initialize(Vector3 maxPosition, ConfigurationParameters parms,
@@ -305,10 +322,20 @@ public abstract BulletShape CreateMeshShape(BulletWorld world,
305 int indicesCount, int[] indices, 322 int indicesCount, int[] indices,
306 int verticesCount, float[] vertices ); 323 int verticesCount, float[] vertices );
307 324
325public abstract BulletShape CreateGImpactShape(BulletWorld world,
326 int indicesCount, int[] indices,
327 int verticesCount, float[] vertices );
328
308public abstract BulletShape CreateHullShape(BulletWorld world, 329public abstract BulletShape CreateHullShape(BulletWorld world,
309 int hullCount, float[] hulls); 330 int hullCount, float[] hulls);
310 331
311public abstract BulletShape BuildHullShapeFromMesh(BulletWorld world, BulletShape meshShape); 332public abstract BulletShape BuildHullShapeFromMesh(BulletWorld world, BulletShape meshShape, HACDParams parms);
333
334public abstract BulletShape BuildConvexHullShapeFromMesh(BulletWorld world, BulletShape meshShape);
335
336public abstract BulletShape CreateConvexHullShape(BulletWorld world,
337 int indicesCount, int[] indices,
338 int verticesCount, float[] vertices );
312 339
313public abstract BulletShape BuildNativeShape(BulletWorld world, ShapeData shapeData); 340public abstract BulletShape BuildNativeShape(BulletWorld world, ShapeData shapeData);
314 341
@@ -351,7 +378,7 @@ public abstract void DestroyObject(BulletWorld sim, BulletBody obj);
351// ===================================================================================== 378// =====================================================================================
352public abstract BulletShape CreateGroundPlaneShape(UInt32 id, float height, float collisionMargin); 379public abstract BulletShape CreateGroundPlaneShape(UInt32 id, float height, float collisionMargin);
353 380
354public abstract BulletShape CreateTerrainShape(UInt32 id, Vector3 size, float minHeight, float maxHeight, float[] heightMap, 381public abstract BulletShape CreateTerrainShape(UInt32 id, Vector3 size, float minHeight, float maxHeight, float[] heightMap,
355 float scaleFactor, float collisionMargin); 382 float scaleFactor, float collisionMargin);
356 383
357// ===================================================================================== 384// =====================================================================================
@@ -366,7 +393,7 @@ public abstract BulletConstraint Create6DofConstraintToPoint(BulletWorld world,
366 bool useLinearReferenceFrameA, bool disableCollisionsBetweenLinkedBodies); 393 bool useLinearReferenceFrameA, bool disableCollisionsBetweenLinkedBodies);
367 394
368public abstract BulletConstraint Create6DofConstraintFixed(BulletWorld world, BulletBody obj1, 395public abstract BulletConstraint Create6DofConstraintFixed(BulletWorld world, BulletBody obj1,
369 Vector3 frameInBloc, Quaternion frameInBrot, 396 Vector3 frameInBloc, Quaternion frameInBrot,
370 bool useLinearReferenceFrameB, bool disableCollisionsBetweenLinkedBodies); 397 bool useLinearReferenceFrameB, bool disableCollisionsBetweenLinkedBodies);
371 398
372public abstract BulletConstraint Create6DofSpringConstraint(BulletWorld world, BulletBody obj1, BulletBody obj2, 399public abstract BulletConstraint Create6DofSpringConstraint(BulletWorld world, BulletBody obj1, BulletBody obj2,