@@ -34,19 +34,19 @@ public class btCollisionWorld extends Pointer {
34
34
35
35
public native void updateSingleAabb (btCollisionObject colObj );
36
36
37
- public native void updateAabbs ();
37
+ @ Virtual public native void updateAabbs ();
38
38
39
39
/**the computeOverlappingPairs is usually already called by performDiscreteCollisionDetection (or stepSimulation)
40
40
* it can be useful to use if you perform ray tests without collision detection/simulation */
41
- public native void computeOverlappingPairs ();
41
+ @ Virtual public native void computeOverlappingPairs ();
42
42
43
- public native void setDebugDrawer (btIDebugDraw debugDrawer );
43
+ @ Virtual public native void setDebugDrawer (btIDebugDraw debugDrawer );
44
44
45
- public native btIDebugDraw getDebugDrawer ();
45
+ @ Virtual public native btIDebugDraw getDebugDrawer ();
46
46
47
- public native void debugDrawWorld ();
47
+ @ Virtual public native void debugDrawWorld ();
48
48
49
- public native void debugDrawObject (@ Const @ ByRef btTransform worldTransform , @ Const btCollisionShape shape , @ Const @ ByRef btVector3 color );
49
+ @ Virtual public native void debugDrawObject (@ Const @ ByRef btTransform worldTransform , @ Const btCollisionShape shape , @ Const @ ByRef btVector3 color );
50
50
51
51
/**LocalShapeInfo gives extra information for complex shapes
52
52
* Currently, only btTriangleMeshShape is available, so it just contains triangleIndex and subpart */
@@ -99,6 +99,15 @@ private native void allocate(@Const btCollisionObject collisionObject,
99
99
static { Loader .load (); }
100
100
/** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */
101
101
public RayResultCallback (Pointer p ) { super (p ); }
102
+ /** Native array allocator. Access with {@link Pointer#position(long)}. */
103
+ public RayResultCallback (long size ) { super ((Pointer )null ); allocateArray (size ); }
104
+ private native void allocateArray (long size );
105
+ @ Override public RayResultCallback position (long position ) {
106
+ return (RayResultCallback )super .position (position );
107
+ }
108
+ @ Override public RayResultCallback getPointer (long i ) {
109
+ return new RayResultCallback ((Pointer )this ).offsetAddress (i );
110
+ }
102
111
103
112
public native @ Cast ("btScalar" ) double m_closestHitFraction (); public native RayResultCallback m_closestHitFraction (double setter );
104
113
public native @ Const btCollisionObject m_collisionObject (); public native RayResultCallback m_collisionObject (btCollisionObject setter );
@@ -108,9 +117,9 @@ private native void allocate(@Const btCollisionObject collisionObject,
108
117
public native @ Cast ("unsigned int" ) int m_flags (); public native RayResultCallback m_flags (int setter );
109
118
public native @ Cast ("bool" ) boolean hasHit ();
110
119
111
- public native @ Cast ("bool" ) boolean needsCollision (btBroadphaseProxy proxy0 );
120
+ @ Virtual public native @ Cast ("bool" ) @ Const ({ false , false , true } ) boolean needsCollision (btBroadphaseProxy proxy0 );
112
121
113
- public native @ Cast ("btScalar" ) double addSingleResult (@ ByRef LocalRayResult rayResult , @ Cast ("bool" ) boolean normalInWorldSpace );
122
+ @ Virtual ( true ) public native @ Cast ("btScalar" ) double addSingleResult (@ ByRef LocalRayResult rayResult , @ Cast ("bool" ) boolean normalInWorldSpace );
114
123
}
115
124
116
125
@ NoOffset public static class ClosestRayResultCallback extends RayResultCallback {
@@ -127,7 +136,7 @@ private native void allocate(@Const btCollisionObject collisionObject,
127
136
public native @ ByRef btVector3 m_hitNormalWorld (); public native ClosestRayResultCallback m_hitNormalWorld (btVector3 setter );
128
137
public native @ ByRef btVector3 m_hitPointWorld (); public native ClosestRayResultCallback m_hitPointWorld (btVector3 setter );
129
138
130
- public native @ Cast ("btScalar" ) double addSingleResult (@ ByRef LocalRayResult rayResult , @ Cast ("bool" ) boolean normalInWorldSpace );
139
+ @ Virtual public native @ Cast ("btScalar" ) double addSingleResult (@ ByRef LocalRayResult rayResult , @ Cast ("bool" ) boolean normalInWorldSpace );
131
140
}
132
141
133
142
@ NoOffset public static class AllHitsRayResultCallback extends RayResultCallback {
@@ -147,7 +156,7 @@ private native void allocate(@Const btCollisionObject collisionObject,
147
156
public native @ ByRef btVector3Array m_hitPointWorld (); public native AllHitsRayResultCallback m_hitPointWorld (btVector3Array setter );
148
157
public native @ ByRef btScalarArray m_hitFractions (); public native AllHitsRayResultCallback m_hitFractions (btScalarArray setter );
149
158
150
- public native @ Cast ("btScalar" ) double addSingleResult (@ ByRef LocalRayResult rayResult , @ Cast ("bool" ) boolean normalInWorldSpace );
159
+ @ Virtual public native @ Cast ("btScalar" ) double addSingleResult (@ ByRef LocalRayResult rayResult , @ Cast ("bool" ) boolean normalInWorldSpace );
151
160
}
152
161
153
162
@ NoOffset public static class LocalConvexResult extends Pointer {
@@ -178,16 +187,25 @@ private native void allocate(@Const btCollisionObject hitCollisionObject,
178
187
static { Loader .load (); }
179
188
/** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */
180
189
public ConvexResultCallback (Pointer p ) { super (p ); }
190
+ /** Native array allocator. Access with {@link Pointer#position(long)}. */
191
+ public ConvexResultCallback (long size ) { super ((Pointer )null ); allocateArray (size ); }
192
+ private native void allocateArray (long size );
193
+ @ Override public ConvexResultCallback position (long position ) {
194
+ return (ConvexResultCallback )super .position (position );
195
+ }
196
+ @ Override public ConvexResultCallback getPointer (long i ) {
197
+ return new ConvexResultCallback ((Pointer )this ).offsetAddress (i );
198
+ }
181
199
182
200
public native @ Cast ("btScalar" ) double m_closestHitFraction (); public native ConvexResultCallback m_closestHitFraction (double setter );
183
201
public native int m_collisionFilterGroup (); public native ConvexResultCallback m_collisionFilterGroup (int setter );
184
202
public native int m_collisionFilterMask (); public native ConvexResultCallback m_collisionFilterMask (int setter );
185
203
186
204
public native @ Cast ("bool" ) boolean hasHit ();
187
205
188
- public native @ Cast ("bool" ) boolean needsCollision (btBroadphaseProxy proxy0 );
206
+ @ Virtual public native @ Cast ("bool" ) @ Const ({ false , false , true } ) boolean needsCollision (btBroadphaseProxy proxy0 );
189
207
190
- public native @ Cast ("btScalar" ) double addSingleResult (@ ByRef LocalConvexResult convexResult , @ Cast ("bool" ) boolean normalInWorldSpace );
208
+ @ Virtual ( true ) public native @ Cast ("btScalar" ) double addSingleResult (@ ByRef LocalConvexResult convexResult , @ Cast ("bool" ) boolean normalInWorldSpace );
191
209
}
192
210
193
211
@ NoOffset public static class ClosestConvexResultCallback extends ConvexResultCallback {
@@ -205,29 +223,38 @@ private native void allocate(@Const btCollisionObject hitCollisionObject,
205
223
public native @ ByRef btVector3 m_hitPointWorld (); public native ClosestConvexResultCallback m_hitPointWorld (btVector3 setter );
206
224
public native @ Const btCollisionObject m_hitCollisionObject (); public native ClosestConvexResultCallback m_hitCollisionObject (btCollisionObject setter );
207
225
208
- public native @ Cast ("btScalar" ) double addSingleResult (@ ByRef LocalConvexResult convexResult , @ Cast ("bool" ) boolean normalInWorldSpace );
226
+ @ Virtual public native @ Cast ("btScalar" ) double addSingleResult (@ ByRef LocalConvexResult convexResult , @ Cast ("bool" ) boolean normalInWorldSpace );
209
227
}
210
228
211
229
/**ContactResultCallback is used to report contact points */
212
230
@ NoOffset public static class ContactResultCallback extends Pointer {
213
231
static { Loader .load (); }
214
232
/** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */
215
233
public ContactResultCallback (Pointer p ) { super (p ); }
234
+ /** Native array allocator. Access with {@link Pointer#position(long)}. */
235
+ public ContactResultCallback (long size ) { super ((Pointer )null ); allocateArray (size ); }
236
+ private native void allocateArray (long size );
237
+ @ Override public ContactResultCallback position (long position ) {
238
+ return (ContactResultCallback )super .position (position );
239
+ }
240
+ @ Override public ContactResultCallback getPointer (long i ) {
241
+ return new ContactResultCallback ((Pointer )this ).offsetAddress (i );
242
+ }
216
243
217
244
public native int m_collisionFilterGroup (); public native ContactResultCallback m_collisionFilterGroup (int setter );
218
245
public native int m_collisionFilterMask (); public native ContactResultCallback m_collisionFilterMask (int setter );
219
246
public native @ Cast ("btScalar" ) double m_closestDistanceThreshold (); public native ContactResultCallback m_closestDistanceThreshold (double setter );
220
247
221
- public native @ Cast ("bool" ) boolean needsCollision (btBroadphaseProxy proxy0 );
248
+ @ Virtual public native @ Cast ("bool" ) @ Const ({ false , false , true } ) boolean needsCollision (btBroadphaseProxy proxy0 );
222
249
223
- public native @ Cast ("btScalar" ) double addSingleResult (@ ByRef btManifoldPoint cp , @ Const btCollisionObjectWrapper colObj0Wrap , int partId0 , int index0 , @ Const btCollisionObjectWrapper colObj1Wrap , int partId1 , int index1 );
250
+ @ Virtual ( true ) public native @ Cast ("btScalar" ) double addSingleResult (@ ByRef btManifoldPoint cp , @ Const btCollisionObjectWrapper colObj0Wrap , int partId0 , int index0 , @ Const btCollisionObjectWrapper colObj1Wrap , int partId1 , int index1 );
224
251
}
225
252
226
253
public native int getNumCollisionObjects ();
227
254
228
255
/** rayTest performs a raycast on all objects in the btCollisionWorld, and calls the resultCallback
229
256
* This allows for several queries: first hit, all hits, any hit, dependent on the value returned by the callback. */
230
- public native void rayTest (@ Const @ ByRef btVector3 rayFromWorld , @ Const @ ByRef btVector3 rayToWorld , @ ByRef RayResultCallback resultCallback );
257
+ @ Virtual public native @ Const ({ false , false , true }) void rayTest (@ Const @ ByRef btVector3 rayFromWorld , @ Const @ ByRef btVector3 rayToWorld , @ ByRef RayResultCallback resultCallback );
231
258
232
259
/** convexTest performs a swept convex cast on all objects in the btCollisionWorld, and calls the resultCallback
233
260
* This allows for several queries: first hit, all hits, any hit, dependent on the value return by the callback. */
@@ -266,22 +293,21 @@ public static native void objectQuerySingleInternal(@Const btConvexShape castSha
266
293
@ Const btCollisionObjectWrapper colObjWrap ,
267
294
@ ByRef ConvexResultCallback resultCallback , @ Cast ("btScalar" ) double allowedPenetration );
268
295
269
- public native void addCollisionObject (btCollisionObject collisionObject , int collisionFilterGroup /*=btBroadphaseProxy::DefaultFilter*/ , int collisionFilterMask /*=btBroadphaseProxy::AllFilter*/ );
270
- public native void addCollisionObject (btCollisionObject collisionObject );
296
+ @ Virtual public native void addCollisionObject (btCollisionObject collisionObject , int collisionFilterGroup /*=btBroadphaseProxy::DefaultFilter*/ , int collisionFilterMask /*=btBroadphaseProxy::AllFilter*/ );
271
297
272
- public native void refreshBroadphaseProxy (btCollisionObject collisionObject );
298
+ @ Virtual public native void refreshBroadphaseProxy (btCollisionObject collisionObject );
273
299
274
300
public native @ ByRef btCollisionObjectArray getCollisionObjectArray ();
275
301
276
- public native void removeCollisionObject (btCollisionObject collisionObject );
302
+ @ Virtual public native void removeCollisionObject (btCollisionObject collisionObject );
277
303
278
- public native void performDiscreteCollisionDetection ();
304
+ @ Virtual public native void performDiscreteCollisionDetection ();
279
305
280
306
public native @ ByRef btDispatcherInfo getDispatchInfo ();
281
307
282
308
public native @ Cast ("bool" ) boolean getForceUpdateAllAabbs ();
283
309
public native void setForceUpdateAllAabbs (@ Cast ("bool" ) boolean forceUpdateAllAabbs );
284
310
285
311
/**Preliminary serialization test for Bullet 2.76. Loading those files requires a separate parser (Bullet/Demos/SerializeDemo) */
286
- public native void serialize (btSerializer serializer );
312
+ @ Virtual public native void serialize (btSerializer serializer );
287
313
}
0 commit comments