Skip to content

Commit a63254e

Browse files
committed
feat: Update box2d
1 parent 8814f41 commit a63254e

File tree

3 files changed

+49
-22
lines changed

3 files changed

+49
-22
lines changed

patches/java_binding_gen_patches.patch

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -28,27 +28,6 @@ diff --git a/src/main/java/com/badlogic/gdx/box2d/Box2d.java b/src/main/java/com
2828
}
2929

3030
public static void initialize() {
31-
@@ -4733,20 +4741,6 @@
32-
return 0;
33-
*/
34-
35-
- /**
36-
- * Get the allowed clip fraction.
37-
- */
38-
- public static float b2Shape_GetAllowedClipFraction(b2ShapeId shapeId) {
39-
- return b2Shape_GetAllowedClipFraction_internal(shapeId.getPointer());
40-
- }
41-
-
42-
- static private native float b2Shape_GetAllowedClipFraction_internal(long shapeId);/*
43-
- HANDLE_JAVA_EXCEPTION_START()
44-
- return (jfloat)b2Shape_GetAllowedClipFraction(*(b2ShapeId*)shapeId);
45-
- HANDLE_JAVA_EXCEPTION_END()
46-
- return 0;
47-
- */
48-
-
49-
/**
50-
* Get the shape filter
51-
*/
5231
@@ -7122,7 +7116,7 @@
5332
/**
5433
* Prototype callback for overlap queries.

src/main/java/com/badlogic/gdx/box2d/Box2d.java

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3818,6 +3818,38 @@ public static void b2Body_SetAngularVelocity(b2BodyId bodyId, float angularVeloc
38183818
HANDLE_JAVA_EXCEPTION_END()
38193819
*/
38203820

3821+
/**
3822+
* Get the linear velocity of a local point attached to a body. Usually in meters per second.
3823+
*/
3824+
public static b2Vec2 b2Body_GetLocalPointVelocity(b2BodyId bodyId, b2Vec2 localPoint) {
3825+
return new b2Vec2(b2Body_GetLocalPointVelocity_internal(bodyId.getPointer(), localPoint.getPointer()), true);
3826+
}
3827+
3828+
static private native long b2Body_GetLocalPointVelocity_internal(long bodyId, long localPoint);/*
3829+
HANDLE_JAVA_EXCEPTION_START()
3830+
b2Vec2* _ret = (b2Vec2*)malloc(sizeof(b2Vec2));
3831+
*_ret = b2Body_GetLocalPointVelocity(*(b2BodyId*)bodyId, *(b2Vec2*)localPoint);
3832+
return (jlong)_ret;
3833+
HANDLE_JAVA_EXCEPTION_END()
3834+
return 0;
3835+
*/
3836+
3837+
/**
3838+
* Get the linear velocity of a world point attached to a body. Usually in meters per second.
3839+
*/
3840+
public static b2Vec2 b2Body_GetWorldPointVelocity(b2BodyId bodyId, b2Vec2 worldPoint) {
3841+
return new b2Vec2(b2Body_GetWorldPointVelocity_internal(bodyId.getPointer(), worldPoint.getPointer()), true);
3842+
}
3843+
3844+
static private native long b2Body_GetWorldPointVelocity_internal(long bodyId, long worldPoint);/*
3845+
HANDLE_JAVA_EXCEPTION_START()
3846+
b2Vec2* _ret = (b2Vec2*)malloc(sizeof(b2Vec2));
3847+
*_ret = b2Body_GetWorldPointVelocity(*(b2BodyId*)bodyId, *(b2Vec2*)worldPoint);
3848+
return (jlong)_ret;
3849+
HANDLE_JAVA_EXCEPTION_END()
3850+
return 0;
3851+
*/
3852+
38213853
/**
38223854
* Apply a force at a world point. If the force is not applied at the center of mass,
38233855
* it will generate a torque and affect the angular velocity. This optionally wakes up the body.
@@ -5134,6 +5166,22 @@ public static b2AABB b2Shape_GetAABB(b2ShapeId shapeId) {
51345166
return 0;
51355167
*/
51365168

5169+
/**
5170+
* Get the mass data for a shape
5171+
*/
5172+
public static b2MassData b2Shape_GetMassData(b2ShapeId shapeId) {
5173+
return new b2MassData(b2Shape_GetMassData_internal(shapeId.getPointer()), true);
5174+
}
5175+
5176+
static private native long b2Shape_GetMassData_internal(long shapeId);/*
5177+
HANDLE_JAVA_EXCEPTION_START()
5178+
b2MassData* _ret = (b2MassData*)malloc(sizeof(b2MassData));
5179+
*_ret = b2Shape_GetMassData(*(b2ShapeId*)shapeId);
5180+
return (jlong)_ret;
5181+
HANDLE_JAVA_EXCEPTION_END()
5182+
return 0;
5183+
*/
5184+
51375185
/**
51385186
* Get the closest point on a shape to a target point. Target and result are in world space.
51395187
* todo need sample

0 commit comments

Comments
 (0)