Skip to main content
gamedev.net
🔒 Locked

Sliding boxes

Started by Ilici 1 reply 700+ views
Original Post
Ilici
Ilici
I'm trying to work out an algorithm to slide 3D AABBs against each other, making sure that they move correctly as they may have different velocities. I don't know if i should go for a full-blown polygonal collision detection and resolution algorithm or a specific AABB case. I don't store the mass of the objects so there are only movable and immovable objects so if the objects should be moved apart they will be moved by the same amount. So how do i find the vector along which i should separate the objects, using their previous and current positions? I think i have to find the side against which i have to project outside but can i find it without having to do a test on each of the vertices of each AABB ? On a closer look i think only the 2D case should be covered as for height i need to hack some stair climbing detection.
oliii
oliii
you'll still need the full 3D I'd recon.

you can have a look at this.

the case for axis aligned bounding boxes is actually easier. you'll only have 3 projection axes (X, Y, Z). Hope you'll understand the document. I could use some feedback on those.
Everything is better with Metal.
oliii
oliii
... but in short. THe separation vector you are looking for would be the MTD (Minimum Translational Distance). Basically the axis between (-X, +X, -Y, +Y, and -Z, +Z) with the minimum overlap distance.
Everything is better with Metal.

Topic Locked

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

Sign in to reply to this topic.