I noticed that the whole overriding transformation methods in debug draw was rather dirty and very awkward, especially if you're trying to maintain your own viewport transformations in your own program. So instead I make DebugDraw use an IViewportTransform
interface, which has all necessary functions for any generic drawing transformations, yet staying detached from the drawing itself. I also included an OBBViewportTransform
, which uses an OBB to transform world coordinates to the screen (and back). This also means you can do slightly more crazy stuff, like rotations (uses a Mat22, so nothing too crazy).
The great thing about the interface is that you can make your own transformation class and do whatever types of transforms you want (like messing with 3x3 or 4x4 matrices), and have the debugdraw do all the correct rendering
DebugDraw still includes it's old methods transformation methods (which use the new ViewportTransform), so it shouldn't be that big of a deal to update your code.