HomeForumsWhat's newResources 
 
 
JoEngine: sample of 3d collision?
celsowm - Aug 8, 2020
 celsowm Aug 8, 2020
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.

Thanks in advance

 Ponut Aug 9, 2020
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 Aug 10, 2020

Ponut said:


Thanks for your answer.
If you have or can provide a small .c example I would appreciate a lot.