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

#include <W3DProjectedShadow.h>

Inherits Shadow.

Public Member Functions

 W3DProjectedShadow (void)
 
 ~W3DProjectedShadow (void)
 
void setRenderObject (RenderObjClass *robj)
 
void setObjPosHistory (Vector3 &pos)
 position of object when projection matrix was updated.
 
void setTexture (Int lightIndex, W3DShadowTexture *texture)
 textur with light's shadow
 
void update (void)
 updates the texture and/or projection parameters when the object or light moves.
 
void init (void)
 allocates local member variables used for projection
 
void updateTexture (Vector3 &lightPos)
 updates the shadow texture image using render object and given light position.
 
void updateProjectionParameters (const Matrix3D &cameraXform)
 recompute projection matrix - needed when light or object moves.
 
TexProjectClassgetShadowProjector (void)
 
W3DShadowTexturegetTexture (Int lightIndex)
 
- Public Member Functions inherited from Shadow
 Shadow (void)
 if this is set, then no render will occur, even if enableShadowRender() is enabled. Used by Shroud.
 
void enableShadowInvisible (Bool isEnabled)
 
void enableShadowRender (Bool isEnabled)
 
Bool isRenderEnabled (void)
 
Bool isInvisibleEnabled (void)
 
void setOpacity (Int value)
 adjust opacity of decal/shadow
 
void setColor (Color value)
 adjust ARGB color of decal/shadow
 
void setAngle (Real angle)
 adjust orientation around z-axis
 
void setPosition (Real x, Real y, Real z)
 
void setSize (Real sizeX, Real sizeY)
 

Protected Member Functions

virtual void release (void)
 custom rendering flags
 

Protected Attributes

W3DShadowTexturem_shadowTexture [MAX_SHADOW_LIGHTS]
 cached shadow data
 
TexProjectClassm_shadowProjector
 object used to generate texture and projection matrix.
 
RenderObjClassm_robj
 render object used to cast the shadow.
 
Vector3 m_lastObjPosition
 position of object at time of projection matrix update.
 
W3DProjectedShadowm_next
 
Bool m_allowWorldAlign
 for the shadow manager list
 
Real m_decalOffsetU
 wrap shadow around world geometry - else align perpendicular to local z-axis.
 
Real m_decalOffsetV
 texture coordinate offset so not centered at object origin.
 
Int m_flags
 texture coordinate offset so not centered at object origin.
 
- Protected Attributes inherited from Shadow
Bool m_isEnabled
 
Bool m_isInvisibleEnabled
 toggle to turn rendering of this shadow on/off.
 
UnsignedInt m_opacity
 if set, overrides and causes no rendering.
 
UnsignedInt m_color
 color in ARGB format. (Alpha is ignored).
 
ShadowType m_type
 
Int m_diffuse
 type of projection
 
Real m_x
 diffuse color used to tint/fade shadow.
 
Real m_y
 
Real m_z
 
Real m_oowDecalSizeX
 world position of shadow center when not bound to robj/drawable.
 
Real m_oowDecalSizeY
 1/(world space extent of texture in x direction)
 
Real m_decalSizeX
 1/(world space extent of texture in y direction)
 
Real m_decalSizeY
 1/(world space extent of texture in x direction)
 
Real m_localAngle
 1/(world space extent of texture in y direction)
 

Friends

class W3DProjectedShadowManager
 

Detailed Description

Object for maintaining and updating an object's shadow texture.

Definition at line 96 of file W3DProjectedShadow.h.

Constructor & Destructor Documentation

◆ W3DProjectedShadow()

W3DProjectedShadow::W3DProjectedShadow ( void )

type of projection

wrap shadow around world geometry - else align perpendicular to local z-axis.

Definition at line 2120 of file W3DProjectedShadow.cpp.

◆ ~W3DProjectedShadow()

W3DProjectedShadow::~W3DProjectedShadow ( void )

Definition at line 2133 of file W3DProjectedShadow.cpp.

Member Function Documentation

◆ getShadowProjector()

TexProjectClass * W3DProjectedShadow::getShadowProjector ( void )
inline

