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

Custom render object that draws animated tracks/waves on the water. More...

#include <W3DWaterTracks.h>

Public Member Functions

 WaterTracksObj (void)
 
 ~WaterTracksObj (void)
 
virtual void Render (void)
 
virtual void Get_Obj_Space_Bounding_Sphere (SphereClass &sphere) const
 draw this object
 
virtual void Get_Obj_Space_Bounding_Box (AABoxClass &aabox) const
 bounding box of this object
 
Int freeWaterTracksResources (void)
 free W3D assets used for this track
 
void init (Real width, Real length, Vector2 &start, Vector2 &end, Char *texturename, Int waveTimeOffset)
 allocate W3D resources and set size
 
void init (Real width, Vector2 &start, Vector2 &end, Char *texturename)
 allocate W3D resources and set size
 
Int update (Int msElapsed)
 update animation state
 
Int render (DX8VertexBufferClass *vertexBuffer, Int batchStart)
 draw this object
 

Protected Attributes

TextureClassm_stageZeroTexture
 primary texture
 
SphereClass m_boundingSphere
 bounding sphere of WaterTracks
 
AABoxClass m_boundingBox
 bounding box of WaterTracks
 
waveType m_type
 used for render state sorting (set this to texture pointer for now).
 
Int m_x
 vertex count
 
Int m_y
 vertex count
 
Bool m_bound
 object is bound to owner and accepts new edges
 
Vector2 m_startPos
 starting position of wave
 
Vector2 m_waveDir
 direction of wave travel
 
Vector2 m_perpDir
 direction perpendicular to wave travel
 
Vector2 m_initStartPos
 original settings used to create wave
 
Vector2 m_initEndPos
 original settings used to create wave
 
Int m_initTimeOffset
 time offset when wave is added into the system
 
Int m_fadeMs
 time for wave to fade out after it stops moving
 
Int m_totalMs
 amount of time to complete full motion
 
Int m_elapsedMs
 amount of time since start of motion
 
Real m_waveInitialWidth
 width of wave segment when it first appears
 
Real m_waveInitialHeight
 height of wave segment when it first appears
 
Real m_waveFinalWidth
 width of wave segment at full size
 
Real m_waveFinalWidthPeakFrac
 fraction along path when wave reaches full width
 
Real m_waveFinalHeight
 final height of unstretched wave
 
Real m_initialVelocity
 
Real m_waveDistance
 
Real m_timeToReachBeach
 
Real m_frontSlowDownAcc
 
Real m_timeToStop
 
Real m_timeToRetreat
 
Real m_backSlowDownAcc
 
Real m_timeToCompress
 
Real m_flipU
 force uv coordinates to flip
 
WaterTracksObjm_nextSystem
 next track in system
 
WaterTracksObjm_prevSystem
 previous track in system
 

Friends

class WaterTracksRenderSystem
 

Detailed Description

Custom render object that draws animated tracks/waves on the water.

This is an object which draws a small breaking wave or splash animation. These objects are to be managed/accessed only by the WaterTracksRenderObjClassSystem

Definition at line 38 of file W3DWaterTracks.h.

Constructor & Destructor Documentation

◆ WaterTracksObj()

WaterTracksObj::WaterTracksObj ( void )

Constructor. Just nulls out some variables.

Definition at line 135 of file W3DWaterTracks.cpp.

◆ ~WaterTracksObj()

WaterTracksObj::~WaterTracksObj ( void )

Destructor. Releases w3d assets.

Definition at line 125 of file W3DWaterTracks.cpp.

Member Function Documentation

◆ freeWaterTracksResources()

Int WaterTracksObj::freeWaterTracksResources ( void )

free W3D assets used for this track

Free any W3D resources associated with this object

Definition at line 167 of file W3DWaterTracks.cpp.

◆ Get_Obj_Space_Bounding_Box()

