• Create Account

### #Actualtheo2005

Posted 28 June 2012 - 03:41 AM

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..

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

### #1theo2005

Posted 27 June 2012 - 03:53 PM

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..

PARTNERS