TextureTileArray Class Reference


Detailed Description

This class describes a 2D array of texture tiles.

It is very fast to access a tile given a U and V coordinate in that tile (each tile covers exactly a 1.0 x 1.0 area in UV coordinates, and starts on a whole number) This is used by both the TexturePool class and the CGMaterial class.

Definition at line 346 of file material.h.

#include <material.h>

List of all members.

Classes

class   TileDescriptor

Public Member Functions

  TextureTileArray ()
  ~TextureTileArray ()
float  getMinU () const
  returns the minimum U coordinate.
float  getMinV () const
  returns the minimum V coordinate.
float  getMaxU () const
  returns the maximum U coordinate.
float  getMaxV () const
  returns the maximum V coordinate.
void  getTotalUVBounds (float &minU, float &minV, float &maxU, float &maxV) const
  get the bounds of this texture tile array
bool  contains (float U, float V) const
  returns true if the array is big enough to contain the specified UV coordinates
int  getTileStateIndex (float U, float V) const
void  setTileStateIndex (float U, float V, int indx)
void  dropAll ()
  deallocate all textures and clears their states.
void  clearTileStateIndices ()

Constructor & Destructor Documentation

TextureTileArray ( ) [inline]

Definition at line 387 of file material.h.

{ init();    }
~TextureTileArray ( ) [inline]

Definition at line 388 of file material.h.

{ dropAll(); } 

Member Function Documentation

float getMinU ( ) const [inline]

returns the minimum U coordinate.

Will have all 0 to the right of the decimal

Definition at line 392 of file material.h.

{ return m_UOrigin; }
float getMinV ( ) const [inline]

returns the minimum V coordinate.

Will have all 0 to the right of the decimal

Definition at line 395 of file material.h.

{ return m_VOrigin; }
float getMaxU ( ) const [inline]

returns the maximum U coordinate.

Will have all 0 to the right of the decimal

Definition at line 398 of file material.h.

{ return m_UOrigin + (float)m_USize; }
float getMaxV ( ) const [inline]

returns the maximum V coordinate.

Will have all 0 to the right of the decimal

Definition at line 401 of file material.h.

{ return m_VOrigin + (float)m_VSize; }
void getTotalUVBounds ( float &  minU,
float &  minV,
float &  maxU,
float &  maxV 
) const [inline]

get the bounds of this texture tile array

Definition at line 404 of file material.h.

        {
            minU = m_UOrigin; 
            minV = m_VOrigin; 
            maxU = minU + (float)m_USize;
            maxV = minV + (float)m_VSize;
        }
bool contains ( float  U,
float  V 
) const [inline]

returns true if the array is big enough to contain the specified UV coordinates

Definition at line 414 of file material.h.

        {
            return m_Tiles && U >= getMinU() && U < getMaxU() && V >= getMinV() && V < getMaxV();
        }
int getTileStateIndex ( float  U,
float  V 
) const [inline]

Definition at line 420 of file material.h.

        {
            if (!contains(U, V)) return -1; else
            return tileFromUV(U, V)->m_TileStateIndex;
        }
void setTileStateIndex ( float  U,
float  V,
int  indx 
) [inline]

Definition at line 426 of file material.h.

        {
            if (!contains(U, V)) resizeArrayToInclude(U, V);
            tileFromUV(U, V)->m_TileStateIndex = indx;
        }
void dropAll ( )

deallocate all textures and clears their states.

Also deallocates the entire TextureTile array and sets the bounds to 0. (which means don't call getLive, getInactiveColor, or getProxyLevel after calling this without first allocating those textures first.

void clearTileStateIndices ( )

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

TextureTileArray TextureTileArray TextureTileArray TextureTileArray TextureTileArray TextureTileArray TextureTileArray TextureTileArray TextureTileArray TextureTileArray
TextureTileArray TextureTileArray TextureTileArray TextureTileArray TextureTileArray TextureTileArray TextureTileArray TextureTileArray TextureTileArray TextureTileArray