voxelTerrain icon indicating copy to clipboard operation
voxelTerrain copied to clipboard

Program BASSERT on add cubes

Open geotyper opened this issue 5 years ago • 1 comments

Screenshot at 2020-01-30 12-31-25 Screenshot at 2020-01-30 12-30-32 Screenshot at 2020-01-30 12-30-20

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

geotyper avatar Jan 30 '20 09:01 geotyper

and think the same problem Screenshot at 2020-01-30 13-09-23

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))));
        }

geotyper avatar Jan 30 '20 10:01 geotyper