voxelTerrain
voxelTerrain copied to clipboard
Program BASSERT on add cubes
When add to t_voxelContainer some cubes(Edit::box) program stop on assert voxelsPerTile = 24 This is situation when cube past in the border between tiles?
if create Cubes by press mouse button all is Ok
quaternion rotation;
rotation = rotation * quaternion(Ogre::Degree((float)handler.RandomInt(45,15)).valueDegrees(), Ogre::Degree((float)handler.RandomInt(45,15)).valueDegrees(), Ogre::Degree((float)handler.RandomInt(45,15)).valueDegrees(),
Ogre::Degree((float)handler.RandomInt(45,15)).valueDegrees());
//auto bb=t_editBox::create(handler.RandomInt(7,35), rotation);
t_editBox::pointer boxEdit(t_editBox::create(handler.RandomInt(7,35), rotation));
//bb.data()->diffuseToSet=colour(handler.RandomInt(50,190)/255.0f,handler.RandomInt(50,190)/255.0f,handler.RandomInt(50,190)/255.0f, 1.0);
voxelContainer->editVoxel(boxEdit,transform(Ogre::Vector3(handler.targetPos.x, handler.RandomInt(7,25), handler.targetPos.z)));
where handler.targetPos.x and y mouse position on plane from picture
But if change last line to
voxelContainer->editVoxel(boxEdit,transform(Ogre::Vector3(handler.RandomInt(-250,250) , handler.RandomInt(7,25), handler.RandomInt(-250,250))));
error appears
and think the same problem
if create Cubes in loop, from number cubes more than 9 they lose there orientation
for(int i=0; i<19; i++)
{
rotation = rotation * quaternion(Ogre::Degree((float)handler.RandomInt(45,15)).valueDegrees(), Ogre::Degree((float)handler.RandomInt(45,15)).valueDegrees(), Ogre::Degree((float)handler.RandomInt(45,15)).valueDegrees(),
Ogre::Degree((float)handler.RandomInt(45,15)).valueDegrees());
t_editBox::pointer boxEdit(t_editBox::create(handler.RandomInt(7,35), rotation));
voxelContainer->editVoxel(boxEdit,transform(Ogre::Vector3(handler.RandomInt(-250,250) , handler.RandomInt(7,25), handler.RandomInt(-250,250))));
}