I'm making a game like MineCraft,
But I can fix my Collision for each block,
When I walk over it with an FPS camera I still can go true it.
I already read the Collision tutorial 4 times, and I know how to use it but It always gives errors, so I'm asking someone to help me.
I use this code (Check the end of the post) to draw the blocks when they are not existing,
I will redo it but first I need to fix the collision. (The Player is 2 Blocks High).
Is there a way todo this?
Code: Select all
{
while(true)
{
//Handle Game//
for (int I = 0; I < 500; I++)
{
if (Block[I].ID != NULL)
{
if (Block[I].Skin == NULL) // Create Objects if not exist.
{
Block[I].Skin = smgr->addCubeSceneNode();
Block[I].Skin->setScale(core::vector3df(0.80f,0.80f,0.80f));
Block[I].Skin->setPosition(Block[I].Position);
Block[I].Skin->setMaterialTexture(0, BlockTex[Block[I].Type]);
Block[I].Skin->setMaterialFlag(video::EMF_LIGHTING, false);
}
}
}
Sleep(10);
}
return 0;
}