since pos.Y =0, y = 0, cubescale.Y = 20, and offset = 0.02f I am not understanding the value of p.Y
all variables are float (f32)
Code: Select all
irrObject* irrLevel::createObject_Pyramid(int id, vector3df pos, vector3df rot, vector3df scale, vector3df cubescale, float mass, stringc texturefilename)
{
vector3df p = pos;
vector3df r(0, 0, 0);
float offset = getPhysX3Manager()->getSkinWidth();
float x, y, z;
for (y = 0; y < scale.Y; y++)
{
p.Y = pos.Y + (y* (cubescale.Y + offset));
for (x = 0; x < scale.X - y * 2; x++)
{
p.X = pos.X + x* (cubescale.X + offset);
for (z = 0; z < scale.Z - y * 2; z++)
{
p.Z = pos.Z + z* (cubescale.Z + offset);
createObject_Cube(id, p, r, cubescale, mass, texturefilename);
}
}
pos.X += cubescale.X;
pos.Z += cubescale.Z;
}
return NULL;
}