Opinions: Overlap vs Gap

Started by
1 comment, last by Ghost Clock 11 years, 9 months ago
I'd like to get some opinions on something that I'm pretty sure is just me being an overly picky perfectionist. I have a tank and a block that are in real world terms, "touching". My collision code (which is not going to be altered unless it can't be helped) is pretty accurate most of the time but some innaccuracy is inevitable (floating point values and all that). So with that, which would be better in the rare instance where the accuracy isn't perfect? Overlap:
overlap.jpg
or Gap:
gap.jpg

Remember, in both of these pictures, the block and tank are touching, right next to each other. With the extra gap data added to the collision data of each object, there shouldn't ever be any overlap but there will also always be a gap between objects 99% of the time. Without the gap data added, overlapping will happen some times but most of the time it'll look dead on.

Getting the gap data is also a bit of extra work where as getting the default data is all but automated.

I'm not making a game about rubbing tanks up against walls, so I have doubts anyone will even notice but that little voice in the back of my head won't shut up until I get a few opinions on what others think would be preferable. Personally, they both bug me equally.
Advertisement
In my opinion, the gap would be better, unless you are pushing blocks and seeing the block move with a gap between the thing pushing it and the block being pushed.

Why not say, "If A is inside B, set A's left edge to be equal to B's right edge"?

In my opinion, the gap would be better, unless you are pushing blocks and seeing the block move with a gap between the thing pushing it and the block being pushed.

That's a really good point to think about. Not the case as it happens but I'll keep that in mind if I end up reusing this code for such a mechanic.

Why not say, "If A is inside B, set A's left edge to be equal to B's right edge"?
[/quote]
I don't have a good short answer to that and would struggle to explain it in detail. I get what you're saying though, I've used such a method before but it wouldn't be ideal to make work with my current collision check methods.

This topic is closed to new replies.

Advertisement