Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KHR_physics_rigid_bodies Draft Proposal #2424

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

eoineoineoin
Copy link
Member

@eoineoineoin eoineoineoin commented Jul 10, 2024

Obsoletes #2257 - lot of iteration and discussion since initial pull request.

Known Implementations

Blender importer/exporter
Babylon.js importer
Godot importer

Sample Assets

https://github.com/eoineoineoin/glTF_Physics/tree/master/samples

Comment on lines +149 to +157
"extensions": {
"KHR_collision_shapes" : {
"shapes": [
{
"mesh": { "mesh": 0 },
"type": "mesh",
"extensions": {
"KHR_physics_rigid_bodies": {
"convexHull": true
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see that this was removed from KHR_collision_shapes. Why? What are the intended users of KHR_collision_shapes that are not KHR_physics_rigid_bodies?

In OMI_physics_gravity, I am making use of convex hulls, as it is one of the allowed shape types when the type of gravity is set to shaped gravity. It seems weird to put the definition of this inside of KHR_physics_rigid_bodies when it makes more sense to use KHR_collision_shapes.

Aside from KHR_physics_rigid_bodies and OMI_physics_gravity, which extensions need the collision shape types box, sphere, capsule, cylinder, and concave mesh, but not convex hull? Basically every physics system ever supports them. If an implementation does not support convex hulls for some reason, what use does it have for boxes and spheres, which are also convex objects? Or is the concern that people may misuse convex hulls somehow?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

KHR_collision_shapes is deliberately separated from KHR_physics_rigid_bodies to enable the geometries to be used by any number of future extensions, not necessarily limited to the domain of rigid body simulation. For example, node selection or 3D UI components, etc.

There was a concern that for these simpler use-cases, writing or importing code to generate convex hulls would be prohibitively complex. I agree that convex hulls are a necessity for rigid body simulation, which is why this property was moved to this extension. In addition, this configuration enables the rigid body specification to describe convex hulls of future shape types such as signed distance fields.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants