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

rgreid: added new "Spinning top" demo to compound.html. #121

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

rgreid
Copy link

@rgreid rgreid commented Feb 9, 2014

Two cylinders demonstrating gyroscopic precession, as per my email.

@schteppe
Copy link
Owner

schteppe commented Feb 9, 2014

Hi,
Thanks for the demo! Actually, Cannon.js does not have correct physics for gyroscopic forces. These are often omitted in physics engines because they make the simulations less stable. Your demo seem to work quite well anyway, and I'm a bit surprised that it works so well without gyro forces.

Stefan

@rgreid
Copy link
Author

rgreid commented Jul 1, 2014

Thanks Stefan. I understand the stability issues. Do you have a rough estimate how complex the code changes would be to implement gyroscopic forces? i.e. if I set a summer student working on it.

@schteppe
Copy link
Owner

schteppe commented Jul 1, 2014

Hm. Not sure. The actual force is computed in just a few lines of code, see the implementation in Bullet physics here: http://bulletphysics.org/Bullet/BulletFull/btRigidBody_8cpp_source.html#l00260

What I'm unsure about is whether this math should go into the constraint equations somewhere. In that case, we're talking complicated physics stuff.

@rgreid
Copy link
Author

rgreid commented Jul 1, 2014

ODE implements gyroscopic forces directly in the main stepping code. It also uses an approximation [1] to make things more stable: https://bitbucket.org/odedevs/ode/src/a2104504c78b79cd9a08a6d9de49260304786015/ode/src/step.cpp?at=default#cl-445

[1] "Stabilizing Gyroscopic Forces in Rigid Multibody Simulations" (Lacoursière 2006)

@schteppe
Copy link
Owner

schteppe commented Jul 2, 2014

If it's nothing more than adding some force, then it should be simple to implement. Testing would take take most time.

d3x0r pushed a commit to d3x0r/cannon.js that referenced this pull request Jan 18, 2022
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.

None yet

2 participants