# JoEngine: sample of 3d collision?

#### celsowm

Hi everyone !
I would like to ask you guys if is there a sample/example of a simple 3d collision using Jo Engine to help newbies to understand how to do that.

#### Ponut

Gear Supporter
It's relatively simple to do a axis-aligned box collision

First, you need to define the X, Y, Z radius of each object (size)

Then define the position of each object

Then get the absolute distance from each object to each other object in X,Y,Z (xd = JO_ABS(x1 - x2) etc).

Then you know if any object's distance to the other object minus the radius of both objects is less than 0, they are colliding.

• celsowm

#### celsowm

It's relatively simple to do a axis-aligned box collision

First, you need to define the X, Y, Z radius of each object (size)

Then define the position of each object

Then get the absolute distance from each object to each other object in X,Y,Z (xd = JO_ABS(x1 - x2) etc).

Then you know if any object's distance to the other object minus the radius of both objects is less than 0, they are colliding.

If you have or can provide a small .c example I would appreciate a lot.

Replies
7
Views
243
Replies
2
Views
543
Replies
4
Views
583
Replies
5
Views
599
Replies
3
Views
1K