#include "Stdafx.h"
Go to the source code of this file.
Defines | |
#define | FIND_MAX_VALUES |
#define | INIT_QUANTIZATION |
#define | PERFORM_QUANTIZATION |
#define | REMAP_DATA(member) |
Functions | |
static void | _BuildCollisionTree (AABBCollisionNode *linear, const udword box_id, udword ¤t_id, const AABBTreeNode *current_node) |
static void | _BuildNoLeafTree (AABBNoLeafNode *linear, const udword box_id, udword ¤t_id, const AABBTreeNode *current_node) |
inline_ void | ComputeMinMax (Point &min, Point &max, const VertexPointers &vp) |
Variables | |
static bool | gFixQuantized = true |
Contains code for optimized trees. Implements 4 trees:
Definition in file OPC_OptimizedTree.cpp.
#define FIND_MAX_VALUES |
/* Get max values */ \ Point CMax(MIN_FLOAT, MIN_FLOAT, MIN_FLOAT); \ Point EMax(MIN_FLOAT, MIN_FLOAT, MIN_FLOAT); \ for(udword i=0;i<mNbNodes;i++) \ { \ if(fabsf(Nodes[i].mAABB.mCenter.x)>CMax.x) CMax.x = fabsf(Nodes[i].mAABB.mCenter.x); \ if(fabsf(Nodes[i].mAABB.mCenter.y)>CMax.y) CMax.y = fabsf(Nodes[i].mAABB.mCenter.y); \ if(fabsf(Nodes[i].mAABB.mCenter.z)>CMax.z) CMax.z = fabsf(Nodes[i].mAABB.mCenter.z); \ if(fabsf(Nodes[i].mAABB.mExtents.x)>EMax.x) EMax.x = fabsf(Nodes[i].mAABB.mExtents.x); \ if(fabsf(Nodes[i].mAABB.mExtents.y)>EMax.y) EMax.y = fabsf(Nodes[i].mAABB.mExtents.y); \ if(fabsf(Nodes[i].mAABB.mExtents.z)>EMax.z) EMax.z = fabsf(Nodes[i].mAABB.mExtents.z); \ }
Definition at line 490 of file OPC_OptimizedTree.cpp.
#define INIT_QUANTIZATION |
udword nbc=15; /* Keep one bit for sign */ \ udword nbe=15; /* Keep one bit for fix */ \ if(!gFixQuantized) nbe++; \ \ /* Compute quantization coeffs */ \ Point CQuantCoeff, EQuantCoeff; \ CQuantCoeff.x = CMax.x!=0.0f ? float((1<<nbc)-1)/CMax.x : 0.0f; \ CQuantCoeff.y = CMax.y!=0.0f ? float((1<<nbc)-1)/CMax.y : 0.0f; \ CQuantCoeff.z = CMax.z!=0.0f ? float((1<<nbc)-1)/CMax.z : 0.0f; \ EQuantCoeff.x = EMax.x!=0.0f ? float((1<<nbe)-1)/EMax.x : 0.0f; \ EQuantCoeff.y = EMax.y!=0.0f ? float((1<<nbe)-1)/EMax.y : 0.0f; \ EQuantCoeff.z = EMax.z!=0.0f ? float((1<<nbe)-1)/EMax.z : 0.0f; \ /* Compute and save dequantization coeffs */ \ mCenterCoeff.x = CQuantCoeff.x!=0.0f ? 1.0f / CQuantCoeff.x : 0.0f; \ mCenterCoeff.y = CQuantCoeff.y!=0.0f ? 1.0f / CQuantCoeff.y : 0.0f; \ mCenterCoeff.z = CQuantCoeff.z!=0.0f ? 1.0f / CQuantCoeff.z : 0.0f; \ mExtentsCoeff.x = EQuantCoeff.x!=0.0f ? 1.0f / EQuantCoeff.x : 0.0f; \ mExtentsCoeff.y = EQuantCoeff.y!=0.0f ? 1.0f / EQuantCoeff.y : 0.0f; \ mExtentsCoeff.z = EQuantCoeff.z!=0.0f ? 1.0f / EQuantCoeff.z : 0.0f; \
Definition at line 504 of file OPC_OptimizedTree.cpp.
#define PERFORM_QUANTIZATION |
Definition at line 525 of file OPC_OptimizedTree.cpp.
#define REMAP_DATA | ( | member | ) |
static void _BuildCollisionTree | ( | AABBCollisionNode * | linear, |
const udword | box_id, | ||
udword & | current_id, | ||
const AABBTreeNode * | current_node | ||
) | [static] |
Definition at line 99 of file OPC_OptimizedTree.cpp.
static void _BuildNoLeafTree | ( | AABBNoLeafNode * | linear, |
const udword | box_id, | ||
udword & | current_id, | ||
const AABBTreeNode * | current_node | ||
) | [static] |
Definition at line 158 of file OPC_OptimizedTree.cpp.
inline_ void ComputeMinMax | ( | Point & | min, |
Point & | max, | ||
const VertexPointers & | vp | ||
) |
Definition at line 364 of file OPC_OptimizedTree.cpp.
bool gFixQuantized = true [static] |
Compilation flag:
Definition at line 76 of file OPC_OptimizedTree.cpp.