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

#include <texproject.h>

Inherits ProjectorClass, CullableClass, and MultiListObjectClass.

Public Member Functions

 TexProjectClass (void)
 
virtual ~TexProjectClass (void)
 
void Set_Texture_Size (int size)
 
int Get_Texture_Size (void)
 
void Init_Multiplicative (void)
 
void Init_Additive (void)
 
void Set_Intensity (float intensity, bool immediate=false)
 
float Get_Intensity (void)
 
bool Is_Intensity_Zero (void)
 
void Set_Attenuation (float attenuation)
 
float Get_Attenuation (void)
 
void Enable_Attenuation (bool onoff)
 
bool Is_Attenuation_Enabled (void)
 
MaterialPassClassPeek_Material_Pass (void)
 
void Enable_Affect_Dynamic_Objects (bool onoff)
 
bool Is_Affect_Dynamic_Objects_Enabled (void)
 
void Enable_Affect_Static_Objects (bool onoff)
 
bool Is_Affect_Static_Objects_Enabled (void)
 
void Enable_Depth_Gradient (bool onoff)
 
bool Is_Depth_Gradient_Enabled (bool onoff)
 
virtual void Set_Perspective_Projection (float hfov, float vfov, float znear, float zfar)
 
virtual void Set_Ortho_Projection (float xmin, float xmax, float ymin, float ymax, float znear, float zfar)
 
void Set_Texture (TextureClass *texture)
 
TextureClassGet_Texture (void) const
 
TextureClassPeek_Texture (void) const
 
void Set_DepthStencilBuffer (ZTextureClass *ztex)
 
ZTextureClassGet_DepthStencilBuffer () const
 
ZTextureClassPeek_DepthStencilBuffer () const
 
bool Compute_Perspective_Projection (RenderObjClass *obj, const Vector3 &lightpos, float znear=-1.0f, float zfar=-1.0f)
 
bool Compute_Perspective_Projection (const AABoxClass &obj_box, const Matrix3D &tm, const Vector3 &lightpos, float znear=-1.0f, float zfar=-1.0f)
 
bool Compute_Ortho_Projection (RenderObjClass *obj, const Vector3 &lightdir, float znear=-1.0f, float zfar=-1.0f)
 
bool Compute_Ortho_Projection (const AABoxClass &obj_box, const Matrix3D &tm, const Vector3 &lightdir, float znear=-1.0f, float zfar=-1.0f)
 
bool Needs_Render_Target (void)
 
void Set_Render_Target (TextureClass *render_target, ZTextureClass *ztarget=NULL)
 
TextureClassPeek_Render_Target (TextureClass **rtarget=NULL, ZTextureClass **ztarget=NULL)
 
bool Compute_Texture (RenderObjClass *model, SpecialRenderInfoClass *context)
 
virtual void Pre_Render_Update (const Matrix3D &camera)
 
virtual void * Get_Projection_Object_ID (void) const
 
- Public Member Functions inherited from ProjectorClass
 ProjectorClass (void)
 
virtual ~ProjectorClass (void)
 
virtual void Set_Transform (const Matrix3D &tm)
 
virtual const Matrix3DGet_Transform (void) const
 
const OBBoxClassGet_Bounding_Volume (void) const
 
void Compute_Texture_Coordinate (const Vector3 &point, Vector3 *set_stq)
 
MatrixMapperClassPeek_Mapper () const
 
- Public Member Functions inherited from CullableClass
 CullableClass (void)
 
virtual ~CullableClass (void)
 
WWINLINE const AABoxClassGet_Cull_Box (void) const
 
void Set_Cull_Box (const AABoxClass &box, bool just_loaded=false)
 
void Set_Culling_System (CullSystemClass *sys)
 
CullSystemClassGet_Culling_System (void) const
 
WWINLINE void Set_Cull_Link (CullLinkClass *c)
 
WWINLINE CullLinkClassGet_Cull_Link (void) const
 
- 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)
 
- Public Member Functions inherited from MultiListObjectClass
 MultiListObjectClass (void)
 
virtual ~MultiListObjectClass (void)
 
MultiListNodeClassGet_List_Node () const
 
void Set_List_Node (MultiListNodeClass *node)
 

Protected Types

