Richard Boegli's CnC_Generals_Zero_Hour Fork WIP
This is documentation of Richard Boegil's Zero Hour Fork
 
Loading...
Searching...
No Matches
MatrixMapperClass Class Reference

#include <matrixmapper.h>

Inherits TextureMapperClass.

Inherited by CompositeMatrixMapperClass.

Public Types

enum  { INVERT_DEPTH_GRADIENT = 0x00000001 }
 
enum  MappingType { ORTHO_PROJECTION = 0 , PERSPECTIVE_PROJECTION , DEPTH_GRADIENT , NORMAL_GRADIENT }
 
- Public Types inherited from TextureMapperClass
enum  {
  MAPPER_ID_UNKNOWN , MAPPER_ID_LINEAR_OFFSET , MAPPER_ID_CLASSIC_ENVIRONMENT , MAPPER_ID_ENVIRONMENT ,
  MAPPER_ID_SCREEN , MAPPER_ID_ANIMATING_1D , MAPPER_ID_AXIAL , MAPPER_ID_SILHOUETTE ,
  MAPPER_ID_SCALE , MAPPER_ID_GRID , MAPPER_ID_ROTATE , MAPPER_ID_SINE_LINEAR_OFFSET ,
  MAPPER_ID_STEP_LINEAR_OFFSET , MAPPER_ID_ZIGZAG_LINEAR_OFFSET , MAPPER_ID_WS_CLASSIC_ENVIRONMENT , MAPPER_ID_WS_ENVIRONMENT ,
  MAPPER_ID_GRID_CLASSIC_ENVIRONMENT , MAPPER_ID_GRID_ENVIRONMENT , MAPPER_ID_RANDOM , MAPPER_ID_EDGE ,
  MAPPER_ID_BUMPENV , MAPPER_ID_GRID_WS_CLASSIC_ENVIRONMENT , MAPPER_ID_GRID_WS_ENVIRONMENT
}
 

Public Member Functions

 MatrixMapperClass (int stage)
 
void Set_Flag (uint32 flag, bool onoff)
 
bool Get_Flag (uint32 flag) const
 
void Set_Type (MappingType type)
 
MappingType Get_Type (void)
 
void Set_Texture_Transform (const Matrix3D &view_to_texture, float texsize)
 
void Set_Texture_Transform (const Matrix4x4 &view_to_texture, float texsize)
 
const Matrix4x4Get_Texture_Transform (void) const
 
void Set_Gradient_U_Coord (float coord)
 
float Get_Gradient_U_Coord (void)
 
void Compute_Texture_Coordinate (const Vector3 &point, Vector3 *set_stq)
 
TextureMapperClassClone (void) const
 
virtual void Apply (int uv_array_index)
 
virtual void Calculate_Texture_Matrix (Matrix4x4 &tex_matrix)
 
- Public Member Functions inherited from TextureMapperClass
 TextureMapperClass (unsigned int stage=0)
 
 TextureMapperClass (const TextureMapperClass &src)
 
virtual ~TextureMapperClass (void)
 
virtual int Mapper_ID (void) const
 
virtual bool Is_Time_Variant (void)
 
virtual void Reset (void)
 
virtual bool Needs_Normals (void)
 
void Set_Stage (int stage)
 
int Get_Stage (void) const
 
- Public Member Functions inherited from W3DMPO
virtual ~W3DMPO ()
 
- Public Member Functions inherited from RefCountClass
 RefCountClass (void)
 
 RefCountClass (const RefCountClass &)
 
void Add_Ref (void) const
 
WWINLINE void Release_Ref (void) const
 
int Num_Refs (void) const
 
virtual void Delete_This (void)
 

Protected Member Functions

void Update_View_To_Pixel_Transform (float texsize)
 
- Protected Member Functions inherited from W3DMPO
virtual int glueEnforcer () const =0
 
- Protected Member Functions inherited from RefCountClass
virtual ~RefCountClass (void)
 

Protected Attributes

uint32 Flags
 
MappingType Type
 
Matrix4x4 ViewToTexture
 
Matrix4x4 ViewToPixel
 
Vector3 ViewSpaceProjectionNormal
 
float GradientUCoord
 
- Protected Attributes inherited from TextureMapperClass
unsigned int Stage
 

Additional Inherited Members

- Static Public Member Functions inherited from RefCountClass
static int Total_Refs (void)
 
static RefCountClassAdd_Active_Ref (RefCountClass *obj)
 
static RefCountClassSet_Ref_Owner (RefCountClass *obj, char *file, int line)
 
static void Remove_Active_Ref (RefCountClass *obj)
 
static bool Validate_Active_Ref (RefCountClass *obj)
 
- Public Attributes inherited from RefCountClass
RefCountNodeClass ActiveRefNode
 
ActiveRefStruct ActiveRefInfo
 
