OGRE  1.9
Object-Oriented Graphics Rendering Engine
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Ogre::BspLevel::VisData Struct Reference

Internal lookup table to determine visibility between leaves. More...

#include <OgreBspLevel.h>

Public Attributes

int numClusters
 
int rowLength
 Number of clusters, therefore number of rows. More...
 
unsigned char * tableData
 

Detailed Description

Internal lookup table to determine visibility between leaves.

Leaf nodes are assigned to 'clusters' of nodes, which are used to group nodes together for visibility testing. This data holds a lookup table which is used to determine if one cluster of leaves is visible from another cluster. Whilst it would be possible to expand all this out so that each node had a list of pointers to other visible nodes, this would be very expensive in terms of storage (using the cluster method there is a table which is 1-bit squared per cluster, rounded up to the nearest byte obviously, which uses far less space than 4-bytes per linked node per source node). Of course the limitation here is that you have to each leaf in turn to determine if it is visible rather than just following a list, but since this is only done once per frame this is not such a big overhead. Each row in the table is a 'from' cluster, with each bit in the row corresponding to a 'to' cluster, both ordered based on cluster index. A 0 in the bit indicates the 'to' cluster is not visible from the 'from' cluster, whilst a 1 indicates it is. As many will notice, this is lifted directly from the Quake implementation of PVS.

Definition at line 180 of file OgreBspLevel.h.

Member Data Documentation

int Ogre::BspLevel::VisData::numClusters

Definition at line 183 of file OgreBspLevel.h.

int Ogre::BspLevel::VisData::rowLength

Number of clusters, therefore number of rows.

Definition at line 184 of file OgreBspLevel.h.

unsigned char* Ogre::BspLevel::VisData::tableData

Definition at line 182 of file OgreBspLevel.h.


The documentation for this struct was generated from the following file: