diff options
Diffstat (limited to '')
-rwxr-xr-x | OpenSim/Region/Physics/BulletSPlugin/BSAPIUnman.cs | 2425 |
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 | */ |
27 | using System; | 27 | using System; |
28 | using System.Collections.Generic; | 28 | using System.Collections.Generic; |
29 | using System.Runtime.InteropServices; | 29 | using System.Runtime.InteropServices; |
30 | using System.Security; | 30 | using System.Security; |
31 | using System.Text; | 31 | using System.Text; |
32 | 32 | ||
33 | using OpenMetaverse; | 33 | using OpenMetaverse; |
34 | 34 | ||
35 | namespace OpenSim.Region.Physics.BulletSPlugin | 35 | namespace OpenSim.Region.Physics.BulletSPlugin |
36 | { | 36 | { |
37 | public sealed class BSAPIUnman : BulletSimAPITemplate | 37 | public sealed class BSAPIUnman : BulletSimAPITemplate |
38 | { | 38 | { |
39 | /* | 39 | /* |
40 | // Initialization and simulation | 40 | // Initialization and simulation |
41 | public BulletWorld Initialize(Vector3 maxPosition, IntPtr parms, | 41 | public 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 | ||
46 | public bool UpdateParameter(BulletWorld world, uint localID, String parm, float value); | 46 | public bool UpdateParameter(BulletWorld world, uint localID, String parm, float value); |
47 | 47 | ||
48 | public void SetHeightMap(BulletWorld world, float[] heightmap); | 48 | public void SetHeightMap(BulletWorld world, float[] heightmap); |
49 | 49 | ||
50 | public void Shutdown(BulletWorld sim); | 50 | public void Shutdown(BulletWorld sim); |
51 | 51 | ||
52 | public int PhysicsStep(BulletWorld world, float timeStep, int maxSubSteps, float fixedTimeStep, | 52 | public 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 | ||
58 | public bool PushUpdate(BulletBody obj); | 58 | public 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 |
63 | public override BulletShape CreateMeshShape(BulletWorld world, | 63 | public 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 | ||
72 | public override BulletShape CreateHullShape(BulletWorld world, int hullCount, float[] hulls) | 72 | public 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 | ||
79 | public override BulletShape BuildHullShapeFromMesh(BulletWorld world, BulletShape meshShape) | 79 | public 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 | ||
86 | public override BulletShape BuildNativeShape( BulletWorld world, ShapeData shapeData) | 86 | public 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 | ||
93 | public override bool IsNativeShape(BulletShape shape) | 93 | public 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 | ||
100 | public override void SetShapeCollisionMargin(BulletShape shape, float margin) | 100 | public 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 | ||
106 | public override BulletShape BuildCapsuleShape(BulletWorld world, float radius, float height, Vector3 scale) | 106 | public 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 | ||
113 | public override BulletShape CreateCompoundShape(BulletWorld sim, bool enableDynamicAabbTree) | 113 | public 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 | ||
121 | public override int GetNumberOfCompoundChildren(BulletShape shape) | 121 | public 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 | ||
128 | public override void AddChildShapeToCompoundShape(BulletShape cShape, BulletShape addShape, Vector3 pos, Quaternion rot) | 128 | public 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 | ||
133 | public override BulletShape GetChildShapeFromCompoundShapeIndex(BulletShape cShape, int indx) | 133 | public 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 | ||
138 | public override BulletShape RemoveChildShapeFromCompoundShapeIndex(BulletShape cShape, int indx) | 138 | public 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 | ||
143 | public override void RemoveChildShapeFromCompoundShape(BulletShape cShape, BulletShape removeShape) | 143 | public 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 | ||
148 | public override void RecalculateCompoundShapeLocalAabb(BulletShape cShape) | 148 | public override void RecalculateCompoundShapeLocalAabb(BulletShape cShape) |
149 | { | 149 | { |
150 | BSAPI.RecalculateCompoundShapeLocalAabb2(cShape.ptr); | 150 | BSAPICPP.RecalculateCompoundShapeLocalAabb2(cShape.ptr); |
151 | } | 151 | } |
152 | 152 | ||
153 | public override BulletShape DuplicateCollisionShape(BulletWorld sim, BulletShape srcShape, uint id) | 153 | public 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 | ||
158 | public override BulletBody CreateBodyFromShapeAndInfo(BulletWorld sim, BulletShape shape, uint id, IntPtr constructionInfo) | 158 | public 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 | ||
163 | public override bool DeleteCollisionShape(BulletWorld world, BulletShape shape) | 163 | public 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 | ||
168 | public override int GetBodyType(BulletBody obj) | 168 | public override int GetBodyType(BulletBody obj) |
169 | { | 169 | { |
170 | return BSAPI.GetBodyType2(obj.ptr); | 170 | return BSAPICPP.GetBodyType2(obj.ptr); |
171 | } | 171 | } |
172 | 172 | ||
173 | public override BulletBody CreateBodyFromShape(BulletWorld sim, BulletShape shape, uint id, Vector3 pos, Quaternion rot) | 173 | public 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 | ||
178 | public override BulletBody CreateBodyWithDefaultMotionState(BulletShape shape, uint id, Vector3 pos, Quaternion rot) | 178 | public 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 | ||
183 | public override BulletBody CreateGhostFromShape(BulletWorld sim, BulletShape shape, uint id, Vector3 pos, Quaternion rot) | 183 | public 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 | ||
188 | public override IntPtr AllocateBodyInfo(BulletBody obj) | 188 | public override IntPtr AllocateBodyInfo(BulletBody obj) |
189 | { | 189 | { |
190 | return BSAPI.AllocateBodyInfo2(obj.ptr); | 190 | return BSAPICPP.AllocateBodyInfo2(obj.ptr); |
191 | } | 191 | } |
192 | 192 | ||
193 | public override void ReleaseBodyInfo(IntPtr obj) | 193 | public override void ReleaseBodyInfo(IntPtr obj) |
194 | { | 194 | { |
195 | BSAPI.ReleaseBodyInfo2(obj); | 195 | BSAPICPP.ReleaseBodyInfo2(obj); |
196 | } | 196 | } |
197 | 197 | ||
198 | public override void DestroyObject(BulletWorld sim, BulletBody obj) | 198 | public 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 | 205 | public override IntPtr CreateHeightMapInfo(BulletWorld sim, uint id, Vector3 minCoords, Vector3 maxCoords, |
206 | public 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); | |
209 | public override IntPtr FillHeightMapInfo(BulletWorld sim, IntPtr mapInfo, uint id, Vector3 minCoords, Vector3 maxCoords, | 209 | } |
210 | [MarshalAs(UnmanagedType.LPArray)] float[] heightMap, float collisionMargin); | 210 | |
211 | 211 | public override IntPtr FillHeightMapInfo(BulletWorld sim, IntPtr mapInfo, uint id, Vector3 minCoords, Vector3 maxCoords, | |
212 | public override bool ReleaseHeightMapInfo(IntPtr heightMapInfo); | 212 | float[] heightMap, float collisionMargin) |
213 | 213 | { | |
214 | public override BulletBody CreateGroundPlaneShape(uint id, float height, float collisionMargin); | 214 | return BSAPICPP.FillHeightMapInfo2(sim.ptr, mapInfo, id, minCoords, maxCoords, heightMap, collisionMargin); |
215 | 215 | } | |
216 | public override BulletBody CreateTerrainShape(IntPtr mapInfo); | 216 | |
217 | 217 | public override bool ReleaseHeightMapInfo(IntPtr heightMapInfo) | |
218 | // ===================================================================================== | 218 | { |
219 | // Constraint creation and helper routines | 219 | return BSAPICPP.ReleaseHeightMapInfo2(heightMapInfo); |
220 | public override BulletConstraint Create6DofConstraint(BulletWorld world, BulletBody obj1, BulletBody obj2, | 220 | } |
221 | Vector3 frame1loc, Quaternion frame1rot, | 221 | |
222 | Vector3 frame2loc, Quaternion frame2rot, | 222 | public 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); | |
225 | public override BulletConstraint Create6DofConstraintToPoint(BulletWorld world, BulletBody obj1, BulletBody obj2, | 225 | } |
226 | Vector3 joinPoint, | 226 | |
227 | bool useLinearReferenceFrameA, bool disableCollisionsBetweenLinkedBodies); | 227 | public override BulletShape CreateTerrainShape(IntPtr mapInfo) |
228 | 228 | { | |
229 | public 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 | |
234 | public override void SetConstraintEnable(BulletConstraint constrain, float numericTrueFalse); | 234 | public override BulletConstraint Create6DofConstraint(BulletWorld world, BulletBody obj1, BulletBody obj2, |
235 | 235 | Vector3 frame1loc, Quaternion frame1rot, | |
236 | public override void SetConstraintNumSolverIterations(BulletConstraint constrain, float iterations); | 236 | Vector3 frame2loc, Quaternion frame2rot, |
237 | 237 | bool useLinearReferenceFrameA, bool disableCollisionsBetweenLinkedBodies) | |
238 | public 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)); | |
241 | public override bool SetLinearLimits(BulletConstraint constrain, Vector3 low, Vector3 hi); | 241 | } |
242 | 242 | ||
243 | public override bool SetAngularLimits(BulletConstraint constrain, Vector3 low, Vector3 hi); | 243 | public override BulletConstraint Create6DofConstraintToPoint(BulletWorld world, BulletBody obj1, BulletBody obj2, |
244 | 244 | Vector3 joinPoint, | |
245 | public override bool UseFrameOffset(BulletConstraint constrain, float enable); | 245 | bool useLinearReferenceFrameA, bool disableCollisionsBetweenLinkedBodies) |
246 | 246 | { | |
247 | public 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)); | |
249 | public override bool SetBreakingImpulseThreshold(BulletConstraint constrain, float threshold); | 249 | } |
250 | 250 | ||
251 | public override bool CalculateTransforms(BulletConstraint constrain); | 251 | public override BulletConstraint CreateHingeConstraint(BulletWorld world, BulletBody obj1, BulletBody obj2, |
252 | 252 | Vector3 pivotinA, Vector3 pivotinB, | |
253 | public override bool SetConstraintParam(BulletConstraint constrain, ConstraintParams paramIndex, float value, ConstraintParamAxis axis); | 253 | Vector3 axisInA, Vector3 axisInB, |
254 | 254 | bool useLinearReferenceFrameA, bool disableCollisionsBetweenLinkedBodies) | |
255 | public 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 | } |
259 | public override void UpdateSingleAabb(BulletWorld world, BulletBody obj); | 259 | |
260 | 260 | public override void SetConstraintEnable(BulletConstraint constrain, float numericTrueFalse) | |
261 | public override void UpdateAabbs(BulletWorld world); | 261 | { |
262 | 262 | BSAPICPP.SetConstraintEnable2(constrain.ptr, numericTrueFalse); | |
263 | public override bool GetForceUpdateAllAabbs(BulletWorld world); | 263 | } |
264 | 264 | ||
265 | public override void SetForceUpdateAllAabbs(BulletWorld world, bool force); | 265 | public override void SetConstraintNumSolverIterations(BulletConstraint constrain, float iterations) |
266 | 266 | { | |
267 | // ===================================================================================== | 267 | BSAPICPP.SetConstraintNumSolverIterations2(constrain.ptr, iterations); |
268 | // btDynamicsWorld entries | 268 | } |
269 | public override bool AddObjectToWorld(BulletWorld world, BulletBody obj); | 269 | |
270 | 270 | public override bool SetFrames(BulletConstraint constrain, | |
271 | public override bool RemoveObjectFromWorld(BulletWorld world, BulletBody obj); | 271 | Vector3 frameA, Quaternion frameArot, Vector3 frameB, Quaternion frameBrot) |
272 | 272 | { | |
273 | public override bool AddConstraintToWorld(BulletWorld world, BulletConstraint constrain, bool disableCollisionsBetweenLinkedObjects); | 273 | return BSAPICPP.SetFrames2(constrain.ptr, frameA, frameArot, frameB, frameBrot); |
274 | 274 | } | |
275 | public override bool RemoveConstraintFromWorld(BulletWorld world, BulletConstraint constrain); | 275 | |
276 | // ===================================================================================== | 276 | public override bool SetLinearLimits(BulletConstraint constrain, Vector3 low, Vector3 hi) |
277 | // btCollisionObject entries | 277 | { |
278 | public override Vector3 GetAnisotripicFriction(BulletConstraint constrain); | 278 | return BSAPICPP.SetLinearLimits2(constrain.ptr, low, hi); |
279 | 279 | } | |
280 | public override Vector3 SetAnisotripicFriction(BulletConstraint constrain, Vector3 frict); | 280 | |
281 | 281 | public override bool SetAngularLimits(BulletConstraint constrain, Vector3 low, Vector3 hi) | |
282 | public override bool HasAnisotripicFriction(BulletConstraint constrain); | 282 | { |
283 | 283 | return BSAPICPP.SetAngularLimits2(constrain.ptr, low, hi); | |
284 | public override void SetContactProcessingThreshold(BulletBody obj, float val); | 284 | } |
285 | 285 | ||
286 | public override float GetContactProcessingThreshold(BulletBody obj); | 286 | public override bool UseFrameOffset(BulletConstraint constrain, float enable) |
287 | 287 | { | |
288 | public override bool IsStaticObject(BulletBody obj); | 288 | return BSAPICPP.UseFrameOffset2(constrain.ptr, enable); |
289 | 289 | } | |
290 | public override bool IsKinematicObject(BulletBody obj); | 290 | |
291 | 291 | public override bool TranslationalLimitMotor(BulletConstraint constrain, float enable, float targetVel, float maxMotorForce) | |
292 | public override bool IsStaticOrKinematicObject(BulletBody obj); | 292 | { |
293 | 293 | return BSAPICPP.TranslationalLimitMotor2(constrain.ptr, enable, targetVel, maxMotorForce); | |
294 | public override bool HasContactResponse(BulletBody obj); | 294 | } |
295 | 295 | ||
296 | public override void SetCollisionShape(BulletWorld sim, BulletBody obj, BulletBody shape); | 296 | public override bool SetBreakingImpulseThreshold(BulletConstraint constrain, float threshold) |
297 | 297 | { | |
298 | public override BulletShape GetCollisionShape(BulletBody obj); | 298 | return BSAPICPP.SetBreakingImpulseThreshold2(constrain.ptr, threshold); |
299 | 299 | } | |
300 | public override int GetActivationState(BulletBody obj); | 300 | |
301 | 301 | public override bool CalculateTransforms(BulletConstraint constrain) | |
302 | public override void SetActivationState(BulletBody obj, int state); | 302 | { |
303 | 303 | return BSAPICPP.CalculateTransforms2(constrain.ptr); | |
304 | public override void SetDeactivationTime(BulletBody obj, float dtime); | 304 | } |
305 | 305 | ||
306 | public override float GetDeactivationTime(BulletBody obj); | 306 | public override bool SetConstraintParam(BulletConstraint constrain, ConstraintParams paramIndex, float value, ConstraintParamAxis axis) |
307 | 307 | { | |
308 | public override void ForceActivationState(BulletBody obj, ActivationState state); | 308 | return BSAPICPP.SetConstraintParam2(constrain.ptr, paramIndex, value, axis); |
309 | 309 | } | |
310 | public override void Activate(BulletBody obj, bool forceActivation); | 310 | |
311 | 311 | public override bool DestroyConstraint(BulletWorld world, BulletConstraint constrain) | |
312 | public override bool IsActive(BulletBody obj); | 312 | { |
313 | 313 | return BSAPICPP.DestroyConstraint2(world.ptr, constrain.ptr); | |
314 | public override void SetRestitution(BulletBody obj, float val); | 314 | } |
315 | 315 | ||
316 | public override float GetRestitution(BulletBody obj); | 316 | // ===================================================================================== |
317 | 317 | // btCollisionWorld entries | |
318 | public override void SetFriction(BulletBody obj, float val); | 318 | public override void UpdateSingleAabb(BulletWorld world, BulletBody obj) |
319 | 319 | { | |
320 | public override float GetFriction(BulletBody obj); | 320 | BSAPICPP.UpdateSingleAabb2(world.ptr, obj.ptr); |
321 | 321 | } | |
322 | public override Vector3 GetPosition(BulletBody obj); | 322 | |
323 | 323 | public override void UpdateAabbs(BulletWorld world) | |
324 | public override Quaternion GetOrientation(BulletBody obj); | 324 | { |
325 | 325 | BSAPICPP.UpdateAabbs2(world.ptr); | |
326 | public override void SetTranslation(BulletBody obj, Vector3 position, Quaternion rotation); | 326 | } |
327 | 327 | ||
328 | public override IntPtr GetBroadphaseHandle(BulletBody obj); | 328 | public override bool GetForceUpdateAllAabbs(BulletWorld world) |
329 | 329 | { | |
330 | public override void SetBroadphaseHandle(BulletBody obj, IntPtr handle); | 330 | return BSAPICPP.GetForceUpdateAllAabbs2(world.ptr); |
331 | 331 | } | |
332 | public override void SetInterpolationLinearVelocity(BulletBody obj, Vector3 vel); | 332 | |
333 | 333 | public override void SetForceUpdateAllAabbs(BulletWorld world, bool force) | |
334 | public override void SetInterpolationAngularVelocity(BulletBody obj, Vector3 vel); | 334 | { |
335 | 335 | BSAPICPP.SetForceUpdateAllAabbs2(world.ptr, force); | |
336 | public override void SetInterpolationVelocity(BulletBody obj, Vector3 linearVel, Vector3 angularVel); | 336 | } |
337 | 337 | ||
338 | public override float GetHitFraction(BulletBody obj); | 338 | // ===================================================================================== |
339 | 339 | // btDynamicsWorld entries | |
340 | public override void SetHitFraction(BulletBody obj, float val); | 340 | public override bool AddObjectToWorld(BulletWorld world, BulletBody obj) |
341 | 341 | { | |
342 | public override CollisionFlags GetCollisionFlags(BulletBody obj); | 342 | return BSAPICPP.AddObjectToWorld2(world.ptr, obj.ptr); |
343 | 343 | } | |
344 | public override CollisionFlags SetCollisionFlags(BulletBody obj, CollisionFlags flags); | 344 | |
345 | 345 | public override bool RemoveObjectFromWorld(BulletWorld world, BulletBody obj) | |
346 | public override CollisionFlags AddToCollisionFlags(BulletBody obj, CollisionFlags flags); | 346 | { |
347 | 347 | return BSAPICPP.RemoveObjectFromWorld2(world.ptr, obj.ptr); | |
348 | public override CollisionFlags RemoveFromCollisionFlags(BulletBody obj, CollisionFlags flags); | 348 | } |
349 | 349 | ||
350 | public override float GetCcdMotionThreshold(BulletBody obj); | 350 | public override bool AddConstraintToWorld(BulletWorld world, BulletConstraint constrain, bool disableCollisionsBetweenLinkedObjects) |
351 | 351 | { | |
352 | public override void SetCcdMotionThreshold(BulletBody obj, float val); | 352 | return BSAPICPP.AddConstraintToWorld2(world.ptr, constrain.ptr, disableCollisionsBetweenLinkedObjects); |
353 | 353 | } | |
354 | public override float GetCcdSweptSphereRadius(BulletBody obj); | 354 | |
355 | 355 | public override bool RemoveConstraintFromWorld(BulletWorld world, BulletConstraint constrain) | |
356 | public override void SetCcdSweptSphereRadius(BulletBody obj, float val); | 356 | { |
357 | 357 | return BSAPICPP.RemoveConstraintFromWorld2(world.ptr, constrain.ptr); | |
358 | public override IntPtr GetUserPointer(BulletBody obj); | 358 | } |
359 | 359 | // ===================================================================================== | |
360 | public override void SetUserPointer(BulletBody obj, IntPtr val); | 360 | // btCollisionObject entries |
361 | 361 | public override Vector3 GetAnisotripicFriction(BulletConstraint constrain) | |
362 | // ===================================================================================== | 362 | { |
363 | // btRigidBody entries | 363 | return BSAPICPP.GetAnisotripicFriction2(constrain.ptr); |
364 | public override void ApplyGravity(BulletBody obj); | 364 | } |
365 | 365 | ||
366 | public override void SetGravity(BulletBody obj, Vector3 val); | 366 | public override Vector3 SetAnisotripicFriction(BulletConstraint constrain, Vector3 frict) |
367 | 367 | { | |
368 | public override Vector3 GetGravity(BulletBody obj); | 368 | return BSAPICPP.SetAnisotripicFriction2(constrain.ptr, frict); |
369 | 369 | } | |
370 | public override void SetDamping(BulletBody obj, float lin_damping, float ang_damping); | 370 | |
371 | 371 | public override bool HasAnisotripicFriction(BulletConstraint constrain) | |
372 | public override void SetLinearDamping(BulletBody obj, float lin_damping); | 372 | { |
373 | 373 | return BSAPICPP.HasAnisotripicFriction2(constrain.ptr); | |
374 | public override void SetAngularDamping(BulletBody obj, float ang_damping); | 374 | } |
375 | 375 | ||
376 | public override float GetLinearDamping(BulletBody obj); | 376 | public override void SetContactProcessingThreshold(BulletBody obj, float val) |
377 | 377 | { | |
378 | public override float GetAngularDamping(BulletBody obj); | 378 | BSAPICPP.SetContactProcessingThreshold2(obj.ptr, val); |
379 | 379 | } | |
380 | public override float GetLinearSleepingThreshold(BulletBody obj); | 380 | |
381 | 381 | public override float GetContactProcessingThreshold(BulletBody obj) | |
382 | 382 | { | |
383 | public override void ApplyDamping(BulletBody obj, float timeStep); | 383 | return BSAPICPP.GetContactProcessingThreshold2(obj.ptr); |
384 | 384 | } | |
385 | public override void SetMassProps(BulletBody obj, float mass, Vector3 inertia); | 385 | |
386 | 386 | public override bool IsStaticObject(BulletBody obj) | |
387 | public override Vector3 GetLinearFactor(BulletBody obj); | 387 | { |
388 | 388 | return BSAPICPP.IsStaticObject2(obj.ptr); | |
389 | public override void SetLinearFactor(BulletBody obj, Vector3 factor); | 389 | } |
390 | 390 | ||
391 | public override void SetCenterOfMassByPosRot(BulletBody obj, Vector3 pos, Quaternion rot); | 391 | public 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); |
394 | public 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. | 396 | public override bool IsStaticOrKinematicObject(BulletBody obj) |
397 | public override void SetObjectForce(BulletBody obj, Vector3 force); | 397 | { |
398 | 398 | return BSAPICPP.IsStaticOrKinematicObject2(obj.ptr); | |
399 | public override Vector3 GetTotalForce(BulletBody obj); | 399 | } |
400 | 400 | ||
401 | public override Vector3 GetTotalTorque(BulletBody obj); | 401 | public override bool HasContactResponse(BulletBody obj) |
402 | 402 | { | |
403 | public override Vector3 GetInvInertiaDiagLocal(BulletBody obj); | 403 | return BSAPICPP.HasContactResponse2(obj.ptr); |
404 | 404 | } | |
405 | public override void SetInvInertiaDiagLocal(BulletBody obj, Vector3 inert); | 405 | |
406 | 406 | public override void SetCollisionShape(BulletWorld sim, BulletBody obj, BulletShape shape) | |
407 | public override void SetSleepingThresholds(BulletBody obj, float lin_threshold, float ang_threshold); | 407 | { |
408 | 408 | BSAPICPP.SetCollisionShape2(sim.ptr, obj.ptr, shape.ptr); | |
409 | public override void ApplyTorque(BulletBody obj, Vector3 torque); | 409 | } |
410 | 410 | ||
411 | // Apply force at the given point. Will add torque to the object. | 411 | public override BulletShape GetCollisionShape(BulletBody obj) |
412 | public 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 | } |
415 | public override void ApplyCentralImpulse(BulletBody obj, Vector3 imp); | 415 | |
416 | 416 | public override int GetActivationState(BulletBody obj) | |
417 | // Apply impulse to the object's torque. Force is scaled by object's mass. | 417 | { |
418 | public 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 | |
421 | public override void ApplyImpulse(BulletBody obj, Vector3 imp, Vector3 pos); | 421 | public override void SetActivationState(BulletBody obj, int state) |
422 | 422 | { | |
423 | public override void ClearForces(BulletBody obj); | 423 | BSAPICPP.SetActivationState2(obj.ptr, state); |
424 | 424 | } | |
425 | public override void ClearAllForces(BulletBody obj); | 425 | |
426 | 426 | public override void SetDeactivationTime(BulletBody obj, float dtime) | |
427 | public override void UpdateInertiaTensor(BulletBody obj); | 427 | { |
428 | 428 | BSAPICPP.SetDeactivationTime2(obj.ptr, dtime); | |
429 | public override Vector3 GetLinearVelocity(BulletBody obj); | 429 | } |
430 | 430 | ||
431 | public override Vector3 GetAngularVelocity(BulletBody obj); | 431 | public override float GetDeactivationTime(BulletBody obj) |
432 | 432 | { | |
433 | public override void SetLinearVelocity(BulletBody obj, Vector3 val); | 433 | return BSAPICPP.GetDeactivationTime2(obj.ptr); |
434 | 434 | } | |
435 | public override void SetAngularVelocity(BulletBody obj, Vector3 angularVelocity); | 435 | |
436 | 436 | public override void ForceActivationState(BulletBody obj, ActivationState state) | |
437 | public override Vector3 GetVelocityInLocalPoint(BulletBody obj, Vector3 pos); | 437 | { |
438 | 438 | BSAPICPP.ForceActivationState2(obj.ptr, state); | |
439 | public override void Translate(BulletBody obj, Vector3 trans); | 439 | } |
440 | 440 | ||
441 | public override void UpdateDeactivation(BulletBody obj, float timeStep); | 441 | public override void Activate(BulletBody obj, bool forceActivation) |
442 | 442 | { | |
443 | public override bool WantsSleeping(BulletBody obj); | 443 | BSAPICPP.Activate2(obj.ptr, forceActivation); |
444 | 444 | } | |
445 | public override void SetAngularFactor(BulletBody obj, float factor); | 445 | |
446 | 446 | public override bool IsActive(BulletBody obj) | |
447 | public override void SetAngularFactorV(BulletBody obj, Vector3 factor); | 447 | { |
448 | 448 | return BSAPICPP.IsActive2(obj.ptr); | |
449 | public override Vector3 GetAngularFactor(BulletBody obj); | 449 | } |
450 | 450 | ||
451 | public override bool IsInWorld(BulletBody obj); | 451 | public override void SetRestitution(BulletBody obj, float val) |
452 | 452 | { | |
453 | public override void AddConstraintRef(BulletBody obj, BulletConstraint constrain); | 453 | BSAPICPP.SetRestitution2(obj.ptr, val); |
454 | 454 | } | |
455 | public override void RemoveConstraintRef(BulletBody obj, BulletConstraint constrain); | 455 | |
456 | 456 | public override float GetRestitution(BulletBody obj) | |
457 | public override BulletConstraint GetConstraintRef(BulletBody obj, int index); | 457 | { |
458 | 458 | return BSAPICPP.GetRestitution2(obj.ptr); | |
459 | public override int GetNumConstraintRefs(BulletBody obj); | 459 | } |
460 | 460 | ||
461 | public override bool SetCollisionGroupMask(BulletBody body, uint filter, uint mask); | 461 | public override void SetFriction(BulletBody obj, float val) |
462 | 462 | { | |
463 | // ===================================================================================== | 463 | BSAPICPP.SetFriction2(obj.ptr, val); |
464 | // btCollisionShape entries | 464 | } |
465 | 465 | ||
466 | public override float GetAngularMotionDisc(BulletShape shape); | 466 | public override float GetFriction(BulletBody obj) |
467 | 467 | { | |
468 | public override float GetContactBreakingThreshold(BulletShape shape, float defaultFactor); | 468 | return BSAPICPP.GetFriction2(obj.ptr); |
469 | 469 | } | |
470 | public override bool IsPolyhedral(BulletShape shape); | 470 | |
471 | 471 | public override Vector3 GetPosition(BulletBody obj) | |
472 | public override bool IsConvex2d(BulletShape shape); | 472 | { |
473 | 473 | return BSAPICPP.GetPosition2(obj.ptr); | |
474 | public override bool IsConvex(BulletShape shape); | 474 | } |
475 | 475 | ||
476 | public override bool IsNonMoving(BulletShape shape); | 476 | public override Quaternion GetOrientation(BulletBody obj) |
477 | 477 | { | |
478 | public override bool IsConcave(BulletShape shape); | 478 | return BSAPICPP.GetOrientation2(obj.ptr); |
479 | 479 | } | |
480 | public override bool IsCompound(BulletShape shape); | 480 | |
481 | 481 | public override void SetTranslation(BulletBody obj, Vector3 position, Quaternion rotation) | |
482 | public override bool IsSoftBody(BulletShape shape); | 482 | { |
483 | 483 | BSAPICPP.SetTranslation2(obj.ptr, position, rotation); | |
484 | public override bool IsInfinite(BulletShape shape); | 484 | } |
485 | 485 | ||
486 | public override void SetLocalScaling(BulletShape shape, Vector3 scale); | 486 | public override IntPtr GetBroadphaseHandle(BulletBody obj) |
487 | 487 | { | |
488 | public override Vector3 GetLocalScaling(BulletShape shape); | 488 | return BSAPICPP.GetBroadphaseHandle2(obj.ptr); |
489 | 489 | } | |
490 | public override Vector3 CalculateLocalInertia(BulletShape shape, float mass); | 490 | |
491 | 491 | public override void SetBroadphaseHandle(BulletBody obj, IntPtr handle) | |
492 | public override int GetShapeType(BulletShape shape); | 492 | { |
493 | 493 | BSAPICPP.SetUserPointer2(obj.ptr, handle); | |
494 | public override void SetMargin(BulletShape shape, float val); | 494 | } |
495 | 495 | ||
496 | public override float GetMargin(BulletShape shape); | 496 | public override void SetInterpolationLinearVelocity(BulletBody obj, Vector3 vel) |
497 | */ | 497 | { |
498 | 498 | BSAPICPP.SetInterpolationLinearVelocity2(obj.ptr, vel); | |
499 | static class BSAPI | 499 | } |
500 | { | 500 | |
501 | // ===================================================================================== | 501 | public 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); |
504 | public static extern IntPtr CreateMeshShape2(IntPtr world, | 504 | } |
505 | int indicesCount, [MarshalAs(UnmanagedType.LPArray)] int[] indices, | 505 | |
506 | int verticesCount, [MarshalAs(UnmanagedType.LPArray)] float[] vertices ); | 506 | public 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); |
509 | public static extern IntPtr CreateHullShape2(IntPtr world, | 509 | } |
510 | int hullCount, [MarshalAs(UnmanagedType.LPArray)] float[] hulls); | 510 | |
511 | 511 | public override float GetHitFraction(BulletBody obj) | |
512 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 512 | { |
513 | public static extern IntPtr BuildHullShapeFromMesh2(IntPtr world, IntPtr meshShape); | 513 | return BSAPICPP.GetHitFraction2(obj.ptr); |
514 | 514 | } | |
515 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 515 | |
516 | public static extern IntPtr BuildNativeShape2(IntPtr world, ShapeData shapeData); | 516 | public override void SetHitFraction(BulletBody obj, float val) |
517 | 517 | { | |
518 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 518 | BSAPICPP.SetHitFraction2(obj.ptr, val); |
519 | public static extern bool IsNativeShape2(IntPtr shape); | 519 | } |
520 | 520 | ||
521 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 521 | public override CollisionFlags GetCollisionFlags(BulletBody obj) |
522 | public static extern void SetShapeCollisionMargin2(IntPtr shape, float margin); | 522 | { |
523 | 523 | return BSAPICPP.GetCollisionFlags2(obj.ptr); | |
524 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 524 | } |
525 | public static extern IntPtr BuildCapsuleShape2(IntPtr world, float radius, float height, Vector3 scale); | 525 | |
526 | 526 | public override CollisionFlags SetCollisionFlags(BulletBody obj, CollisionFlags flags) | |
527 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 527 | { |
528 | public 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 | |
531 | public static extern int GetNumberOfCompoundChildren2(IntPtr cShape); | 531 | public override CollisionFlags AddToCollisionFlags(BulletBody obj, CollisionFlags flags) |
532 | 532 | { | |
533 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 533 | return BSAPICPP.AddToCollisionFlags2(obj.ptr, flags); |
534 | public static extern void AddChildShapeToCompoundShape2(IntPtr cShape, IntPtr addShape, Vector3 pos, Quaternion rot); | 534 | } |
535 | 535 | ||
536 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 536 | public override CollisionFlags RemoveFromCollisionFlags(BulletBody obj, CollisionFlags flags) |
537 | public 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 | } |
540 | public static extern IntPtr RemoveChildShapeFromCompoundShapeIndex2(IntPtr cShape, int indx); | 540 | |
541 | 541 | public override float GetCcdMotionThreshold(BulletBody obj) | |
542 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 542 | { |
543 | public static extern void RemoveChildShapeFromCompoundShape2(IntPtr cShape, IntPtr removeShape); | 543 | return BSAPICPP.GetCcdMotionThreshold2(obj.ptr); |
544 | 544 | } | |
545 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 545 | |
546 | public static extern void RecalculateCompoundShapeLocalAabb2(IntPtr cShape); | 546 | |
547 | 547 | public override void SetCcdMotionThreshold(BulletBody obj, float val) | |
548 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 548 | { |
549 | public 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 | |
552 | public static extern IntPtr CreateBodyFromShapeAndInfo2(IntPtr sim, IntPtr shape, uint id, IntPtr constructionInfo); | 552 | public override float GetCcdSweptSphereRadius(BulletBody obj) |
553 | 553 | { | |
554 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 554 | return BSAPICPP.GetCcdSweptSphereRadius2(obj.ptr); |
555 | public static extern bool DeleteCollisionShape2(IntPtr world, IntPtr shape); | 555 | } |
556 | 556 | ||
557 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 557 | public override void SetCcdSweptSphereRadius(BulletBody obj, float val) |
558 | public static extern int GetBodyType2(IntPtr obj); | 558 | { |
559 | 559 | BSAPICPP.SetCcdSweptSphereRadius2(obj.ptr, val); | |
560 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 560 | } |
561 | public static extern IntPtr CreateBodyFromShape2(IntPtr sim, IntPtr shape, uint id, Vector3 pos, Quaternion rot); | 561 | |
562 | 562 | public override IntPtr GetUserPointer(BulletBody obj) | |
563 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 563 | { |
564 | public 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 | |
567 | public static extern IntPtr CreateGhostFromShape2(IntPtr sim, IntPtr shape, uint id, Vector3 pos, Quaternion rot); | 567 | public override void SetUserPointer(BulletBody obj, IntPtr val) |
568 | 568 | { | |
569 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 569 | BSAPICPP.SetUserPointer2(obj.ptr, val); |
570 | public static extern IntPtr AllocateBodyInfo2(IntPtr obj); | 570 | } |
571 | 571 | ||
572 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 572 | /* |
573 | public static extern void ReleaseBodyInfo2(IntPtr obj); | 573 | // ===================================================================================== |
574 | 574 | // btRigidBody entries | |
575 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 575 | public override void ApplyGravity(BulletBody obj); |
576 | public static extern void DestroyObject2(IntPtr sim, IntPtr obj); | 576 | |
577 | 577 | public override void SetGravity(BulletBody obj, Vector3 val); | |
578 | } | 578 | |
579 | } | 579 | public override Vector3 GetGravity(BulletBody obj); |
580 | 580 | ||
581 | // =============================================================================== | 581 | public override void SetDamping(BulletBody obj, float lin_damping, float ang_damping); |
582 | // =============================================================================== | 582 | |
583 | // =============================================================================== | 583 | public override void SetLinearDamping(BulletBody obj, float lin_damping); |
584 | // =============================================================================== | 584 | |
585 | // =============================================================================== | 585 | public override void SetAngularDamping(BulletBody obj, float ang_damping); |
586 | // =============================================================================== | 586 | |
587 | // =============================================================================== | 587 | public override float GetLinearDamping(BulletBody obj); |
588 | // =============================================================================== | 588 | |
589 | // =============================================================================== | 589 | public override float GetAngularDamping(BulletBody obj); |
590 | // =============================================================================== | 590 | |
591 | // =============================================================================== | 591 | public override float GetLinearSleepingThreshold(BulletBody obj); |
592 | // =============================================================================== | 592 | |
593 | // =============================================================================== | 593 | |
594 | static class BulletSimAPI { | 594 | public override void ApplyDamping(BulletBody obj, float timeStep); |
595 | // =============================================================================== | 595 | |
596 | // Link back to the managed code for outputting log messages | 596 | public override void SetMassProps(BulletBody obj, float mass, Vector3 inertia); |
597 | [UnmanagedFunctionPointer(CallingConvention.Cdecl)] | 597 | |
598 | public delegate void DebugLogCallback([MarshalAs(UnmanagedType.LPStr)]string msg); | 598 | public override Vector3 GetLinearFactor(BulletBody obj); |
599 | 599 | ||
600 | // =============================================================================== | 600 | public override void SetLinearFactor(BulletBody obj, Vector3 factor); |
601 | // Initialization and simulation | 601 | |
602 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 602 | public override void SetCenterOfMassByPosRot(BulletBody obj, Vector3 pos, Quaternion rot); |
603 | public 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, | 605 | public 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] | 608 | public override void SetObjectForce(BulletBody obj, Vector3 force); |
609 | public static extern bool UpdateParameter2(IntPtr world, uint localID, String parm, float value); | 609 | |
610 | 610 | public override Vector3 GetTotalForce(BulletBody obj); | |
611 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 611 | |
612 | public static extern void SetHeightMap2(IntPtr world, float[] heightmap); | 612 | public override Vector3 GetTotalTorque(BulletBody obj); |
613 | 613 | ||
614 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 614 | public override Vector3 GetInvInertiaDiagLocal(BulletBody obj); |
615 | public static extern void Shutdown2(IntPtr sim); | 615 | |
616 | 616 | public override void SetInvInertiaDiagLocal(BulletBody obj, Vector3 inert); | |
617 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 617 | |
618 | public static extern int PhysicsStep2(IntPtr world, float timeStep, int maxSubSteps, float fixedTimeStep, | 618 | public override void SetSleepingThresholds(BulletBody obj, float lin_threshold, float ang_threshold); |
619 | out int updatedEntityCount, | 619 | |
620 | out IntPtr updatedEntitiesPtr, | 620 | public 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 | 623 | public override void ApplyForce(BulletBody obj, Vector3 force, Vector3 pos); | |
624 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 624 | |
625 | public static extern bool PushUpdate2(IntPtr obj); | 625 | // Apply impulse to the object. Same as "ApplycentralForce" but force scaled by object's mass. |
626 | 626 | public 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] | 629 | public override void ApplyTorqueImpulse(BulletBody obj, Vector3 imp); |
630 | public 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 | 632 | public override void ApplyImpulse(BulletBody obj, Vector3 imp, Vector3 pos); | |
633 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 633 | |
634 | public static extern IntPtr FillHeightMapInfo2(IntPtr sim, IntPtr mapInfo, uint id, Vector3 minCoords, Vector3 maxCoords, | 634 | public override void ClearForces(BulletBody obj); |
635 | [MarshalAs(UnmanagedType.LPArray)] float[] heightMap, float collisionMargin); | 635 | |
636 | 636 | public override void ClearAllForces(BulletBody obj); | |
637 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 637 | |
638 | public static extern bool ReleaseHeightMapInfo2(IntPtr heightMapInfo); | 638 | public override void UpdateInertiaTensor(BulletBody obj); |
639 | 639 | ||
640 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 640 | public override Vector3 GetLinearVelocity(BulletBody obj); |
641 | public static extern IntPtr CreateGroundPlaneShape2(uint id, float height, float collisionMargin); | 641 | |
642 | 642 | public override Vector3 GetAngularVelocity(BulletBody obj); | |
643 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 643 | |
644 | public static extern IntPtr CreateTerrainShape2(IntPtr mapInfo); | 644 | public override void SetLinearVelocity(BulletBody obj, Vector3 val); |
645 | 645 | ||
646 | // ===================================================================================== | 646 | public override void SetAngularVelocity(BulletBody obj, Vector3 angularVelocity); |
647 | // Constraint creation and helper routines | 647 | |
648 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 648 | public override Vector3 GetVelocityInLocalPoint(BulletBody obj, Vector3 pos); |
649 | public static extern IntPtr Create6DofConstraint2(IntPtr world, IntPtr obj1, IntPtr obj2, | 649 | |
650 | Vector3 frame1loc, Quaternion frame1rot, | 650 | public override void Translate(BulletBody obj, Vector3 trans); |
651 | Vector3 frame2loc, Quaternion frame2rot, | 651 | |
652 | bool useLinearReferenceFrameA, bool disableCollisionsBetweenLinkedBodies); | 652 | public override void UpdateDeactivation(BulletBody obj, float timeStep); |
653 | 653 | ||
654 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 654 | public override bool WantsSleeping(BulletBody obj); |
655 | public static extern IntPtr Create6DofConstraintToPoint2(IntPtr world, IntPtr obj1, IntPtr obj2, | 655 | |
656 | Vector3 joinPoint, | 656 | public override void SetAngularFactor(BulletBody obj, float factor); |
657 | bool useLinearReferenceFrameA, bool disableCollisionsBetweenLinkedBodies); | 657 | |
658 | 658 | public override void SetAngularFactorV(BulletBody obj, Vector3 factor); | |
659 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 659 | |
660 | public static extern IntPtr CreateHingeConstraint2(IntPtr world, IntPtr obj1, IntPtr obj2, | 660 | public override Vector3 GetAngularFactor(BulletBody obj); |
661 | Vector3 pivotinA, Vector3 pivotinB, | 661 | |
662 | Vector3 axisInA, Vector3 axisInB, | 662 | public override bool IsInWorld(BulletBody obj); |
663 | bool useLinearReferenceFrameA, bool disableCollisionsBetweenLinkedBodies); | 663 | |
664 | 664 | public override void AddConstraintRef(BulletBody obj, BulletConstraint constrain); | |
665 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 665 | |
666 | public static extern void SetConstraintEnable2(IntPtr constrain, float numericTrueFalse); | 666 | public override void RemoveConstraintRef(BulletBody obj, BulletConstraint constrain); |
667 | 667 | ||
668 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 668 | public override BulletConstraint GetConstraintRef(BulletBody obj, int index); |
669 | public static extern void SetConstraintNumSolverIterations2(IntPtr constrain, float iterations); | 669 | |
670 | 670 | public override int GetNumConstraintRefs(BulletBody obj); | |
671 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 671 | |
672 | public static extern bool SetFrames2(IntPtr constrain, | 672 | public 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 |
676 | public static extern bool SetLinearLimits2(IntPtr constrain, Vector3 low, Vector3 hi); | 676 | |
677 | 677 | public override float GetAngularMotionDisc(BulletShape shape); | |
678 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 678 | |
679 | public static extern bool SetAngularLimits2(IntPtr constrain, Vector3 low, Vector3 hi); | 679 | public override float GetContactBreakingThreshold(BulletShape shape, float defaultFactor); |
680 | 680 | ||
681 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 681 | public override bool IsPolyhedral(BulletShape shape); |
682 | public static extern bool UseFrameOffset2(IntPtr constrain, float enable); | 682 | |
683 | 683 | public override bool IsConvex2d(BulletShape shape); | |
684 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 684 | |
685 | public static extern bool TranslationalLimitMotor2(IntPtr constrain, float enable, float targetVel, float maxMotorForce); | 685 | public override bool IsConvex(BulletShape shape); |
686 | 686 | ||
687 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 687 | public override bool IsNonMoving(BulletShape shape); |
688 | public static extern bool SetBreakingImpulseThreshold2(IntPtr constrain, float threshold); | 688 | |
689 | 689 | public override bool IsConcave(BulletShape shape); | |
690 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 690 | |
691 | public static extern bool CalculateTransforms2(IntPtr constrain); | 691 | public override bool IsCompound(BulletShape shape); |
692 | 692 | ||
693 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 693 | public override bool IsSoftBody(BulletShape shape); |
694 | public static extern bool SetConstraintParam2(IntPtr constrain, ConstraintParams paramIndex, float value, ConstraintParamAxis axis); | 694 | |
695 | 695 | public override bool IsInfinite(BulletShape shape); | |
696 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 696 | |
697 | public static extern bool DestroyConstraint2(IntPtr world, IntPtr constrain); | 697 | public override void SetLocalScaling(BulletShape shape, Vector3 scale); |
698 | 698 | ||
699 | // ===================================================================================== | 699 | public override Vector3 GetLocalScaling(BulletShape shape); |
700 | // btCollisionWorld entries | 700 | |
701 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 701 | public override Vector3 CalculateLocalInertia(BulletShape shape, float mass); |
702 | public static extern void UpdateSingleAabb2(IntPtr world, IntPtr obj); | 702 | |
703 | 703 | public override int GetShapeType(BulletShape shape); | |
704 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 704 | |
705 | public static extern void UpdateAabbs2(IntPtr world); | 705 | public override void SetMargin(BulletShape shape, float val); |
706 | 706 | ||
707 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 707 | public override float GetMargin(BulletShape shape); |
708 | public static extern bool GetForceUpdateAllAabbs2(IntPtr world); | 708 | */ |
709 | 709 | ||
710 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 710 | static class BSAPICPP |
711 | public 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] | 715 | public static extern IntPtr CreateMeshShape2(IntPtr world, |
716 | public 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 | |
719 | public static extern bool RemoveObjectFromWorld2(IntPtr world, IntPtr obj); | 719 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] |
720 | 720 | public static extern IntPtr CreateHullShape2(IntPtr world, | |
721 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 721 | int hullCount, [MarshalAs(UnmanagedType.LPArray)] float[] hulls); |
722 | public 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] | 724 | public static extern IntPtr BuildHullShapeFromMesh2(IntPtr world, IntPtr meshShape); |
725 | public static extern bool RemoveConstraintFromWorld2(IntPtr world, IntPtr constrain); | 725 | |
726 | // ===================================================================================== | 726 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] |
727 | // btCollisionObject entries | 727 | public static extern IntPtr BuildNativeShape2(IntPtr world, ShapeData shapeData); |
728 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 728 | |
729 | public static extern Vector3 GetAnisotripicFriction2(IntPtr constrain); | 729 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] |
730 | 730 | public static extern bool IsNativeShape2(IntPtr shape); | |
731 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 731 | |
732 | public static extern Vector3 SetAnisotripicFriction2(IntPtr constrain, Vector3 frict); | 732 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] |
733 | 733 | public static extern void SetShapeCollisionMargin2(IntPtr shape, float margin); | |
734 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 734 | |
735 | public static extern bool HasAnisotripicFriction2(IntPtr constrain); | 735 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] |
736 | 736 | public static extern IntPtr BuildCapsuleShape2(IntPtr world, float radius, float height, Vector3 scale); | |
737 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 737 | |
738 | public static extern void SetContactProcessingThreshold2(IntPtr obj, float val); | 738 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] |
739 | 739 | public static extern IntPtr CreateCompoundShape2(IntPtr sim, bool enableDynamicAabbTree); | |
740 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 740 | |
741 | public static extern float GetContactProcessingThreshold2(IntPtr obj); | 741 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] |
742 | 742 | public static extern int GetNumberOfCompoundChildren2(IntPtr cShape); | |
743 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 743 | |
744 | public static extern bool IsStaticObject2(IntPtr obj); | 744 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] |
745 | 745 | public static extern void AddChildShapeToCompoundShape2(IntPtr cShape, IntPtr addShape, Vector3 pos, Quaternion rot); | |
746 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 746 | |
747 | public static extern bool IsKinematicObject2(IntPtr obj); | 747 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] |
748 | 748 | public static extern IntPtr GetChildShapeFromCompoundShapeIndex2(IntPtr cShape, int indx); | |
749 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 749 | |
750 | public static extern bool IsStaticOrKinematicObject2(IntPtr obj); | 750 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] |
751 | 751 | public static extern IntPtr RemoveChildShapeFromCompoundShapeIndex2(IntPtr cShape, int indx); | |
752 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 752 | |
753 | public static extern bool HasContactResponse2(IntPtr obj); | 753 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] |
754 | 754 | public static extern void RemoveChildShapeFromCompoundShape2(IntPtr cShape, IntPtr removeShape); | |
755 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 755 | |
756 | public static extern void SetCollisionShape2(IntPtr sim, IntPtr obj, IntPtr shape); | 756 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] |
757 | 757 | public static extern void RecalculateCompoundShapeLocalAabb2(IntPtr cShape); | |
758 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 758 | |
759 | public static extern IntPtr GetCollisionShape2(IntPtr obj); | 759 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] |
760 | 760 | public static extern IntPtr DuplicateCollisionShape2(IntPtr sim, IntPtr srcShape, uint id); | |
761 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 761 | |
762 | public static extern int GetActivationState2(IntPtr obj); | 762 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] |
763 | 763 | public static extern IntPtr CreateBodyFromShapeAndInfo2(IntPtr sim, IntPtr shape, uint id, IntPtr constructionInfo); | |
764 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 764 | |
765 | public static extern void SetActivationState2(IntPtr obj, int state); | 765 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] |
766 | 766 | public static extern bool DeleteCollisionShape2(IntPtr world, IntPtr shape); | |
767 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 767 | |
768 | public static extern void SetDeactivationTime2(IntPtr obj, float dtime); | 768 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] |
769 | 769 | public static extern int GetBodyType2(IntPtr obj); | |
770 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 770 | |
771 | public static extern float GetDeactivationTime2(IntPtr obj); | 771 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] |
772 | 772 | public static extern IntPtr CreateBodyFromShape2(IntPtr sim, IntPtr shape, uint id, Vector3 pos, Quaternion rot); | |
773 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 773 | |
774 | public static extern void ForceActivationState2(IntPtr obj, ActivationState state); | 774 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] |
775 | 775 | public static extern IntPtr CreateBodyWithDefaultMotionState2(IntPtr shape, uint id, Vector3 pos, Quaternion rot); | |
776 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 776 | |
777 | public static extern void Activate2(IntPtr obj, bool forceActivation); | 777 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] |
778 | 778 | public static extern IntPtr CreateGhostFromShape2(IntPtr sim, IntPtr shape, uint id, Vector3 pos, Quaternion rot); | |
779 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 779 | |
780 | public static extern bool IsActive2(IntPtr obj); | 780 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] |
781 | 781 | public static extern IntPtr AllocateBodyInfo2(IntPtr obj); | |
782 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 782 | |
783 | public static extern void SetRestitution2(IntPtr obj, float val); | 783 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] |
784 | 784 | public static extern void ReleaseBodyInfo2(IntPtr obj); | |
785 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 785 | |
786 | public static extern float GetRestitution2(IntPtr obj); | 786 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] |
787 | 787 | public static extern void DestroyObject2(IntPtr sim, IntPtr obj); | |
788 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 788 | |
789 | public 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] |
792 | public static extern float GetFriction2(IntPtr obj); | 792 | public 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] |
796 | public static extern Transform GetWorldTransform2(IntPtr obj); | 796 | public 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 | |
799 | public static extern void setWorldTransform2(IntPtr obj, Transform trans); | 799 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] |
800 | */ | 800 | public static extern bool ReleaseHeightMapInfo2(IntPtr heightMapInfo); |
801 | 801 | ||
802 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 802 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] |
803 | public static extern Vector3 GetPosition2(IntPtr obj); | 803 | public 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] |
806 | public static extern Quaternion GetOrientation2(IntPtr obj); | 806 | public static extern IntPtr CreateTerrainShape2(IntPtr mapInfo); |
807 | 807 | ||
808 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 808 | // ===================================================================================== |
809 | public 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] | 811 | public static extern IntPtr Create6DofConstraint2(IntPtr world, IntPtr obj1, IntPtr obj2, |
812 | public 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); |
815 | public static extern void SetBroadphaseHandle2(IntPtr obj, IntPtr handle); | 815 | |
816 | 816 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | |
817 | /* | 817 | public static extern IntPtr Create6DofConstraintToPoint2(IntPtr world, IntPtr obj1, IntPtr obj2, |
818 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 818 | Vector3 joinPoint, |
819 | public 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] |
822 | public static extern void SetInterpolationWorldTransform2(IntPtr obj, Transform trans); | 822 | public 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); |
826 | public static extern void SetInterpolationLinearVelocity2(IntPtr obj, Vector3 vel); | 826 | |
827 | 827 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | |
828 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 828 | public static extern void SetConstraintEnable2(IntPtr constrain, float numericTrueFalse); |
829 | public static extern void SetInterpolationAngularVelocity2(IntPtr obj, Vector3 vel); | 829 | |
830 | 830 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | |
831 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 831 | public static extern void SetConstraintNumSolverIterations2(IntPtr constrain, float iterations); |
832 | public 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] | 834 | public static extern bool SetFrames2(IntPtr constrain, |
835 | public 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] |
838 | public static extern void SetHitFraction2(IntPtr obj, float val); | 838 | public 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] |
841 | public static extern CollisionFlags GetCollisionFlags2(IntPtr obj); | 841 | public 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] |
844 | public static extern CollisionFlags SetCollisionFlags2(IntPtr obj, CollisionFlags flags); | 844 | public static extern bool UseFrameOffset2(IntPtr constrain, float enable); |
845 | 845 | ||
846 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 846 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] |
847 | public static extern CollisionFlags AddToCollisionFlags2(IntPtr obj, CollisionFlags flags); | 847 | public 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] |
850 | public static extern CollisionFlags RemoveFromCollisionFlags2(IntPtr obj, CollisionFlags flags); | 850 | public static extern bool SetBreakingImpulseThreshold2(IntPtr constrain, float threshold); |
851 | 851 | ||
852 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 852 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] |
853 | public static extern float GetCcdMotionThreshold2(IntPtr obj); | 853 | public static extern bool CalculateTransforms2(IntPtr constrain); |
854 | 854 | ||
855 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 855 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] |
856 | public static extern void SetCcdMotionThreshold2(IntPtr obj, float val); | 856 | public 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] |
859 | public static extern float GetCcdSweptSphereRadius2(IntPtr obj); | 859 | public static extern bool DestroyConstraint2(IntPtr world, IntPtr constrain); |
860 | 860 | ||
861 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 861 | // ===================================================================================== |
862 | public 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] | 864 | public static extern void UpdateSingleAabb2(IntPtr world, IntPtr obj); |
865 | public static extern IntPtr GetUserPointer2(IntPtr obj); | 865 | |
866 | 866 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | |
867 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 867 | public static extern void UpdateAabbs2(IntPtr world); |
868 | public static extern void SetUserPointer2(IntPtr obj, IntPtr val); | 868 | |
869 | 869 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | |
870 | // ===================================================================================== | 870 | public static extern bool GetForceUpdateAllAabbs2(IntPtr world); |
871 | // btRigidBody entries | 871 | |
872 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 872 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] |
873 | public static extern void ApplyGravity2(IntPtr obj); | 873 | public static extern void SetForceUpdateAllAabbs2(IntPtr world, bool force); |
874 | 874 | ||
875 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 875 | // ===================================================================================== |
876 | public 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] | 878 | public static extern bool AddObjectToWorld2(IntPtr world, IntPtr obj); |
879 | public static extern Vector3 GetGravity2(IntPtr obj); | 879 | |
880 | 880 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | |
881 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 881 | public static extern bool RemoveObjectFromWorld2(IntPtr world, IntPtr obj); |
882 | public 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] | 884 | public static extern bool AddConstraintToWorld2(IntPtr world, IntPtr constrain, bool disableCollisionsBetweenLinkedObjects); |
885 | public 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] | 887 | public static extern bool RemoveConstraintFromWorld2(IntPtr world, IntPtr constrain); |
888 | public 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] |
891 | public static extern float GetLinearDamping2(IntPtr obj); | 891 | public static extern Vector3 GetAnisotripicFriction2(IntPtr constrain); |
892 | 892 | ||
893 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 893 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] |
894 | public static extern float GetAngularDamping2(IntPtr obj); | 894 | public static extern Vector3 SetAnisotripicFriction2(IntPtr constrain, Vector3 frict); |
895 | 895 | ||
896 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 896 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] |
897 | public static extern float GetLinearSleepingThreshold2(IntPtr obj); | 897 | public static extern bool HasAnisotripicFriction2(IntPtr constrain); |
898 | 898 | ||
899 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 899 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] |
900 | public static extern float GetAngularSleepingThreshold2(IntPtr obj); | 900 | public static extern void SetContactProcessingThreshold2(IntPtr obj, float val); |
901 | 901 | ||
902 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 902 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] |
903 | public static extern void ApplyDamping2(IntPtr obj, float timeStep); | 903 | public static extern float GetContactProcessingThreshold2(IntPtr obj); |
904 | 904 | ||
905 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 905 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] |
906 | public static extern void SetMassProps2(IntPtr obj, float mass, Vector3 inertia); | 906 | public static extern bool IsStaticObject2(IntPtr obj); |
907 | 907 | ||
908 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 908 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] |
909 | public static extern Vector3 GetLinearFactor2(IntPtr obj); | 909 | public static extern bool IsKinematicObject2(IntPtr obj); |
910 | 910 | ||
911 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 911 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] |
912 | public static extern void SetLinearFactor2(IntPtr obj, Vector3 factor); | 912 | public static extern bool IsStaticOrKinematicObject2(IntPtr obj); |
913 | 913 | ||
914 | /* | 914 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] |
915 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 915 | public static extern bool HasContactResponse2(IntPtr obj); |
916 | public static extern void SetCenterOfMassTransform2(IntPtr obj, Transform trans); | 916 | |
917 | */ | 917 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] |
918 | 918 | public static extern void SetCollisionShape2(IntPtr sim, IntPtr obj, IntPtr shape); | |
919 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 919 | |
920 | public static extern void SetCenterOfMassByPosRot2(IntPtr obj, Vector3 pos, Quaternion rot); | 920 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] |
921 | 921 | public 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] |
924 | public static extern void ApplyCentralForce2(IntPtr obj, Vector3 force); | 924 | public 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] | 927 | public static extern void SetActivationState2(IntPtr obj, int state); |
928 | public static extern void SetObjectForce2(IntPtr obj, Vector3 force); | 928 | |
929 | 929 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | |
930 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 930 | public static extern void SetDeactivationTime2(IntPtr obj, float dtime); |
931 | public static extern Vector3 GetTotalForce2(IntPtr obj); | 931 | |
932 | 932 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | |
933 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 933 | public static extern float GetDeactivationTime2(IntPtr obj); |
934 | public static extern Vector3 GetTotalTorque2(IntPtr obj); | 934 | |
935 | 935 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | |
936 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 936 | public static extern void ForceActivationState2(IntPtr obj, ActivationState state); |
937 | public static extern Vector3 GetInvInertiaDiagLocal2(IntPtr obj); | 937 | |
938 | 938 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | |
939 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 939 | public static extern void Activate2(IntPtr obj, bool forceActivation); |
940 | public static extern void SetInvInertiaDiagLocal2(IntPtr obj, Vector3 inert); | 940 | |
941 | 941 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | |
942 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 942 | public static extern bool IsActive2(IntPtr obj); |
943 | public 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] | 945 | public static extern void SetRestitution2(IntPtr obj, float val); |
946 | public 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. | 948 | public static extern float GetRestitution2(IntPtr obj); |
949 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 949 | |
950 | public static extern void ApplyForce2(IntPtr obj, Vector3 force, Vector3 pos); | 950 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] |
951 | 951 | public 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] |
954 | public static extern void ApplyCentralImpulse2(IntPtr obj, Vector3 imp); | 954 | public 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] |
958 | public static extern void ApplyTorqueImpulse2(IntPtr obj, Vector3 imp); | 958 | public 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] | 961 | public static extern void setWorldTransform2(IntPtr obj, Transform trans); |
962 | public 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] |
965 | public static extern void ClearForces2(IntPtr obj); | 965 | public static extern Vector3 GetPosition2(IntPtr obj); |
966 | 966 | ||
967 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 967 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] |
968 | public static extern void ClearAllForces2(IntPtr obj); | 968 | public static extern Quaternion GetOrientation2(IntPtr obj); |
969 | 969 | ||
970 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 970 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] |
971 | public static extern void UpdateInertiaTensor2(IntPtr obj); | 971 | public 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] |
974 | public static extern Vector3 GetCenterOfMassPosition2(IntPtr obj); | 974 | public static extern IntPtr GetBroadphaseHandle2(IntPtr obj); |
975 | 975 | ||
976 | /* | 976 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] |
977 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 977 | public static extern void SetBroadphaseHandle2(IntPtr obj, IntPtr handle); |
978 | public static extern Transform GetCenterOfMassTransform2(IntPtr obj); | 978 | |
979 | */ | 979 | /* |
980 | 980 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | |
981 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 981 | public static extern Transform GetInterpolationWorldTransform2(IntPtr obj); |
982 | public static extern Vector3 GetLinearVelocity2(IntPtr obj); | 982 | |
983 | 983 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | |
984 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 984 | public static extern void SetInterpolationWorldTransform2(IntPtr obj, Transform trans); |
985 | public static extern Vector3 GetAngularVelocity2(IntPtr obj); | 985 | */ |
986 | 986 | ||
987 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 987 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] |
988 | public static extern void SetLinearVelocity2(IntPtr obj, Vector3 val); | 988 | public static extern void SetInterpolationLinearVelocity2(IntPtr obj, Vector3 vel); |
989 | 989 | ||
990 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 990 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] |
991 | public static extern void SetAngularVelocity2(IntPtr obj, Vector3 angularVelocity); | 991 | public static extern void SetInterpolationAngularVelocity2(IntPtr obj, Vector3 vel); |
992 | 992 | ||
993 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 993 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] |
994 | public static extern Vector3 GetVelocityInLocalPoint2(IntPtr obj, Vector3 pos); | 994 | public 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] |
997 | public static extern void Translate2(IntPtr obj, Vector3 trans); | 997 | public static extern float GetHitFraction2(IntPtr obj); |
998 | 998 | ||
999 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 999 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] |
1000 | public static extern void UpdateDeactivation2(IntPtr obj, float timeStep); | 1000 | public static extern void SetHitFraction2(IntPtr obj, float val); |
1001 | 1001 | ||
1002 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 1002 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] |
1003 | public static extern bool WantsSleeping2(IntPtr obj); | 1003 | public static extern CollisionFlags GetCollisionFlags2(IntPtr obj); |
1004 | 1004 | ||
1005 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 1005 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] |
1006 | public static extern void SetAngularFactor2(IntPtr obj, float factor); | 1006 | public static extern CollisionFlags SetCollisionFlags2(IntPtr obj, CollisionFlags flags); |
1007 | 1007 | ||
1008 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 1008 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] |
1009 | public static extern void SetAngularFactorV2(IntPtr obj, Vector3 factor); | 1009 | public static extern CollisionFlags AddToCollisionFlags2(IntPtr obj, CollisionFlags flags); |
1010 | 1010 | ||
1011 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 1011 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] |
1012 | public static extern Vector3 GetAngularFactor2(IntPtr obj); | 1012 | public static extern CollisionFlags RemoveFromCollisionFlags2(IntPtr obj, CollisionFlags flags); |
1013 | 1013 | ||
1014 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 1014 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] |
1015 | public static extern bool IsInWorld2(IntPtr obj); | 1015 | public static extern float GetCcdMotionThreshold2(IntPtr obj); |
1016 | 1016 | ||
1017 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 1017 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] |
1018 | public static extern void AddConstraintRef2(IntPtr obj, IntPtr constrain); | 1018 | public static extern void SetCcdMotionThreshold2(IntPtr obj, float val); |
1019 | 1019 | ||
1020 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 1020 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] |
1021 | public static extern void RemoveConstraintRef2(IntPtr obj, IntPtr constrain); | 1021 | public static extern float GetCcdSweptSphereRadius2(IntPtr obj); |
1022 | 1022 | ||
1023 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 1023 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] |
1024 | public static extern IntPtr GetConstraintRef2(IntPtr obj, int index); | 1024 | public static extern void SetCcdSweptSphereRadius2(IntPtr obj, float val); |
1025 | 1025 | ||
1026 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 1026 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] |
1027 | public static extern int GetNumConstraintRefs2(IntPtr obj); | 1027 | public static extern IntPtr GetUserPointer2(IntPtr obj); |
1028 | 1028 | ||
1029 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 1029 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] |
1030 | public static extern bool SetCollisionGroupMask2(IntPtr body, uint filter, uint mask); | 1030 | public 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 | // =============================================================================== |
1036 | public static extern float GetAngularMotionDisc2(IntPtr shape); | 1036 | // =============================================================================== |
1037 | 1037 | // =============================================================================== | |
1038 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 1038 | // =============================================================================== |
1039 | public static extern float GetContactBreakingThreshold2(IntPtr shape, float defaultFactor); | 1039 | // =============================================================================== |
1040 | 1040 | // =============================================================================== | |
1041 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 1041 | // =============================================================================== |
1042 | public static extern bool IsPolyhedral2(IntPtr shape); | 1042 | // =============================================================================== |
1043 | 1043 | // =============================================================================== | |
1044 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 1044 | // =============================================================================== |
1045 | public static extern bool IsConvex2d2(IntPtr shape); | 1045 | // =============================================================================== |
1046 | 1046 | // =============================================================================== | |
1047 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 1047 | // =============================================================================== |
1048 | public static extern bool IsConvex2(IntPtr shape); | 1048 | static class BulletSimAPI { |
1049 | 1049 | // =============================================================================== | |
1050 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 1050 | // Link back to the managed code for outputting log messages |
1051 | public static extern bool IsNonMoving2(IntPtr shape); | 1051 | [UnmanagedFunctionPointer(CallingConvention.Cdecl)] |
1052 | 1052 | public delegate void DebugLogCallback([MarshalAs(UnmanagedType.LPStr)]string msg); | |
1053 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 1053 | |
1054 | public 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] |
1057 | public static extern bool IsCompound2(IntPtr shape); | 1057 | public 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, |
1060 | public 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] |
1063 | public static extern bool IsInfinite2(IntPtr shape); | 1063 | public 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] |
1066 | public static extern void SetLocalScaling2(IntPtr shape, Vector3 scale); | 1066 | public static extern void SetHeightMap2(IntPtr world, float[] heightmap); |
1067 | 1067 | ||
1068 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 1068 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] |
1069 | public static extern Vector3 GetLocalScaling2(IntPtr shape); | 1069 | public static extern void Shutdown2(IntPtr sim); |
1070 | 1070 | ||
1071 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 1071 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] |
1072 | public static extern Vector3 CalculateLocalInertia2(IntPtr shape, float mass); | 1072 | public 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, |
1075 | public static extern int GetShapeType2(IntPtr shape); | 1075 | out int collidersCount, |
1076 | 1076 | out IntPtr collidersPtr); | |
1077 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 1077 | |
1078 | public static extern void SetMargin2(IntPtr shape, float val); | 1078 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] |
1079 | 1079 | public static extern bool PushUpdate2(IntPtr obj); | |
1080 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 1080 | |
1081 | public static extern float GetMargin2(IntPtr shape); | 1081 | // ===================================================================================== |
1082 | 1082 | // btRigidBody entries | |
1083 | // ===================================================================================== | 1083 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] |
1084 | // Debugging | 1084 | public static extern void ApplyGravity2(IntPtr obj); |
1085 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 1085 | |
1086 | public static extern void DumpRigidBody2(IntPtr sim, IntPtr collisionObject); | 1086 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] |
1087 | 1087 | public static extern void SetGravity2(IntPtr obj, Vector3 val); | |
1088 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 1088 | |
1089 | public static extern void DumpCollisionShape2(IntPtr sim, IntPtr collisionShape); | 1089 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] |
1090 | 1090 | public static extern Vector3 GetGravity2(IntPtr obj); | |
1091 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 1091 | |
1092 | public static extern void DumpMapInfo2(IntPtr sim, IntPtr manInfo); | 1092 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] |
1093 | 1093 | public static extern void SetDamping2(IntPtr obj, float lin_damping, float ang_damping); | |
1094 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 1094 | |
1095 | public static extern void DumpConstraint2(IntPtr sim, IntPtr constrain); | 1095 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] |
1096 | 1096 | public static extern void SetLinearDamping2(IntPtr obj, float lin_damping); | |
1097 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 1097 | |
1098 | public static extern void DumpActivationInfo2(IntPtr sim); | 1098 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] |
1099 | 1099 | public static extern void SetAngularDamping2(IntPtr obj, float ang_damping); | |
1100 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 1100 | |
1101 | public static extern void DumpAllInfo2(IntPtr sim); | 1101 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] |
1102 | 1102 | public static extern float GetLinearDamping2(IntPtr obj); | |
1103 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 1103 | |
1104 | public static extern void DumpPhysicsStatistics2(IntPtr sim); | 1104 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] |
1105 | 1105 | public static extern float GetAngularDamping2(IntPtr obj); | |
1106 | } | 1106 | |
1107 | } | 1107 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] |
1108 | public static extern float GetLinearSleepingThreshold2(IntPtr obj); | ||
1109 | |||
1110 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
1111 | public static extern float GetAngularSleepingThreshold2(IntPtr obj); | ||
1112 | |||
1113 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
1114 | public static extern void ApplyDamping2(IntPtr obj, float timeStep); | ||
1115 | |||
1116 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
1117 | public static extern void SetMassProps2(IntPtr obj, float mass, Vector3 inertia); | ||
1118 | |||
1119 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
1120 | public static extern Vector3 GetLinearFactor2(IntPtr obj); | ||
1121 | |||
1122 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
1123 | public static extern void SetLinearFactor2(IntPtr obj, Vector3 factor); | ||
1124 | |||
1125 | /* | ||
1126 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
1127 | public static extern void SetCenterOfMassTransform2(IntPtr obj, Transform trans); | ||
1128 | */ | ||
1129 | |||
1130 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
1131 | public 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] | ||
1135 | public 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] | ||
1139 | public static extern void SetObjectForce2(IntPtr obj, Vector3 force); | ||
1140 | |||
1141 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
1142 | public static extern Vector3 GetTotalForce2(IntPtr obj); | ||
1143 | |||
1144 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
1145 | public static extern Vector3 GetTotalTorque2(IntPtr obj); | ||
1146 | |||
1147 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
1148 | public static extern Vector3 GetInvInertiaDiagLocal2(IntPtr obj); | ||
1149 | |||
1150 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
1151 | public static extern void SetInvInertiaDiagLocal2(IntPtr obj, Vector3 inert); | ||
1152 | |||
1153 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
1154 | public static extern void SetSleepingThresholds2(IntPtr obj, float lin_threshold, float ang_threshold); | ||
1155 | |||
1156 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
1157 | public 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] | ||
1161 | public 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] | ||
1165 | public 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] | ||
1169 | public 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] | ||
1173 | public static extern void ApplyImpulse2(IntPtr obj, Vector3 imp, Vector3 pos); | ||
1174 | |||
1175 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
1176 | public static extern void ClearForces2(IntPtr obj); | ||
1177 | |||
1178 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
1179 | public static extern void ClearAllForces2(IntPtr obj); | ||
1180 | |||
1181 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
1182 | public static extern void UpdateInertiaTensor2(IntPtr obj); | ||
1183 | |||
1184 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
1185 | public static extern Vector3 GetCenterOfMassPosition2(IntPtr obj); | ||
1186 | |||
1187 | /* | ||
1188 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
1189 | public static extern Transform GetCenterOfMassTransform2(IntPtr obj); | ||
1190 | */ | ||
1191 | |||
1192 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
1193 | public static extern Vector3 GetLinearVelocity2(IntPtr obj); | ||
1194 | |||
1195 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
1196 | public static extern Vector3 GetAngularVelocity2(IntPtr obj); | ||
1197 | |||
1198 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
1199 | public static extern void SetLinearVelocity2(IntPtr obj, Vector3 val); | ||
1200 | |||
1201 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
1202 | public static extern void SetAngularVelocity2(IntPtr obj, Vector3 angularVelocity); | ||
1203 | |||
1204 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
1205 | public static extern Vector3 GetVelocityInLocalPoint2(IntPtr obj, Vector3 pos); | ||
1206 | |||
1207 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
1208 | public static extern void Translate2(IntPtr obj, Vector3 trans); | ||
1209 | |||
1210 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
1211 | public static extern void UpdateDeactivation2(IntPtr obj, float timeStep); | ||
1212 | |||
1213 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
1214 | public static extern bool WantsSleeping2(IntPtr obj); | ||
1215 | |||
1216 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
1217 | public static extern void SetAngularFactor2(IntPtr obj, float factor); | ||
1218 | |||
1219 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
1220 | public static extern void SetAngularFactorV2(IntPtr obj, Vector3 factor); | ||
1221 | |||
1222 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
1223 | public static extern Vector3 GetAngularFactor2(IntPtr obj); | ||
1224 | |||
1225 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
1226 | public static extern bool IsInWorld2(IntPtr obj); | ||
1227 | |||
1228 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
1229 | public static extern void AddConstraintRef2(IntPtr obj, IntPtr constrain); | ||
1230 | |||
1231 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
1232 | public static extern void RemoveConstraintRef2(IntPtr obj, IntPtr constrain); | ||
1233 | |||
1234 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
1235 | public static extern IntPtr GetConstraintRef2(IntPtr obj, int index); | ||
1236 | |||
1237 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
1238 | public static extern int GetNumConstraintRefs2(IntPtr obj); | ||
1239 | |||
1240 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
1241 | public static extern bool SetCollisionGroupMask2(IntPtr body, uint filter, uint mask); | ||
1242 | |||
1243 | // ===================================================================================== | ||
1244 | // btCollisionShape entries | ||
1245 | |||
1246 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
1247 | public static extern float GetAngularMotionDisc2(IntPtr shape); | ||
1248 | |||
1249 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
1250 | public static extern float GetContactBreakingThreshold2(IntPtr shape, float defaultFactor); | ||
1251 | |||
1252 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
1253 | public static extern bool IsPolyhedral2(IntPtr shape); | ||
1254 | |||
1255 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
1256 | public static extern bool IsConvex2d2(IntPtr shape); | ||
1257 | |||
1258 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
1259 | public static extern bool IsConvex2(IntPtr shape); | ||
1260 | |||
1261 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
1262 | public static extern bool IsNonMoving2(IntPtr shape); | ||
1263 | |||
1264 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
1265 | public static extern bool IsConcave2(IntPtr shape); | ||
1266 | |||
1267 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
1268 | public static extern bool IsCompound2(IntPtr shape); | ||
1269 | |||
1270 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
1271 | public static extern bool IsSoftBody2(IntPtr shape); | ||
1272 | |||
1273 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
1274 | public static extern bool IsInfinite2(IntPtr shape); | ||
1275 | |||
1276 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
1277 | public static extern void SetLocalScaling2(IntPtr shape, Vector3 scale); | ||
1278 | |||
1279 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
1280 | public static extern Vector3 GetLocalScaling2(IntPtr shape); | ||
1281 | |||
1282 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
1283 | public static extern Vector3 CalculateLocalInertia2(IntPtr shape, float mass); | ||
1284 | |||
1285 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
1286 | public static extern int GetShapeType2(IntPtr shape); | ||
1287 | |||
1288 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
1289 | public static extern void SetMargin2(IntPtr shape, float val); | ||
1290 | |||
1291 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
1292 | public static extern float GetMargin2(IntPtr shape); | ||
1293 | |||
1294 | // ===================================================================================== | ||
1295 | // Debugging | ||
1296 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
1297 | public static extern void DumpRigidBody2(IntPtr sim, IntPtr collisionObject); | ||
1298 | |||
1299 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
1300 | public static extern void DumpCollisionShape2(IntPtr sim, IntPtr collisionShape); | ||
1301 | |||
1302 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
1303 | public static extern void DumpMapInfo2(IntPtr sim, IntPtr manInfo); | ||
1304 | |||
1305 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
1306 | public static extern void DumpConstraint2(IntPtr sim, IntPtr constrain); | ||
1307 | |||
1308 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
1309 | public static extern void DumpActivationInfo2(IntPtr sim); | ||
1310 | |||
1311 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
1312 | public static extern void DumpAllInfo2(IntPtr sim); | ||
1313 | |||
1314 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
1315 | public static extern void DumpPhysicsStatistics2(IntPtr sim); | ||
1316 | |||
1317 | } | ||
1318 | } | ||