notgiven688/jitterphysics2

ConvexHullShape with flat meshes

Khhs167 opened this issue · 3 comments

Hi! I'm currently working on implementing this library into my engine when I noticed I get an error whilst loading collision meshes.

Strange, I thought, so I had a look and found out that the issue lied in the fact that one of my collision meshes was simply a completely flat plane.

This then led to the mass calculations resulting in a mass of 0(since it's infinitely thin). And since 0 mass is disallowed it throws an error.

I'm wondering if there might be a fix available for this?

Thank you for reporting this. This sounds like a bug introduced with: 89d46a8

I guess you are creating static geometry and therefore do not care for the mass of the body?

Edit: To clarify, which exception are you hitting? This one: https://github.com/notgiven688/jitterphysics2/blob/89d46a86489b0e09dab9deb072a4e8f45b371ec9/src/Jitter2/Dynamics/RigidBody.cs#L342C1-L343C122 ?

I'm personally creating static geometry but I could imagine that's not the case for everyone who might experience this issue.

Also yes, it is that exact exception.

I think we can just remove the exception. It does not serve any purpose (any longer): #112