- Static Public Attributes inherited from RefCountClass
static RefCountListClass ActiveRefList
 

Detailed Description

MatrixMapperClass. Does the chore of computing the u-v coorinates for a projected texture. Note that this VP must be "baby-sat" by something external to ensure that its ViewToTexture transform is up-to-date. I use it in the TexProjectClass to implement projected textures.

NOTE: for projected textures, the equation for computing a valid ViewToTexture transform is as follows (assuming my usual column vectors, etc): -1 ViewToTexture = Projection * Mwrld-shadow * Mwrld-camera

Definition at line 63 of file matrixmapper.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
INVERT_DEPTH_GRADIENT 

Definition at line 68 of file matrixmapper.h.

◆ MappingType

Enumerator
ORTHO_PROJECTION 
PERSPECTIVE_PROJECTION 
DEPTH_GRADIENT 
NORMAL_GRADIENT 

Definition at line 72 of file matrixmapper.h.

Constructor & Destructor Documentation

◆ MatrixMapperClass()

MatrixMapperClass::MatrixMapperClass ( int stage)

Definition at line 71 of file matrixmapper.cpp.

Member Function Documentation

◆ Apply()

void MatrixMapperClass::Apply ( int uv_array_index)
virtual

Implements TextureMapperClass.

Reimplemented in CompositeMatrixMapperClass.

Definition at line 226 of file matrixmapper.cpp.

◆ Calculate_Texture_Matrix()

void MatrixMapperClass::Calculate_Texture_Matrix ( Matrix4x4 & tex_matrix)
virtual

Implements TextureMapperClass.

Reimplemented in CompositeMatrixMapperClass.

Definition at line 294 of file matrixmapper.cpp.

◆ Clone()

TextureMapperClass * MatrixMapperClass::Clone ( void ) const
inlinevirtual

Implements TextureMapperClass.

Definition at line 99 of file matrixmapper.h.

◆ Compute_Texture_Coordinate()

void MatrixMapperClass::Compute_Texture_Coordinate ( const Vector3 & point,
Vector3 * set_stq )

Definition at line 207 of file matrixmapper.cpp.

◆ Get_Flag()

bool MatrixMapperClass::Get_Flag ( uint32 flag) const
inline

Definition at line 152 of file matrixmapper.h.

◆ Get_Gradient_U_Coord()

float MatrixMapperClass::Get_Gradient_U_Coord ( void )
inline

Definition at line 95 of file matrixmapper.h.

◆ Get_Texture_Transform()

const Matrix4x4 & MatrixMapperClass::Get_Texture_Transform ( void ) const
inline

Definition at line 167 of file matrixmapper.h.

◆ Get_Type()

MatrixMapperClass::MappingType MatrixMapperClass::Get_Type ( void )
inline

Definition at line 162 of file matrixmapper.h.

◆ Set_Flag()

void MatrixMapperClass::Set_Flag ( uint32 flag,
bool onoff )
inline

Definition at line 143 of file matrixmapper.h.

◆ Set_Gradient_U_Coord()

void MatrixMapperClass::Set_Gradient_U_Coord ( float coord)
inline

Definition at line 94 of file matrixmapper.h.

◆ Set_Texture_Transform() [1/2]

void MatrixMapperClass::Set_Texture_Transform ( const Matrix3D & view_to_texture,
float texsize )

Definition at line 94 of file matrixmapper.cpp.

◆ Set_Texture_Transform() [2/2]

void MatrixMapperClass::Set_Texture_Transform ( const Matrix4x4 & view_to_texture,
float texsize )

Definition at line 112 of file matrixmapper.cpp.

◆ Set_Type()

void MatrixMapperClass::Set_Type ( MappingType type)
inline

Definition at line 157 of file matrixmapper.h.

◆ Update_View_To_Pixel_Transform()

void MatrixMapperClass::Update_View_To_Pixel_Transform ( float texsize)
protected

Definition at line 131 of file matrixmapper.cpp.

Member Data Documentation

◆ Flags

uint32 MatrixMapperClass::Flags
protected

Definition at line 108 of file matrixmapper.h.

◆ GradientUCoord

float MatrixMapperClass::GradientUCoord
protected

Definition at line 113 of file matrixmapper.h.

◆ Type

MappingType MatrixMapperClass::Type
protected

Definition at line 109 of file matrixmapper.h.

◆ ViewSpaceProjectionNormal

Vector3 MatrixMapperClass::ViewSpaceProjectionNormal
protected

Definition at line 112 of file matrixmapper.h.

◆ ViewToPixel

Matrix4x4 MatrixMapperClass::ViewToPixel
protected

Definition at line 111 of file matrixmapper.h.

◆ ViewToTexture

Matrix4x4 MatrixMapperClass::ViewToTexture
protected

Definition at line 110 of file matrixmapper.h.


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