-
Hello! I've integrated Velcro Physics into an ECS I've built for MonoGame. Since the beginning I've had some challenges using Dynamic Bodies effectively, primarily around Gravity response and Gravity while the body is applying forces resulting in odd behaviors / movement that just doesn't seem right! Is there official documentation around the setup of the Physics World object and Forces? I'd like to make sure I'm using the system correctly and get the simulation straightened out! For further context around where the issues may be stemming from, I have a Pixel-Perfect render pipeline that uses an "internal render resolution" before scaling that pixel-perfect result up to the full screen resolution. I've set the World Simulation to operate at the internal render resolution (since that seemed appropriate) with the Display to Sim Units Ratio being around 28 Pixels-Per-Unit. Are there any specifics about the Velcro+MonoGame implementation I can read into? I've started reading the source code for Velcro as well as Box2D to get a better idea of what's going on, but any official Velcro Docs would be much appreciated! Thank you! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
Velcro is a combination of Box2D (with some perf improvements) and a lot of helpful tools to build/manipulate polygons. Box2D has great docs already, so I don't see the need to replicate them since 95% of the terms/subjects are transferrable. There are a few best-pratices you should follow:
Could you describe the issues you have? Maybe record a video of what's happening. |
Beta Was this translation helpful? Give feedback.
I got it figured out - There were signs that the problem was scaling, I thought I had taken care of Pixels to Unit Conversions and my test was using the DebugView to validate... well! Like many code tests, the test wasn't working right so I refactored the test until it passed (basically haha) Thinking, "surely the code is right, everything works besides the test"
TLDR; the DebugView didn't seem to align with my world, I thought I had taken care of pixels/coordinates conversions to Units so I 'fixed' the Matrix for the DebugView so it aligned with the world... turns out, I missed some conversion steps for Pixels-Per-Unit! The Physics System and Dynamic Bodies are now working properly with …