Xna updating bounding box canadain dating

23 Mar

Creating the bounding box: The creation of a bounding box is pretty simple.

In this case, our sprite's pivot point is at it's centre, so our top left corner is half the height and width away from our position.

I am working on a cross platform game, and Cocos2D-XNA currently lacks on Mouse Support. I see that the other platform specific input devices are hold together via interfaces and implemented on CCNode.

These are: ICCTargeted Touch Delegate, ICCStandard Touch Delegate, ICCTouch Delegate, ICCKeypad Delegate, ICCKeyboard Delegate.

This part specifically explains what an axis aligned bounding box actually is, as well as how to detect if two such bounding boxes have collided.

Let's take a look at what happens when two spheres are touching.

If you are unfamiliar with Java Script, some of this code might look a bit confusing.

Basically what we are doing is adding a method to the "".

It's not too bad1) Orientate the object to it's identity.2) Search through all the vertices finding the min(x,y,z) and the max(x,y,z).

This will be the min and max of your obb.3) Then simply rotate it back.