enum  FlagsType {
  PERSPECTIVE = 0x00000001 , ADDITIVE = 0x00000002 , TEXTURE_DIRTY = 0x00000004 , VOLATILE = 0x00000008 ,
  ATTENUATE = 0x00000010 , AFFECT_DYNAMIC_OBJS = 0x00000020 , AFFECT_STATIC_OBJS = 0x00000040 , USE_DEPTH_GRADIENT = 0x00000080 ,
  HAS_RENDER_TARGET = 0x00000100 , SIZE_MASK = 0xFFF00000 , SIZE_SHIFT = 20 , DEFAULT_FLAGS = ATTENUATE | AFFECT_DYNAMIC_OBJS | AFFECT_STATIC_OBJS
}
 

Protected Member Functions

void Set_Flag (uint32 flag, bool onoff)
 
bool Get_Flag (uint32 flag) const
 
virtual void Update_WS_Bounding_Volume (void)
 
void Configure_Camera (CameraClass &camera)
 
- Protected Member Functions inherited from RefCountClass
virtual ~RefCountClass (void)
 

Protected Attributes

uint32 Flags
 
float DesiredIntensity
 
float Intensity
 
float Attenuation
 
MaterialPassClassMaterialPass
 
MatrixMapperClassMapper1
 
TextureClassRenderTarget
 
ZTextureClassDepthStencilTarget
 
float HFov
 
float VFov
 
float XMin
 
float XMax
 
float YMin
 
float YMax
 
float ZNear
 
float ZFar
 
- Protected Attributes inherited from ProjectorClass
Matrix3D Transform
 
Matrix4x4 Projection
 
AABoxClass LocalBoundingVolume
 
OBBoxClass WorldBoundingVolume
 
MatrixMapperClassMapper
 

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

TexProjectClass This class is used to project textures onto object in the world. It contains a pointer to the texture to be projected, a bounding volume for the projection, and a material pass which can perform the projection.

Design Goals:

  • Texture Projectors should be easy to place in the world and move around. solution: Store the bounding volume and any other parameters in a coordinate system local to the projector. Update the world-space cache whenever needed. The automatically generated shadow texture projectors are a special case subset of the general texture projection code. For this reason, a local bounding volume will be stored and its world-space equivalent will be updated whenever needed.
  • Texture projectors need to be compatible with the culling systems. solution: inherit the Cullable interface.
  • Texture projectors need to be quickly pulled in and out of many lists during the rendering process. solution: list system similar to PhysListClass? I really need to templatize this.
    • done: MultiListClass!
  • Dynamic Texture projectors need to be updated in stages. Update/recompute only the bounding volume first, then defer computing the actual texture until it is determined that the volume falls into the frustum and is applied to at least one object. solution: Code the bounding volume/projection paramter generation separate from the texture generation code. A derived texture projection object. Let texture projectors know about the object they are projecting so that they can have that object rendered from the desired viewpoint. Need a 'Dirty' flag and a pointer to a 'parent' object. Perhaps separate this code into a ShadowProjectClass since shadows are the only case I can think of that need the ability to re-render their 'parent' object. Everything else should be a static texture-map either generated 'artistically' or generated off-line.

Definition at line 104 of file texproject.h.

Member Enumeration Documentation

◆ FlagsType

Enumerator
PERSPECTIVE 
ADDITIVE 
TEXTURE_DIRTY 
VOLATILE 
ATTENUATE 
AFFECT_DYNAMIC_OBJS 
AFFECT_STATIC_OBJS 
USE_DEPTH_GRADIENT 
HAS_RENDER_TARGET 
SIZE_MASK 
SIZE_SHIFT 
DEFAULT_FLAGS 

Definition at line 192 of file texproject.h.

Constructor & Destructor Documentation

◆ TexProjectClass()

TexProjectClass::TexProjectClass ( void )

Definition at line 184 of file texproject.cpp.

◆ ~TexProjectClass()

TexProjectClass::~TexProjectClass ( void )
virtual

Definition at line 235 of file texproject.cpp.

Member Function Documentation

◆ Compute_Ortho_Projection() [1/2]

bool TexProjectClass::Compute_Ortho_Projection ( const AABoxClass & obj_box,
const Matrix3D & tm,
const Vector3 & lightdir,
float znear = -1.0f,
float zfar = -1.0f )

Definition at line 1033 of file texproject.cpp.

◆ Compute_Ortho_Projection() [2/2]

