idmillington / cyclone-physics

The Physics engine that accompanies the book "Game Physics Engine Design"
MIT License
931 stars 262 forks source link

Issue with Collision Box - no rest pose is reached #60

Closed dame-time closed 1 year ago

dame-time commented 1 year ago

Hi, I've tried to implement the engine (the Rigid Body one) inside my "Game Engine" sort, though I have a minor issue with the Collision Box component!

For some strange reason, I have this behavior if I rotate the cube before letting it fall to the ground!

https://user-images.githubusercontent.com/61808196/195894745-97fb8942-1e20-4e82-94d3-cdd5cb01f5da.mp4

Does anyone have some clue about what is happening? I double-checked the entire implementation of the engine and everything looks correct to me!

I don't need the actual solution, I just need a possible explanation of what is happening.

ButchDean commented 1 year ago

It sounds like you have reference code to compare to yours. Unfortunately human eyes are not the best and spotting differences in code.

Have you tried using a diff tool to compare the code? Is your code pushed anywhere?

ftedoldi commented 1 year ago

It sounds like you have reference code to compare to yours. Unfortunately human eyes are not the best and spotting differences in code.

Have you tried using a diff tool to compare the code? Is your code pushed anywhere?

We solved! There were some problems in our Quaternion class and vertex shader that caused that strange visual behaviour. Thanks for the answer!

dame-time commented 1 year ago

Yep, also a bug of the Look At, sorry for the vague question, and thanks for your time!