mirror of
https://github.com/overte-org/overte.git
synced 2025-04-21 08:04:01 +02:00
cleaned up some compiler warnings and constants
This commit is contained in:
parent
7ceb549416
commit
1e421d222d
3 changed files with 10 additions and 10 deletions
|
@ -430,7 +430,7 @@ bool CoverageRegion::mergeItemsInArray(VoxelProjectedPolygon* seed, bool seedInA
|
|||
otherPolygon->merge(*seed);
|
||||
|
||||
if (seedInArray) {
|
||||
const int IGNORED = NULL;
|
||||
int* IGNORED = NULL;
|
||||
// remove this otherOtherPolygon for our polygon array
|
||||
_polygonCount = removeFromSortedArrays((void*)seed,
|
||||
(void**)_polygons, _polygonDistances, IGNORED,
|
||||
|
@ -479,7 +479,7 @@ void CoverageRegion::storeInArray(VoxelProjectedPolygon* polygon) {
|
|||
// in the list. We still check to see if the polygon is "in front" of the target polygon before we test occlusion. Since
|
||||
// sometimes things come out of order.
|
||||
const bool SORT_BY_SIZE = false;
|
||||
const int IGNORED = NULL;
|
||||
int IGNORED = 0;
|
||||
if (SORT_BY_SIZE) {
|
||||
// This old code assumes that polygons will always be added in z-buffer order, but that doesn't seem to
|
||||
// be a good assumption. So instead, we will need to sort this by distance. Use a binary search to find the
|
||||
|
@ -488,12 +488,12 @@ void CoverageRegion::storeInArray(VoxelProjectedPolygon* polygon) {
|
|||
float reverseArea = 4.0f - area;
|
||||
//qDebug("store by size area=%f reverse area=%f\n", area, reverseArea);
|
||||
_polygonCount = insertIntoSortedArrays((void*)polygon, reverseArea, IGNORED,
|
||||
(void**)_polygons, _polygonSizes, IGNORED,
|
||||
(void**)_polygons, _polygonSizes, &IGNORED,
|
||||
_polygonCount, _polygonArraySize);
|
||||
} else {
|
||||
const int IGNORED = NULL;
|
||||
int IGNORED = 0;
|
||||
_polygonCount = insertIntoSortedArrays((void*)polygon, polygon->getDistance(), IGNORED,
|
||||
(void**)_polygons, _polygonDistances, IGNORED,
|
||||
(void**)_polygons, _polygonDistances, &IGNORED,
|
||||
_polygonCount, _polygonArraySize);
|
||||
}
|
||||
|
||||
|
|
|
@ -23,7 +23,8 @@ const glm::vec3 IDENTITY_FRONT = glm::vec3( 0.0f, 0.0f,-1.0f);
|
|||
const bool LOW_RES_MONO = false; // while in "low res mode" do voxels switch to monochrome
|
||||
const uint64_t CHANGE_FUDGE = 1000 * 200; // useconds of fudge in determining if we want to resend changed voxels
|
||||
|
||||
const int TREE_SCALE = 128;
|
||||
const int TREE_SCALE = 128; // This is the number of meters of the 0.0 to 1.0 voxel universe
|
||||
const float VOXEL_SIZE_SCALE = 50000.0f; // This controls the LOD bigger will make smaller voxels visible at greater distance
|
||||
|
||||
const int NUMBER_OF_CHILDREN = 8;
|
||||
const int MAX_VOXEL_PACKET_SIZE = 1492;
|
||||
|
@ -40,4 +41,4 @@ const glBufferIndex GLBUFFER_INDEX_UNKNOWN = ULONG_MAX;
|
|||
const float SIXTY_FPS_IN_MILLISECONDS = 1000.0f / 60.0f;
|
||||
const float VIEW_CULLING_RATE_IN_MILLISECONDS = 1000.0f; // once a second is fine
|
||||
|
||||
#endif
|
||||
#endif
|
|
@ -32,12 +32,11 @@
|
|||
#include "VoxelTree.h"
|
||||
|
||||
float boundaryDistanceForRenderLevel(unsigned int renderLevel) {
|
||||
const float voxelSizeScale = 50000.0f;
|
||||
return voxelSizeScale / powf(2, renderLevel);
|
||||
return ::VOXEL_SIZE_SCALE / powf(2, renderLevel);
|
||||
}
|
||||
|
||||
float boundaryDistanceSquaredForRenderLevel(unsigned int renderLevel) {
|
||||
const float voxelSizeScale = (50000.0f/TREE_SCALE) * (50000.0f/TREE_SCALE);
|
||||
const float voxelSizeScale = (::VOXEL_SIZE_SCALE/TREE_SCALE) * (::VOXEL_SIZE_SCALE/TREE_SCALE);
|
||||
return voxelSizeScale / powf(2, (2 * renderLevel));
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue