orangeduck / Corange

Pure C Game Engine
http://www.youtube.com/watch?v=482GxqTWXtA
Other
1.78k stars 199 forks source link

Sea demo bug #81

Closed infdivzero closed 1 year ago

infdivzero commented 1 year ago

After a short while, the ellipsoid disappears. I put a printf into sea_update() to see what happens to the ellipsoid's position and saw the coordinates decreasing until they hit nan at which point the disappearing happens. What's causing this? Is this part of why the physics demo adds its own physics functions?

I didn't see any of the balls disappear (although the ball count seems to be off by one) in the physics demo, and since they're constantly bouncing, I think it could be a gravity handling problem

blogdron commented 1 year ago

The engine's physics functions only handle collisions. The reaction of models to collisions will be set by the programmer through the callback. The game tells you that a collision has occurred here, then it's up to you and your physics processors. The fact that the capsule fails is a bug, but the author of the graphic programmer warns about it in README, studying and fixing the behavior of the capsule will be a good homework, at the same time it will be clear how to work with collisions and how to add your own collision handlers, you will have to add real physical behavior yourself =) The demo with bouncing balls is the same, it just either has gravity or it can be turned off, the engine determines only the moments of collision, and then just through the reflection function (like light), the balls bounce off the platform, no rotations and complex behaviors. The balls jump because it seemed to me that if they just crawled it would not be so fun because they do not interact with each other :smile: