Skip to main content
GameDev.net gamedev.net
🔒 Locked

Organizing a dynamic 2d world.

Started by rakoon2 Dec 29, 2004 at 5:26 PM 1 replies 1k views
Original Post
rakoon2
rakoon2
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
Zakwayda
Zakwayda
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.
rakoon2
rakoon2
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!

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.