aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Physics/BulletSPlugin/BSApiTemplate.cs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/PhysicsModules/BulletS/BSApiTemplate.cs (renamed from OpenSim/Region/Physics/BulletSPlugin/BSApiTemplate.cs)245
1 files changed, 173 insertions, 72 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSApiTemplate.cs b/OpenSim/Region/PhysicsModules/BulletS/BSApiTemplate.cs
index 8ad78ca..7756b10 100644
--- a/OpenSim/Region/Physics/BulletSPlugin/BSApiTemplate.cs
+++ b/OpenSim/Region/PhysicsModules/BulletS/BSApiTemplate.cs
@@ -6,7 +6,7 @@
6 * modification, are permitted provided that the following conditions are met: 6 * modification, are permitted provided that the following conditions are met:
7 * * Redistributions of source code must retain the above copyright 7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above copyrightD 9 * * Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution. 11 * documentation and/or other materials provided with the distribution.
12 * * Neither the name of the OpenSimulator Project nor the 12 * * Neither the name of the OpenSimulator Project nor the
@@ -31,7 +31,7 @@ using System.Security;
31using System.Text; 31using System.Text;
32using OpenMetaverse; 32using OpenMetaverse;
33 33
34namespace OpenSim.Region.Physics.BulletSPlugin { 34namespace OpenSim.Region.PhysicsModule.BulletS {
35 35
36 // Constraint type values as defined by Bullet 36 // Constraint type values as defined by Bullet
37public enum ConstraintType : int 37public enum ConstraintType : int
@@ -43,7 +43,11 @@ public enum ConstraintType : int
43 SLIDER_CONSTRAINT_TYPE, 43 SLIDER_CONSTRAINT_TYPE,
44 CONTACT_CONSTRAINT_TYPE, 44 CONTACT_CONSTRAINT_TYPE,
45 D6_SPRING_CONSTRAINT_TYPE, 45 D6_SPRING_CONSTRAINT_TYPE,
46 MAX_CONSTRAINT_TYPE 46 GEAR_CONSTRAINT_TYPE, // added in Bullet 2.82
47 FIXED_CONSTRAINT_TYPE, // added in Bullet 2.82
48 MAX_CONSTRAINT_TYPE, // last type defined by Bullet
49 //
50 BS_FIXED_CONSTRAINT_TYPE = 1234 // BulletSim constraint that is fixed and unmoving
47} 51}
48 52
49// =============================================================================== 53// ===============================================================================
@@ -70,6 +74,8 @@ public enum BSPhysicsShapeType
70 SHAPE_COMPOUND = 22, 74 SHAPE_COMPOUND = 22,
71 SHAPE_HEIGHTMAP = 23, 75 SHAPE_HEIGHTMAP = 23,
72 SHAPE_AVATAR = 24, 76 SHAPE_AVATAR = 24,
77 SHAPE_CONVEXHULL= 25,
78 SHAPE_GIMPACT = 26,
73}; 79};
74 80
75// The native shapes have predefined shape hash keys 81// The native shapes have predefined shape hash keys
@@ -87,7 +93,7 @@ public enum FixedShapeKey : ulong
87[StructLayout(LayoutKind.Sequential)] 93[StructLayout(LayoutKind.Sequential)]
88public struct ShapeData 94public struct ShapeData
89{ 95{
90 public uint ID; 96 public UInt32 ID;
91 public BSPhysicsShapeType Type; 97 public BSPhysicsShapeType Type;
92 public Vector3 Position; 98 public Vector3 Position;
93 public Quaternion Rotation; 99 public Quaternion Rotation;
@@ -111,7 +117,7 @@ public struct ShapeData
111[StructLayout(LayoutKind.Sequential)] 117[StructLayout(LayoutKind.Sequential)]
112public struct SweepHit 118public struct SweepHit
113{ 119{
114 public uint ID; 120 public UInt32 ID;
115 public float Fraction; 121 public float Fraction;
116 public Vector3 Normal; 122 public Vector3 Normal;
117 public Vector3 Point; 123 public Vector3 Point;
@@ -119,27 +125,47 @@ public struct SweepHit
119[StructLayout(LayoutKind.Sequential)] 125[StructLayout(LayoutKind.Sequential)]
120public struct RaycastHit 126public struct RaycastHit
121{ 127{
122 public uint ID; 128 public UInt32 ID;
123 public float Fraction; 129 public float Fraction;
124 public Vector3 Normal; 130 public Vector3 Normal;
125} 131}
126[StructLayout(LayoutKind.Sequential)] 132[StructLayout(LayoutKind.Sequential)]
127public struct CollisionDesc 133public struct CollisionDesc
128{ 134{
129 public uint aID; 135 public UInt32 aID;
130 public uint bID; 136 public UInt32 bID;
131 public Vector3 point; 137 public Vector3 point;
132 public Vector3 normal; 138 public Vector3 normal;
139 public float penetration;
133} 140}
134[StructLayout(LayoutKind.Sequential)] 141[StructLayout(LayoutKind.Sequential)]
135public struct EntityProperties 142public struct EntityProperties
136{ 143{
137 public uint ID; 144 public UInt32 ID;
138 public Vector3 Position; 145 public Vector3 Position;
139 public Quaternion Rotation; 146 public Quaternion Rotation;
140 public Vector3 Velocity; 147 public Vector3 Velocity;
141 public Vector3 Acceleration; 148 public Vector3 Acceleration;
142 public Vector3 RotationalVelocity; 149 public Vector3 RotationalVelocity;
150
151 public override string ToString()
152 {
153 StringBuilder buff = new StringBuilder();
154 buff.Append("<i=");
155 buff.Append(ID.ToString());
156 buff.Append(",p=");
157 buff.Append(Position.ToString());
158 buff.Append(",r=");
159 buff.Append(Rotation.ToString());
160 buff.Append(",v=");
161 buff.Append(Velocity.ToString());
162 buff.Append(",a=");
163 buff.Append(Acceleration.ToString());
164 buff.Append(",rv=");
165 buff.Append(RotationalVelocity.ToString());
166 buff.Append(">");
167 return buff.ToString();
168 }
143} 169}
144 170
145// Format of this structure must match the definition in the C++ code 171// Format of this structure must match the definition in the C++ code
@@ -154,32 +180,6 @@ public struct ConfigurationParameters
154 public float collisionMargin; 180 public float collisionMargin;
155 public float gravity; 181 public float gravity;
156 182
157 public float XlinearDamping;
158 public float XangularDamping;
159 public float XdeactivationTime;
160 public float XlinearSleepingThreshold;
161 public float XangularSleepingThreshold;
162 public float XccdMotionThreshold;
163 public float XccdSweptSphereRadius;
164 public float XcontactProcessingThreshold;
165
166 public float XterrainImplementation;
167 public float XterrainFriction;
168 public float XterrainHitFraction;
169 public float XterrainRestitution;
170 public float XterrainCollisionMargin;
171
172 public float XavatarFriction;
173 public float XavatarStandingFriction;
174 public float XavatarDensity;
175 public float XavatarRestitution;
176 public float XavatarCapsuleWidth;
177 public float XavatarCapsuleDepth;
178 public float XavatarCapsuleHeight;
179 public float XavatarContactProcessingThreshold;
180
181 public float XvehicleAngularDamping;
182
183 public float maxPersistantManifoldPoolSize; 183 public float maxPersistantManifoldPoolSize;
184 public float maxCollisionAlgorithmPoolSize; 184 public float maxCollisionAlgorithmPoolSize;
185 public float shouldDisableContactPoolDynamicAllocation; 185 public float shouldDisableContactPoolDynamicAllocation;
@@ -188,22 +188,45 @@ public struct ConfigurationParameters
188 public float shouldSplitSimulationIslands; 188 public float shouldSplitSimulationIslands;
189 public float shouldEnableFrictionCaching; 189 public float shouldEnableFrictionCaching;
190 public float numberOfSolverIterations; 190 public float numberOfSolverIterations;
191 public float useSingleSidedMeshes;
192 public float globalContactBreakingThreshold;
191 193
192 public float XlinksetImplementation; 194 public float physicsLoggingFrames;
193 public float XlinkConstraintUseFrameOffset;
194 public float XlinkConstraintEnableTransMotor;
195 public float XlinkConstraintTransMotorMaxVel;
196 public float XlinkConstraintTransMotorMaxForce;
197 public float XlinkConstraintERP;
198 public float XlinkConstraintCFM;
199 public float XlinkConstraintSolverIterations;
200
201 public float XphysicsLoggingFrames;
202 195
203 public const float numericTrue = 1f; 196 public const float numericTrue = 1f;
204 public const float numericFalse = 0f; 197 public const float numericFalse = 0f;
205} 198}
206 199
200// Parameters passed for the conversion of a mesh to a hull using Bullet's HACD library.
201[StructLayout(LayoutKind.Sequential)]
202public struct HACDParams
203{
204 // usual default values
205 public float maxVerticesPerHull; // 100
206 public float minClusters; // 2
207 public float compacityWeight; // 0.1
208 public float volumeWeight; // 0.0
209 public float concavity; // 100
210 public float addExtraDistPoints; // false
211 public float addNeighboursDistPoints; // false
212 public float addFacesPoints; // false
213 public float shouldAdjustCollisionMargin; // false
214 // VHACD
215 public float whichHACD; // zero if Bullet HACD, non-zero says VHACD
216 // http://kmamou.blogspot.ca/2014/12/v-hacd-20-parameters-description.html
217 public float vHACDresolution; // 100,000 max number of voxels generated during voxelization stage
218 public float vHACDdepth; // 20 max number of clipping stages
219 public float vHACDconcavity; // 0.0025 maximum concavity
220 public float vHACDplaneDownsampling; // 4 granularity of search for best clipping plane
221 public float vHACDconvexHullDownsampling; // 4 precision of hull gen process
222 public float vHACDalpha; // 0.05 bias toward clipping along symmetry planes
223 public float vHACDbeta; // 0.05 bias toward clipping along revolution axis
224 public float vHACDgamma; // 0.00125 max concavity when merging
225 public float vHACDpca; // 0 on/off normalizing mesh before decomp
226 public float vHACDmode; // 0 0:voxel based, 1: tetrahedron based
227 public float vHACDmaxNumVerticesPerCH; // 64 max triangles per convex hull
228 public float vHACDminVolumePerCH; // 0.0001 sampling of generated convex hulls
229}
207 230
208// The states a bullet collision object can have 231// The states a bullet collision object can have
209public enum ActivationState : uint 232public enum ActivationState : uint
@@ -238,11 +261,12 @@ public enum CollisionFlags : uint
238 CF_DISABLE_VISUALIZE_OBJECT = 1 << 5, 261 CF_DISABLE_VISUALIZE_OBJECT = 1 << 5,
239 CF_DISABLE_SPU_COLLISION_PROCESS = 1 << 6, 262 CF_DISABLE_SPU_COLLISION_PROCESS = 1 << 6,
240 // Following used by BulletSim to control collisions and updates 263 // Following used by BulletSim to control collisions and updates
241 BS_SUBSCRIBE_COLLISION_EVENTS = 1 << 10, 264 BS_SUBSCRIBE_COLLISION_EVENTS = 1 << 10, // return collision events from unmanaged to managed
242 BS_FLOATS_ON_WATER = 1 << 11, 265 BS_FLOATS_ON_WATER = 1 << 11, // the object should float at water level
243 BS_VEHICLE_COLLISIONS = 1 << 12, 266 BS_VEHICLE_COLLISIONS = 1 << 12, // return collisions for vehicle ground checking
267 BS_RETURN_ROOT_COMPOUND_SHAPE = 1 << 13, // return the pos/rot of the root shape in a compound shape
244 BS_NONE = 0, 268 BS_NONE = 0,
245 BS_ALL = 0xFFFFFFFF 269 BS_ALL = 0x7FFF // collision flags are a signed short
246}; 270};
247 271
248// Values f collisions groups and masks 272// Values f collisions groups and masks
@@ -258,14 +282,14 @@ public enum CollisionFilterGroups : uint
258 BDebrisGroup = 1 << 3, // 0008 282 BDebrisGroup = 1 << 3, // 0008
259 BSensorTrigger = 1 << 4, // 0010 283 BSensorTrigger = 1 << 4, // 0010
260 BCharacterGroup = 1 << 5, // 0020 284 BCharacterGroup = 1 << 5, // 0020
261 BAllGroup = 0x000FFFFF, 285 BAllGroup = 0x0007FFF, // collision flags are a signed short
262 // Filter groups defined by BulletSim 286 // Filter groups defined by BulletSim
263 BGroundPlaneGroup = 1 << 10, // 0400 287 BGroundPlaneGroup = 1 << 8, // 0400
264 BTerrainGroup = 1 << 11, // 0800 288 BTerrainGroup = 1 << 9, // 0800
265 BRaycastGroup = 1 << 12, // 1000 289 BRaycastGroup = 1 << 10, // 1000
266 BSolidGroup = 1 << 13, // 2000 290 BSolidGroup = 1 << 11, // 2000
267 // BLinksetGroup = xx // a linkset proper is either static or dynamic 291 // BLinksetGroup = xx // a linkset proper is either static or dynamic
268 BLinksetChildGroup = 1 << 14, // 4000 292 BLinksetChildGroup = 1 << 12, // 4000
269}; 293};
270 294
271// CFM controls the 'hardness' of the constraint. 0=fixed, 0..1=violatable. Default=0 295// CFM controls the 'hardness' of the constraint. 0=fixed, 0..1=violatable. Default=0
@@ -285,7 +309,7 @@ public enum ConstraintParamAxis : int
285 AXIS_ANGULAR_X, 309 AXIS_ANGULAR_X,
286 AXIS_ANGULAR_Y, 310 AXIS_ANGULAR_Y,
287 AXIS_ANGULAR_Z, 311 AXIS_ANGULAR_Z,
288 AXIS_LINEAR_ALL = 20, // these last three added by BulletSim so we don't have to do zillions of calls 312 AXIS_LINEAR_ALL = 20, // added by BulletSim so we don't have to do zillions of calls
289 AXIS_ANGULAR_ALL, 313 AXIS_ANGULAR_ALL,
290 AXIS_ALL 314 AXIS_ALL
291}; 315};
@@ -294,7 +318,7 @@ public abstract class BSAPITemplate
294{ 318{
295// Returns the name of the underlying Bullet engine 319// Returns the name of the underlying Bullet engine
296public abstract string BulletEngineName { get; } 320public abstract string BulletEngineName { get; }
297public abstract string BulletEngineVersion { get; protected set;} 321public abstract string BulletEngineVersion { get; protected set;}
298 322
299// Initialization and simulation 323// Initialization and simulation
300public abstract BulletWorld Initialize(Vector3 maxPosition, ConfigurationParameters parms, 324public abstract BulletWorld Initialize(Vector3 maxPosition, ConfigurationParameters parms,
@@ -305,7 +329,7 @@ public abstract BulletWorld Initialize(Vector3 maxPosition, ConfigurationParamet
305public abstract int PhysicsStep(BulletWorld world, float timeStep, int maxSubSteps, float fixedTimeStep, 329public abstract int PhysicsStep(BulletWorld world, float timeStep, int maxSubSteps, float fixedTimeStep,
306 out int updatedEntityCount, out int collidersCount); 330 out int updatedEntityCount, out int collidersCount);
307 331
308public abstract bool UpdateParameter(BulletWorld world, uint localID, String parm, float value); 332public abstract bool UpdateParameter(BulletWorld world, UInt32 localID, String parm, float value);
309 333
310public abstract void Shutdown(BulletWorld sim); 334public abstract void Shutdown(BulletWorld sim);
311 335
@@ -317,10 +341,20 @@ public abstract BulletShape CreateMeshShape(BulletWorld world,
317 int indicesCount, int[] indices, 341 int indicesCount, int[] indices,
318 int verticesCount, float[] vertices ); 342 int verticesCount, float[] vertices );
319 343
344public abstract BulletShape CreateGImpactShape(BulletWorld world,
345 int indicesCount, int[] indices,
346 int verticesCount, float[] vertices );
347
320public abstract BulletShape CreateHullShape(BulletWorld world, 348public abstract BulletShape CreateHullShape(BulletWorld world,
321 int hullCount, float[] hulls); 349 int hullCount, float[] hulls);
322 350
323public abstract BulletShape BuildHullShapeFromMesh(BulletWorld world, BulletShape meshShape); 351public abstract BulletShape BuildHullShapeFromMesh(BulletWorld world, BulletShape meshShape, HACDParams parms);
352
353public abstract BulletShape BuildConvexHullShapeFromMesh(BulletWorld world, BulletShape meshShape);
354
355public abstract BulletShape CreateConvexHullShape(BulletWorld world,
356 int indicesCount, int[] indices,
357 int verticesCount, float[] vertices );
324 358
325public abstract BulletShape BuildNativeShape(BulletWorld world, ShapeData shapeData); 359public abstract BulletShape BuildNativeShape(BulletWorld world, ShapeData shapeData);
326 360
@@ -342,26 +376,28 @@ public abstract BulletShape RemoveChildShapeFromCompoundShapeIndex(BulletShape c
342 376
343public abstract void RemoveChildShapeFromCompoundShape(BulletShape cShape, BulletShape removeShape); 377public abstract void RemoveChildShapeFromCompoundShape(BulletShape cShape, BulletShape removeShape);
344 378
379public abstract void UpdateChildTransform(BulletShape pShape, int childIndex, Vector3 pos, Quaternion rot, bool shouldRecalculateLocalAabb);
380
345public abstract void RecalculateCompoundShapeLocalAabb(BulletShape cShape); 381public abstract void RecalculateCompoundShapeLocalAabb(BulletShape cShape);
346 382
347public abstract BulletShape DuplicateCollisionShape(BulletWorld sim, BulletShape srcShape, uint id); 383public abstract BulletShape DuplicateCollisionShape(BulletWorld sim, BulletShape srcShape, UInt32 id);
348 384
349public abstract bool DeleteCollisionShape(BulletWorld world, BulletShape shape); 385public abstract bool DeleteCollisionShape(BulletWorld world, BulletShape shape);
350 386
351public abstract CollisionObjectTypes GetBodyType(BulletBody obj); 387public abstract CollisionObjectTypes GetBodyType(BulletBody obj);
352 388
353public abstract BulletBody CreateBodyFromShape(BulletWorld sim, BulletShape shape, uint id, Vector3 pos, Quaternion rot); 389public abstract BulletBody CreateBodyFromShape(BulletWorld sim, BulletShape shape, UInt32 id, Vector3 pos, Quaternion rot);
354 390
355public abstract BulletBody CreateBodyWithDefaultMotionState(BulletShape shape, uint id, Vector3 pos, Quaternion rot); 391public abstract BulletBody CreateBodyWithDefaultMotionState(BulletShape shape, UInt32 id, Vector3 pos, Quaternion rot);
356 392
357public abstract BulletBody CreateGhostFromShape(BulletWorld sim, BulletShape shape, uint id, Vector3 pos, Quaternion rot); 393public abstract BulletBody CreateGhostFromShape(BulletWorld sim, BulletShape shape, UInt32 id, Vector3 pos, Quaternion rot);
358 394
359public abstract void DestroyObject(BulletWorld sim, BulletBody obj); 395public abstract void DestroyObject(BulletWorld sim, BulletBody obj);
360 396
361// ===================================================================================== 397// =====================================================================================
362public abstract BulletShape CreateGroundPlaneShape(uint id, float height, float collisionMargin); 398public abstract BulletShape CreateGroundPlaneShape(UInt32 id, float height, float collisionMargin);
363 399
364public abstract BulletShape CreateTerrainShape(uint id, Vector3 size, float minHeight, float maxHeight, float[] heightMap, 400public abstract BulletShape CreateTerrainShape(UInt32 id, Vector3 size, float minHeight, float maxHeight, float[] heightMap,
365 float scaleFactor, float collisionMargin); 401 float scaleFactor, float collisionMargin);
366 402
367// ===================================================================================== 403// =====================================================================================
@@ -375,11 +411,38 @@ public abstract BulletConstraint Create6DofConstraintToPoint(BulletWorld world,
375 Vector3 joinPoint, 411 Vector3 joinPoint,
376 bool useLinearReferenceFrameA, bool disableCollisionsBetweenLinkedBodies); 412 bool useLinearReferenceFrameA, bool disableCollisionsBetweenLinkedBodies);
377 413
414public abstract BulletConstraint Create6DofConstraintFixed(BulletWorld world, BulletBody obj1,
415 Vector3 frameInBloc, Quaternion frameInBrot,
416 bool useLinearReferenceFrameB, bool disableCollisionsBetweenLinkedBodies);
417
418public abstract BulletConstraint Create6DofSpringConstraint(BulletWorld world, BulletBody obj1, BulletBody obj2,
419 Vector3 frame1loc, Quaternion frame1rot,
420 Vector3 frame2loc, Quaternion frame2rot,
421 bool useLinearReferenceFrameA, bool disableCollisionsBetweenLinkedBodies);
422
378public abstract BulletConstraint CreateHingeConstraint(BulletWorld world, BulletBody obj1, BulletBody obj2, 423public abstract BulletConstraint CreateHingeConstraint(BulletWorld world, BulletBody obj1, BulletBody obj2,
379 Vector3 pivotinA, Vector3 pivotinB, 424 Vector3 pivotinA, Vector3 pivotinB,
380 Vector3 axisInA, Vector3 axisInB, 425 Vector3 axisInA, Vector3 axisInB,
381 bool useLinearReferenceFrameA, bool disableCollisionsBetweenLinkedBodies); 426 bool useLinearReferenceFrameA, bool disableCollisionsBetweenLinkedBodies);
382 427
428public abstract BulletConstraint CreateSliderConstraint(BulletWorld world, BulletBody obj1, BulletBody obj2,
429 Vector3 frameInAloc, Quaternion frameInArot,
430 Vector3 frameInBloc, Quaternion frameInBrot,
431 bool useLinearReferenceFrameA, bool disableCollisionsBetweenLinkedBodies);
432
433public abstract BulletConstraint CreateConeTwistConstraint(BulletWorld world, BulletBody obj1, BulletBody obj2,
434 Vector3 frameInAloc, Quaternion frameInArot,
435 Vector3 frameInBloc, Quaternion frameInBrot,
436 bool disableCollisionsBetweenLinkedBodies);
437
438public abstract BulletConstraint CreateGearConstraint(BulletWorld world, BulletBody obj1, BulletBody obj2,
439 Vector3 axisInA, Vector3 axisInB,
440 float ratio, bool disableCollisionsBetweenLinkedBodies);
441
442public abstract BulletConstraint CreatePoint2PointConstraint(BulletWorld world, BulletBody obj1, BulletBody obj2,
443 Vector3 pivotInA, Vector3 pivotInB,
444 bool disableCollisionsBetweenLinkedBodies);
445
383public abstract void SetConstraintEnable(BulletConstraint constrain, float numericTrueFalse); 446public abstract void SetConstraintEnable(BulletConstraint constrain, float numericTrueFalse);
384 447
385public abstract void SetConstraintNumSolverIterations(BulletConstraint constrain, float iterations); 448public abstract void SetConstraintNumSolverIterations(BulletConstraint constrain, float iterations);
@@ -397,6 +460,38 @@ public abstract bool TranslationalLimitMotor(BulletConstraint constrain, float e
397 460
398public abstract bool SetBreakingImpulseThreshold(BulletConstraint constrain, float threshold); 461public abstract bool SetBreakingImpulseThreshold(BulletConstraint constrain, float threshold);
399 462
463public const int HINGE_NOT_SPECIFIED = -1;
464public abstract bool HingeSetLimits(BulletConstraint constrain, float low, float high, float softness, float bias, float relaxation);
465
466public abstract bool SpringEnable(BulletConstraint constrain, int index, float numericTrueFalse);
467
468public const int SPRING_NOT_SPECIFIED = -1;
469public abstract bool SpringSetEquilibriumPoint(BulletConstraint constrain, int index, float equilibriumPoint);
470
471public abstract bool SpringSetStiffness(BulletConstraint constrain, int index, float stiffnesss);
472
473public abstract bool SpringSetDamping(BulletConstraint constrain, int index, float damping);
474
475public const int SLIDER_LOWER_LIMIT = 0;
476public const int SLIDER_UPPER_LIMIT = 1;
477public const int SLIDER_LINEAR = 2;
478public const int SLIDER_ANGULAR = 3;
479public abstract bool SliderSetLimits(BulletConstraint constrain, int lowerUpper, int linAng, float val);
480
481public const int SLIDER_SET_SOFTNESS = 4;
482public const int SLIDER_SET_RESTITUTION = 5;
483public const int SLIDER_SET_DAMPING = 6;
484public const int SLIDER_SET_DIRECTION = 7;
485public const int SLIDER_SET_LIMIT = 8;
486public const int SLIDER_SET_ORTHO = 9;
487public abstract bool SliderSet(BulletConstraint constrain, int softRestDamp, int dirLimOrtho, int linAng, float val);
488
489public abstract bool SliderMotorEnable(BulletConstraint constrain, int linAng, float numericTrueFalse);
490
491public const int SLIDER_MOTOR_VELOCITY = 10;
492public const int SLIDER_MAX_MOTOR_FORCE = 11;
493public abstract bool SliderMotor(BulletConstraint constrain, int forceVel, int linAng, float val);
494
400public abstract bool CalculateTransforms(BulletConstraint constrain); 495public abstract bool CalculateTransforms(BulletConstraint constrain);
401 496
402public abstract bool SetConstraintParam(BulletConstraint constrain, ConstraintParams paramIndex, float value, ConstraintParamAxis axis); 497public abstract bool SetConstraintParam(BulletConstraint constrain, ConstraintParams paramIndex, float value, ConstraintParamAxis axis);
@@ -420,6 +515,8 @@ public abstract bool AddObjectToWorld(BulletWorld world, BulletBody obj);
420 515
421public abstract bool RemoveObjectFromWorld(BulletWorld world, BulletBody obj); 516public abstract bool RemoveObjectFromWorld(BulletWorld world, BulletBody obj);
422 517
518public abstract bool ClearCollisionProxyCache(BulletWorld world, BulletBody obj);
519
423public abstract bool AddConstraintToWorld(BulletWorld world, BulletConstraint constrain, bool disableCollisionsBetweenLinkedObjects); 520public abstract bool AddConstraintToWorld(BulletWorld world, BulletConstraint constrain, bool disableCollisionsBetweenLinkedObjects);
424 521
425public abstract bool RemoveConstraintFromWorld(BulletWorld world, BulletConstraint constrain); 522public abstract bool RemoveConstraintFromWorld(BulletWorld world, BulletConstraint constrain);
@@ -607,7 +704,7 @@ public abstract BulletConstraint GetConstraintRef(BulletBody obj, int index);
607 704
608public abstract int GetNumConstraintRefs(BulletBody obj); 705public abstract int GetNumConstraintRefs(BulletBody obj);
609 706
610public abstract bool SetCollisionGroupMask(BulletBody body, uint filter, uint mask); 707public abstract bool SetCollisionGroupMask(BulletBody body, UInt32 filter, UInt32 mask);
611 708
612// ===================================================================================== 709// =====================================================================================
613// btCollisionShape entries 710// btCollisionShape entries
@@ -646,17 +743,21 @@ public abstract float GetMargin(BulletShape shape);
646 743
647// ===================================================================================== 744// =====================================================================================
648// Debugging 745// Debugging
649public abstract void DumpRigidBody(BulletWorld sim, BulletBody collisionObject); 746public virtual void DumpRigidBody(BulletWorld sim, BulletBody collisionObject) { }
747
748public virtual void DumpCollisionShape(BulletWorld sim, BulletShape collisionShape) { }
749
750public virtual void DumpConstraint(BulletWorld sim, BulletConstraint constrain) { }
650 751
651public abstract void DumpCollisionShape(BulletWorld sim, BulletShape collisionShape); 752public virtual void DumpActivationInfo(BulletWorld sim) { }
652 753
653public abstract void DumpConstraint(BulletWorld sim, BulletConstraint constrain); 754public virtual void DumpAllInfo(BulletWorld sim) { }
654 755
655public abstract void DumpActivationInfo(BulletWorld sim); 756public virtual void DumpPhysicsStatistics(BulletWorld sim) { }
656 757
657public abstract void DumpAllInfo(BulletWorld sim); 758public virtual void ResetBroadphasePool(BulletWorld sim) { }
658 759
659public abstract void DumpPhysicsStatistics(BulletWorld sim); 760public virtual void ResetConstraintSolver(BulletWorld sim) { }
660 761
661}; 762};
662} 763}