Hi folks,
i use the matrix functions that were part of the examples in the SDK:
Code: Select all
void matrix_multiply(float* result, float* a, float* b)
{
unsigned int i,j,k;
float temp[16];
for (i = 0; i < 4; ++i)
{
for (j = 0; j < 4; ++j)
{
float t = 0.0f;
for (k = 0; k < 4; ++k)
t += a[(k << 2)+j] * b[(i << 2)+k];
temp[(i << 2)+j] = t;
}
}
memcpy(result,temp,sizeof(float)*16);
}
Code: Select all
matrix_identity((float*)&world);
matrix_identity((float*)&tmpworld);
matrix_multiply((float*)&world, &world, &tmpworld);
since its part of a 3d game i want it to be in cpp cause of the object oriented way of programming.
well i copied the code but i got an error with that exact code:
Code: Select all
bj.cpp:165: error: cannot convert 'ScePspFMatrix4*' to 'float*' for argument '2' to 'void matrix_multiply(float*, float*, float*)'
O
my question: Why this difference in code? why does my old code won't work anymore?