Quick Programming Tip: Get Overlapping Area Between Two AABBs.

Quick Programming Tip: Get Overlapping Area Between Two AABBs.

Another Quick Programming Tip comes today. Since I searched through google how to get a the box generated by two overlapping AABBs and found nothing, I found the answer myself and thought it would be good to share it here, so here it goes!

The Question:

You got two AABBs, you know they intersect, and you want to find this inner area, how would you proceed?

2015-04-29 20_16_02-Blender
Continue reading →

Share this:
Quick Programming Tip: Rotate Actor to Face and the Perp Dot Product

Quick Programming Tip: Rotate Actor to Face and the Perp Dot Product

Here’s a new occasional series: Quick Programming Tips! These we’ll usually be a question for a small problem, and the solution with explanation for it.

The Question:

Here’s the first one! How do I rotate progressively a entity to face another entity? For example, you have two entities Red and Blue. You want Blue to attack Red, but Blue is not facing Red, but the opposite side.

Blue is facing the opposite side.

Blue is facing the opposite side.

Obviously, if Blue attack Red without facing him, it will not look good at all. So he has to look in the direction of Red to properly attack him.

Continue reading →

Share this: