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

chipmunk unsafe #11

Closed
dnldd opened this issue Jan 2, 2012 · 2 comments
Closed

chipmunk unsafe #11

dnldd opened this issue Jan 2, 2012 · 2 comments

Comments

@dnldd
Copy link

dnldd commented Jan 2, 2012

Chipmunk_unsafe.h allows changing the shapes attached to a body but does not expose functions for creating unattached shapes - to the body. Is there a reason for this? One possible scenario this would be useful is changing the collision area of a body during runtime to correlate with that body's animation. Shapes bounding the frames of the animation could be loaded from a file, initialized and attached when needed. Thoughts?

@slembcke
Copy link
Owner

slembcke commented Jan 2, 2012

To enable or disable a shape, you just need to add or remove it from the space. Keep in mind that as the comments in the header warn, Chipmunk will have no idea how the shape of a body changed. If adding a new shape causes it to overlap something else, they will sort of mush apart from each like sponges and not rigid objects.

@slembcke slembcke closed this as completed Jan 2, 2012
@dnldd
Copy link
Author

dnldd commented Jan 2, 2012

Thanks for the clarification. Attaching all the shapes to a body and enabling/disabling when needed should yield the same results without using chipmunk_unsafe.h. Nice.

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

No branches or pull requests

2 participants