After following the Objective-C tutorial (and converting to C++), this happened

Post Reply

User avatar
drleviathan
Posts: 572
Joined: Tue Sep 30, 2014 6:03 pm
Location: San Francisco

Re: After following the Objective-C tutorial (and converting to C++), this happened

Post by drleviathan » Tue Feb 11, 2020 5:14 pm

I watched the video. What I saw: a dynamic box descended and bounce on the floor (which appeared to be thin mesh square). Upon hitting the floor a second time the box tunnelled through and continued falling.

Tunnelling... it is a known problem with physics simulations. There are a few ways to solve it for your case:

(1) Use a convex shape for the floor rather than a thin mesh. Make sure the vertical dimension of your convex shape is larger than 2X the max expected per-substep position change of your dynamic box.

(2) Enable continuous collision detection (CCD), and configure it properly, for the dynamic box.

(3) If you really must use a thin shape for the floor... take smaller substeps such that the box never moves more than 1/2 its smallest dimension at whatever it its maximum expected velocity.

Starconstructor
Posts: 2
Joined: Mon Feb 10, 2020 5:56 pm

Re: After following the Objective-C tutorial (and converting to C++), this happened

Post by Starconstructor » Mon Feb 17, 2020 4:52 pm

Great. What’s the terminology for other potential problems with physics, so I don’t have to come back?

User avatar
drleviathan
Posts: 572
Joined: Tue Sep 30, 2014 6:03 pm
Location: San Francisco

Re: After following the Objective-C tutorial (and converting to C++), this happened

Post by drleviathan » Tue Feb 18, 2020 5:30 pm

Alas, that question is too broad. The answer spans entire textbooks on the subject. Best to come back when you have a specific issue or question.

Post Reply