Scaled vertices to always be integers.

This commit is contained in:
David Williams
2007-08-31 22:19:47 +00:00
parent 107c4ae860
commit ca0805bd2f
3 changed files with 101 additions and 43 deletions

25
include/Constants.h Normal file
View File

@ -0,0 +1,25 @@
#ifndef __Constants_H__
#define __Constants_H__
namespace Ogre
{
//FIXME - i think we can define mod using a bitmask which flattens the upper bits. Should define that here.
const unsigned int OGRE_BLOCK_SIDE_LENGTH_POWER = 5;
const unsigned int OGRE_BLOCK_SIDE_LENGTH = (0x0001 << OGRE_BLOCK_SIDE_LENGTH_POWER);
const unsigned int OGRE_NO_OF_VOXELS_IN_BLOCK = (OGRE_BLOCK_SIDE_LENGTH * OGRE_BLOCK_SIDE_LENGTH * OGRE_BLOCK_SIDE_LENGTH);
const unsigned int OGRE_VOLUME_SIDE_LENGTH_POWER = 8;
const unsigned int OGRE_VOLUME_SIDE_LENGTH = (0x0001 << OGRE_VOLUME_SIDE_LENGTH_POWER);
const unsigned int OGRE_VOLUME_SIDE_LENGTH_IN_BLOCKS = (OGRE_VOLUME_SIDE_LENGTH >> OGRE_BLOCK_SIDE_LENGTH_POWER);
const unsigned int OGRE_NO_OF_BLOCKS_IN_VOLUME = (OGRE_VOLUME_SIDE_LENGTH_IN_BLOCKS * OGRE_VOLUME_SIDE_LENGTH_IN_BLOCKS * OGRE_VOLUME_SIDE_LENGTH_IN_BLOCKS);
const unsigned int OGRE_NO_OF_VOXELS_IN_VOLUME = (OGRE_VOLUME_SIDE_LENGTH * OGRE_VOLUME_SIDE_LENGTH * OGRE_VOLUME_SIDE_LENGTH);
const unsigned int OGRE_REGION_SIDE_LENGTH_POWER = 4;
const unsigned int OGRE_REGION_SIDE_LENGTH = (0x0001 << OGRE_REGION_SIDE_LENGTH_POWER);
const unsigned int OGRE_VOLUME_SIDE_LENGTH_IN_REGIONS = (OGRE_VOLUME_SIDE_LENGTH >> OGRE_REGION_SIDE_LENGTH_POWER);
const unsigned int OGRE_NO_OF_REGIONS_IN_VOLUME = (OGRE_VOLUME_SIDE_LENGTH_IN_REGIONS * OGRE_VOLUME_SIDE_LENGTH_IN_REGIONS * OGRE_VOLUME_SIDE_LENGTH_IN_REGIONS);
const unsigned long OGRE_MAX_VOXELS_TO_BURN_PER_FRAME = 1000;
}
#endif