bool TexProjectClass::Compute_Ortho_Projection ( RenderObjClass * obj,
const Vector3 & lightdir,
float znear = -1.0f,
float zfar = -1.0f )

Definition at line 993 of file texproject.cpp.

◆ Compute_Perspective_Projection() [1/2]

bool TexProjectClass::Compute_Perspective_Projection ( const AABoxClass & obj_box,
const Matrix3D & tm,
const Vector3 & lightpos,
float znear = -1.0f,
float zfar = -1.0f )

Definition at line 907 of file texproject.cpp.

◆ Compute_Perspective_Projection() [2/2]

bool TexProjectClass::Compute_Perspective_Projection ( RenderObjClass * obj,
const Vector3 & lightpos,
float znear = -1.0f,
float zfar = -1.0f )

Definition at line 866 of file texproject.cpp.

◆ Compute_Texture()

bool TexProjectClass::Compute_Texture ( RenderObjClass * model,
SpecialRenderInfoClass * context )

Definition at line 1115 of file texproject.cpp.

◆ Configure_Camera()

void TexProjectClass::Configure_Camera ( CameraClass & camera)
protected

Definition at line 1269 of file texproject.cpp.

◆ Enable_Affect_Dynamic_Objects()

void TexProjectClass::Enable_Affect_Dynamic_Objects ( bool onoff)
inline

Definition at line 130 of file texproject.h.

◆ Enable_Affect_Static_Objects()

void TexProjectClass::Enable_Affect_Static_Objects ( bool onoff)
inline

Definition at line 132 of file texproject.h.

◆ Enable_Attenuation()

void TexProjectClass::Enable_Attenuation ( bool onoff)

Definition at line 460 of file texproject.cpp.

◆ Enable_Depth_Gradient()

void TexProjectClass::Enable_Depth_Gradient ( bool onoff)

Definition at line 496 of file texproject.cpp.

◆ Get_Attenuation()

float TexProjectClass::Get_Attenuation ( void )

Definition at line 442 of file texproject.cpp.

◆ Get_DepthStencilBuffer()

ZTextureClass * TexProjectClass::Get_DepthStencilBuffer ( ) const

◆ Get_Flag()

bool TexProjectClass::Get_Flag ( uint32 flag) const
protected

Definition at line 329 of file texproject.cpp.

◆ Get_Intensity()

float TexProjectClass::Get_Intensity ( void )

Definition at line 381 of file texproject.cpp.

◆ Get_Projection_Object_ID()

virtual void * TexProjectClass::Get_Projection_Object_ID ( void ) const
inlinevirtual

Definition at line 183 of file texproject.h.

◆ Get_Texture()

TextureClass * TexProjectClass::Get_Texture ( void ) const

Definition at line 756 of file texproject.cpp.

◆ Get_Texture_Size()

int TexProjectClass::Get_Texture_Size ( void )

Definition at line 285 of file texproject.cpp.

◆ Init_Additive()

void TexProjectClass::Init_Additive ( void )

Definition at line 646 of file texproject.cpp.

◆ Init_Multiplicative()

void TexProjectClass::Init_Multiplicative ( void )

Definition at line 541 of file texproject.cpp.

◆ Is_Affect_Dynamic_Objects_Enabled()

bool TexProjectClass::Is_Affect_Dynamic_Objects_Enabled ( void )
inline

Definition at line 131 of file texproject.h.

◆ Is_Affect_Static_Objects_Enabled()

bool TexProjectClass::Is_Affect_Static_Objects_Enabled ( void )
inline

Definition at line 133 of file texproject.h.

◆ Is_Attenuation_Enabled()

bool TexProjectClass::Is_Attenuation_Enabled ( void )

Definition at line 478 of file texproject.cpp.

◆ Is_Depth_Gradient_Enabled()

bool TexProjectClass::Is_Depth_Gradient_Enabled ( bool onoff)

Definition at line 521 of file texproject.cpp.

◆ Is_Intensity_Zero()

bool TexProjectClass::Is_Intensity_Zero ( void )

Definition at line 401 of file texproject.cpp.

◆ Needs_Render_Target()

bool TexProjectClass::Needs_Render_Target ( void )

Definition at line 1197 of file texproject.cpp.

◆ Peek_DepthStencilBuffer()

ZTextureClass * TexProjectClass::Peek_DepthStencilBuffer ( ) const

◆ Peek_Material_Pass()

