Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions JoltC/Functions.h
Original file line number Diff line number Diff line change
Expand Up @@ -553,15 +553,15 @@
JPC_RVec3 inBaseOffset,
const JPC_CollideShapeResult *inCollisionResult);

void (*OnContactAdded)(

Check warning on line 556 in JoltC/Functions.h

View workflow job for this annotation

GitHub Actions / Tests - ubuntu-latest Debug

offset of on non-standard-layout type 'JPH::ShapeCastSettings' [-Winvalid-offsetof]

Check warning on line 556 in JoltC/Functions.h

View workflow job for this annotation

GitHub Actions / Tests - ubuntu-latest Debug -DDOUBLE_PRECISION=ON

offset of on non-standard-layout type 'JPH::ShapeCastSettings' [-Winvalid-offsetof]

Check warning on line 556 in JoltC/Functions.h

View workflow job for this annotation

GitHub Actions / Tests - ubuntu-latest Debug -DOBJECT_LAYER_BITS=32

offset of on non-standard-layout type 'JPH::ShapeCastSettings' [-Winvalid-offsetof]
void *self,

Check warning on line 557 in JoltC/Functions.h

View workflow job for this annotation

GitHub Actions / Tests - ubuntu-latest Debug

offset of on non-standard-layout type 'JPH::ShapeCastSettings' [-Winvalid-offsetof]

Check warning on line 557 in JoltC/Functions.h

View workflow job for this annotation

GitHub Actions / Tests - ubuntu-latest Debug -DDOUBLE_PRECISION=ON

offset of on non-standard-layout type 'JPH::ShapeCastSettings' [-Winvalid-offsetof]

Check warning on line 557 in JoltC/Functions.h

View workflow job for this annotation

GitHub Actions / Tests - ubuntu-latest Debug -DOBJECT_LAYER_BITS=32

offset of on non-standard-layout type 'JPH::ShapeCastSettings' [-Winvalid-offsetof]
const JPC_Body *inBody1,

Check warning on line 558 in JoltC/Functions.h

View workflow job for this annotation

GitHub Actions / Tests - ubuntu-latest Debug

offset of on non-standard-layout type 'JPH::ShapeCastSettings' [-Winvalid-offsetof]

Check warning on line 558 in JoltC/Functions.h

View workflow job for this annotation

GitHub Actions / Tests - ubuntu-latest Debug -DDOUBLE_PRECISION=ON

offset of on non-standard-layout type 'JPH::ShapeCastSettings' [-Winvalid-offsetof]

Check warning on line 558 in JoltC/Functions.h

View workflow job for this annotation

GitHub Actions / Tests - ubuntu-latest Debug -DOBJECT_LAYER_BITS=32

offset of on non-standard-layout type 'JPH::ShapeCastSettings' [-Winvalid-offsetof]
const JPC_Body *inBody2,

Check warning on line 559 in JoltC/Functions.h

View workflow job for this annotation

GitHub Actions / Tests - ubuntu-latest Debug

offset of on non-standard-layout type 'JPH::ShapeCastSettings' [-Winvalid-offsetof]

Check warning on line 559 in JoltC/Functions.h

View workflow job for this annotation

GitHub Actions / Tests - ubuntu-latest Debug -DDOUBLE_PRECISION=ON

offset of on non-standard-layout type 'JPH::ShapeCastSettings' [-Winvalid-offsetof]

Check warning on line 559 in JoltC/Functions.h

View workflow job for this annotation

GitHub Actions / Tests - ubuntu-latest Debug -DOBJECT_LAYER_BITS=32

offset of on non-standard-layout type 'JPH::ShapeCastSettings' [-Winvalid-offsetof]
const JPC_ContactManifold *inManifold,

Check warning on line 560 in JoltC/Functions.h

View workflow job for this annotation

GitHub Actions / Tests - ubuntu-latest Debug

offset of on non-standard-layout type 'JPH::ShapeCastSettings' [-Winvalid-offsetof]

Check warning on line 560 in JoltC/Functions.h

View workflow job for this annotation

GitHub Actions / Tests - ubuntu-latest Debug -DDOUBLE_PRECISION=ON

offset of on non-standard-layout type 'JPH::ShapeCastSettings' [-Winvalid-offsetof]

Check warning on line 560 in JoltC/Functions.h

View workflow job for this annotation

GitHub Actions / Tests - ubuntu-latest Debug -DOBJECT_LAYER_BITS=32

offset of on non-standard-layout type 'JPH::ShapeCastSettings' [-Winvalid-offsetof]
JPC_ContactSettings *ioSettings);

Check warning on line 561 in JoltC/Functions.h

View workflow job for this annotation

GitHub Actions / Tests - ubuntu-latest Debug

offset of on non-standard-layout type 'JPH::ShapeCastSettings' [-Winvalid-offsetof]

Check warning on line 561 in JoltC/Functions.h

View workflow job for this annotation

GitHub Actions / Tests - ubuntu-latest Debug -DDOUBLE_PRECISION=ON

offset of on non-standard-layout type 'JPH::ShapeCastSettings' [-Winvalid-offsetof]

Check warning on line 561 in JoltC/Functions.h

View workflow job for this annotation

GitHub Actions / Tests - ubuntu-latest Debug -DOBJECT_LAYER_BITS=32

offset of on non-standard-layout type 'JPH::ShapeCastSettings' [-Winvalid-offsetof]

Check warning on line 562 in JoltC/Functions.h

View workflow job for this annotation

GitHub Actions / Tests - ubuntu-latest Debug

