Quantcast
Channel: Community | MonoGame - Latest topics
Viewing all articles
Browse latest Browse all 6821

3D collision detection with irregular objects.

$
0
0

@MuntyScruntFundle wrote:

So I thought I'd make a few lozenge shaped objects, kind of like long rocks, to do some collision testing.

Quickly I realised the BoundingSphere is no use here, because at least 50% of the produced sphere is empty.space.

How would you get around this scenario? I've thought of 2 possible solutions, but have no idea which would be the most expensive or what drawbacks there would be.
1. Create the object as 2 meshes, each being roughly spherical, then loop the meshes in the collision testing. The downside being texturing could be difficult.
2. Use one mesh and do two checks, one at each end of the object. Downside being there's a load more math finding the 'centre' of each end of the object.

This problem is obviously going to rear its head with any number of irregular objects.

Then I thought, what about a disk shape, something like a tablet, or a jar lid. It has a circular or rectangular area but little height. How would you go about collision testing that object? It would be very difficult to create out of small meshes.

Then, what if you have multiple objects of different shapes in the same scene and want to collision test everything?

I know I'm getting into the realms of physics engines rather than games, but I want to test the limits of what I can get before starting something, getting half way though, and realising I've gone in a dumb direction.

Any input would be gratefully received.

Thank you.

Posts: 2

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 6821

Trending Articles