diff options
author | Melanie | 2013-01-02 11:52:37 +0000 |
---|---|---|
committer | Melanie | 2013-01-02 11:52:37 +0000 |
commit | 7943c8d11cbcac3ab16fb347d0c4116adc6437a5 (patch) | |
tree | a8f099569905001bdedf144a77fd7b9191aa6427 /OpenSim/Region/Physics/BulletSPlugin/BulletSimAPI.cs | |
parent | Merge branch 'master' into careminster (diff) | |
parent | BulletSim: add parameter to have Bullet output performance statistics (diff) | |
download | opensim-SC-7943c8d11cbcac3ab16fb347d0c4116adc6437a5.zip opensim-SC-7943c8d11cbcac3ab16fb347d0c4116adc6437a5.tar.gz opensim-SC-7943c8d11cbcac3ab16fb347d0c4116adc6437a5.tar.bz2 opensim-SC-7943c8d11cbcac3ab16fb347d0c4116adc6437a5.tar.xz |
Merge branch 'master' into careminster
Conflicts:
OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Physics/BulletSPlugin/BulletSimAPI.cs | 1276 |
1 files changed, 0 insertions, 1276 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BulletSimAPI.cs b/OpenSim/Region/Physics/BulletSPlugin/BulletSimAPI.cs deleted file mode 100644 index b361498..0000000 --- a/OpenSim/Region/Physics/BulletSPlugin/BulletSimAPI.cs +++ /dev/null | |||
@@ -1,1276 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://opensimulator.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyrightD | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSimulator Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | */ | ||
27 | using System; | ||
28 | using System.Collections.Generic; | ||
29 | using System.Runtime.InteropServices; | ||
30 | using System.Security; | ||
31 | using System.Text; | ||
32 | using OpenMetaverse; | ||
33 | |||
34 | namespace OpenSim.Region.Physics.BulletSPlugin { | ||
35 | |||
36 | // Constraint type values as defined by Bullet | ||
37 | public enum ConstraintType : int | ||
38 | { | ||
39 | POINT2POINT_CONSTRAINT_TYPE = 3, | ||
40 | HINGE_CONSTRAINT_TYPE, | ||
41 | CONETWIST_CONSTRAINT_TYPE, | ||
42 | D6_CONSTRAINT_TYPE, | ||
43 | SLIDER_CONSTRAINT_TYPE, | ||
44 | CONTACT_CONSTRAINT_TYPE, | ||
45 | D6_SPRING_CONSTRAINT_TYPE, | ||
46 | MAX_CONSTRAINT_TYPE | ||
47 | } | ||
48 | |||
49 | // =============================================================================== | ||
50 | [StructLayout(LayoutKind.Sequential)] | ||
51 | public struct ConvexHull | ||
52 | { | ||
53 | Vector3 Offset; | ||
54 | int VertexCount; | ||
55 | Vector3[] Vertices; | ||
56 | } | ||
57 | public enum BSPhysicsShapeType | ||
58 | { | ||
59 | SHAPE_UNKNOWN = 0, | ||
60 | SHAPE_CAPSULE = 1, | ||
61 | SHAPE_BOX = 2, | ||
62 | SHAPE_CONE = 3, | ||
63 | SHAPE_CYLINDER = 4, | ||
64 | SHAPE_SPHERE = 5, | ||
65 | SHAPE_MESH = 6, | ||
66 | SHAPE_HULL = 7, | ||
67 | // following defined by BulletSim | ||
68 | SHAPE_GROUNDPLANE = 20, | ||
69 | SHAPE_TERRAIN = 21, | ||
70 | SHAPE_COMPOUND = 22, | ||
71 | SHAPE_HEIGHTMAP = 23, | ||
72 | SHAPE_AVATAR = 24, | ||
73 | }; | ||
74 | |||
75 | // The native shapes have predefined shape hash keys | ||
76 | public enum FixedShapeKey : ulong | ||
77 | { | ||
78 | KEY_NONE = 0, | ||
79 | KEY_BOX = 1, | ||
80 | KEY_SPHERE = 2, | ||
81 | KEY_CONE = 3, | ||
82 | KEY_CYLINDER = 4, | ||
83 | KEY_CAPSULE = 5, | ||
84 | KEY_AVATAR = 6, | ||
85 | } | ||
86 | |||
87 | [StructLayout(LayoutKind.Sequential)] | ||
88 | public struct ShapeData | ||
89 | { | ||
90 | public uint ID; | ||
91 | public BSPhysicsShapeType Type; | ||
92 | public Vector3 Position; | ||
93 | public Quaternion Rotation; | ||
94 | public Vector3 Velocity; | ||
95 | public Vector3 Scale; | ||
96 | public float Mass; | ||
97 | public float Buoyancy; | ||
98 | public System.UInt64 HullKey; | ||
99 | public System.UInt64 MeshKey; | ||
100 | public float Friction; | ||
101 | public float Restitution; | ||
102 | public float Collidable; // true of things bump into this | ||
103 | public float Static; // true if a static object. Otherwise gravity, etc. | ||
104 | public float Solid; // true if object cannot be passed through | ||
105 | public Vector3 Size; | ||
106 | |||
107 | // note that bools are passed as floats since bool size changes by language and architecture | ||
108 | public const float numericTrue = 1f; | ||
109 | public const float numericFalse = 0f; | ||
110 | } | ||
111 | [StructLayout(LayoutKind.Sequential)] | ||
112 | public struct SweepHit | ||
113 | { | ||
114 | public uint ID; | ||
115 | public float Fraction; | ||
116 | public Vector3 Normal; | ||
117 | public Vector3 Point; | ||
118 | } | ||
119 | [StructLayout(LayoutKind.Sequential)] | ||
120 | public struct RaycastHit | ||
121 | { | ||
122 | public uint ID; | ||
123 | public float Fraction; | ||
124 | public Vector3 Normal; | ||
125 | } | ||
126 | [StructLayout(LayoutKind.Sequential)] | ||
127 | public struct CollisionDesc | ||
128 | { | ||
129 | public uint aID; | ||
130 | public uint bID; | ||
131 | public Vector3 point; | ||
132 | public Vector3 normal; | ||
133 | } | ||
134 | [StructLayout(LayoutKind.Sequential)] | ||
135 | public struct EntityProperties | ||
136 | { | ||
137 | public uint ID; | ||
138 | public Vector3 Position; | ||
139 | public Quaternion Rotation; | ||
140 | public Vector3 Velocity; | ||
141 | public Vector3 Acceleration; | ||
142 | public Vector3 RotationalVelocity; | ||
143 | } | ||
144 | |||
145 | // Format of this structure must match the definition in the C++ code | ||
146 | // NOTE: adding the X causes compile breaks if used. These are unused symbols | ||
147 | // that can be removed from both here and the unmanaged definition of this structure. | ||
148 | [StructLayout(LayoutKind.Sequential)] | ||
149 | public struct ConfigurationParameters | ||
150 | { | ||
151 | public float defaultFriction; | ||
152 | public float defaultDensity; | ||
153 | public float defaultRestitution; | ||
154 | public float collisionMargin; | ||
155 | public float gravity; | ||
156 | |||
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; | ||
184 | public float maxCollisionAlgorithmPoolSize; | ||
185 | public float shouldDisableContactPoolDynamicAllocation; | ||
186 | public float shouldForceUpdateAllAabbs; | ||
187 | public float shouldRandomizeSolverOrder; | ||
188 | public float shouldSplitSimulationIslands; | ||
189 | public float shouldEnableFrictionCaching; | ||
190 | public float numberOfSolverIterations; | ||
191 | |||
192 | public float XlinksetImplementation; | ||
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 physicsLoggingFrames; | ||
202 | |||
203 | public const float numericTrue = 1f; | ||
204 | public const float numericFalse = 0f; | ||
205 | } | ||
206 | |||
207 | |||
208 | // The states a bullet collision object can have | ||
209 | public enum ActivationState : uint | ||
210 | { | ||
211 | ACTIVE_TAG = 1, | ||
212 | ISLAND_SLEEPING, | ||
213 | WANTS_DEACTIVATION, | ||
214 | DISABLE_DEACTIVATION, | ||
215 | DISABLE_SIMULATION, | ||
216 | } | ||
217 | |||
218 | public enum CollisionObjectTypes : int | ||
219 | { | ||
220 | CO_COLLISION_OBJECT = 1 << 0, | ||
221 | CO_RIGID_BODY = 1 << 1, | ||
222 | CO_GHOST_OBJECT = 1 << 2, | ||
223 | CO_SOFT_BODY = 1 << 3, | ||
224 | CO_HF_FLUID = 1 << 4, | ||
225 | CO_USER_TYPE = 1 << 5, | ||
226 | } | ||
227 | |||
228 | // Values used by Bullet and BulletSim to control object properties. | ||
229 | // Bullet's "CollisionFlags" has more to do with operations on the | ||
230 | // object (if collisions happen, if gravity effects it, ...). | ||
231 | public enum CollisionFlags : uint | ||
232 | { | ||
233 | CF_STATIC_OBJECT = 1 << 0, | ||
234 | CF_KINEMATIC_OBJECT = 1 << 1, | ||
235 | CF_NO_CONTACT_RESPONSE = 1 << 2, | ||
236 | CF_CUSTOM_MATERIAL_CALLBACK = 1 << 3, | ||
237 | CF_CHARACTER_OBJECT = 1 << 4, | ||
238 | CF_DISABLE_VISUALIZE_OBJECT = 1 << 5, | ||
239 | CF_DISABLE_SPU_COLLISION_PROCESS = 1 << 6, | ||
240 | // Following used by BulletSim to control collisions and updates | ||
241 | BS_SUBSCRIBE_COLLISION_EVENTS = 1 << 10, | ||
242 | BS_FLOATS_ON_WATER = 1 << 11, | ||
243 | BS_VEHICLE_COLLISIONS = 1 << 12, | ||
244 | BS_NONE = 0, | ||
245 | BS_ALL = 0xFFFFFFFF | ||
246 | }; | ||
247 | |||
248 | // Values f collisions groups and masks | ||
249 | public enum CollisionFilterGroups : uint | ||
250 | { | ||
251 | // Don't use the bit definitions!! Define the use in a | ||
252 | // filter/mask definition below. This way collision interactions | ||
253 | // are more easily found and debugged. | ||
254 | BNoneGroup = 0, | ||
255 | BDefaultGroup = 1 << 0, // 0001 | ||
256 | BStaticGroup = 1 << 1, // 0002 | ||
257 | BKinematicGroup = 1 << 2, // 0004 | ||
258 | BDebrisGroup = 1 << 3, // 0008 | ||
259 | BSensorTrigger = 1 << 4, // 0010 | ||
260 | BCharacterGroup = 1 << 5, // 0020 | ||
261 | BAllGroup = 0x000FFFFF, | ||
262 | // Filter groups defined by BulletSim | ||
263 | BGroundPlaneGroup = 1 << 10, // 0400 | ||
264 | BTerrainGroup = 1 << 11, // 0800 | ||
265 | BRaycastGroup = 1 << 12, // 1000 | ||
266 | BSolidGroup = 1 << 13, // 2000 | ||
267 | // BLinksetGroup = xx // a linkset proper is either static or dynamic | ||
268 | BLinksetChildGroup = 1 << 14, // 4000 | ||
269 | }; | ||
270 | |||
271 | // CFM controls the 'hardness' of the constraint. 0=fixed, 0..1=violatable. Default=0 | ||
272 | // ERP controls amount of correction per tick. Usable range=0.1..0.8. Default=0.2. | ||
273 | public enum ConstraintParams : int | ||
274 | { | ||
275 | BT_CONSTRAINT_ERP = 1, // this one is not used in Bullet as of 20120730 | ||
276 | BT_CONSTRAINT_STOP_ERP, | ||
277 | BT_CONSTRAINT_CFM, | ||
278 | BT_CONSTRAINT_STOP_CFM, | ||
279 | }; | ||
280 | public enum ConstraintParamAxis : int | ||
281 | { | ||
282 | AXIS_LINEAR_X = 0, | ||
283 | AXIS_LINEAR_Y, | ||
284 | AXIS_LINEAR_Z, | ||
285 | AXIS_ANGULAR_X, | ||
286 | AXIS_ANGULAR_Y, | ||
287 | AXIS_ANGULAR_Z, | ||
288 | AXIS_LINEAR_ALL = 20, // these last three added by BulletSim so we don't have to do zillions of calls | ||
289 | AXIS_ANGULAR_ALL, | ||
290 | AXIS_ALL | ||
291 | }; | ||
292 | |||
293 | public abstract class BulletSimAPITemplate | ||
294 | { | ||
295 | // Initialization and simulation | ||
296 | public abstract BulletWorld Initialize2(Vector3 maxPosition, IntPtr parms, | ||
297 | int maxCollisions, IntPtr collisionArray, | ||
298 | int maxUpdates, IntPtr updateArray | ||
299 | ); | ||
300 | |||
301 | public abstract bool UpdateParameter2(BulletWorld world, uint localID, String parm, float value); | ||
302 | |||
303 | public abstract void SetHeightMap2(BulletWorld world, float[] heightmap); | ||
304 | |||
305 | public abstract void Shutdown2(BulletWorld sim); | ||
306 | |||
307 | public abstract int PhysicsStep2(BulletWorld world, float timeStep, int maxSubSteps, float fixedTimeStep, | ||
308 | out int updatedEntityCount, | ||
309 | out IntPtr updatedEntitiesPtr, | ||
310 | out int collidersCount, | ||
311 | out IntPtr collidersPtr); | ||
312 | |||
313 | public abstract bool PushUpdate2(BulletBody obj); | ||
314 | |||
315 | // ===================================================================================== | ||
316 | // Mesh, hull, shape and body creation helper routines | ||
317 | public abstract BulletShape CreateMeshShape2(BulletWorld world, | ||
318 | int indicesCount, [MarshalAs(UnmanagedType.LPArray)] int[] indices, | ||
319 | int verticesCount, [MarshalAs(UnmanagedType.LPArray)] float[] vertices ); | ||
320 | |||
321 | public abstract BulletShape CreateHullShape2(BulletWorld world, | ||
322 | int hullCount, [MarshalAs(UnmanagedType.LPArray)] float[] hulls); | ||
323 | |||
324 | public abstract BulletShape BuildHullShapeFromMesh2(BulletWorld world, BulletShape meshShape); | ||
325 | |||
326 | public abstract BulletShape BuildNativeShape2(BulletWorld world, ShapeData shapeData); | ||
327 | |||
328 | public abstract bool IsNativeShape2(BulletShape shape); | ||
329 | |||
330 | public abstract void SetShapeCollisionMargin(BulletShape shape, float margin); | ||
331 | |||
332 | public abstract BulletShape BuildCapsuleShape2(BulletWorld world, float radius, float height, Vector3 scale); | ||
333 | |||
334 | public abstract BulletShape CreateCompoundShape2(BulletWorld sim, bool enableDynamicAabbTree); | ||
335 | |||
336 | public abstract int GetNumberOfCompoundChildren2(BulletShape cShape); | ||
337 | |||
338 | public abstract void AddChildShapeToCompoundShape2(BulletShape cShape, BulletShape addShape, Vector3 pos, Quaternion rot); | ||
339 | |||
340 | public abstract BulletShape GetChildShapeFromCompoundShapeIndex2(BulletShape cShape, int indx); | ||
341 | |||
342 | public abstract BulletShape RemoveChildShapeFromCompoundShapeIndex2(BulletShape cShape, int indx); | ||
343 | |||
344 | public abstract void RemoveChildShapeFromCompoundShape2(BulletShape cShape, BulletShape removeShape); | ||
345 | |||
346 | public abstract void RecalculateCompoundShapeLocalAabb2(BulletShape cShape); | ||
347 | |||
348 | public abstract BulletShape DuplicateCollisionShape2(BulletWorld sim, BulletShape srcShape, uint id); | ||
349 | |||
350 | public abstract BulletBody CreateBodyFromShapeAndInfo2(BulletWorld sim, BulletShape shape, uint id, IntPtr constructionInfo); | ||
351 | |||
352 | public abstract bool DeleteCollisionShape2(BulletWorld world, BulletShape shape); | ||
353 | |||
354 | public abstract int GetBodyType2(BulletBody obj); | ||
355 | |||
356 | public abstract BulletBody CreateBodyFromShape2(BulletWorld sim, BulletShape shape, uint id, Vector3 pos, Quaternion rot); | ||
357 | |||
358 | public abstract BulletBody CreateBodyWithDefaultMotionState2(BulletShape shape, uint id, Vector3 pos, Quaternion rot); | ||
359 | |||
360 | public abstract BulletBody CreateGhostFromShape2(BulletWorld sim, BulletShape shape, uint id, Vector3 pos, Quaternion rot); | ||
361 | |||
362 | public abstract IntPtr AllocateBodyInfo2(BulletBody obj); | ||
363 | |||
364 | public abstract void ReleaseBodyInfo2(IntPtr obj); | ||
365 | |||
366 | public abstract void DestroyObject2(BulletWorld sim, BulletBody obj); | ||
367 | |||
368 | // ===================================================================================== | ||
369 | // Terrain creation and helper routines | ||
370 | public abstract IntPtr CreateHeightMapInfo2(BulletWorld sim, uint id, Vector3 minCoords, Vector3 maxCoords, | ||
371 | [MarshalAs(UnmanagedType.LPArray)] float[] heightMap, float collisionMargin); | ||
372 | |||
373 | public abstract IntPtr FillHeightMapInfo2(BulletWorld sim, IntPtr mapInfo, uint id, Vector3 minCoords, Vector3 maxCoords, | ||
374 | [MarshalAs(UnmanagedType.LPArray)] float[] heightMap, float collisionMargin); | ||
375 | |||
376 | public abstract bool ReleaseHeightMapInfo2(IntPtr heightMapInfo); | ||
377 | |||
378 | public abstract BulletBody CreateGroundPlaneShape2(uint id, float height, float collisionMargin); | ||
379 | |||
380 | public abstract BulletBody CreateTerrainShape2(IntPtr mapInfo); | ||
381 | |||
382 | // ===================================================================================== | ||
383 | // Constraint creation and helper routines | ||
384 | public abstract BulletConstraint Create6DofConstraint2(BulletWorld world, BulletBody obj1, BulletBody obj2, | ||
385 | Vector3 frame1loc, Quaternion frame1rot, | ||
386 | Vector3 frame2loc, Quaternion frame2rot, | ||
387 | bool useLinearReferenceFrameA, bool disableCollisionsBetweenLinkedBodies); | ||
388 | |||
389 | public abstract BulletConstraint Create6DofConstraintToPoint2(BulletWorld world, BulletBody obj1, BulletBody obj2, | ||
390 | Vector3 joinPoint, | ||
391 | bool useLinearReferenceFrameA, bool disableCollisionsBetweenLinkedBodies); | ||
392 | |||
393 | public abstract BulletConstraint CreateHingeConstraint2(BulletWorld world, BulletBody obj1, BulletBody obj2, | ||
394 | Vector3 pivotinA, Vector3 pivotinB, | ||
395 | Vector3 axisInA, Vector3 axisInB, | ||
396 | bool useLinearReferenceFrameA, bool disableCollisionsBetweenLinkedBodies); | ||
397 | |||
398 | public abstract void SetConstraintEnable2(BulletConstraint constrain, float numericTrueFalse); | ||
399 | |||
400 | public abstract void SetConstraintNumSolverIterations2(BulletConstraint constrain, float iterations); | ||
401 | |||
402 | public abstract bool SetFrames2(BulletConstraint constrain, | ||
403 | Vector3 frameA, Quaternion frameArot, Vector3 frameB, Quaternion frameBrot); | ||
404 | |||
405 | public abstract bool SetLinearLimits2(BulletConstraint constrain, Vector3 low, Vector3 hi); | ||
406 | |||
407 | public abstract bool SetAngularLimits2(BulletConstraint constrain, Vector3 low, Vector3 hi); | ||
408 | |||
409 | public abstract bool UseFrameOffset2(BulletConstraint constrain, float enable); | ||
410 | |||
411 | public abstract bool TranslationalLimitMotor2(BulletConstraint constrain, float enable, float targetVel, float maxMotorForce); | ||
412 | |||
413 | public abstract bool SetBreakingImpulseThreshold2(BulletConstraint constrain, float threshold); | ||
414 | |||
415 | public abstract bool CalculateTransforms2(BulletConstraint constrain); | ||
416 | |||
417 | public abstract bool SetConstraintParam2(BulletConstraint constrain, ConstraintParams paramIndex, float value, ConstraintParamAxis axis); | ||
418 | |||
419 | public abstract bool DestroyConstraint2(BulletWorld world, BulletConstraint constrain); | ||
420 | |||
421 | // ===================================================================================== | ||
422 | // btCollisionWorld entries | ||
423 | public abstract void UpdateSingleAabb2(BulletWorld world, BulletBody obj); | ||
424 | |||
425 | public abstract void UpdateAabbs2(BulletWorld world); | ||
426 | |||
427 | public abstract bool GetForceUpdateAllAabbs2(BulletWorld world); | ||
428 | |||
429 | public abstract void SetForceUpdateAllAabbs2(BulletWorld world, bool force); | ||
430 | |||
431 | // ===================================================================================== | ||
432 | // btDynamicsWorld entries | ||
433 | public abstract bool AddObjectToWorld2(BulletWorld world, BulletBody obj); | ||
434 | |||
435 | public abstract bool RemoveObjectFromWorld2(BulletWorld world, BulletBody obj); | ||
436 | |||
437 | public abstract bool AddConstraintToWorld2(BulletWorld world, BulletConstraint constrain, bool disableCollisionsBetweenLinkedObjects); | ||
438 | |||
439 | public abstract bool RemoveConstraintFromWorld2(BulletWorld world, BulletConstraint constrain); | ||
440 | // ===================================================================================== | ||
441 | // btCollisionObject entries | ||
442 | public abstract Vector3 GetAnisotripicFriction2(BulletConstraint constrain); | ||
443 | |||
444 | public abstract Vector3 SetAnisotripicFriction2(BulletConstraint constrain, Vector3 frict); | ||
445 | |||
446 | public abstract bool HasAnisotripicFriction2(BulletConstraint constrain); | ||
447 | |||
448 | public abstract void SetContactProcessingThreshold2(BulletBody obj, float val); | ||
449 | |||
450 | public abstract float GetContactProcessingThreshold2(BulletBody obj); | ||
451 | |||
452 | public abstract bool IsStaticObject2(BulletBody obj); | ||
453 | |||
454 | public abstract bool IsKinematicObject2(BulletBody obj); | ||
455 | |||
456 | public abstract bool IsStaticOrKinematicObject2(BulletBody obj); | ||
457 | |||
458 | public abstract bool HasContactResponse2(BulletBody obj); | ||
459 | |||
460 | public abstract void SetCollisionShape2(BulletWorld sim, BulletBody obj, BulletBody shape); | ||
461 | |||
462 | public abstract BulletShape GetCollisionShape2(BulletBody obj); | ||
463 | |||
464 | public abstract int GetActivationState2(BulletBody obj); | ||
465 | |||
466 | public abstract void SetActivationState2(BulletBody obj, int state); | ||
467 | |||
468 | public abstract void SetDeactivationTime2(BulletBody obj, float dtime); | ||
469 | |||
470 | public abstract float GetDeactivationTime2(BulletBody obj); | ||
471 | |||
472 | public abstract void ForceActivationState2(BulletBody obj, ActivationState state); | ||
473 | |||
474 | public abstract void Activate2(BulletBody obj, bool forceActivation); | ||
475 | |||
476 | public abstract bool IsActive2(BulletBody obj); | ||
477 | |||
478 | public abstract void SetRestitution2(BulletBody obj, float val); | ||
479 | |||
480 | public abstract float GetRestitution2(BulletBody obj); | ||
481 | |||
482 | public abstract void SetFriction2(BulletBody obj, float val); | ||
483 | |||
484 | public abstract float GetFriction2(BulletBody obj); | ||
485 | |||
486 | /* Haven't defined the type 'Transform' | ||
487 | public abstract Transform GetWorldTransform2(BulletBody obj); | ||
488 | |||
489 | public abstract void setWorldTransform2(BulletBody obj, Transform trans); | ||
490 | */ | ||
491 | |||
492 | public abstract Vector3 GetPosition2(BulletBody obj); | ||
493 | |||
494 | public abstract Quaternion GetOrientation2(BulletBody obj); | ||
495 | |||
496 | public abstract void SetTranslation2(BulletBody obj, Vector3 position, Quaternion rotation); | ||
497 | |||
498 | public abstract IntPtr GetBroadphaseHandle2(BulletBody obj); | ||
499 | |||
500 | public abstract void SetBroadphaseHandle2(BulletBody obj, IntPtr handle); | ||
501 | |||
502 | /* | ||
503 | public abstract Transform GetInterpolationWorldTransform2(IntPtr obj); | ||
504 | |||
505 | public abstract void SetInterpolationWorldTransform2(IntPtr obj, Transform trans); | ||
506 | */ | ||
507 | |||
508 | public abstract void SetInterpolationLinearVelocity2(BulletBody obj, Vector3 vel); | ||
509 | |||
510 | public abstract void SetInterpolationAngularVelocity2(BulletBody obj, Vector3 vel); | ||
511 | |||
512 | public abstract void SetInterpolationVelocity2(BulletBody obj, Vector3 linearVel, Vector3 angularVel); | ||
513 | |||
514 | public abstract float GetHitFraction2(BulletBody obj); | ||
515 | |||
516 | public abstract void SetHitFraction2(BulletBody obj, float val); | ||
517 | |||
518 | public abstract CollisionFlags GetCollisionFlags2(BulletBody obj); | ||
519 | |||
520 | public abstract CollisionFlags SetCollisionFlags2(BulletBody obj, CollisionFlags flags); | ||
521 | |||
522 | public abstract CollisionFlags AddToCollisionFlags2(BulletBody obj, CollisionFlags flags); | ||
523 | |||
524 | public abstract CollisionFlags RemoveFromCollisionFlags2(BulletBody obj, CollisionFlags flags); | ||
525 | |||
526 | public abstract float GetCcdMotionThreshold2(BulletBody obj); | ||
527 | |||
528 | public abstract void SetCcdMotionThreshold2(BulletBody obj, float val); | ||
529 | |||
530 | public abstract float GetCcdSweptSphereRadius2(BulletBody obj); | ||
531 | |||
532 | public abstract void SetCcdSweptSphereRadius2(BulletBody obj, float val); | ||
533 | |||
534 | public abstract IntPtr GetUserPointer2(BulletBody obj); | ||
535 | |||
536 | public abstract void SetUserPointer2(BulletBody obj, IntPtr val); | ||
537 | |||
538 | // ===================================================================================== | ||
539 | // btRigidBody entries | ||
540 | public abstract void ApplyGravity2(BulletBody obj); | ||
541 | |||
542 | public abstract void SetGravity2(BulletBody obj, Vector3 val); | ||
543 | |||
544 | public abstract Vector3 GetGravity2(BulletBody obj); | ||
545 | |||
546 | public abstract void SetDamping2(BulletBody obj, float lin_damping, float ang_damping); | ||
547 | |||
548 | public abstract void SetLinearDamping2(BulletBody obj, float lin_damping); | ||
549 | |||
550 | public abstract void SetAngularDamping2(BulletBody obj, float ang_damping); | ||
551 | |||
552 | public abstract float GetLinearDamping2(BulletBody obj); | ||
553 | |||
554 | public abstract float GetAngularDamping2(BulletBody obj); | ||
555 | |||
556 | public abstract float GetLinearSleepingThreshold2(BulletBody obj); | ||
557 | |||
558 | |||
559 | public abstract void ApplyDamping2(BulletBody obj, float timeStep); | ||
560 | |||
561 | public abstract void SetMassProps2(BulletBody obj, float mass, Vector3 inertia); | ||
562 | |||
563 | public abstract Vector3 GetLinearFactor2(BulletBody obj); | ||
564 | |||
565 | public abstract void SetLinearFactor2(BulletBody obj, Vector3 factor); | ||
566 | |||
567 | /* | ||
568 | public abstract void SetCenterOfMassTransform2(BulletBody obj, Transform trans); | ||
569 | */ | ||
570 | |||
571 | public abstract void SetCenterOfMassByPosRot2(BulletBody obj, Vector3 pos, Quaternion rot); | ||
572 | |||
573 | // Add a force to the object as if its mass is one. | ||
574 | public abstract void ApplyCentralForce2(BulletBody obj, Vector3 force); | ||
575 | |||
576 | // Set the force being applied to the object as if its mass is one. | ||
577 | public abstract void SetObjectForce2(BulletBody obj, Vector3 force); | ||
578 | |||
579 | public abstract Vector3 GetTotalForce2(BulletBody obj); | ||
580 | |||
581 | public abstract Vector3 GetTotalTorque2(BulletBody obj); | ||
582 | |||
583 | public abstract Vector3 GetInvInertiaDiagLocal2(BulletBody obj); | ||
584 | |||
585 | public abstract void SetInvInertiaDiagLocal2(BulletBody obj, Vector3 inert); | ||
586 | |||
587 | public abstract void SetSleepingThresholds2(BulletBody obj, float lin_threshold, float ang_threshold); | ||
588 | |||
589 | public abstract void ApplyTorque2(BulletBody obj, Vector3 torque); | ||
590 | |||
591 | // Apply force at the given point. Will add torque to the object. | ||
592 | public abstract void ApplyForce2(BulletBody obj, Vector3 force, Vector3 pos); | ||
593 | |||
594 | // Apply impulse to the object. Same as "ApplycentralForce" but force scaled by object's mass. | ||
595 | public abstract void ApplyCentralImpulse2(BulletBody obj, Vector3 imp); | ||
596 | |||
597 | // Apply impulse to the object's torque. Force is scaled by object's mass. | ||
598 | public abstract void ApplyTorqueImpulse2(BulletBody obj, Vector3 imp); | ||
599 | |||
600 | // Apply impulse at the point given. For is scaled by object's mass and effects both linear and angular forces. | ||
601 | public abstract void ApplyImpulse2(BulletBody obj, Vector3 imp, Vector3 pos); | ||
602 | |||
603 | public abstract void ClearForces2(BulletBody obj); | ||
604 | |||
605 | public abstract void ClearAllForces2(BulletBody obj); | ||
606 | |||
607 | public abstract void UpdateInertiaTensor2(BulletBody obj); | ||
608 | |||
609 | |||
610 | /* | ||
611 | public abstract Transform GetCenterOfMassTransform2(BulletBody obj); | ||
612 | */ | ||
613 | |||
614 | public abstract Vector3 GetLinearVelocity2(BulletBody obj); | ||
615 | |||
616 | public abstract Vector3 GetAngularVelocity2(BulletBody obj); | ||
617 | |||
618 | public abstract void SetLinearVelocity2(BulletBody obj, Vector3 val); | ||
619 | |||
620 | public abstract void SetAngularVelocity2(BulletBody obj, Vector3 angularVelocity); | ||
621 | |||
622 | public abstract Vector3 GetVelocityInLocalPoint2(BulletBody obj, Vector3 pos); | ||
623 | |||
624 | public abstract void Translate2(BulletBody obj, Vector3 trans); | ||
625 | |||
626 | public abstract void UpdateDeactivation2(BulletBody obj, float timeStep); | ||
627 | |||
628 | public abstract bool WantsSleeping2(BulletBody obj); | ||
629 | |||
630 | public abstract void SetAngularFactor2(BulletBody obj, float factor); | ||
631 | |||
632 | public abstract void SetAngularFactorV2(BulletBody obj, Vector3 factor); | ||
633 | |||
634 | public abstract Vector3 GetAngularFactor2(BulletBody obj); | ||
635 | |||
636 | public abstract bool IsInWorld2(BulletBody obj); | ||
637 | |||
638 | public abstract void AddConstraintRef2(BulletBody obj, BulletConstraint constrain); | ||
639 | |||
640 | public abstract void RemoveConstraintRef2(BulletBody obj, BulletConstraint constrain); | ||
641 | |||
642 | public abstract BulletConstraint GetConstraintRef2(BulletBody obj, int index); | ||
643 | |||
644 | public abstract int GetNumConstraintRefs2(BulletBody obj); | ||
645 | |||
646 | public abstract bool SetCollisionGroupMask2(BulletBody body, uint filter, uint mask); | ||
647 | |||
648 | // ===================================================================================== | ||
649 | // btCollisionShape entries | ||
650 | |||
651 | public abstract float GetAngularMotionDisc2(BulletShape shape); | ||
652 | |||
653 | public abstract float GetContactBreakingThreshold2(BulletShape shape, float defaultFactor); | ||
654 | |||
655 | public abstract bool IsPolyhedral2(BulletShape shape); | ||
656 | |||
657 | public abstract bool IsConvex2d2(BulletShape shape); | ||
658 | |||
659 | public abstract bool IsConvex2(BulletShape shape); | ||
660 | |||
661 | public abstract bool IsNonMoving2(BulletShape shape); | ||
662 | |||
663 | public abstract bool IsConcave2(BulletShape shape); | ||
664 | |||
665 | public abstract bool IsCompound2(BulletShape shape); | ||
666 | |||
667 | public abstract bool IsSoftBody2(BulletShape shape); | ||
668 | |||
669 | public abstract bool IsInfinite2(BulletShape shape); | ||
670 | |||
671 | public abstract void SetLocalScaling2(BulletShape shape, Vector3 scale); | ||
672 | |||
673 | public abstract Vector3 GetLocalScaling2(BulletShape shape); | ||
674 | |||
675 | public abstract Vector3 CalculateLocalInertia2(BulletShape shape, float mass); | ||
676 | |||
677 | public abstract int GetShapeType2(BulletShape shape); | ||
678 | |||
679 | public abstract void SetMargin2(BulletShape shape, float val); | ||
680 | |||
681 | public abstract float GetMargin2(BulletShape shape); | ||
682 | |||
683 | }; | ||
684 | |||
685 | // =============================================================================== | ||
686 | static class BulletSimAPI { | ||
687 | // =============================================================================== | ||
688 | // Link back to the managed code for outputting log messages | ||
689 | [UnmanagedFunctionPointer(CallingConvention.Cdecl)] | ||
690 | public delegate void DebugLogCallback([MarshalAs(UnmanagedType.LPStr)]string msg); | ||
691 | |||
692 | // =============================================================================== | ||
693 | // Initialization and simulation | ||
694 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
695 | public static extern IntPtr Initialize2(Vector3 maxPosition, IntPtr parms, | ||
696 | int maxCollisions, IntPtr collisionArray, | ||
697 | int maxUpdates, IntPtr updateArray, | ||
698 | DebugLogCallback logRoutine); | ||
699 | |||
700 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
701 | public static extern bool UpdateParameter2(IntPtr world, uint localID, String parm, float value); | ||
702 | |||
703 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
704 | public static extern void SetHeightMap2(IntPtr world, float[] heightmap); | ||
705 | |||
706 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
707 | public static extern void Shutdown2(IntPtr sim); | ||
708 | |||
709 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
710 | public static extern int PhysicsStep2(IntPtr world, float timeStep, int maxSubSteps, float fixedTimeStep, | ||
711 | out int updatedEntityCount, | ||
712 | out IntPtr updatedEntitiesPtr, | ||
713 | out int collidersCount, | ||
714 | out IntPtr collidersPtr); | ||
715 | |||
716 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
717 | public static extern bool PushUpdate2(IntPtr obj); | ||
718 | |||
719 | // ===================================================================================== | ||
720 | // Mesh, hull, shape and body creation helper routines | ||
721 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
722 | public static extern IntPtr CreateMeshShape2(IntPtr world, | ||
723 | int indicesCount, [MarshalAs(UnmanagedType.LPArray)] int[] indices, | ||
724 | int verticesCount, [MarshalAs(UnmanagedType.LPArray)] float[] vertices ); | ||
725 | |||
726 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
727 | public static extern IntPtr CreateHullShape2(IntPtr world, | ||
728 | int hullCount, [MarshalAs(UnmanagedType.LPArray)] float[] hulls); | ||
729 | |||
730 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
731 | public static extern IntPtr BuildHullShapeFromMesh2(IntPtr world, IntPtr meshShape); | ||
732 | |||
733 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
734 | public static extern IntPtr BuildNativeShape2(IntPtr world, ShapeData shapeData); | ||
735 | |||
736 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
737 | public static extern bool IsNativeShape2(IntPtr shape); | ||
738 | |||
739 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
740 | public static extern void SetShapeCollisionMargin(IntPtr shape, float margin); | ||
741 | |||
742 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
743 | public static extern IntPtr BuildCapsuleShape2(IntPtr world, float radius, float height, Vector3 scale); | ||
744 | |||
745 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
746 | public static extern IntPtr CreateCompoundShape2(IntPtr sim, bool enableDynamicAabbTree); | ||
747 | |||
748 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
749 | public static extern int GetNumberOfCompoundChildren2(IntPtr cShape); | ||
750 | |||
751 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
752 | public static extern void AddChildShapeToCompoundShape2(IntPtr cShape, IntPtr addShape, Vector3 pos, Quaternion rot); | ||
753 | |||
754 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
755 | public static extern IntPtr GetChildShapeFromCompoundShapeIndex2(IntPtr cShape, int indx); | ||
756 | |||
757 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
758 | public static extern IntPtr RemoveChildShapeFromCompoundShapeIndex2(IntPtr cShape, int indx); | ||
759 | |||
760 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
761 | public static extern void RemoveChildShapeFromCompoundShape2(IntPtr cShape, IntPtr removeShape); | ||
762 | |||
763 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
764 | public static extern void RecalculateCompoundShapeLocalAabb2(IntPtr cShape); | ||
765 | |||
766 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
767 | public static extern IntPtr DuplicateCollisionShape2(IntPtr sim, IntPtr srcShape, uint id); | ||
768 | |||
769 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
770 | public static extern IntPtr CreateBodyFromShapeAndInfo2(IntPtr sim, IntPtr shape, uint id, IntPtr constructionInfo); | ||
771 | |||
772 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
773 | public static extern bool DeleteCollisionShape2(IntPtr world, IntPtr shape); | ||
774 | |||
775 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
776 | public static extern int GetBodyType2(IntPtr obj); | ||
777 | |||
778 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
779 | public static extern IntPtr CreateBodyFromShape2(IntPtr sim, IntPtr shape, uint id, Vector3 pos, Quaternion rot); | ||
780 | |||
781 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
782 | public static extern IntPtr CreateBodyWithDefaultMotionState2(IntPtr shape, uint id, Vector3 pos, Quaternion rot); | ||
783 | |||
784 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
785 | public static extern IntPtr CreateGhostFromShape2(IntPtr sim, IntPtr shape, uint id, Vector3 pos, Quaternion rot); | ||
786 | |||
787 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
788 | public static extern IntPtr AllocateBodyInfo2(IntPtr obj); | ||
789 | |||
790 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
791 | public static extern void ReleaseBodyInfo2(IntPtr obj); | ||
792 | |||
793 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
794 | public static extern void DestroyObject2(IntPtr sim, IntPtr obj); | ||
795 | |||
796 | // ===================================================================================== | ||
797 | // Terrain creation and helper routines | ||
798 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
799 | public static extern IntPtr CreateHeightMapInfo2(IntPtr sim, uint id, Vector3 minCoords, Vector3 maxCoords, | ||
800 | [MarshalAs(UnmanagedType.LPArray)] float[] heightMap, float collisionMargin); | ||
801 | |||
802 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
803 | public static extern IntPtr FillHeightMapInfo2(IntPtr sim, IntPtr mapInfo, uint id, Vector3 minCoords, Vector3 maxCoords, | ||
804 | [MarshalAs(UnmanagedType.LPArray)] float[] heightMap, float collisionMargin); | ||
805 | |||
806 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
807 | public static extern bool ReleaseHeightMapInfo2(IntPtr heightMapInfo); | ||
808 | |||
809 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
810 | public static extern IntPtr CreateGroundPlaneShape2(uint id, float height, float collisionMargin); | ||
811 | |||
812 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
813 | public static extern IntPtr CreateTerrainShape2(IntPtr mapInfo); | ||
814 | |||
815 | // ===================================================================================== | ||
816 | // Constraint creation and helper routines | ||
817 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
818 | public static extern IntPtr Create6DofConstraint2(IntPtr world, IntPtr obj1, IntPtr obj2, | ||
819 | Vector3 frame1loc, Quaternion frame1rot, | ||
820 | Vector3 frame2loc, Quaternion frame2rot, | ||
821 | bool useLinearReferenceFrameA, bool disableCollisionsBetweenLinkedBodies); | ||
822 | |||
823 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
824 | public static extern IntPtr Create6DofConstraintToPoint2(IntPtr world, IntPtr obj1, IntPtr obj2, | ||
825 | Vector3 joinPoint, | ||
826 | bool useLinearReferenceFrameA, bool disableCollisionsBetweenLinkedBodies); | ||
827 | |||
828 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
829 | public static extern IntPtr CreateHingeConstraint2(IntPtr world, IntPtr obj1, IntPtr obj2, | ||
830 | Vector3 pivotinA, Vector3 pivotinB, | ||
831 | Vector3 axisInA, Vector3 axisInB, | ||
832 | bool useLinearReferenceFrameA, bool disableCollisionsBetweenLinkedBodies); | ||
833 | |||
834 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
835 | public static extern void SetConstraintEnable2(IntPtr constrain, float numericTrueFalse); | ||
836 | |||
837 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
838 | public static extern void SetConstraintNumSolverIterations2(IntPtr constrain, float iterations); | ||
839 | |||
840 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
841 | public static extern bool SetFrames2(IntPtr constrain, | ||
842 | Vector3 frameA, Quaternion frameArot, Vector3 frameB, Quaternion frameBrot); | ||
843 | |||
844 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
845 | public static extern bool SetLinearLimits2(IntPtr constrain, Vector3 low, Vector3 hi); | ||
846 | |||
847 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
848 | public static extern bool SetAngularLimits2(IntPtr constrain, Vector3 low, Vector3 hi); | ||
849 | |||
850 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
851 | public static extern bool UseFrameOffset2(IntPtr constrain, float enable); | ||
852 | |||
853 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
854 | public static extern bool TranslationalLimitMotor2(IntPtr constrain, float enable, float targetVel, float maxMotorForce); | ||
855 | |||
856 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
857 | public static extern bool SetBreakingImpulseThreshold2(IntPtr constrain, float threshold); | ||
858 | |||
859 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
860 | public static extern bool CalculateTransforms2(IntPtr constrain); | ||
861 | |||
862 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
863 | public static extern bool SetConstraintParam2(IntPtr constrain, ConstraintParams paramIndex, float value, ConstraintParamAxis axis); | ||
864 | |||
865 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
866 | public static extern bool DestroyConstraint2(IntPtr world, IntPtr constrain); | ||
867 | |||
868 | // ===================================================================================== | ||
869 | // btCollisionWorld entries | ||
870 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
871 | public static extern void UpdateSingleAabb2(IntPtr world, IntPtr obj); | ||
872 | |||
873 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
874 | public static extern void UpdateAabbs2(IntPtr world); | ||
875 | |||
876 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
877 | public static extern bool GetForceUpdateAllAabbs2(IntPtr world); | ||
878 | |||
879 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
880 | public static extern void SetForceUpdateAllAabbs2(IntPtr world, bool force); | ||
881 | |||
882 | // ===================================================================================== | ||
883 | // btDynamicsWorld entries | ||
884 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
885 | public static extern bool AddObjectToWorld2(IntPtr world, IntPtr obj); | ||
886 | |||
887 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
888 | public static extern bool RemoveObjectFromWorld2(IntPtr world, IntPtr obj); | ||
889 | |||
890 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
891 | public static extern bool AddConstraintToWorld2(IntPtr world, IntPtr constrain, bool disableCollisionsBetweenLinkedObjects); | ||
892 | |||
893 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
894 | public static extern bool RemoveConstraintFromWorld2(IntPtr world, IntPtr constrain); | ||
895 | // ===================================================================================== | ||
896 | // btCollisionObject entries | ||
897 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
898 | public static extern Vector3 GetAnisotripicFriction2(IntPtr constrain); | ||
899 | |||
900 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
901 | public static extern Vector3 SetAnisotripicFriction2(IntPtr constrain, Vector3 frict); | ||
902 | |||
903 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
904 | public static extern bool HasAnisotripicFriction2(IntPtr constrain); | ||
905 | |||
906 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
907 | public static extern void SetContactProcessingThreshold2(IntPtr obj, float val); | ||
908 | |||
909 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
910 | public static extern float GetContactProcessingThreshold2(IntPtr obj); | ||
911 | |||
912 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
913 | public static extern bool IsStaticObject2(IntPtr obj); | ||
914 | |||
915 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
916 | public static extern bool IsKinematicObject2(IntPtr obj); | ||
917 | |||
918 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
919 | public static extern bool IsStaticOrKinematicObject2(IntPtr obj); | ||
920 | |||
921 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
922 | public static extern bool HasContactResponse2(IntPtr obj); | ||
923 | |||
924 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
925 | public static extern void SetCollisionShape2(IntPtr sim, IntPtr obj, IntPtr shape); | ||
926 | |||
927 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
928 | public static extern IntPtr GetCollisionShape2(IntPtr obj); | ||
929 | |||
930 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
931 | public static extern int GetActivationState2(IntPtr obj); | ||
932 | |||
933 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
934 | public static extern void SetActivationState2(IntPtr obj, int state); | ||
935 | |||
936 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
937 | public static extern void SetDeactivationTime2(IntPtr obj, float dtime); | ||
938 | |||
939 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
940 | public static extern float GetDeactivationTime2(IntPtr obj); | ||
941 | |||
942 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
943 | public static extern void ForceActivationState2(IntPtr obj, ActivationState state); | ||
944 | |||
945 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
946 | public static extern void Activate2(IntPtr obj, bool forceActivation); | ||
947 | |||
948 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
949 | public static extern bool IsActive2(IntPtr obj); | ||
950 | |||
951 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
952 | public static extern void SetRestitution2(IntPtr obj, float val); | ||
953 | |||
954 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
955 | public static extern float GetRestitution2(IntPtr obj); | ||
956 | |||
957 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
958 | public static extern void SetFriction2(IntPtr obj, float val); | ||
959 | |||
960 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
961 | public static extern float GetFriction2(IntPtr obj); | ||
962 | |||
963 | /* Haven't defined the type 'Transform' | ||
964 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
965 | public static extern Transform GetWorldTransform2(IntPtr obj); | ||
966 | |||
967 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
968 | public static extern void setWorldTransform2(IntPtr obj, Transform trans); | ||
969 | */ | ||
970 | |||
971 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
972 | public static extern Vector3 GetPosition2(IntPtr obj); | ||
973 | |||
974 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
975 | public static extern Quaternion GetOrientation2(IntPtr obj); | ||
976 | |||
977 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
978 | public static extern void SetTranslation2(IntPtr obj, Vector3 position, Quaternion rotation); | ||
979 | |||
980 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
981 | public static extern IntPtr GetBroadphaseHandle2(IntPtr obj); | ||
982 | |||
983 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
984 | public static extern void SetBroadphaseHandle2(IntPtr obj, IntPtr handle); | ||
985 | |||
986 | /* | ||
987 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
988 | public static extern Transform GetInterpolationWorldTransform2(IntPtr obj); | ||
989 | |||
990 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
991 | public static extern void SetInterpolationWorldTransform2(IntPtr obj, Transform trans); | ||
992 | */ | ||
993 | |||
994 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
995 | public static extern void SetInterpolationLinearVelocity2(IntPtr obj, Vector3 vel); | ||
996 | |||
997 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
998 | public static extern void SetInterpolationAngularVelocity2(IntPtr obj, Vector3 vel); | ||
999 | |||
1000 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
1001 | public static extern void SetInterpolationVelocity2(IntPtr obj, Vector3 linearVel, Vector3 angularVel); | ||
1002 | |||
1003 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
1004 | public static extern float GetHitFraction2(IntPtr obj); | ||
1005 | |||
1006 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
1007 | public static extern void SetHitFraction2(IntPtr obj, float val); | ||
1008 | |||
1009 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
1010 | public static extern CollisionFlags GetCollisionFlags2(IntPtr obj); | ||
1011 | |||
1012 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
1013 | public static extern CollisionFlags SetCollisionFlags2(IntPtr obj, CollisionFlags flags); | ||
1014 | |||
1015 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
1016 | public static extern CollisionFlags AddToCollisionFlags2(IntPtr obj, CollisionFlags flags); | ||
1017 | |||
1018 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
1019 | public static extern CollisionFlags RemoveFromCollisionFlags2(IntPtr obj, CollisionFlags flags); | ||
1020 | |||
1021 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
1022 | public static extern float GetCcdMotionThreshold2(IntPtr obj); | ||
1023 | |||
1024 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
1025 | public static extern void SetCcdMotionThreshold2(IntPtr obj, float val); | ||
1026 | |||
1027 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
1028 | public static extern float GetCcdSweptSphereRadius2(IntPtr obj); | ||
1029 | |||
1030 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
1031 | public static extern void SetCcdSweptSphereRadius2(IntPtr obj, float val); | ||
1032 | |||
1033 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
1034 | public static extern IntPtr GetUserPointer2(IntPtr obj); | ||
1035 | |||
1036 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
1037 | public static extern void SetUserPointer2(IntPtr obj, IntPtr val); | ||
1038 | |||
1039 | // ===================================================================================== | ||
1040 | // btRigidBody entries | ||
1041 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
1042 | public static extern void ApplyGravity2(IntPtr obj); | ||
1043 | |||
1044 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
1045 | public static extern void SetGravity2(IntPtr obj, Vector3 val); | ||
1046 | |||
1047 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
1048 | public static extern Vector3 GetGravity2(IntPtr obj); | ||
1049 | |||
1050 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
1051 | public static extern void SetDamping2(IntPtr obj, float lin_damping, float ang_damping); | ||
1052 | |||
1053 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
1054 | public static extern void SetLinearDamping2(IntPtr obj, float lin_damping); | ||
1055 | |||
1056 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
1057 | public static extern void SetAngularDamping2(IntPtr obj, float ang_damping); | ||
1058 | |||
1059 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
1060 | public static extern float GetLinearDamping2(IntPtr obj); | ||
1061 | |||
1062 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
1063 | public static extern float GetAngularDamping2(IntPtr obj); | ||
1064 | |||
1065 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
1066 | public static extern float GetLinearSleepingThreshold2(IntPtr obj); | ||
1067 | |||
1068 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
1069 | public static extern float GetAngularSleepingThreshold2(IntPtr obj); | ||
1070 | |||
1071 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
1072 | public static extern void ApplyDamping2(IntPtr obj, float timeStep); | ||
1073 | |||
1074 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
1075 | public static extern void SetMassProps2(IntPtr obj, float mass, Vector3 inertia); | ||
1076 | |||
1077 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
1078 | public static extern Vector3 GetLinearFactor2(IntPtr obj); | ||
1079 | |||
1080 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
1081 | public static extern void SetLinearFactor2(IntPtr obj, Vector3 factor); | ||
1082 | |||
1083 | /* | ||
1084 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
1085 | public static extern void SetCenterOfMassTransform2(IntPtr obj, Transform trans); | ||
1086 | */ | ||
1087 | |||
1088 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
1089 | public static extern void SetCenterOfMassByPosRot2(IntPtr obj, Vector3 pos, Quaternion rot); | ||
1090 | |||
1091 | // Add a force to the object as if its mass is one. | ||
1092 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
1093 | public static extern void ApplyCentralForce2(IntPtr obj, Vector3 force); | ||
1094 | |||
1095 | // Set the force being applied to the object as if its mass is one. | ||
1096 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
1097 | public static extern void SetObjectForce2(IntPtr obj, Vector3 force); | ||
1098 | |||
1099 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
1100 | public static extern Vector3 GetTotalForce2(IntPtr obj); | ||
1101 | |||
1102 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
1103 | public static extern Vector3 GetTotalTorque2(IntPtr obj); | ||
1104 | |||
1105 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
1106 | public static extern Vector3 GetInvInertiaDiagLocal2(IntPtr obj); | ||
1107 | |||
1108 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
1109 | public static extern void SetInvInertiaDiagLocal2(IntPtr obj, Vector3 inert); | ||
1110 | |||
1111 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
1112 | public static extern void SetSleepingThresholds2(IntPtr obj, float lin_threshold, float ang_threshold); | ||
1113 | |||
1114 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
1115 | public static extern void ApplyTorque2(IntPtr obj, Vector3 torque); | ||
1116 | |||
1117 | // Apply force at the given point. Will add torque to the object. | ||
1118 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
1119 | public static extern void ApplyForce2(IntPtr obj, Vector3 force, Vector3 pos); | ||
1120 | |||
1121 | // Apply impulse to the object. Same as "ApplycentralForce" but force scaled by object's mass. | ||
1122 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
1123 | public static extern void ApplyCentralImpulse2(IntPtr obj, Vector3 imp); | ||
1124 | |||
1125 | // Apply impulse to the object's torque. Force is scaled by object's mass. | ||
1126 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
1127 | public static extern void ApplyTorqueImpulse2(IntPtr obj, Vector3 imp); | ||
1128 | |||
1129 | // Apply impulse at the point given. For is scaled by object's mass and effects both linear and angular forces. | ||
1130 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
1131 | public static extern void ApplyImpulse2(IntPtr obj, Vector3 imp, Vector3 pos); | ||
1132 | |||
1133 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
1134 | public static extern void ClearForces2(IntPtr obj); | ||
1135 | |||
1136 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
1137 | public static extern void ClearAllForces2(IntPtr obj); | ||
1138 | |||
1139 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
1140 | public static extern void UpdateInertiaTensor2(IntPtr obj); | ||
1141 | |||
1142 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
1143 | public static extern Vector3 GetCenterOfMassPosition2(IntPtr obj); | ||
1144 | |||
1145 | /* | ||
1146 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
1147 | public static extern Transform GetCenterOfMassTransform2(IntPtr obj); | ||
1148 | */ | ||
1149 | |||
1150 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
1151 | public static extern Vector3 GetLinearVelocity2(IntPtr obj); | ||
1152 | |||
1153 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
1154 | public static extern Vector3 GetAngularVelocity2(IntPtr obj); | ||
1155 | |||
1156 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
1157 | public static extern void SetLinearVelocity2(IntPtr obj, Vector3 val); | ||
1158 | |||
1159 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
1160 | public static extern void SetAngularVelocity2(IntPtr obj, Vector3 angularVelocity); | ||
1161 | |||
1162 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
1163 | public static extern Vector3 GetVelocityInLocalPoint2(IntPtr obj, Vector3 pos); | ||
1164 | |||
1165 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
1166 | public static extern void Translate2(IntPtr obj, Vector3 trans); | ||
1167 | |||
1168 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
1169 | public static extern void UpdateDeactivation2(IntPtr obj, float timeStep); | ||
1170 | |||
1171 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
1172 | public static extern bool WantsSleeping2(IntPtr obj); | ||
1173 | |||
1174 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
1175 | public static extern void SetAngularFactor2(IntPtr obj, float factor); | ||
1176 | |||
1177 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
1178 | public static extern void SetAngularFactorV2(IntPtr obj, Vector3 factor); | ||
1179 | |||
1180 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
1181 | public static extern Vector3 GetAngularFactor2(IntPtr obj); | ||
1182 | |||
1183 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
1184 | public static extern bool IsInWorld2(IntPtr obj); | ||
1185 | |||
1186 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
1187 | public static extern void AddConstraintRef2(IntPtr obj, IntPtr constrain); | ||
1188 | |||
1189 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
1190 | public static extern void RemoveConstraintRef2(IntPtr obj, IntPtr constrain); | ||
1191 | |||
1192 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
1193 | public static extern IntPtr GetConstraintRef2(IntPtr obj, int index); | ||
1194 | |||
1195 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
1196 | public static extern int GetNumConstraintRefs2(IntPtr obj); | ||
1197 | |||
1198 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
1199 | public static extern bool SetCollisionGroupMask2(IntPtr body, uint filter, uint mask); | ||
1200 | |||
1201 | // ===================================================================================== | ||
1202 | // btCollisionShape entries | ||
1203 | |||
1204 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
1205 | public static extern float GetAngularMotionDisc2(IntPtr shape); | ||
1206 | |||
1207 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
1208 | public static extern float GetContactBreakingThreshold2(IntPtr shape, float defaultFactor); | ||
1209 | |||
1210 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
1211 | public static extern bool IsPolyhedral2(IntPtr shape); | ||
1212 | |||
1213 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
1214 | public static extern bool IsConvex2d2(IntPtr shape); | ||
1215 | |||
1216 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
1217 | public static extern bool IsConvex2(IntPtr shape); | ||
1218 | |||
1219 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
1220 | public static extern bool IsNonMoving2(IntPtr shape); | ||
1221 | |||
1222 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
1223 | public static extern bool IsConcave2(IntPtr shape); | ||
1224 | |||
1225 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
1226 | public static extern bool IsCompound2(IntPtr shape); | ||
1227 | |||
1228 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
1229 | public static extern bool IsSoftBody2(IntPtr shape); | ||
1230 | |||
1231 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
1232 | public static extern bool IsInfinite2(IntPtr shape); | ||
1233 | |||
1234 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
1235 | public static extern void SetLocalScaling2(IntPtr shape, Vector3 scale); | ||
1236 | |||
1237 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
1238 | public static extern Vector3 GetLocalScaling2(IntPtr shape); | ||
1239 | |||
1240 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
1241 | public static extern Vector3 CalculateLocalInertia2(IntPtr shape, float mass); | ||
1242 | |||
1243 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
1244 | public static extern int GetShapeType2(IntPtr shape); | ||
1245 | |||
1246 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
1247 | public static extern void SetMargin2(IntPtr shape, float val); | ||
1248 | |||
1249 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
1250 | public static extern float GetMargin2(IntPtr shape); | ||
1251 | |||
1252 | // ===================================================================================== | ||
1253 | // Debugging | ||
1254 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
1255 | public static extern void DumpRigidBody2(IntPtr sim, IntPtr collisionObject); | ||
1256 | |||
1257 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
1258 | public static extern void DumpCollisionShape2(IntPtr sim, IntPtr collisionShape); | ||
1259 | |||
1260 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
1261 | public static extern void DumpMapInfo2(IntPtr sim, IntPtr manInfo); | ||
1262 | |||
1263 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
1264 | public static extern void DumpConstraint2(IntPtr sim, IntPtr constrain); | ||
1265 | |||
1266 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
1267 | public static extern void DumpActivationInfo2(IntPtr sim); | ||
1268 | |||
1269 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
1270 | public static extern void DumpAllInfo2(IntPtr sim); | ||
1271 | |||
1272 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
1273 | public static extern void DumpPhysicsStatistics2(IntPtr sim); | ||
1274 | |||
1275 | } | ||
1276 | } | ||