offset of on non-standard-layout type 'JPH::ShapeCastSettings' [-Winvalid-offsetof]

Check warning on line 562 in JoltC/Functions.h

View workflow job for this annotation

GitHub Actions / Tests - ubuntu-latest Debug -DDOUBLE_PRECISION=ON

offset of on non-standard-layout type 'JPH::ShapeCastSettings' [-Winvalid-offsetof]

Check warning on line 562 in JoltC/Functions.h

View workflow job for this annotation

GitHub Actions / Tests - ubuntu-latest Debug -DOBJECT_LAYER_BITS=32

offset of on non-standard-layout type 'JPH::ShapeCastSettings' [-Winvalid-offsetof]
void (*OnContactPersisted)(

Check warning on line 563 in JoltC/Functions.h

View workflow job for this annotation

GitHub Actions / Tests - ubuntu-latest Debug

offset of on non-standard-layout type 'JPH::ShapeCastSettings' [-Winvalid-offsetof]

Check warning on line 563 in JoltC/Functions.h

View workflow job for this annotation

GitHub Actions / Tests - ubuntu-latest Debug -DDOUBLE_PRECISION=ON

offset of on non-standard-layout type 'JPH::ShapeCastSettings' [-Winvalid-offsetof]

Check warning on line 563 in JoltC/Functions.h

View workflow job for this annotation

GitHub Actions / Tests - ubuntu-latest Debug -DOBJECT_LAYER_BITS=32

offset of on non-standard-layout type 'JPH::ShapeCastSettings' [-Winvalid-offsetof]
void *self,

Check warning on line 564 in JoltC/Functions.h

View workflow job for this annotation

GitHub Actions / Tests - ubuntu-latest Debug

offset of on non-standard-layout type 'JPH::ShapeCastSettings' [-Winvalid-offsetof]

Check warning on line 564 in JoltC/Functions.h

View workflow job for this annotation

GitHub Actions / Tests - ubuntu-latest Debug -DDOUBLE_PRECISION=ON

offset of on non-standard-layout type 'JPH::ShapeCastSettings' [-Winvalid-offsetof]

Check warning on line 564 in JoltC/Functions.h

View workflow job for this annotation

GitHub Actions / Tests - ubuntu-latest Debug -DOBJECT_LAYER_BITS=32

offset of on non-standard-layout type 'JPH::ShapeCastSettings' [-Winvalid-offsetof]
const JPC_Body *inBody1,
const JPC_Body *inBody2,
const JPC_ContactManifold *inManifold,
Expand Down Expand Up @@ -1159,6 +1159,23 @@
JPC_API void JPC_CylinderShapeSettings_default(JPC_CylinderShapeSettings* object);
JPC_API bool JPC_CylinderShapeSettings_Create(const JPC_CylinderShapeSettings* self, JPC_Shape** outShape, JPC_String** outError);

////////////////////////////////////////////////////////////////////////////////
// PlaneShapeSettings -> ShapeSettings

typedef struct JPC_PlaneShapeSettings {
// ShapeSettings
uint64_t UserData;

// PlaneShapeSettings
// TODO: Material
JPC_Vec3 Normal;
float Constant;
float HalfExtent;
} JPC_PlaneShapeSettings;

JPC_API void JPC_PlaneShapeSettings_default(JPC_PlaneShapeSettings* object);
JPC_API bool JPC_PlaneShapeSettings_Create(const JPC_PlaneShapeSettings* self, JPC_Shape** outShape, JPC_String** outError);

////////////////////////////////////////////////////////////////////////////////
// ConvexHullShapeSettings -> ConvexShapeSettings -> ShapeSettings

Expand Down
28 changes: 28 additions & 0 deletions JoltCImpl/JoltC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include <Jolt/Physics/Collision/Shape/CylinderShape.h>
#include <Jolt/Physics/Collision/Shape/MeshShape.h>
#include <Jolt/Physics/Collision/Shape/MutableCompoundShape.h>
#include <Jolt/Physics/Collision/Shape/PlaneShape.h>
#include <Jolt/Physics/Collision/Shape/SphereShape.h>
#include <Jolt/Physics/Collision/Shape/StaticCompoundShape.h>
#include <Jolt/Physics/Collision/Shape/TriangleShape.h>
Expand Down Expand Up @@ -1907,6 +1908,33 @@ JPC_API bool JPC_CylinderShapeSettings_Create(const JPC_CylinderShapeSettings* s
return HandleShapeResult(settings.Create(), outShape, outError);
}

////////////////////////////////////////////////////////////////////////////////
// PlaneShapeSettings

static void to_jph(const JPC_PlaneShapeSettings* input, JPH::PlaneShapeSettings* output) {
output->mUserData = input->UserData;

// TODO: Material
output->mPlane = JPH::Plane(to_jph(input->Normal), input->Constant);
output->mHalfExtent = input->HalfExtent;
}

JPC_API void JPC_PlaneShapeSettings_default(JPC_PlaneShapeSettings* object) {
object->UserData = 0;

// TODO: Material
object->Normal = JPC_Vec3{0, 1, 0, 1};
object->Constant = 0.0;
object->HalfExtent = JPH::PlaneShapeSettings::cDefaultHalfExtent;
}

JPC_API bool JPC_PlaneShapeSettings_Create(const JPC_PlaneShapeSettings* self, JPC_Shape** outShape, JPC_String** outError) {
JPH::PlaneShapeSettings settings;
to_jph(self, &settings);

return HandleShapeResult(settings.Create(), outShape, outError);
}

////////////////////////////////////////////////////////////////////////////////
// ConvexHullShapeSettings

Expand Down
Loading