aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Physics/BulletSPlugin/BSAPIUnman.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Physics/BulletSPlugin/BSAPIUnman.cs')
-rwxr-xr-xOpenSim/Region/Physics/BulletSPlugin/BSAPIUnman.cs2425
1 files changed, 1318 insertions, 1107 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSAPIUnman.cs b/OpenSim/Region/Physics/BulletSPlugin/BSAPIUnman.cs
index bbfc1f8..9a8a2e8 100755
--- a/OpenSim/Region/Physics/BulletSPlugin/BSAPIUnman.cs
+++ b/OpenSim/Region/Physics/BulletSPlugin/BSAPIUnman.cs
@@ -1,1107 +1,1318 @@
1/* 1/*
2 * Copyright (c) Contributors, http://opensimulator.org/ 2 * Copyright (c) Contributors, http://opensimulator.org/
3 * See CONTRIBUTORS.TXT for a full list of copyright holders. 3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
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 copyrightD
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
13 * names of its contributors may be used to endorse or promote products 13 * names of its contributors may be used to endorse or promote products
14 * derived from this software without specific prior written permission. 14 * derived from this software without specific prior written permission.
15 * 15 *
16 * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY 16 * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY 19 * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 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 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 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 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. 25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */ 26 */
27using System; 27using System;
28using System.Collections.Generic; 28using System.Collections.Generic;
29using System.Runtime.InteropServices; 29using System.Runtime.InteropServices;
30using System.Security; 30using System.Security;
31using System.Text; 31using System.Text;
32 32
33using OpenMetaverse; 33using OpenMetaverse;
34 34
35namespace OpenSim.Region.Physics.BulletSPlugin 35namespace OpenSim.Region.Physics.BulletSPlugin
36{ 36{
37public sealed class BSAPIUnman : BulletSimAPITemplate 37public sealed class BSAPIUnman : BulletSimAPITemplate
38{ 38{
39 /* 39 /*
40// Initialization and simulation 40// Initialization and simulation
41public BulletWorld Initialize(Vector3 maxPosition, IntPtr parms, 41public BulletWorld Initialize(Vector3 maxPosition, IntPtr parms,
42 int maxCollisions, IntPtr collisionArray, 42 int maxCollisions, IntPtr collisionArray,
43 int maxUpdates, IntPtr updateArray 43 int maxUpdates, IntPtr updateArray
44 ); 44 );
45 45
46public bool UpdateParameter(BulletWorld world, uint localID, String parm, float value); 46public bool UpdateParameter(BulletWorld world, uint localID, String parm, float value);
47 47
48public void SetHeightMap(BulletWorld world, float[] heightmap); 48public void SetHeightMap(BulletWorld world, float[] heightmap);
49 49
50public void Shutdown(BulletWorld sim); 50public void Shutdown(BulletWorld sim);
51 51
52public int PhysicsStep(BulletWorld world, float timeStep, int maxSubSteps, float fixedTimeStep, 52public int PhysicsStep(BulletWorld world, float timeStep, int maxSubSteps, float fixedTimeStep,
53 out int updatedEntityCount, 53 out int updatedEntityCount,
54 out IntPtr updatedEntitiesPtr, 54 out IntPtr updatedEntitiesPtr,
55 out int collidersCount, 55 out int collidersCount,
56 out IntPtr collidersPtr); 56 out IntPtr collidersPtr);
57 57
58public bool PushUpdate(BulletBody obj); 58public bool PushUpdate(BulletBody obj);
59 */ 59 */
60 60
61// ===================================================================================== 61// =====================================================================================
62// Mesh, hull, shape and body creation helper routines 62// Mesh, hull, shape and body creation helper routines
63public override BulletShape CreateMeshShape(BulletWorld world, 63public override BulletShape CreateMeshShape(BulletWorld world,
64 int indicesCount, int[] indices, 64 int indicesCount, int[] indices,
65 int verticesCount, float[] vertices) 65 int verticesCount, float[] vertices)
66{ 66{
67 return new BulletShape( 67 return new BulletShape(
68 BSAPI.CreateMeshShape2(world.ptr, indicesCount, indices, verticesCount, vertices), 68 BSAPICPP.CreateMeshShape2(world.ptr, indicesCount, indices, verticesCount, vertices),
69 BSPhysicsShapeType.SHAPE_MESH); 69 BSPhysicsShapeType.SHAPE_MESH);
70} 70}
71 71
72public override BulletShape CreateHullShape(BulletWorld world, int hullCount, float[] hulls) 72public override BulletShape CreateHullShape(BulletWorld world, int hullCount, float[] hulls)
73{ 73{
74 return new BulletShape( 74 return new BulletShape(
75 BSAPI.CreateHullShape2(world.ptr, hullCount, hulls), 75 BSAPICPP.CreateHullShape2(world.ptr, hullCount, hulls),
76 BSPhysicsShapeType.SHAPE_HULL); 76 BSPhysicsShapeType.SHAPE_HULL);
77} 77}
78 78
79public override BulletShape BuildHullShapeFromMesh(BulletWorld world, BulletShape meshShape) 79public override BulletShape BuildHullShapeFromMesh(BulletWorld world, BulletShape meshShape)
80{ 80{
81 return new BulletShape( 81 return new BulletShape(
82 BSAPI.BuildHullShapeFromMesh2(world.ptr, meshShape.ptr), 82 BSAPICPP.BuildHullShapeFromMesh2(world.ptr, meshShape.ptr),
83 BSPhysicsShapeType.SHAPE_HULL); 83 BSPhysicsShapeType.SHAPE_HULL);
84} 84}
85 85
86public override BulletShape BuildNativeShape( BulletWorld world, ShapeData shapeData) 86public override BulletShape BuildNativeShape( BulletWorld world, ShapeData shapeData)
87{ 87{
88 return new BulletShape( 88 return new BulletShape(
89 BSAPI.BuildNativeShape2(world.ptr, shapeData), 89 BSAPICPP.BuildNativeShape2(world.ptr, shapeData),
90 shapeData.Type); 90 shapeData.Type);
91} 91}
92 92
93public override bool IsNativeShape(BulletShape shape) 93public override bool IsNativeShape(BulletShape shape)
94{ 94{
95 if (shape.HasPhysicalShape) 95 if (shape.HasPhysicalShape)
96 return BSAPI.IsNativeShape2(shape.ptr); 96 return BSAPICPP.IsNativeShape2(shape.ptr);
97 return false; 97 return false;
98} 98}
99 99
100public override void SetShapeCollisionMargin(BulletShape shape, float margin) 100public override void SetShapeCollisionMargin(BulletShape shape, float margin)
101{ 101{
102 if (shape.HasPhysicalShape) 102 if (shape.HasPhysicalShape)
103 BSAPI.SetShapeCollisionMargin2(shape.ptr, margin); 103 BSAPICPP.SetShapeCollisionMargin2(shape.ptr, margin);
104} 104}
105 105
106public override BulletShape BuildCapsuleShape(BulletWorld world, float radius, float height, Vector3 scale) 106public override BulletShape BuildCapsuleShape(BulletWorld world, float radius, float height, Vector3 scale)
107{ 107{
108 return new BulletShape( 108 return new BulletShape(
109 BSAPI.BuildCapsuleShape2(world.ptr, radius, height, scale), 109 BSAPICPP.BuildCapsuleShape2(world.ptr, radius, height, scale),
110 BSPhysicsShapeType.SHAPE_CAPSULE); 110 BSPhysicsShapeType.SHAPE_CAPSULE);
111} 111}
112 112
113public override BulletShape CreateCompoundShape(BulletWorld sim, bool enableDynamicAabbTree) 113public override BulletShape CreateCompoundShape(BulletWorld sim, bool enableDynamicAabbTree)
114{ 114{
115 return new BulletShape( 115 return new BulletShape(
116 BSAPI.CreateCompoundShape2(sim.ptr, enableDynamicAabbTree), 116 BSAPICPP.CreateCompoundShape2(sim.ptr, enableDynamicAabbTree),
117 BSPhysicsShapeType.SHAPE_COMPOUND); 117 BSPhysicsShapeType.SHAPE_COMPOUND);
118 118
119} 119}
120 120
121public override int GetNumberOfCompoundChildren(BulletShape shape) 121public override int GetNumberOfCompoundChildren(BulletShape shape)
122{ 122{
123 if (shape.HasPhysicalShape) 123 if (shape.HasPhysicalShape)
124 return BSAPI.GetNumberOfCompoundChildren2(shape.ptr); 124 return BSAPICPP.GetNumberOfCompoundChildren2(shape.ptr);
125 return 0; 125 return 0;
126} 126}
127 127
128public override void AddChildShapeToCompoundShape(BulletShape cShape, BulletShape addShape, Vector3 pos, Quaternion rot) 128public override void AddChildShapeToCompoundShape(BulletShape cShape, BulletShape addShape, Vector3 pos, Quaternion rot)
129{ 129{
130 BSAPI.AddChildShapeToCompoundShape2(cShape.ptr, addShape.ptr, pos, rot); 130 BSAPICPP.AddChildShapeToCompoundShape2(cShape.ptr, addShape.ptr, pos, rot);
131} 131}
132 132
133public override BulletShape GetChildShapeFromCompoundShapeIndex(BulletShape cShape, int indx) 133public override BulletShape GetChildShapeFromCompoundShapeIndex(BulletShape cShape, int indx)
134{ 134{
135 return new BulletShape(BSAPI.GetChildShapeFromCompoundShapeIndex2(cShape.ptr, indx)); 135 return new BulletShape(BSAPICPP.GetChildShapeFromCompoundShapeIndex2(cShape.ptr, indx));
136} 136}
137 137
138public override BulletShape RemoveChildShapeFromCompoundShapeIndex(BulletShape cShape, int indx) 138public override BulletShape RemoveChildShapeFromCompoundShapeIndex(BulletShape cShape, int indx)
139{ 139{
140 return new BulletShape(BSAPI.RemoveChildShapeFromCompoundShapeIndex2(cShape.ptr, indx)); 140 return new BulletShape(BSAPICPP.RemoveChildShapeFromCompoundShapeIndex2(cShape.ptr, indx));
141} 141}
142 142
143public override void RemoveChildShapeFromCompoundShape(BulletShape cShape, BulletShape removeShape) 143public override void RemoveChildShapeFromCompoundShape(BulletShape cShape, BulletShape removeShape)
144{ 144{
145 BSAPI.RemoveChildShapeFromCompoundShape2(cShape.ptr, removeShape.ptr); 145 BSAPICPP.RemoveChildShapeFromCompoundShape2(cShape.ptr, removeShape.ptr);
146} 146}
147 147
148public override void RecalculateCompoundShapeLocalAabb(BulletShape cShape) 148public override void RecalculateCompoundShapeLocalAabb(BulletShape cShape)
149{ 149{
150 BSAPI.RecalculateCompoundShapeLocalAabb2(cShape.ptr); 150 BSAPICPP.RecalculateCompoundShapeLocalAabb2(cShape.ptr);
151} 151}
152 152
153public override BulletShape DuplicateCollisionShape(BulletWorld sim, BulletShape srcShape, uint id) 153public override BulletShape DuplicateCollisionShape(BulletWorld sim, BulletShape srcShape, uint id)
154{ 154{
155 return new BulletShape(BSAPI.DuplicateCollisionShape2(sim.ptr, srcShape.ptr, id), srcShape.type); 155 return new BulletShape(BSAPICPP.DuplicateCollisionShape2(sim.ptr, srcShape.ptr, id), srcShape.type);
156} 156}
157 157
158public override BulletBody CreateBodyFromShapeAndInfo(BulletWorld sim, BulletShape shape, uint id, IntPtr constructionInfo) 158public override BulletBody CreateBodyFromShapeAndInfo(BulletWorld sim, BulletShape shape, uint id, IntPtr constructionInfo)
159{ 159{
160 return new BulletBody(id, BSAPI.CreateBodyFromShapeAndInfo2(sim.ptr, shape.ptr, id, constructionInfo)); 160 return new BulletBody(id, BSAPICPP.CreateBodyFromShapeAndInfo2(sim.ptr, shape.ptr, id, constructionInfo));
161} 161}
162 162
163public override bool DeleteCollisionShape(BulletWorld world, BulletShape shape) 163public override bool DeleteCollisionShape(BulletWorld world, BulletShape shape)
164{ 164{
165 return BSAPI.DeleteCollisionShape2(world.ptr, shape.ptr); 165 return BSAPICPP.DeleteCollisionShape2(world.ptr, shape.ptr);
166} 166}
167 167
168public override int GetBodyType(BulletBody obj) 168public override int GetBodyType(BulletBody obj)
169{ 169{
170 return BSAPI.GetBodyType2(obj.ptr); 170 return BSAPICPP.GetBodyType2(obj.ptr);
171} 171}
172 172
173public override BulletBody CreateBodyFromShape(BulletWorld sim, BulletShape shape, uint id, Vector3 pos, Quaternion rot) 173public override BulletBody CreateBodyFromShape(BulletWorld sim, BulletShape shape, uint id, Vector3 pos, Quaternion rot)
174{ 174{
175 return new BulletBody(id, BSAPI.CreateBodyFromShape2(sim.ptr, shape.ptr, id, pos, rot)); 175 return new BulletBody(id, BSAPICPP.CreateBodyFromShape2(sim.ptr, shape.ptr, id, pos, rot));
176} 176}
177 177
178public override BulletBody CreateBodyWithDefaultMotionState(BulletShape shape, uint id, Vector3 pos, Quaternion rot) 178public override BulletBody CreateBodyWithDefaultMotionState(BulletShape shape, uint id, Vector3 pos, Quaternion rot)
179{ 179{
180 return new BulletBody(id, BSAPI.CreateBodyWithDefaultMotionState2(shape.ptr, id, pos, rot)); 180 return new BulletBody(id, BSAPICPP.CreateBodyWithDefaultMotionState2(shape.ptr, id, pos, rot));
181} 181}
182 182
183public override BulletBody CreateGhostFromShape(BulletWorld sim, BulletShape shape, uint id, Vector3 pos, Quaternion rot) 183public override BulletBody CreateGhostFromShape(BulletWorld sim, BulletShape shape, uint id, Vector3 pos, Quaternion rot)
184{ 184{
185 return new BulletBody(id, BSAPI.CreateGhostFromShape2(sim.ptr, shape.ptr, id, pos, rot)); 185 return new BulletBody(id, BSAPICPP.CreateGhostFromShape2(sim.ptr, shape.ptr, id, pos, rot));
186} 186}
187 187
188public override IntPtr AllocateBodyInfo(BulletBody obj) 188public override IntPtr AllocateBodyInfo(BulletBody obj)
189{ 189{
190 return BSAPI.AllocateBodyInfo2(obj.ptr); 190 return BSAPICPP.AllocateBodyInfo2(obj.ptr);
191} 191}
192 192
193public override void ReleaseBodyInfo(IntPtr obj) 193public override void ReleaseBodyInfo(IntPtr obj)
194{ 194{
195 BSAPI.ReleaseBodyInfo2(obj); 195 BSAPICPP.ReleaseBodyInfo2(obj);
196} 196}
197 197
198public override void DestroyObject(BulletWorld sim, BulletBody obj) 198public override void DestroyObject(BulletWorld sim, BulletBody obj)
199{ 199{
200 BSAPI.DestroyObject2(sim.ptr, obj.ptr); 200 BSAPICPP.DestroyObject2(sim.ptr, obj.ptr);
201} 201}
202 202
203 /* 203// =====================================================================================
204// ===================================================================================== 204// Terrain creation and helper routines
205// Terrain creation and helper routines 205public override IntPtr CreateHeightMapInfo(BulletWorld sim, uint id, Vector3 minCoords, Vector3 maxCoords,
206public override IntPtr CreateHeightMapInfo(BulletWorld sim, uint id, Vector3 minCoords, Vector3 maxCoords, 206 float[] heightMap, float collisionMargin)
207 [MarshalAs(UnmanagedType.LPArray)] float[] heightMap, float collisionMargin); 207{
208 208 return BSAPICPP.CreateHeightMapInfo2(sim.ptr, id, minCoords, maxCoords, heightMap, collisionMargin);
209public override IntPtr FillHeightMapInfo(BulletWorld sim, IntPtr mapInfo, uint id, Vector3 minCoords, Vector3 maxCoords, 209}
210 [MarshalAs(UnmanagedType.LPArray)] float[] heightMap, float collisionMargin); 210
211 211public override IntPtr FillHeightMapInfo(BulletWorld sim, IntPtr mapInfo, uint id, Vector3 minCoords, Vector3 maxCoords,
212public override bool ReleaseHeightMapInfo(IntPtr heightMapInfo); 212 float[] heightMap, float collisionMargin)
213 213{
214public override BulletBody CreateGroundPlaneShape(uint id, float height, float collisionMargin); 214 return BSAPICPP.FillHeightMapInfo2(sim.ptr, mapInfo, id, minCoords, maxCoords, heightMap, collisionMargin);
215 215}
216public override BulletBody CreateTerrainShape(IntPtr mapInfo); 216
217 217public override bool ReleaseHeightMapInfo(IntPtr heightMapInfo)
218// ===================================================================================== 218{
219// Constraint creation and helper routines 219 return BSAPICPP.ReleaseHeightMapInfo2(heightMapInfo);
220public override BulletConstraint Create6DofConstraint(BulletWorld world, BulletBody obj1, BulletBody obj2, 220}
221 Vector3 frame1loc, Quaternion frame1rot, 221
222 Vector3 frame2loc, Quaternion frame2rot, 222public override BulletShape CreateGroundPlaneShape(uint id, float height, float collisionMargin)
223 bool useLinearReferenceFrameA, bool disableCollisionsBetweenLinkedBodies); 223{
224 224 return new BulletShape(BSAPICPP.CreateGroundPlaneShape2(id, height, collisionMargin), BSPhysicsShapeType.SHAPE_GROUNDPLANE);
225public override BulletConstraint Create6DofConstraintToPoint(BulletWorld world, BulletBody obj1, BulletBody obj2, 225}
226 Vector3 joinPoint, 226
227 bool useLinearReferenceFrameA, bool disableCollisionsBetweenLinkedBodies); 227public override BulletShape CreateTerrainShape(IntPtr mapInfo)
228 228{
229public override BulletConstraint CreateHingeConstraint(BulletWorld world, BulletBody obj1, BulletBody obj2, 229 return new BulletShape(BSAPICPP.CreateTerrainShape2(mapInfo), BSPhysicsShapeType.SHAPE_TERRAIN);
230 Vector3 pivotinA, Vector3 pivotinB, 230}
231 Vector3 axisInA, Vector3 axisInB, 231
232 bool useLinearReferenceFrameA, bool disableCollisionsBetweenLinkedBodies); 232// =====================================================================================
233 233// Constraint creation and helper routines
234public override void SetConstraintEnable(BulletConstraint constrain, float numericTrueFalse); 234public override BulletConstraint Create6DofConstraint(BulletWorld world, BulletBody obj1, BulletBody obj2,
235 235 Vector3 frame1loc, Quaternion frame1rot,
236public override void SetConstraintNumSolverIterations(BulletConstraint constrain, float iterations); 236 Vector3 frame2loc, Quaternion frame2rot,
237 237 bool useLinearReferenceFrameA, bool disableCollisionsBetweenLinkedBodies)
238public override bool SetFrames(BulletConstraint constrain, 238{
239 Vector3 frameA, Quaternion frameArot, Vector3 frameB, Quaternion frameBrot); 239 return new BulletConstraint(BSAPICPP.Create6DofConstraint2(world.ptr, obj1.ptr, obj2.ptr, frame1loc, frame1rot,
240 240 frame2loc, frame2rot, useLinearReferenceFrameA, disableCollisionsBetweenLinkedBodies));
241public override bool SetLinearLimits(BulletConstraint constrain, Vector3 low, Vector3 hi); 241}
242 242
243public override bool SetAngularLimits(BulletConstraint constrain, Vector3 low, Vector3 hi); 243public override BulletConstraint Create6DofConstraintToPoint(BulletWorld world, BulletBody obj1, BulletBody obj2,
244 244 Vector3 joinPoint,
245public override bool UseFrameOffset(BulletConstraint constrain, float enable); 245 bool useLinearReferenceFrameA, bool disableCollisionsBetweenLinkedBodies)
246 246{
247public override bool TranslationalLimitMotor(BulletConstraint constrain, float enable, float targetVel, float maxMotorForce); 247 return new BulletConstraint(BSAPICPP.Create6DofConstraintToPoint2(world.ptr, obj1.ptr, obj2.ptr,
248 248 joinPoint, useLinearReferenceFrameA, disableCollisionsBetweenLinkedBodies));
249public override bool SetBreakingImpulseThreshold(BulletConstraint constrain, float threshold); 249}
250 250
251public override bool CalculateTransforms(BulletConstraint constrain); 251public override BulletConstraint CreateHingeConstraint(BulletWorld world, BulletBody obj1, BulletBody obj2,
252 252 Vector3 pivotinA, Vector3 pivotinB,
253public override bool SetConstraintParam(BulletConstraint constrain, ConstraintParams paramIndex, float value, ConstraintParamAxis axis); 253 Vector3 axisInA, Vector3 axisInB,
254 254 bool useLinearReferenceFrameA, bool disableCollisionsBetweenLinkedBodies)
255public override bool DestroyConstraint(BulletWorld world, BulletConstraint constrain); 255{
256 256 return new BulletConstraint(BSAPICPP.CreateHingeConstraint2(world.ptr, obj1.ptr, obj2.ptr,
257// ===================================================================================== 257 pivotinA, pivotinB, axisInA, axisInB, useLinearReferenceFrameA, disableCollisionsBetweenLinkedBodies));
258// btCollisionWorld entries 258}
259public override void UpdateSingleAabb(BulletWorld world, BulletBody obj); 259
260 260public override void SetConstraintEnable(BulletConstraint constrain, float numericTrueFalse)
261public override void UpdateAabbs(BulletWorld world); 261{
262 262 BSAPICPP.SetConstraintEnable2(constrain.ptr, numericTrueFalse);
263public override bool GetForceUpdateAllAabbs(BulletWorld world); 263}
264 264
265public override void SetForceUpdateAllAabbs(BulletWorld world, bool force); 265public override void SetConstraintNumSolverIterations(BulletConstraint constrain, float iterations)
266 266{
267// ===================================================================================== 267 BSAPICPP.SetConstraintNumSolverIterations2(constrain.ptr, iterations);
268// btDynamicsWorld entries 268}
269public override bool AddObjectToWorld(BulletWorld world, BulletBody obj); 269
270 270public override bool SetFrames(BulletConstraint constrain,
271public override bool RemoveObjectFromWorld(BulletWorld world, BulletBody obj); 271 Vector3 frameA, Quaternion frameArot, Vector3 frameB, Quaternion frameBrot)
272 272{
273public override bool AddConstraintToWorld(BulletWorld world, BulletConstraint constrain, bool disableCollisionsBetweenLinkedObjects); 273 return BSAPICPP.SetFrames2(constrain.ptr, frameA, frameArot, frameB, frameBrot);
274 274}
275public override bool RemoveConstraintFromWorld(BulletWorld world, BulletConstraint constrain); 275
276// ===================================================================================== 276public override bool SetLinearLimits(BulletConstraint constrain, Vector3 low, Vector3 hi)
277// btCollisionObject entries 277{
278public override Vector3 GetAnisotripicFriction(BulletConstraint constrain); 278 return BSAPICPP.SetLinearLimits2(constrain.ptr, low, hi);
279 279}
280public override Vector3 SetAnisotripicFriction(BulletConstraint constrain, Vector3 frict); 280
281 281public override bool SetAngularLimits(BulletConstraint constrain, Vector3 low, Vector3 hi)
282public override bool HasAnisotripicFriction(BulletConstraint constrain); 282{
283 283 return BSAPICPP.SetAngularLimits2(constrain.ptr, low, hi);
284public override void SetContactProcessingThreshold(BulletBody obj, float val); 284}
285 285
286public override float GetContactProcessingThreshold(BulletBody obj); 286public override bool UseFrameOffset(BulletConstraint constrain, float enable)
287 287{
288public override bool IsStaticObject(BulletBody obj); 288 return BSAPICPP.UseFrameOffset2(constrain.ptr, enable);
289 289}
290public override bool IsKinematicObject(BulletBody obj); 290
291 291public override bool TranslationalLimitMotor(BulletConstraint constrain, float enable, float targetVel, float maxMotorForce)
292public override bool IsStaticOrKinematicObject(BulletBody obj); 292{
293 293 return BSAPICPP.TranslationalLimitMotor2(constrain.ptr, enable, targetVel, maxMotorForce);
294public override bool HasContactResponse(BulletBody obj); 294}
295 295
296public override void SetCollisionShape(BulletWorld sim, BulletBody obj, BulletBody shape); 296public override bool SetBreakingImpulseThreshold(BulletConstraint constrain, float threshold)
297 297{
298public override BulletShape GetCollisionShape(BulletBody obj); 298 return BSAPICPP.SetBreakingImpulseThreshold2(constrain.ptr, threshold);
299 299}
300public override int GetActivationState(BulletBody obj); 300
301 301public override bool CalculateTransforms(BulletConstraint constrain)
302public override void SetActivationState(BulletBody obj, int state); 302{
303 303 return BSAPICPP.CalculateTransforms2(constrain.ptr);
304public override void SetDeactivationTime(BulletBody obj, float dtime); 304}
305 305
306public override float GetDeactivationTime(BulletBody obj); 306public override bool SetConstraintParam(BulletConstraint constrain, ConstraintParams paramIndex, float value, ConstraintParamAxis axis)
307 307{
308public override void ForceActivationState(BulletBody obj, ActivationState state); 308 return BSAPICPP.SetConstraintParam2(constrain.ptr, paramIndex, value, axis);
309 309}
310public override void Activate(BulletBody obj, bool forceActivation); 310
311 311public override bool DestroyConstraint(BulletWorld world, BulletConstraint constrain)
312public override bool IsActive(BulletBody obj); 312{
313 313 return BSAPICPP.DestroyConstraint2(world.ptr, constrain.ptr);
314public override void SetRestitution(BulletBody obj, float val); 314}
315 315
316public override float GetRestitution(BulletBody obj); 316// =====================================================================================
317 317// btCollisionWorld entries
318public override void SetFriction(BulletBody obj, float val); 318public override void UpdateSingleAabb(BulletWorld world, BulletBody obj)
319 319{
320public override float GetFriction(BulletBody obj); 320 BSAPICPP.UpdateSingleAabb2(world.ptr, obj.ptr);
321 321}
322public override Vector3 GetPosition(BulletBody obj); 322
323 323public override void UpdateAabbs(BulletWorld world)
324public override Quaternion GetOrientation(BulletBody obj); 324{
325 325 BSAPICPP.UpdateAabbs2(world.ptr);
326public override void SetTranslation(BulletBody obj, Vector3 position, Quaternion rotation); 326}
327 327
328public override IntPtr GetBroadphaseHandle(BulletBody obj); 328public override bool GetForceUpdateAllAabbs(BulletWorld world)
329 329{
330public override void SetBroadphaseHandle(BulletBody obj, IntPtr handle); 330 return BSAPICPP.GetForceUpdateAllAabbs2(world.ptr);
331 331}
332public override void SetInterpolationLinearVelocity(BulletBody obj, Vector3 vel); 332
333 333public override void SetForceUpdateAllAabbs(BulletWorld world, bool force)
334public override void SetInterpolationAngularVelocity(BulletBody obj, Vector3 vel); 334{
335 335 BSAPICPP.SetForceUpdateAllAabbs2(world.ptr, force);
336public override void SetInterpolationVelocity(BulletBody obj, Vector3 linearVel, Vector3 angularVel); 336}
337 337
338public override float GetHitFraction(BulletBody obj); 338// =====================================================================================
339 339// btDynamicsWorld entries
340public override void SetHitFraction(BulletBody obj, float val); 340public override bool AddObjectToWorld(BulletWorld world, BulletBody obj)
341 341{
342public override CollisionFlags GetCollisionFlags(BulletBody obj); 342 return BSAPICPP.AddObjectToWorld2(world.ptr, obj.ptr);
343 343}
344public override CollisionFlags SetCollisionFlags(BulletBody obj, CollisionFlags flags); 344
345 345public override bool RemoveObjectFromWorld(BulletWorld world, BulletBody obj)
346public override CollisionFlags AddToCollisionFlags(BulletBody obj, CollisionFlags flags); 346{
347 347 return BSAPICPP.RemoveObjectFromWorld2(world.ptr, obj.ptr);
348public override CollisionFlags RemoveFromCollisionFlags(BulletBody obj, CollisionFlags flags); 348}
349 349
350public override float GetCcdMotionThreshold(BulletBody obj); 350public override bool AddConstraintToWorld(BulletWorld world, BulletConstraint constrain, bool disableCollisionsBetweenLinkedObjects)
351 351{
352public override void SetCcdMotionThreshold(BulletBody obj, float val); 352 return BSAPICPP.AddConstraintToWorld2(world.ptr, constrain.ptr, disableCollisionsBetweenLinkedObjects);
353 353}
354public override float GetCcdSweptSphereRadius(BulletBody obj); 354
355 355public override bool RemoveConstraintFromWorld(BulletWorld world, BulletConstraint constrain)
356public override void SetCcdSweptSphereRadius(BulletBody obj, float val); 356{
357 357 return BSAPICPP.RemoveConstraintFromWorld2(world.ptr, constrain.ptr);
358public override IntPtr GetUserPointer(BulletBody obj); 358}
359 359// =====================================================================================
360public override void SetUserPointer(BulletBody obj, IntPtr val); 360// btCollisionObject entries
361 361public override Vector3 GetAnisotripicFriction(BulletConstraint constrain)
362// ===================================================================================== 362{
363// btRigidBody entries 363 return BSAPICPP.GetAnisotripicFriction2(constrain.ptr);
364public override void ApplyGravity(BulletBody obj); 364}
365 365
366public override void SetGravity(BulletBody obj, Vector3 val); 366public override Vector3 SetAnisotripicFriction(BulletConstraint constrain, Vector3 frict)
367 367{
368public override Vector3 GetGravity(BulletBody obj); 368 return BSAPICPP.SetAnisotripicFriction2(constrain.ptr, frict);
369 369}
370public override void SetDamping(BulletBody obj, float lin_damping, float ang_damping); 370
371 371public override bool HasAnisotripicFriction(BulletConstraint constrain)
372public override void SetLinearDamping(BulletBody obj, float lin_damping); 372{
373 373 return BSAPICPP.HasAnisotripicFriction2(constrain.ptr);
374public override void SetAngularDamping(BulletBody obj, float ang_damping); 374}
375 375
376public override float GetLinearDamping(BulletBody obj); 376public override void SetContactProcessingThreshold(BulletBody obj, float val)
377 377{
378public override float GetAngularDamping(BulletBody obj); 378 BSAPICPP.SetContactProcessingThreshold2(obj.ptr, val);
379 379}
380public override float GetLinearSleepingThreshold(BulletBody obj); 380
381 381public override float GetContactProcessingThreshold(BulletBody obj)
382 382{
383public override void ApplyDamping(BulletBody obj, float timeStep); 383 return BSAPICPP.GetContactProcessingThreshold2(obj.ptr);
384 384}
385public override void SetMassProps(BulletBody obj, float mass, Vector3 inertia); 385
386 386public override bool IsStaticObject(BulletBody obj)
387public override Vector3 GetLinearFactor(BulletBody obj); 387{
388 388 return BSAPICPP.IsStaticObject2(obj.ptr);
389public override void SetLinearFactor(BulletBody obj, Vector3 factor); 389}
390 390
391public override void SetCenterOfMassByPosRot(BulletBody obj, Vector3 pos, Quaternion rot); 391public override bool IsKinematicObject(BulletBody obj)
392 392{
393// Add a force to the object as if its mass is one. 393 return BSAPICPP.IsKinematicObject2(obj.ptr);
394public override void ApplyCentralForce(BulletBody obj, Vector3 force); 394}
395 395
396// Set the force being applied to the object as if its mass is one. 396public override bool IsStaticOrKinematicObject(BulletBody obj)
397public override void SetObjectForce(BulletBody obj, Vector3 force); 397{
398 398 return BSAPICPP.IsStaticOrKinematicObject2(obj.ptr);
399public override Vector3 GetTotalForce(BulletBody obj); 399}
400 400
401public override Vector3 GetTotalTorque(BulletBody obj); 401public override bool HasContactResponse(BulletBody obj)
402 402{
403public override Vector3 GetInvInertiaDiagLocal(BulletBody obj); 403 return BSAPICPP.HasContactResponse2(obj.ptr);
404 404}
405public override void SetInvInertiaDiagLocal(BulletBody obj, Vector3 inert); 405
406 406public override void SetCollisionShape(BulletWorld sim, BulletBody obj, BulletShape shape)
407public override void SetSleepingThresholds(BulletBody obj, float lin_threshold, float ang_threshold); 407{
408 408 BSAPICPP.SetCollisionShape2(sim.ptr, obj.ptr, shape.ptr);
409public override void ApplyTorque(BulletBody obj, Vector3 torque); 409}
410 410
411// Apply force at the given point. Will add torque to the object. 411public override BulletShape GetCollisionShape(BulletBody obj)
412public override void ApplyForce(BulletBody obj, Vector3 force, Vector3 pos); 412{
413 413 return new BulletShape(BSAPICPP.GetCollisionShape2(obj.ptr));
414// Apply impulse to the object. Same as "ApplycentralForce" but force scaled by object's mass. 414}
415public override void ApplyCentralImpulse(BulletBody obj, Vector3 imp); 415
416 416public override int GetActivationState(BulletBody obj)
417// Apply impulse to the object's torque. Force is scaled by object's mass. 417{
418public override void ApplyTorqueImpulse(BulletBody obj, Vector3 imp); 418 return BSAPICPP.GetActivationState2(obj.ptr);
419 419}
420// Apply impulse at the point given. For is scaled by object's mass and effects both linear and angular forces. 420
421public override void ApplyImpulse(BulletBody obj, Vector3 imp, Vector3 pos); 421public override void SetActivationState(BulletBody obj, int state)
422 422{
423public override void ClearForces(BulletBody obj); 423 BSAPICPP.SetActivationState2(obj.ptr, state);
424 424}
425public override void ClearAllForces(BulletBody obj); 425
426 426public override void SetDeactivationTime(BulletBody obj, float dtime)
427public override void UpdateInertiaTensor(BulletBody obj); 427{
428 428 BSAPICPP.SetDeactivationTime2(obj.ptr, dtime);
429public override Vector3 GetLinearVelocity(BulletBody obj); 429}
430 430
431public override Vector3 GetAngularVelocity(BulletBody obj); 431public override float GetDeactivationTime(BulletBody obj)
432 432{
433public override void SetLinearVelocity(BulletBody obj, Vector3 val); 433 return BSAPICPP.GetDeactivationTime2(obj.ptr);
434 434}
435public override void SetAngularVelocity(BulletBody obj, Vector3 angularVelocity); 435
436 436public override void ForceActivationState(BulletBody obj, ActivationState state)
437public override Vector3 GetVelocityInLocalPoint(BulletBody obj, Vector3 pos); 437{
438 438 BSAPICPP.ForceActivationState2(obj.ptr, state);
439public override void Translate(BulletBody obj, Vector3 trans); 439}
440 440
441public override void UpdateDeactivation(BulletBody obj, float timeStep); 441public override void Activate(BulletBody obj, bool forceActivation)
442 442{
443public override bool WantsSleeping(BulletBody obj); 443 BSAPICPP.Activate2(obj.ptr, forceActivation);
444 444}
445public override void SetAngularFactor(BulletBody obj, float factor); 445
446 446public override bool IsActive(BulletBody obj)
447public override void SetAngularFactorV(BulletBody obj, Vector3 factor); 447{
448 448 return BSAPICPP.IsActive2(obj.ptr);
449public override Vector3 GetAngularFactor(BulletBody obj); 449}
450 450
451public override bool IsInWorld(BulletBody obj); 451public override void SetRestitution(BulletBody obj, float val)
452 452{
453public override void AddConstraintRef(BulletBody obj, BulletConstraint constrain); 453 BSAPICPP.SetRestitution2(obj.ptr, val);
454 454}
455public override void RemoveConstraintRef(BulletBody obj, BulletConstraint constrain); 455
456 456public override float GetRestitution(BulletBody obj)
457public override BulletConstraint GetConstraintRef(BulletBody obj, int index); 457{
458 458 return BSAPICPP.GetRestitution2(obj.ptr);
459public override int GetNumConstraintRefs(BulletBody obj); 459}
460 460
461public override bool SetCollisionGroupMask(BulletBody body, uint filter, uint mask); 461public override void SetFriction(BulletBody obj, float val)
462 462{
463// ===================================================================================== 463 BSAPICPP.SetFriction2(obj.ptr, val);
464// btCollisionShape entries 464}
465 465
466public override float GetAngularMotionDisc(BulletShape shape); 466public override float GetFriction(BulletBody obj)
467 467{
468public override float GetContactBreakingThreshold(BulletShape shape, float defaultFactor); 468 return BSAPICPP.GetFriction2(obj.ptr);
469 469}
470public override bool IsPolyhedral(BulletShape shape); 470
471 471public override Vector3 GetPosition(BulletBody obj)
472public override bool IsConvex2d(BulletShape shape); 472{
473 473 return BSAPICPP.GetPosition2(obj.ptr);
474public override bool IsConvex(BulletShape shape); 474}
475 475
476public override bool IsNonMoving(BulletShape shape); 476public override Quaternion GetOrientation(BulletBody obj)
477 477{
478public override bool IsConcave(BulletShape shape); 478 return BSAPICPP.GetOrientation2(obj.ptr);
479 479}
480public override bool IsCompound(BulletShape shape); 480
481 481public override void SetTranslation(BulletBody obj, Vector3 position, Quaternion rotation)
482public override bool IsSoftBody(BulletShape shape); 482{
483 483 BSAPICPP.SetTranslation2(obj.ptr, position, rotation);
484public override bool IsInfinite(BulletShape shape); 484}
485 485
486public override void SetLocalScaling(BulletShape shape, Vector3 scale); 486public override IntPtr GetBroadphaseHandle(BulletBody obj)
487 487{
488public override Vector3 GetLocalScaling(BulletShape shape); 488 return BSAPICPP.GetBroadphaseHandle2(obj.ptr);
489 489}
490public override Vector3 CalculateLocalInertia(BulletShape shape, float mass); 490
491 491public override void SetBroadphaseHandle(BulletBody obj, IntPtr handle)
492public override int GetShapeType(BulletShape shape); 492{
493 493 BSAPICPP.SetUserPointer2(obj.ptr, handle);
494public override void SetMargin(BulletShape shape, float val); 494}
495 495
496public override float GetMargin(BulletShape shape); 496public override void SetInterpolationLinearVelocity(BulletBody obj, Vector3 vel)
497 */ 497{
498 498 BSAPICPP.SetInterpolationLinearVelocity2(obj.ptr, vel);
499static class BSAPI 499}
500{ 500
501// ===================================================================================== 501public override void SetInterpolationAngularVelocity(BulletBody obj, Vector3 vel)
502// Mesh, hull, shape and body creation helper routines 502{
503[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 503 BSAPICPP.SetInterpolationAngularVelocity2(obj.ptr, vel);
504public static extern IntPtr CreateMeshShape2(IntPtr world, 504}
505 int indicesCount, [MarshalAs(UnmanagedType.LPArray)] int[] indices, 505
506 int verticesCount, [MarshalAs(UnmanagedType.LPArray)] float[] vertices ); 506public override void SetInterpolationVelocity(BulletBody obj, Vector3 linearVel, Vector3 angularVel)
507 507{
508[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 508 BSAPICPP.SetInterpolationVelocity2(obj.ptr, linearVel, angularVel);
509public static extern IntPtr CreateHullShape2(IntPtr world, 509}
510 int hullCount, [MarshalAs(UnmanagedType.LPArray)] float[] hulls); 510
511 511public override float GetHitFraction(BulletBody obj)
512[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 512{
513public static extern IntPtr BuildHullShapeFromMesh2(IntPtr world, IntPtr meshShape); 513 return BSAPICPP.GetHitFraction2(obj.ptr);
514 514}
515[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 515
516public static extern IntPtr BuildNativeShape2(IntPtr world, ShapeData shapeData); 516public override void SetHitFraction(BulletBody obj, float val)
517 517{
518[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 518 BSAPICPP.SetHitFraction2(obj.ptr, val);
519public static extern bool IsNativeShape2(IntPtr shape); 519}
520 520
521[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 521public override CollisionFlags GetCollisionFlags(BulletBody obj)
522public static extern void SetShapeCollisionMargin2(IntPtr shape, float margin); 522{
523 523 return BSAPICPP.GetCollisionFlags2(obj.ptr);
524[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 524}
525public static extern IntPtr BuildCapsuleShape2(IntPtr world, float radius, float height, Vector3 scale); 525
526 526public override CollisionFlags SetCollisionFlags(BulletBody obj, CollisionFlags flags)
527[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 527{
528public static extern IntPtr CreateCompoundShape2(IntPtr sim, bool enableDynamicAabbTree); 528 return BSAPICPP.SetCollisionFlags2(obj.ptr, flags);
529 529}
530[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 530
531public static extern int GetNumberOfCompoundChildren2(IntPtr cShape); 531public override CollisionFlags AddToCollisionFlags(BulletBody obj, CollisionFlags flags)
532 532{
533[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 533 return BSAPICPP.AddToCollisionFlags2(obj.ptr, flags);
534public static extern void AddChildShapeToCompoundShape2(IntPtr cShape, IntPtr addShape, Vector3 pos, Quaternion rot); 534}
535 535
536[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 536public override CollisionFlags RemoveFromCollisionFlags(BulletBody obj, CollisionFlags flags)
537public static extern IntPtr GetChildShapeFromCompoundShapeIndex2(IntPtr cShape, int indx); 537{
538 538 return BSAPICPP.RemoveFromCollisionFlags2(obj.ptr, flags);
539[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 539}
540public static extern IntPtr RemoveChildShapeFromCompoundShapeIndex2(IntPtr cShape, int indx); 540
541 541public override float GetCcdMotionThreshold(BulletBody obj)
542[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 542{
543public static extern void RemoveChildShapeFromCompoundShape2(IntPtr cShape, IntPtr removeShape); 543 return BSAPICPP.GetCcdMotionThreshold2(obj.ptr);
544 544}
545[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 545
546public static extern void RecalculateCompoundShapeLocalAabb2(IntPtr cShape); 546
547 547public override void SetCcdMotionThreshold(BulletBody obj, float val)
548[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 548{
549public static extern IntPtr DuplicateCollisionShape2(IntPtr sim, IntPtr srcShape, uint id); 549 BSAPICPP.SetCcdMotionThreshold2(obj.ptr, val);
550 550}
551[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 551
552public static extern IntPtr CreateBodyFromShapeAndInfo2(IntPtr sim, IntPtr shape, uint id, IntPtr constructionInfo); 552public override float GetCcdSweptSphereRadius(BulletBody obj)
553 553{
554[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 554 return BSAPICPP.GetCcdSweptSphereRadius2(obj.ptr);
555public static extern bool DeleteCollisionShape2(IntPtr world, IntPtr shape); 555}
556 556
557[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 557public override void SetCcdSweptSphereRadius(BulletBody obj, float val)
558public static extern int GetBodyType2(IntPtr obj); 558{
559 559 BSAPICPP.SetCcdSweptSphereRadius2(obj.ptr, val);
560[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 560}
561public static extern IntPtr CreateBodyFromShape2(IntPtr sim, IntPtr shape, uint id, Vector3 pos, Quaternion rot); 561
562 562public override IntPtr GetUserPointer(BulletBody obj)
563[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 563{
564public static extern IntPtr CreateBodyWithDefaultMotionState2(IntPtr shape, uint id, Vector3 pos, Quaternion rot); 564 return BSAPICPP.GetUserPointer2(obj.ptr);
565 565}
566[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 566
567public static extern IntPtr CreateGhostFromShape2(IntPtr sim, IntPtr shape, uint id, Vector3 pos, Quaternion rot); 567public override void SetUserPointer(BulletBody obj, IntPtr val)
568 568{
569[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 569 BSAPICPP.SetUserPointer2(obj.ptr, val);
570public static extern IntPtr AllocateBodyInfo2(IntPtr obj); 570}
571 571
572[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 572 /*
573public static extern void ReleaseBodyInfo2(IntPtr obj); 573// =====================================================================================
574 574// btRigidBody entries
575[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 575public override void ApplyGravity(BulletBody obj);
576public static extern void DestroyObject2(IntPtr sim, IntPtr obj); 576
577 577public override void SetGravity(BulletBody obj, Vector3 val);
578} 578
579} 579public override Vector3 GetGravity(BulletBody obj);
580 580
581// =============================================================================== 581public override void SetDamping(BulletBody obj, float lin_damping, float ang_damping);
582// =============================================================================== 582
583// =============================================================================== 583public override void SetLinearDamping(BulletBody obj, float lin_damping);
584// =============================================================================== 584
585// =============================================================================== 585public override void SetAngularDamping(BulletBody obj, float ang_damping);
586// =============================================================================== 586
587// =============================================================================== 587public override float GetLinearDamping(BulletBody obj);
588// =============================================================================== 588
589// =============================================================================== 589public override float GetAngularDamping(BulletBody obj);
590// =============================================================================== 590
591// =============================================================================== 591public override float GetLinearSleepingThreshold(BulletBody obj);
592// =============================================================================== 592
593// =============================================================================== 593
594static class BulletSimAPI { 594public override void ApplyDamping(BulletBody obj, float timeStep);
595// =============================================================================== 595
596// Link back to the managed code for outputting log messages 596public override void SetMassProps(BulletBody obj, float mass, Vector3 inertia);
597[UnmanagedFunctionPointer(CallingConvention.Cdecl)] 597
598public delegate void DebugLogCallback([MarshalAs(UnmanagedType.LPStr)]string msg); 598public override Vector3 GetLinearFactor(BulletBody obj);
599 599
600// =============================================================================== 600public override void SetLinearFactor(BulletBody obj, Vector3 factor);
601// Initialization and simulation 601
602[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 602public override void SetCenterOfMassByPosRot(BulletBody obj, Vector3 pos, Quaternion rot);
603public static extern IntPtr Initialize2(Vector3 maxPosition, IntPtr parms, 603
604 int maxCollisions, IntPtr collisionArray, 604// Add a force to the object as if its mass is one.
605 int maxUpdates, IntPtr updateArray, 605public override void ApplyCentralForce(BulletBody obj, Vector3 force);
606 DebugLogCallback logRoutine); 606
607 607// Set the force being applied to the object as if its mass is one.
608[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 608public override void SetObjectForce(BulletBody obj, Vector3 force);
609public static extern bool UpdateParameter2(IntPtr world, uint localID, String parm, float value); 609
610 610public override Vector3 GetTotalForce(BulletBody obj);
611[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 611
612public static extern void SetHeightMap2(IntPtr world, float[] heightmap); 612public override Vector3 GetTotalTorque(BulletBody obj);
613 613
614[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 614public override Vector3 GetInvInertiaDiagLocal(BulletBody obj);
615public static extern void Shutdown2(IntPtr sim); 615
616 616public override void SetInvInertiaDiagLocal(BulletBody obj, Vector3 inert);
617[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 617
618public static extern int PhysicsStep2(IntPtr world, float timeStep, int maxSubSteps, float fixedTimeStep, 618public override void SetSleepingThresholds(BulletBody obj, float lin_threshold, float ang_threshold);
619 out int updatedEntityCount, 619
620 out IntPtr updatedEntitiesPtr, 620public override void ApplyTorque(BulletBody obj, Vector3 torque);
621 out int collidersCount, 621
622 out IntPtr collidersPtr); 622// Apply force at the given point. Will add torque to the object.
623 623public override void ApplyForce(BulletBody obj, Vector3 force, Vector3 pos);
624[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 624
625public static extern bool PushUpdate2(IntPtr obj); 625// Apply impulse to the object. Same as "ApplycentralForce" but force scaled by object's mass.
626 626public override void ApplyCentralImpulse(BulletBody obj, Vector3 imp);
627// ===================================================================================== 627
628// Terrain creation and helper routines 628// Apply impulse to the object's torque. Force is scaled by object's mass.
629[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 629public override void ApplyTorqueImpulse(BulletBody obj, Vector3 imp);
630public static extern IntPtr CreateHeightMapInfo2(IntPtr sim, uint id, Vector3 minCoords, Vector3 maxCoords, 630
631 [MarshalAs(UnmanagedType.LPArray)] float[] heightMap, float collisionMargin); 631// Apply impulse at the point given. For is scaled by object's mass and effects both linear and angular forces.
632 632public override void ApplyImpulse(BulletBody obj, Vector3 imp, Vector3 pos);
633[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 633
634public static extern IntPtr FillHeightMapInfo2(IntPtr sim, IntPtr mapInfo, uint id, Vector3 minCoords, Vector3 maxCoords, 634public override void ClearForces(BulletBody obj);
635 [MarshalAs(UnmanagedType.LPArray)] float[] heightMap, float collisionMargin); 635
636 636public override void ClearAllForces(BulletBody obj);
637[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 637
638public static extern bool ReleaseHeightMapInfo2(IntPtr heightMapInfo); 638public override void UpdateInertiaTensor(BulletBody obj);
639 639
640[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 640public override Vector3 GetLinearVelocity(BulletBody obj);
641public static extern IntPtr CreateGroundPlaneShape2(uint id, float height, float collisionMargin); 641
642 642public override Vector3 GetAngularVelocity(BulletBody obj);
643[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 643
644public static extern IntPtr CreateTerrainShape2(IntPtr mapInfo); 644public override void SetLinearVelocity(BulletBody obj, Vector3 val);
645 645
646// ===================================================================================== 646public override void SetAngularVelocity(BulletBody obj, Vector3 angularVelocity);
647// Constraint creation and helper routines 647
648[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 648public override Vector3 GetVelocityInLocalPoint(BulletBody obj, Vector3 pos);
649public static extern IntPtr Create6DofConstraint2(IntPtr world, IntPtr obj1, IntPtr obj2, 649
650 Vector3 frame1loc, Quaternion frame1rot, 650public override void Translate(BulletBody obj, Vector3 trans);
651 Vector3 frame2loc, Quaternion frame2rot, 651
652 bool useLinearReferenceFrameA, bool disableCollisionsBetweenLinkedBodies); 652public override void UpdateDeactivation(BulletBody obj, float timeStep);
653 653
654[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 654public override bool WantsSleeping(BulletBody obj);
655public static extern IntPtr Create6DofConstraintToPoint2(IntPtr world, IntPtr obj1, IntPtr obj2, 655
656 Vector3 joinPoint, 656public override void SetAngularFactor(BulletBody obj, float factor);
657 bool useLinearReferenceFrameA, bool disableCollisionsBetweenLinkedBodies); 657
658 658public override void SetAngularFactorV(BulletBody obj, Vector3 factor);
659[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 659
660public static extern IntPtr CreateHingeConstraint2(IntPtr world, IntPtr obj1, IntPtr obj2, 660public override Vector3 GetAngularFactor(BulletBody obj);
661 Vector3 pivotinA, Vector3 pivotinB, 661
662 Vector3 axisInA, Vector3 axisInB, 662public override bool IsInWorld(BulletBody obj);
663 bool useLinearReferenceFrameA, bool disableCollisionsBetweenLinkedBodies); 663
664 664public override void AddConstraintRef(BulletBody obj, BulletConstraint constrain);
665[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 665
666public static extern void SetConstraintEnable2(IntPtr constrain, float numericTrueFalse); 666public override void RemoveConstraintRef(BulletBody obj, BulletConstraint constrain);
667 667
668[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 668public override BulletConstraint GetConstraintRef(BulletBody obj, int index);
669public static extern void SetConstraintNumSolverIterations2(IntPtr constrain, float iterations); 669
670 670public override int GetNumConstraintRefs(BulletBody obj);
671[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 671
672public static extern bool SetFrames2(IntPtr constrain, 672public override bool SetCollisionGroupMask(BulletBody body, uint filter, uint mask);
673 Vector3 frameA, Quaternion frameArot, Vector3 frameB, Quaternion frameBrot); 673
674 674// =====================================================================================
675[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 675// btCollisionShape entries
676public static extern bool SetLinearLimits2(IntPtr constrain, Vector3 low, Vector3 hi); 676
677 677public override float GetAngularMotionDisc(BulletShape shape);
678[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 678
679public static extern bool SetAngularLimits2(IntPtr constrain, Vector3 low, Vector3 hi); 679public override float GetContactBreakingThreshold(BulletShape shape, float defaultFactor);
680 680
681[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 681public override bool IsPolyhedral(BulletShape shape);
682public static extern bool UseFrameOffset2(IntPtr constrain, float enable); 682
683 683public override bool IsConvex2d(BulletShape shape);
684[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 684
685public static extern bool TranslationalLimitMotor2(IntPtr constrain, float enable, float targetVel, float maxMotorForce); 685public override bool IsConvex(BulletShape shape);
686 686
687[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 687public override bool IsNonMoving(BulletShape shape);
688public static extern bool SetBreakingImpulseThreshold2(IntPtr constrain, float threshold); 688
689 689public override bool IsConcave(BulletShape shape);
690[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 690
691public static extern bool CalculateTransforms2(IntPtr constrain); 691public override bool IsCompound(BulletShape shape);
692 692
693[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 693public override bool IsSoftBody(BulletShape shape);
694public static extern bool SetConstraintParam2(IntPtr constrain, ConstraintParams paramIndex, float value, ConstraintParamAxis axis); 694
695 695public override bool IsInfinite(BulletShape shape);
696[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 696
697public static extern bool DestroyConstraint2(IntPtr world, IntPtr constrain); 697public override void SetLocalScaling(BulletShape shape, Vector3 scale);
698 698
699// ===================================================================================== 699public override Vector3 GetLocalScaling(BulletShape shape);
700// btCollisionWorld entries 700
701[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 701public override Vector3 CalculateLocalInertia(BulletShape shape, float mass);
702public static extern void UpdateSingleAabb2(IntPtr world, IntPtr obj); 702
703 703public override int GetShapeType(BulletShape shape);
704[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 704
705public static extern void UpdateAabbs2(IntPtr world); 705public override void SetMargin(BulletShape shape, float val);
706 706
707[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 707public override float GetMargin(BulletShape shape);
708public static extern bool GetForceUpdateAllAabbs2(IntPtr world); 708 */
709 709
710[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 710static class BSAPICPP
711public static extern void SetForceUpdateAllAabbs2(IntPtr world, bool force); 711{
712 712// =====================================================================================
713// ===================================================================================== 713// Mesh, hull, shape and body creation helper routines
714// btDynamicsWorld entries 714[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
715[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 715public static extern IntPtr CreateMeshShape2(IntPtr world,
716public static extern bool AddObjectToWorld2(IntPtr world, IntPtr obj); 716 int indicesCount, [MarshalAs(UnmanagedType.LPArray)] int[] indices,
717 717 int verticesCount, [MarshalAs(UnmanagedType.LPArray)] float[] vertices );
718[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 718
719public static extern bool RemoveObjectFromWorld2(IntPtr world, IntPtr obj); 719[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
720 720public static extern IntPtr CreateHullShape2(IntPtr world,
721[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 721 int hullCount, [MarshalAs(UnmanagedType.LPArray)] float[] hulls);
722public static extern bool AddConstraintToWorld2(IntPtr world, IntPtr constrain, bool disableCollisionsBetweenLinkedObjects); 722
723 723[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
724[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 724public static extern IntPtr BuildHullShapeFromMesh2(IntPtr world, IntPtr meshShape);
725public static extern bool RemoveConstraintFromWorld2(IntPtr world, IntPtr constrain); 725
726// ===================================================================================== 726[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
727// btCollisionObject entries 727public static extern IntPtr BuildNativeShape2(IntPtr world, ShapeData shapeData);
728[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 728
729public static extern Vector3 GetAnisotripicFriction2(IntPtr constrain); 729[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
730 730public static extern bool IsNativeShape2(IntPtr shape);
731[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 731
732public static extern Vector3 SetAnisotripicFriction2(IntPtr constrain, Vector3 frict); 732[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
733 733public static extern void SetShapeCollisionMargin2(IntPtr shape, float margin);
734[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 734
735public static extern bool HasAnisotripicFriction2(IntPtr constrain); 735[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
736 736public static extern IntPtr BuildCapsuleShape2(IntPtr world, float radius, float height, Vector3 scale);
737[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 737
738public static extern void SetContactProcessingThreshold2(IntPtr obj, float val); 738[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
739 739public static extern IntPtr CreateCompoundShape2(IntPtr sim, bool enableDynamicAabbTree);
740[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 740
741public static extern float GetContactProcessingThreshold2(IntPtr obj); 741[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
742 742public static extern int GetNumberOfCompoundChildren2(IntPtr cShape);
743[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 743
744public static extern bool IsStaticObject2(IntPtr obj); 744[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
745 745public static extern void AddChildShapeToCompoundShape2(IntPtr cShape, IntPtr addShape, Vector3 pos, Quaternion rot);
746[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 746
747public static extern bool IsKinematicObject2(IntPtr obj); 747[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
748 748public static extern IntPtr GetChildShapeFromCompoundShapeIndex2(IntPtr cShape, int indx);
749[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 749
750public static extern bool IsStaticOrKinematicObject2(IntPtr obj); 750[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
751 751public static extern IntPtr RemoveChildShapeFromCompoundShapeIndex2(IntPtr cShape, int indx);
752[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 752
753public static extern bool HasContactResponse2(IntPtr obj); 753[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
754 754public static extern void RemoveChildShapeFromCompoundShape2(IntPtr cShape, IntPtr removeShape);
755[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 755
756public static extern void SetCollisionShape2(IntPtr sim, IntPtr obj, IntPtr shape); 756[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
757 757public static extern void RecalculateCompoundShapeLocalAabb2(IntPtr cShape);
758[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 758
759public static extern IntPtr GetCollisionShape2(IntPtr obj); 759[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
760 760public static extern IntPtr DuplicateCollisionShape2(IntPtr sim, IntPtr srcShape, uint id);
761[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 761
762public static extern int GetActivationState2(IntPtr obj); 762[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
763 763public static extern IntPtr CreateBodyFromShapeAndInfo2(IntPtr sim, IntPtr shape, uint id, IntPtr constructionInfo);
764[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 764
765public static extern void SetActivationState2(IntPtr obj, int state); 765[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
766 766public static extern bool DeleteCollisionShape2(IntPtr world, IntPtr shape);
767[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 767
768public static extern void SetDeactivationTime2(IntPtr obj, float dtime); 768[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
769 769public static extern int GetBodyType2(IntPtr obj);
770[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 770
771public static extern float GetDeactivationTime2(IntPtr obj); 771[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
772 772public static extern IntPtr CreateBodyFromShape2(IntPtr sim, IntPtr shape, uint id, Vector3 pos, Quaternion rot);
773[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 773
774public static extern void ForceActivationState2(IntPtr obj, ActivationState state); 774[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
775 775public static extern IntPtr CreateBodyWithDefaultMotionState2(IntPtr shape, uint id, Vector3 pos, Quaternion rot);
776[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 776
777public static extern void Activate2(IntPtr obj, bool forceActivation); 777[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
778 778public static extern IntPtr CreateGhostFromShape2(IntPtr sim, IntPtr shape, uint id, Vector3 pos, Quaternion rot);
779[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 779
780public static extern bool IsActive2(IntPtr obj); 780[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
781 781public static extern IntPtr AllocateBodyInfo2(IntPtr obj);
782[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 782
783public static extern void SetRestitution2(IntPtr obj, float val); 783[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
784 784public static extern void ReleaseBodyInfo2(IntPtr obj);
785[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 785
786public static extern float GetRestitution2(IntPtr obj); 786[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
787 787public static extern void DestroyObject2(IntPtr sim, IntPtr obj);
788[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 788
789public static extern void SetFriction2(IntPtr obj, float val); 789// =====================================================================================
790 790// Terrain creation and helper routines
791[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 791[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
792public static extern float GetFriction2(IntPtr obj); 792public static extern IntPtr CreateHeightMapInfo2(IntPtr sim, uint id, Vector3 minCoords, Vector3 maxCoords,
793 793 [MarshalAs(UnmanagedType.LPArray)] float[] heightMap, float collisionMargin);
794 /* Haven't defined the type 'Transform' 794
795[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 795[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
796public static extern Transform GetWorldTransform2(IntPtr obj); 796public static extern IntPtr FillHeightMapInfo2(IntPtr sim, IntPtr mapInfo, uint id, Vector3 minCoords, Vector3 maxCoords,
797 797 [MarshalAs(UnmanagedType.LPArray)] float[] heightMap, float collisionMargin);
798[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 798
799public static extern void setWorldTransform2(IntPtr obj, Transform trans); 799[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
800 */ 800public static extern bool ReleaseHeightMapInfo2(IntPtr heightMapInfo);
801 801
802[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 802[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
803public static extern Vector3 GetPosition2(IntPtr obj); 803public static extern IntPtr CreateGroundPlaneShape2(uint id, float height, float collisionMargin);
804 804
805[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 805[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
806public static extern Quaternion GetOrientation2(IntPtr obj); 806public static extern IntPtr CreateTerrainShape2(IntPtr mapInfo);
807 807
808[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 808// =====================================================================================
809public static extern void SetTranslation2(IntPtr obj, Vector3 position, Quaternion rotation); 809// Constraint creation and helper routines
810 810[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
811[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 811public static extern IntPtr Create6DofConstraint2(IntPtr world, IntPtr obj1, IntPtr obj2,
812public static extern IntPtr GetBroadphaseHandle2(IntPtr obj); 812 Vector3 frame1loc, Quaternion frame1rot,
813 813 Vector3 frame2loc, Quaternion frame2rot,
814[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 814 bool useLinearReferenceFrameA, bool disableCollisionsBetweenLinkedBodies);
815public static extern void SetBroadphaseHandle2(IntPtr obj, IntPtr handle); 815
816 816[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
817 /* 817public static extern IntPtr Create6DofConstraintToPoint2(IntPtr world, IntPtr obj1, IntPtr obj2,
818[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 818 Vector3 joinPoint,
819public static extern Transform GetInterpolationWorldTransform2(IntPtr obj); 819 bool useLinearReferenceFrameA, bool disableCollisionsBetweenLinkedBodies);
820 820
821[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 821[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
822public static extern void SetInterpolationWorldTransform2(IntPtr obj, Transform trans); 822public static extern IntPtr CreateHingeConstraint2(IntPtr world, IntPtr obj1, IntPtr obj2,
823 */ 823 Vector3 pivotinA, Vector3 pivotinB,
824 824 Vector3 axisInA, Vector3 axisInB,
825[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 825 bool useLinearReferenceFrameA, bool disableCollisionsBetweenLinkedBodies);
826public static extern void SetInterpolationLinearVelocity2(IntPtr obj, Vector3 vel); 826
827 827[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
828[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 828public static extern void SetConstraintEnable2(IntPtr constrain, float numericTrueFalse);
829public static extern void SetInterpolationAngularVelocity2(IntPtr obj, Vector3 vel); 829
830 830[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
831[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 831public static extern void SetConstraintNumSolverIterations2(IntPtr constrain, float iterations);
832public static extern void SetInterpolationVelocity2(IntPtr obj, Vector3 linearVel, Vector3 angularVel); 832
833 833[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
834[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 834public static extern bool SetFrames2(IntPtr constrain,
835public static extern float GetHitFraction2(IntPtr obj); 835 Vector3 frameA, Quaternion frameArot, Vector3 frameB, Quaternion frameBrot);
836 836
837[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 837[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
838public static extern void SetHitFraction2(IntPtr obj, float val); 838public static extern bool SetLinearLimits2(IntPtr constrain, Vector3 low, Vector3 hi);
839 839
840[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 840[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
841public static extern CollisionFlags GetCollisionFlags2(IntPtr obj); 841public static extern bool SetAngularLimits2(IntPtr constrain, Vector3 low, Vector3 hi);
842 842
843[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 843[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
844public static extern CollisionFlags SetCollisionFlags2(IntPtr obj, CollisionFlags flags); 844public static extern bool UseFrameOffset2(IntPtr constrain, float enable);
845 845
846[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 846[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
847public static extern CollisionFlags AddToCollisionFlags2(IntPtr obj, CollisionFlags flags); 847public static extern bool TranslationalLimitMotor2(IntPtr constrain, float enable, float targetVel, float maxMotorForce);
848 848
849[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 849[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
850public static extern CollisionFlags RemoveFromCollisionFlags2(IntPtr obj, CollisionFlags flags); 850public static extern bool SetBreakingImpulseThreshold2(IntPtr constrain, float threshold);
851 851
852[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 852[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
853public static extern float GetCcdMotionThreshold2(IntPtr obj); 853public static extern bool CalculateTransforms2(IntPtr constrain);
854 854
855[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 855[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
856public static extern void SetCcdMotionThreshold2(IntPtr obj, float val); 856public static extern bool SetConstraintParam2(IntPtr constrain, ConstraintParams paramIndex, float value, ConstraintParamAxis axis);
857 857
858[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 858[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
859public static extern float GetCcdSweptSphereRadius2(IntPtr obj); 859public static extern bool DestroyConstraint2(IntPtr world, IntPtr constrain);
860 860
861[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 861// =====================================================================================
862public static extern void SetCcdSweptSphereRadius2(IntPtr obj, float val); 862// btCollisionWorld entries
863 863[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
864[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 864public static extern void UpdateSingleAabb2(IntPtr world, IntPtr obj);
865public static extern IntPtr GetUserPointer2(IntPtr obj); 865
866 866[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
867[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 867public static extern void UpdateAabbs2(IntPtr world);
868public static extern void SetUserPointer2(IntPtr obj, IntPtr val); 868
869 869[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
870// ===================================================================================== 870public static extern bool GetForceUpdateAllAabbs2(IntPtr world);
871// btRigidBody entries 871
872[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 872[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
873public static extern void ApplyGravity2(IntPtr obj); 873public static extern void SetForceUpdateAllAabbs2(IntPtr world, bool force);
874 874
875[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 875// =====================================================================================
876public static extern void SetGravity2(IntPtr obj, Vector3 val); 876// btDynamicsWorld entries
877 877[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
878[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 878public static extern bool AddObjectToWorld2(IntPtr world, IntPtr obj);
879public static extern Vector3 GetGravity2(IntPtr obj); 879
880 880[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
881[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 881public static extern bool RemoveObjectFromWorld2(IntPtr world, IntPtr obj);
882public static extern void SetDamping2(IntPtr obj, float lin_damping, float ang_damping); 882
883 883[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
884[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 884public static extern bool AddConstraintToWorld2(IntPtr world, IntPtr constrain, bool disableCollisionsBetweenLinkedObjects);
885public static extern void SetLinearDamping2(IntPtr obj, float lin_damping); 885
886 886[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
887[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 887public static extern bool RemoveConstraintFromWorld2(IntPtr world, IntPtr constrain);
888public static extern void SetAngularDamping2(IntPtr obj, float ang_damping); 888// =====================================================================================
889 889// btCollisionObject entries
890[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 890[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
891public static extern float GetLinearDamping2(IntPtr obj); 891public static extern Vector3 GetAnisotripicFriction2(IntPtr constrain);
892 892
893[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 893[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
894public static extern float GetAngularDamping2(IntPtr obj); 894public static extern Vector3 SetAnisotripicFriction2(IntPtr constrain, Vector3 frict);
895 895
896[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 896[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
897public static extern float GetLinearSleepingThreshold2(IntPtr obj); 897public static extern bool HasAnisotripicFriction2(IntPtr constrain);
898 898
899[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 899[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
900public static extern float GetAngularSleepingThreshold2(IntPtr obj); 900public static extern void SetContactProcessingThreshold2(IntPtr obj, float val);
901 901
902[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 902[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
903public static extern void ApplyDamping2(IntPtr obj, float timeStep); 903public static extern float GetContactProcessingThreshold2(IntPtr obj);
904 904
905[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 905[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
906public static extern void SetMassProps2(IntPtr obj, float mass, Vector3 inertia); 906public static extern bool IsStaticObject2(IntPtr obj);
907 907
908[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 908[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
909public static extern Vector3 GetLinearFactor2(IntPtr obj); 909public static extern bool IsKinematicObject2(IntPtr obj);
910 910
911[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 911[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
912public static extern void SetLinearFactor2(IntPtr obj, Vector3 factor); 912public static extern bool IsStaticOrKinematicObject2(IntPtr obj);
913 913
914 /* 914[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
915[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 915public static extern bool HasContactResponse2(IntPtr obj);
916public static extern void SetCenterOfMassTransform2(IntPtr obj, Transform trans); 916
917 */ 917[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
918 918public static extern void SetCollisionShape2(IntPtr sim, IntPtr obj, IntPtr shape);
919[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 919
920public static extern void SetCenterOfMassByPosRot2(IntPtr obj, Vector3 pos, Quaternion rot); 920[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
921 921public static extern IntPtr GetCollisionShape2(IntPtr obj);
922// Add a force to the object as if its mass is one. 922
923[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 923[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
924public static extern void ApplyCentralForce2(IntPtr obj, Vector3 force); 924public static extern int GetActivationState2(IntPtr obj);
925 925
926// Set the force being applied to the object as if its mass is one. 926[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
927[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 927public static extern void SetActivationState2(IntPtr obj, int state);
928public static extern void SetObjectForce2(IntPtr obj, Vector3 force); 928
929 929[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
930[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 930public static extern void SetDeactivationTime2(IntPtr obj, float dtime);
931public static extern Vector3 GetTotalForce2(IntPtr obj); 931
932 932[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
933[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 933public static extern float GetDeactivationTime2(IntPtr obj);
934public static extern Vector3 GetTotalTorque2(IntPtr obj); 934
935 935[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
936[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 936public static extern void ForceActivationState2(IntPtr obj, ActivationState state);
937public static extern Vector3 GetInvInertiaDiagLocal2(IntPtr obj); 937
938 938[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
939[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 939public static extern void Activate2(IntPtr obj, bool forceActivation);
940public static extern void SetInvInertiaDiagLocal2(IntPtr obj, Vector3 inert); 940
941 941[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
942[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 942public static extern bool IsActive2(IntPtr obj);
943public static extern void SetSleepingThresholds2(IntPtr obj, float lin_threshold, float ang_threshold); 943
944 944[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
945[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 945public static extern void SetRestitution2(IntPtr obj, float val);
946public static extern void ApplyTorque2(IntPtr obj, Vector3 torque); 946
947 947[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
948// Apply force at the given point. Will add torque to the object. 948public static extern float GetRestitution2(IntPtr obj);
949[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 949
950public static extern void ApplyForce2(IntPtr obj, Vector3 force, Vector3 pos); 950[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
951 951public static extern void SetFriction2(IntPtr obj, float val);
952// Apply impulse to the object. Same as "ApplycentralForce" but force scaled by object's mass. 952
953[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 953[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
954public static extern void ApplyCentralImpulse2(IntPtr obj, Vector3 imp); 954public static extern float GetFriction2(IntPtr obj);
955 955
956// Apply impulse to the object's torque. Force is scaled by object's mass. 956 /* Haven't defined the type 'Transform'
957[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 957[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
958public static extern void ApplyTorqueImpulse2(IntPtr obj, Vector3 imp); 958public static extern Transform GetWorldTransform2(IntPtr obj);
959 959
960// Apply impulse at the point given. For is scaled by object's mass and effects both linear and angular forces. 960[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
961[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 961public static extern void setWorldTransform2(IntPtr obj, Transform trans);
962public static extern void ApplyImpulse2(IntPtr obj, Vector3 imp, Vector3 pos); 962 */
963 963
964[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 964[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
965public static extern void ClearForces2(IntPtr obj); 965public static extern Vector3 GetPosition2(IntPtr obj);
966 966
967[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 967[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
968public static extern void ClearAllForces2(IntPtr obj); 968public static extern Quaternion GetOrientation2(IntPtr obj);
969 969
970[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 970[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
971public static extern void UpdateInertiaTensor2(IntPtr obj); 971public static extern void SetTranslation2(IntPtr obj, Vector3 position, Quaternion rotation);
972 972
973[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 973[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
974public static extern Vector3 GetCenterOfMassPosition2(IntPtr obj); 974public static extern IntPtr GetBroadphaseHandle2(IntPtr obj);
975 975
976 /* 976[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
977[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 977public static extern void SetBroadphaseHandle2(IntPtr obj, IntPtr handle);
978public static extern Transform GetCenterOfMassTransform2(IntPtr obj); 978
979 */ 979 /*
980 980[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
981[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 981public static extern Transform GetInterpolationWorldTransform2(IntPtr obj);
982public static extern Vector3 GetLinearVelocity2(IntPtr obj); 982
983 983[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
984[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 984public static extern void SetInterpolationWorldTransform2(IntPtr obj, Transform trans);
985public static extern Vector3 GetAngularVelocity2(IntPtr obj); 985 */
986 986
987[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 987[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
988public static extern void SetLinearVelocity2(IntPtr obj, Vector3 val); 988public static extern void SetInterpolationLinearVelocity2(IntPtr obj, Vector3 vel);
989 989
990[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 990[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
991public static extern void SetAngularVelocity2(IntPtr obj, Vector3 angularVelocity); 991public static extern void SetInterpolationAngularVelocity2(IntPtr obj, Vector3 vel);
992 992
993[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 993[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
994public static extern Vector3 GetVelocityInLocalPoint2(IntPtr obj, Vector3 pos); 994public static extern void SetInterpolationVelocity2(IntPtr obj, Vector3 linearVel, Vector3 angularVel);
995 995
996[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 996[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
997public static extern void Translate2(IntPtr obj, Vector3 trans); 997public static extern float GetHitFraction2(IntPtr obj);
998 998
999[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 999[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
1000public static extern void UpdateDeactivation2(IntPtr obj, float timeStep); 1000public static extern void SetHitFraction2(IntPtr obj, float val);
1001 1001
1002[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 1002[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
1003public static extern bool WantsSleeping2(IntPtr obj); 1003public static extern CollisionFlags GetCollisionFlags2(IntPtr obj);
1004 1004
1005[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 1005[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
1006public static extern void SetAngularFactor2(IntPtr obj, float factor); 1006public static extern CollisionFlags SetCollisionFlags2(IntPtr obj, CollisionFlags flags);
1007 1007
1008[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 1008[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
1009public static extern void SetAngularFactorV2(IntPtr obj, Vector3 factor); 1009public static extern CollisionFlags AddToCollisionFlags2(IntPtr obj, CollisionFlags flags);
1010 1010
1011[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 1011[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
1012public static extern Vector3 GetAngularFactor2(IntPtr obj); 1012public static extern CollisionFlags RemoveFromCollisionFlags2(IntPtr obj, CollisionFlags flags);
1013 1013
1014[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 1014[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
1015public static extern bool IsInWorld2(IntPtr obj); 1015public static extern float GetCcdMotionThreshold2(IntPtr obj);
1016 1016
1017[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 1017[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
1018public static extern void AddConstraintRef2(IntPtr obj, IntPtr constrain); 1018public static extern void SetCcdMotionThreshold2(IntPtr obj, float val);
1019 1019
1020[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 1020[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
1021public static extern void RemoveConstraintRef2(IntPtr obj, IntPtr constrain); 1021public static extern float GetCcdSweptSphereRadius2(IntPtr obj);
1022 1022
1023[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 1023[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
1024public static extern IntPtr GetConstraintRef2(IntPtr obj, int index); 1024public static extern void SetCcdSweptSphereRadius2(IntPtr obj, float val);
1025 1025
1026[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 1026[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
1027public static extern int GetNumConstraintRefs2(IntPtr obj); 1027public static extern IntPtr GetUserPointer2(IntPtr obj);
1028 1028
1029[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 1029[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
1030public static extern bool SetCollisionGroupMask2(IntPtr body, uint filter, uint mask); 1030public static extern void SetUserPointer2(IntPtr obj, IntPtr val);
1031 1031
1032// ===================================================================================== 1032}
1033// btCollisionShape entries 1033}
1034 1034
1035[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 1035// ===============================================================================
1036public static extern float GetAngularMotionDisc2(IntPtr shape); 1036// ===============================================================================
1037 1037// ===============================================================================
1038[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 1038// ===============================================================================
1039public static extern float GetContactBreakingThreshold2(IntPtr shape, float defaultFactor); 1039// ===============================================================================
1040 1040// ===============================================================================
1041[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 1041// ===============================================================================
1042public static extern bool IsPolyhedral2(IntPtr shape); 1042// ===============================================================================
1043 1043// ===============================================================================
1044[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 1044// ===============================================================================
1045public static extern bool IsConvex2d2(IntPtr shape); 1045// ===============================================================================
1046 1046// ===============================================================================
1047[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 1047// ===============================================================================
1048public static extern bool IsConvex2(IntPtr shape); 1048static class BulletSimAPI {
1049 1049// ===============================================================================
1050[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 1050// Link back to the managed code for outputting log messages
1051public static extern bool IsNonMoving2(IntPtr shape); 1051[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
1052 1052public delegate void DebugLogCallback([MarshalAs(UnmanagedType.LPStr)]string msg);
1053[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 1053
1054public static extern bool IsConcave2(IntPtr shape); 1054// ===============================================================================
1055 1055// Initialization and simulation
1056[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 1056[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
1057public static extern bool IsCompound2(IntPtr shape); 1057public static extern IntPtr Initialize2(Vector3 maxPosition, IntPtr parms,
1058 1058 int maxCollisions, IntPtr collisionArray,
1059[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 1059 int maxUpdates, IntPtr updateArray,
1060public static extern bool IsSoftBody2(IntPtr shape); 1060 DebugLogCallback logRoutine);
1061 1061
1062[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 1062[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
1063public static extern bool IsInfinite2(IntPtr shape); 1063public static extern bool UpdateParameter2(IntPtr world, uint localID, String parm, float value);
1064 1064
1065[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 1065[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
1066public static extern void SetLocalScaling2(IntPtr shape, Vector3 scale); 1066public static extern void SetHeightMap2(IntPtr world, float[] heightmap);
1067 1067
1068[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 1068[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
1069public static extern Vector3 GetLocalScaling2(IntPtr shape); 1069public static extern void Shutdown2(IntPtr sim);
1070 1070
1071[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 1071[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
1072public static extern Vector3 CalculateLocalInertia2(IntPtr shape, float mass); 1072public static extern int PhysicsStep2(IntPtr world, float timeStep, int maxSubSteps, float fixedTimeStep,
1073 1073 out int updatedEntityCount,
1074[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 1074 out IntPtr updatedEntitiesPtr,
1075public static extern int GetShapeType2(IntPtr shape); 1075 out int collidersCount,
1076 1076 out IntPtr collidersPtr);
1077[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 1077
1078public static extern void SetMargin2(IntPtr shape, float val); 1078[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
1079 1079public static extern bool PushUpdate2(IntPtr obj);
1080[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 1080
1081public static extern float GetMargin2(IntPtr shape); 1081// =====================================================================================
1082 1082// btRigidBody entries
1083// ===================================================================================== 1083[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
1084// Debugging 1084public static extern void ApplyGravity2(IntPtr obj);
1085[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 1085
1086public static extern void DumpRigidBody2(IntPtr sim, IntPtr collisionObject); 1086[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
1087 1087public static extern void SetGravity2(IntPtr obj, Vector3 val);
1088[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 1088
1089public static extern void DumpCollisionShape2(IntPtr sim, IntPtr collisionShape); 1089[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
1090 1090public static extern Vector3 GetGravity2(IntPtr obj);
1091[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 1091
1092public static extern void DumpMapInfo2(IntPtr sim, IntPtr manInfo); 1092[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
1093 1093public static extern void SetDamping2(IntPtr obj, float lin_damping, float ang_damping);
1094[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 1094
1095public static extern void DumpConstraint2(IntPtr sim, IntPtr constrain); 1095[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
1096 1096public static extern void SetLinearDamping2(IntPtr obj, float lin_damping);
1097[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 1097
1098public static extern void DumpActivationInfo2(IntPtr sim); 1098[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
1099 1099public static extern void SetAngularDamping2(IntPtr obj, float ang_damping);
1100[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 1100
1101public static extern void DumpAllInfo2(IntPtr sim); 1101[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
1102 1102public static extern float GetLinearDamping2(IntPtr obj);
1103[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 1103
1104public static extern void DumpPhysicsStatistics2(IntPtr sim); 1104[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
1105 1105public static extern float GetAngularDamping2(IntPtr obj);
1106} 1106
1107} 1107[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
1108public static extern float GetLinearSleepingThreshold2(IntPtr obj);
1109
1110[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
1111public static extern float GetAngularSleepingThreshold2(IntPtr obj);
1112
1113[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
1114public static extern void ApplyDamping2(IntPtr obj, float timeStep);
1115
1116[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
1117public static extern void SetMassProps2(IntPtr obj, float mass, Vector3 inertia);
1118
1119[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
1120public static extern Vector3 GetLinearFactor2(IntPtr obj);
1121
1122[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
1123public static extern void SetLinearFactor2(IntPtr obj, Vector3 factor);
1124
1125 /*
1126[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
1127public static extern void SetCenterOfMassTransform2(IntPtr obj, Transform trans);
1128 */
1129
1130[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
1131public static extern void SetCenterOfMassByPosRot2(IntPtr obj, Vector3 pos, Quaternion rot);
1132
1133// Add a force to the object as if its mass is one.
1134[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
1135public static extern void ApplyCentralForce2(IntPtr obj, Vector3 force);
1136
1137// Set the force being applied to the object as if its mass is one.
1138[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
1139public static extern void SetObjectForce2(IntPtr obj, Vector3 force);
1140
1141[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
1142public static extern Vector3 GetTotalForce2(IntPtr obj);
1143
1144[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
1145public static extern Vector3 GetTotalTorque2(IntPtr obj);
1146
1147[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
1148public static extern Vector3 GetInvInertiaDiagLocal2(IntPtr obj);
1149
1150[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
1151public static extern void SetInvInertiaDiagLocal2(IntPtr obj, Vector3 inert);
1152
1153[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
1154public static extern void SetSleepingThresholds2(IntPtr obj, float lin_threshold, float ang_threshold);
1155
1156[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
1157public static extern void ApplyTorque2(IntPtr obj, Vector3 torque);
1158
1159// Apply force at the given point. Will add torque to the object.
1160[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
1161public static extern void ApplyForce2(IntPtr obj, Vector3 force, Vector3 pos);
1162
1163// Apply impulse to the object. Same as "ApplycentralForce" but force scaled by object's mass.
1164[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
1165public static extern void ApplyCentralImpulse2(IntPtr obj, Vector3 imp);
1166
1167// Apply impulse to the object's torque. Force is scaled by object's mass.
1168[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
1169public static extern void ApplyTorqueImpulse2(IntPtr obj, Vector3 imp);
1170
1171// Apply impulse at the point given. For is scaled by object's mass and effects both linear and angular forces.
1172[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
1173public static extern void ApplyImpulse2(IntPtr obj, Vector3 imp, Vector3 pos);
1174
1175[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
1176public static extern void ClearForces2(IntPtr obj);
1177
1178[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
1179public static extern void ClearAllForces2(IntPtr obj);
1180
1181[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
1182public static extern void UpdateInertiaTensor2(IntPtr obj);
1183
1184[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
1185public static extern Vector3 GetCenterOfMassPosition2(IntPtr obj);
1186
1187 /*
1188[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
1189public static extern Transform GetCenterOfMassTransform2(IntPtr obj);
1190 */
1191
1192[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
1193public static extern Vector3 GetLinearVelocity2(IntPtr obj);
1194
1195[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
1196public static extern Vector3 GetAngularVelocity2(IntPtr obj);
1197
1198[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
1199public static extern void SetLinearVelocity2(IntPtr obj, Vector3 val);
1200
1201[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
1202public static extern void SetAngularVelocity2(IntPtr obj, Vector3 angularVelocity);
1203
1204[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
1205public static extern Vector3 GetVelocityInLocalPoint2(IntPtr obj, Vector3 pos);
1206
1207[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
1208public static extern void Translate2(IntPtr obj, Vector3 trans);
1209
1210[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
1211public static extern void UpdateDeactivation2(IntPtr obj, float timeStep);
1212
1213[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
1214public static extern bool WantsSleeping2(IntPtr obj);
1215
1216[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
1217public static extern void SetAngularFactor2(IntPtr obj, float factor);
1218
1219[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
1220public static extern void SetAngularFactorV2(IntPtr obj, Vector3 factor);
1221
1222[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
1223public static extern Vector3 GetAngularFactor2(IntPtr obj);
1224
1225[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
1226public static extern bool IsInWorld2(IntPtr obj);
1227
1228[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
1229public static extern void AddConstraintRef2(IntPtr obj, IntPtr constrain);
1230
1231[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
1232public static extern void RemoveConstraintRef2(IntPtr obj, IntPtr constrain);
1233
1234[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
1235public static extern IntPtr GetConstraintRef2(IntPtr obj, int index);
1236
1237[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
1238public static extern int GetNumConstraintRefs2(IntPtr obj);
1239
1240[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
1241public static extern bool SetCollisionGroupMask2(IntPtr body, uint filter, uint mask);
1242
1243// =====================================================================================
1244// btCollisionShape entries
1245
1246[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
1247public static extern float GetAngularMotionDisc2(IntPtr shape);
1248
1249[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
1250public static extern float GetContactBreakingThreshold2(IntPtr shape, float defaultFactor);
1251
1252[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
1253public static extern bool IsPolyhedral2(IntPtr shape);
1254
1255[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
1256public static extern bool IsConvex2d2(IntPtr shape);
1257
1258[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
1259public static extern bool IsConvex2(IntPtr shape);
1260
1261[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
1262public static extern bool IsNonMoving2(IntPtr shape);
1263
1264[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
1265public static extern bool IsConcave2(IntPtr shape);
1266
1267[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
1268public static extern bool IsCompound2(IntPtr shape);
1269
1270[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
1271public static extern bool IsSoftBody2(IntPtr shape);
1272
1273[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
1274public static extern bool IsInfinite2(IntPtr shape);
1275
1276[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
1277public static extern void SetLocalScaling2(IntPtr shape, Vector3 scale);
1278
1279[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
1280public static extern Vector3 GetLocalScaling2(IntPtr shape);
1281
1282[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
1283public static extern Vector3 CalculateLocalInertia2(IntPtr shape, float mass);
1284
1285[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
1286public static extern int GetShapeType2(IntPtr shape);
1287
1288[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
1289public static extern void SetMargin2(IntPtr shape, float val);
1290
1291[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
1292public static extern float GetMargin2(IntPtr shape);
1293
1294// =====================================================================================
1295// Debugging
1296[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
1297public static extern void DumpRigidBody2(IntPtr sim, IntPtr collisionObject);
1298
1299[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
1300public static extern void DumpCollisionShape2(IntPtr sim, IntPtr collisionShape);
1301
1302[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
1303public static extern void DumpMapInfo2(IntPtr sim, IntPtr manInfo);
1304
1305[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
1306public static extern void DumpConstraint2(IntPtr sim, IntPtr constrain);
1307
1308[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
1309public static extern void DumpActivationInfo2(IntPtr sim);
1310
1311[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
1312public static extern void DumpAllInfo2(IntPtr sim);
1313
1314[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
1315public static extern void DumpPhysicsStatistics2(IntPtr sim);
1316
1317}
1318}