void WaterTracksObj::Get_Obj_Space_Bounding_Box ( AABoxClass & box) const
virtual

bounding box of this object

WW3D method that returns object bounding box used in collision detection

Definition at line 157 of file W3DWaterTracks.cpp.

◆ Get_Obj_Space_Bounding_Sphere()

void WaterTracksObj::Get_Obj_Space_Bounding_Sphere ( SphereClass & sphere) const
virtual

draw this object

bounding sphere of this object

WW3D method that returns object bounding sphere used in frustum culling

Todo
: Add code to cull track marks to screen by constantly updating bounding volumes

Definition at line 147 of file W3DWaterTracks.cpp.

◆ init() [1/2]

void WaterTracksObj::init ( Real width,
Real length,
Vector2 & start,
Vector2 & end,
Char * texturename,
Int waveTimeOffset )

allocate W3D resources and set size

Setup size settings and allocate W3D texture The width/length define the size of the polygon quad which will contain the specified texture.

<width of wave segment when it first appears

<height of wave segment when it first appears

<width of wave segment at full size

<final height of unstretched wave

Definition at line 181 of file W3DWaterTracks.cpp.

◆ init() [2/2]

void WaterTracksObj::init ( Real width,
Vector2 & start,
Vector2 & end,
Char * texturename )

allocate W3D resources and set size

Setup size settings and allocate W3D texture Alternate version of init where: (start, end) define a vector perpendicular to wave travel. The length of this vector is used as the length of the wave segment. The line between start-end defines the maximum distance the wave will reach.

Definition at line 253 of file W3DWaterTracks.cpp.

◆ Render()

virtual void WaterTracksObj::Render ( void )
inlinevirtual

Definition at line 47 of file W3DWaterTracks.h.

◆ render()

Int WaterTracksObj::render ( DX8VertexBufferClass * vertexBuffer,
Int batchStart )

draw this object

Draws the object in it's current state.

Todo
: bug?

Definition at line 311 of file W3DWaterTracks.cpp.

◆ update()

Int WaterTracksObj::update ( Int msElapsed)

update animation state

Update state of object - advance animations and other states.

Todo
: Should check in here if we are done with this object are return FALSE to free it.

Definition at line 284 of file W3DWaterTracks.cpp.

Friends And Related Symbol Documentation

◆ WaterTracksRenderSystem

friend class WaterTracksRenderSystem
friend

Definition at line 40 of file W3DWaterTracks.h.

Member Data Documentation

◆ m_backSlowDownAcc

Real WaterTracksObj::m_backSlowDownAcc
protected

Definition at line 90 of file W3DWaterTracks.h.

◆ m_bound

Bool WaterTracksObj::m_bound
protected

object is bound to owner and accepts new edges

Definition at line 65 of file W3DWaterTracks.h.

◆ m_boundingBox

AABoxClass WaterTracksObj::m_boundingBox
protected

bounding box of WaterTracks

Definition at line 60 of file W3DWaterTracks.h.

◆ m_boundingSphere

SphereClass WaterTracksObj::m_boundingSphere
protected

bounding sphere of WaterTracks

Definition at line 59 of file W3DWaterTracks.h.

◆ m_elapsedMs

Int WaterTracksObj::m_elapsedMs
protected

amount of time since start of motion

Definition at line 75 of file W3DWaterTracks.h.

◆ m_fadeMs

Int WaterTracksObj::m_fadeMs
protected

time for wave to fade out after it stops moving

Definition at line 73 of file W3DWaterTracks.h.

◆ m_flipU

Real WaterTracksObj::m_flipU
protected

force uv coordinates to flip

Definition at line 92 of file W3DWaterTracks.h.

◆ m_frontSlowDownAcc

Real WaterTracksObj::m_frontSlowDownAcc
protected

Definition at line 87 of file W3DWaterTracks.h.

◆ m_initEndPos

Vector2 WaterTracksObj::m_initEndPos
protected

original settings used to create wave