Definition at line 110 of file W3DProjectedShadow.h.

◆ getTexture()

W3DShadowTexture * W3DProjectedShadow::getTexture ( Int lightIndex)
inline

Definition at line 114 of file W3DProjectedShadow.h.

◆ init()

void W3DProjectedShadow::init ( void )

allocates local member variables used for projection

Definition at line 2140 of file W3DProjectedShadow.cpp.

◆ release()

virtual void W3DProjectedShadow::release ( void )
inlineprotectedvirtual

custom rendering flags

release shadow from manager

Implements Shadow.

Definition at line 127 of file W3DProjectedShadow.h.

◆ setObjPosHistory()

void W3DProjectedShadow::setObjPosHistory ( Vector3 & pos)
inline

position of object when projection matrix was updated.

Definition at line 104 of file W3DProjectedShadow.h.

◆ setRenderObject()

void W3DProjectedShadow::setRenderObject ( RenderObjClass * robj)
inline

Definition at line 103 of file W3DProjectedShadow.h.

◆ setTexture()

void W3DProjectedShadow::setTexture ( Int lightIndex,
W3DShadowTexture * texture )
inline

textur with light's shadow

Definition at line 105 of file W3DProjectedShadow.h.

◆ update()

void W3DProjectedShadow::update ( void )

updates the texture and/or projection parameters when the object or light moves.

Todo
: See why infinite light sources don't project shadows correctly.

Definition at line 2239 of file W3DProjectedShadow.cpp.

◆ updateProjectionParameters()

void W3DProjectedShadow::updateProjectionParameters ( const Matrix3D & cameraXform)

recompute projection matrix - needed when light or object moves.

Definition at line 2234 of file W3DProjectedShadow.cpp.

◆ updateTexture()

void W3DProjectedShadow::updateTexture ( Vector3 & lightPos)

updates the shadow texture image using render object and given light position.

Todo
: See why infinite light sources don't project shadows correctly.
Todo
: tweak decal bounding volumes to something sensible

Definition at line 2155 of file W3DProjectedShadow.cpp.

Friends And Related Symbol Documentation

◆ W3DProjectedShadowManager

friend class W3DProjectedShadowManager
friend

Definition at line 98 of file W3DProjectedShadow.h.

Member Data Documentation

◆ m_allowWorldAlign

Bool W3DProjectedShadow::m_allowWorldAlign
protected

for the shadow manager list

Definition at line 123 of file W3DProjectedShadow.h.

◆ m_decalOffsetU

Real W3DProjectedShadow::m_decalOffsetU
protected

wrap shadow around world geometry - else align perpendicular to local z-axis.

Definition at line 124 of file W3DProjectedShadow.h.

◆ m_decalOffsetV

Real W3DProjectedShadow::m_decalOffsetV
protected

texture coordinate offset so not centered at object origin.

Definition at line 125 of file W3DProjectedShadow.h.

◆ m_flags

Int W3DProjectedShadow::m_flags
protected

texture coordinate offset so not centered at object origin.

Definition at line 126 of file W3DProjectedShadow.h.

◆ m_lastObjPosition

Vector3 W3DProjectedShadow::m_lastObjPosition
protected

position of object at time of projection matrix update.

Definition at line 121 of file W3DProjectedShadow.h.

◆ m_next

W3DProjectedShadow* W3DProjectedShadow::m_next
protected

Definition at line 122 of file W3DProjectedShadow.h.

◆ m_robj

RenderObjClass* W3DProjectedShadow::m_robj
protected

render object used to cast the shadow.

Definition at line 120 of file W3DProjectedShadow.h.

◆ m_shadowProjector

TexProjectClass* W3DProjectedShadow::m_shadowProjector
protected

object used to generate texture and projection matrix.

Definition at line 119 of file W3DProjectedShadow.h.

◆ m_shadowTexture

W3DShadowTexture* W3DProjectedShadow::m_shadowTexture[MAX_SHADOW_LIGHTS]
protected

cached shadow data

Definition at line 118 of file W3DProjectedShadow.h.


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