Box2D Forums

It is currently Sun May 19, 2013 7:43 am

All times are UTC - 8 hours [ DST ]




Post new topic Reply to topic  [ 1 post ] 
Author Message
PostPosted: Thu Jul 23, 2009 11:41 pm 
Offline

Joined: Mon Jun 08, 2009 12:21 pm
Posts: 353
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 :D .

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.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC - 8 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group