MaterialPassClass * TexProjectClass::Peek_Material_Pass ( void )

Definition at line 792 of file texproject.cpp.

◆ Peek_Render_Target()

TextureClass * TexProjectClass::Peek_Render_Target ( TextureClass ** rtarget = NULL,
ZTextureClass ** ztarget = NULL )

Definition at line 1239 of file texproject.cpp.

◆ Peek_Texture()

TextureClass * TexProjectClass::Peek_Texture ( void ) const

Definition at line 774 of file texproject.cpp.

◆ Pre_Render_Update()

void TexProjectClass::Pre_Render_Update ( const Matrix3D & camera)
virtual

Definition at line 1304 of file texproject.cpp.

◆ Set_Attenuation()

void TexProjectClass::Set_Attenuation ( float attenuation)

Definition at line 422 of file texproject.cpp.

◆ Set_DepthStencilBuffer()

void TexProjectClass::Set_DepthStencilBuffer ( ZTextureClass * ztex)

◆ Set_Flag()

void TexProjectClass::Set_Flag ( uint32 flag,
bool onoff )
protected

Definition at line 305 of file texproject.cpp.

◆ Set_Intensity()

void TexProjectClass::Set_Intensity ( float intensity,
bool immediate = false )

Definition at line 353 of file texproject.cpp.

◆ Set_Ortho_Projection()

void TexProjectClass::Set_Ortho_Projection ( float xmin,
float xmax,
float ymin,
float ymax,
float znear,
float zfar )
virtual

Reimplemented from ProjectorClass.

Definition at line 834 of file texproject.cpp.

◆ Set_Perspective_Projection()

void TexProjectClass::Set_Perspective_Projection ( float hfov,
float vfov,
float znear,
float zfar )
virtual

Reimplemented from ProjectorClass.

Definition at line 810 of file texproject.cpp.

◆ Set_Render_Target()

void TexProjectClass::Set_Render_Target ( TextureClass * render_target,
ZTextureClass * ztarget = NULL )

Definition at line 1215 of file texproject.cpp.

◆ Set_Texture()

void TexProjectClass::Set_Texture ( TextureClass * texture)

Definition at line 732 of file texproject.cpp.

◆ Set_Texture_Size()

void TexProjectClass::Set_Texture_Size ( int size)

Definition at line 260 of file texproject.cpp.

◆ Update_WS_Bounding_Volume()

void TexProjectClass::Update_WS_Bounding_Volume ( void )
protectedvirtual

Reimplemented from ProjectorClass.

Definition at line 1379 of file texproject.cpp.

Member Data Documentation

◆ Attenuation

float TexProjectClass::Attenuation
protected

Definition at line 216 of file texproject.h.

◆ DepthStencilTarget

ZTextureClass* TexProjectClass::DepthStencilTarget
protected

Definition at line 224 of file texproject.h.

◆ DesiredIntensity

float TexProjectClass::DesiredIntensity
protected

Definition at line 214 of file texproject.h.

◆ Flags

uint32 TexProjectClass::Flags
protected

Definition at line 209 of file texproject.h.

◆ HFov

float TexProjectClass::HFov
protected

Definition at line 230 of file texproject.h.

◆ Intensity

float TexProjectClass::Intensity
protected

Definition at line 215 of file texproject.h.

◆ Mapper1

MatrixMapperClass* TexProjectClass::Mapper1
protected

Definition at line 222 of file texproject.h.

◆ MaterialPass

MaterialPassClass* TexProjectClass::MaterialPass
protected

Definition at line 221 of file texproject.h.

◆ RenderTarget

TextureClass* TexProjectClass::RenderTarget
protected

Definition at line 223 of file texproject.h.

◆ VFov

float TexProjectClass::VFov
protected

Definition at line 231 of file texproject.h.

◆ XMax

float TexProjectClass::XMax
protected

Definition at line 233 of file texproject.h.

◆ XMin

float TexProjectClass::XMin
protected

Definition at line 232 of file texproject.h.

◆ YMax

float TexProjectClass::YMax
protected

Definition at line 235 of file texproject.h.

◆ YMin

float TexProjectClass::YMin
protected

Definition at line 234 of file texproject.h.

◆ ZFar

float TexProjectClass::ZFar
protected

Definition at line 236 of file texproject.h.

◆ ZNear

float TexProjectClass::ZNear
protected

Definition at line 236 of file texproject.h.


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