Why doesn't my object collision work?

Started by
-1 comments, last by theo2005 11 years, 10 months ago
[s]Here's the code to show what I'm doing:


static float (* FrontX)[4] = new float[ObjectQuantity][4];
static float (* FrontY)[4] = new float[ObjectQuantity][4];
static float (* FrontZ)[4] = new float[ObjectQuantity][4];
static float (* BackX)[4] = new float[ObjectQuantity][4];
static float (* BackY)[4] = new float[ObjectQuantity][4];
static float (* BackZ)[4] = new float[ObjectQuantity][4];
for (int count = 0; count < 4; ++ count)
{
FrontX[ObjNum][count] = front[count].x;
FrontY[ObjNum][count] = front[count].y;
FrontZ[ObjNum][count] = front[count].z;
BackX[ObjNum][count] = back[count].x;
BackY[ObjNum][count] = back[count].y;
BackZ[ObjNum][count] = back[count].z;
}
for (int count = 1; count < ObjectQuantity; ++ count) //count 1+ because 0 is player, other objects wont collide
{
for (int CountCorner = 0; CountCorner < 4; ++ CountCorner)
{
if (FrontX[0][CountCorner] == FrontX[count][CountCorner])
{
Movement = FALSE;
}
}
}


I'm only checking the Front X corners of every object, just to check if they collide, but movement never turns false. If I change the == operand to bigger or smaller, then movement becomes false... HOW?? What exactly am I doing wrong here? I tried bashing my player into a wall walking straight, backwards, turning, whatever..[/s]

Nevermind! I figured it out myself. Even though now bound drawing system is bugged somewhat, but oh well...

This topic is closed to new replies.

Advertisement