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

Added new transform property to cpSpaceDebugDrawOptions #208

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

viblo
Copy link

@viblo viblo commented Aug 17, 2021

This PR adds a transform property to cpSpaceDebugDrawOptions, and the transform is applied on the drawing of shapes. However, it is not applied to the size of the dot when drawing constraints. In this way you can make a scaling transform and zoom in without the constraint dots filling up the screen hiding everything else.

This is also the reason why this change has to be done in cpSpaceDebug, since if I just do the transform inside the draw functions (dot, segment, fat segment etc) drawing of DampedSpring will not work nicely. (This is what I tried first)

Code can most likely be optimized further, Im open to suggestions.

@slembcke
Copy link
Owner

This is already handled using the ChipmunkDebugDrawPointLineScale global constant. Is it possible to just use that instead?

@viblo
Copy link
Author

viblo commented Nov 16, 2023

It was a while since I looked at this, but I think in addition to the point sizes also the spring (the zigzag part) didnt scale properly.

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.

2 participants