Sign in to follow this  

Organizing a dynamic 2d world.

This topic is 4730 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello guys! I am currently developing 2d stuff for my engine. 1.) Every non static object is a node in a SceneGraph. 2.) Static collision-only objects are put into a AABRTree, axis aligned bounding recteangle tree. This allows fast collision detection. I have a few questions here: a:) Are AABRTress only useful for static / nonmoving objects? I would have to recalculate the tree everytime a object moves! b.) What type of objects should I make the tree for? Currently my collision objects have a Polygon and a Position and are not scenegraph nodes. Bad? =| 3.) How should I lay out my moveable entitys? Entity2 (2 meens 2d) inherites from Node and has a rigid body object inside. The rigid body object itself has the following things: 1.) A polygon 2.) A 2x2 matrix used for rotations 3.) Velocity 4.) Angular Velocity 5.) Mass, Inertia, Density, ... I have already coded a complete collision system btwn polygons. .) More to come :D Thank you for your time. Good bye! :D

Share this post


Link to post
Share on other sites
Short answer: look into both 'sweep and prune' and 'loose quad/octrees' as possible solutions to organizing your dynamic objects.

Sweep and prune with AABBs is discussed in one of the Baraff papers, I believe (?). Loose octrees are discussed in one of the first two Game Programming Gems books. And of course you're sure to find material using google or the archive search function here on gamedev.

Share this post


Link to post
Share on other sites
Loose trees.. ohh.

But a perfect tree for static/non obing objects would be fine? I would have to reload the tree if I change levels or if the player moves over a portal. ( Eg leaving a closed areal. )



Thanks. See you later!

Share this post


Link to post
Share on other sites

This topic is 4730 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this