Skip to content

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