Hi guys i want really really basic collision detection. Im using old opengl (Glut)
So i implemented my game engine dynamic shadows,obj loader,bmp loader but something wrong i was passing from walls. So I tried to write really basic collision detector but not work as expected:
void distance(float x1, float y1,
float z1, float x2,
float y2, float z2)
{
float d = sqrt(pow(x2 - x1, 2) +
pow(y2 - y1, 2) +
pow(z2 - z1, 2) * 1.0);
if(d = x2,y2,z2) {
x2--;
//y2--;
z2--;
std::cout << std::fixed;
cout << " Colission Enter " << d;
}
return;
}
But my code is bad and only gets collision from one axis. I asked in stackoverflow but i dont get any answers so my last choice Khronos forums
So thanks for all answers
Also your code can be buggy no problem i accept everything.
I dont want use physics libraries so complex .