Definition at line 71 of file W3DWaterTracks.h.

◆ m_initialVelocity

Real WaterTracksObj::m_initialVelocity
protected

Definition at line 84 of file W3DWaterTracks.h.

◆ m_initStartPos

Vector2 WaterTracksObj::m_initStartPos
protected

original settings used to create wave

Definition at line 70 of file W3DWaterTracks.h.

◆ m_initTimeOffset

Int WaterTracksObj::m_initTimeOffset
protected

time offset when wave is added into the system

Definition at line 72 of file W3DWaterTracks.h.

◆ m_nextSystem

WaterTracksObj* WaterTracksObj::m_nextSystem
protected

next track in system

Definition at line 94 of file W3DWaterTracks.h.

◆ m_perpDir

Vector2 WaterTracksObj::m_perpDir
protected

direction perpendicular to wave travel

Definition at line 69 of file W3DWaterTracks.h.

◆ m_prevSystem

WaterTracksObj* WaterTracksObj::m_prevSystem
protected

previous track in system

Definition at line 95 of file W3DWaterTracks.h.

◆ m_stageZeroTexture

TextureClass* WaterTracksObj::m_stageZeroTexture
protected

primary texture

Definition at line 58 of file W3DWaterTracks.h.

◆ m_startPos

Vector2 WaterTracksObj::m_startPos
protected

starting position of wave

Definition at line 66 of file W3DWaterTracks.h.

◆ m_timeToCompress

Real WaterTracksObj::m_timeToCompress
protected

Definition at line 91 of file W3DWaterTracks.h.

◆ m_timeToReachBeach

Real WaterTracksObj::m_timeToReachBeach
protected

Definition at line 86 of file W3DWaterTracks.h.

◆ m_timeToRetreat

Real WaterTracksObj::m_timeToRetreat
protected

Definition at line 89 of file W3DWaterTracks.h.

◆ m_timeToStop

Real WaterTracksObj::m_timeToStop
protected

Definition at line 88 of file W3DWaterTracks.h.

◆ m_totalMs

Int WaterTracksObj::m_totalMs
protected

amount of time to complete full motion

Definition at line 74 of file W3DWaterTracks.h.

◆ m_type

waveType WaterTracksObj::m_type
protected

used for render state sorting (set this to texture pointer for now).

Definition at line 62 of file W3DWaterTracks.h.

◆ m_waveDir

Vector2 WaterTracksObj::m_waveDir
protected

direction of wave travel

Definition at line 68 of file W3DWaterTracks.h.

◆ m_waveDistance

Real WaterTracksObj::m_waveDistance
protected

Definition at line 85 of file W3DWaterTracks.h.

◆ m_waveFinalHeight

Real WaterTracksObj::m_waveFinalHeight
protected

final height of unstretched wave

Definition at line 82 of file W3DWaterTracks.h.

◆ m_waveFinalWidth

Real WaterTracksObj::m_waveFinalWidth
protected

width of wave segment at full size

Definition at line 80 of file W3DWaterTracks.h.

◆ m_waveFinalWidthPeakFrac

Real WaterTracksObj::m_waveFinalWidthPeakFrac
protected

fraction along path when wave reaches full width

Definition at line 81 of file W3DWaterTracks.h.

◆ m_waveInitialHeight

Real WaterTracksObj::m_waveInitialHeight
protected

height of wave segment when it first appears

Definition at line 79 of file W3DWaterTracks.h.

◆ m_waveInitialWidth

Real WaterTracksObj::m_waveInitialWidth
protected

width of wave segment when it first appears

Definition at line 78 of file W3DWaterTracks.h.

◆ m_x

Int WaterTracksObj::m_x
protected

vertex count

Definition at line 63 of file W3DWaterTracks.h.

◆ m_y

Int WaterTracksObj::m_y
protected

vertex count

Definition at line 64 of file W3DWaterTracks.h.


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