DDraceNetwork Docs
CParticles Class Reference

#include <particles.h>

Inheritance diagram for CParticles:
[legend]
Collaboration diagram for CParticles:
[legend]

Classes

class  CRenderGroup
 

Public Types

enum  {
  GROUP_PROJECTILE_TRAIL = 0 , GROUP_TRAIL_EXTRA , GROUP_EXPLOSIONS , GROUP_EXTRA ,
  GROUP_GENERAL , NUM_GROUPS
}
 

Public Member Functions

 CParticles ()
 
virtual int Sizeof () const override
 
void Add (int Group, CParticle *pPart, float TimePassed=0.f)
 
virtual void OnReset () override
 
virtual void OnRender () override
 
virtual void OnInit () override
 
- Public Member Functions inherited from CComponent
virtual ~CComponent ()
 
virtual int Sizeof () const =0
 
class CGameClientGameClient () const
 
class IClientClient () const
 
virtual void OnStateChange (int NewState, int OldState)
 
virtual void OnConsoleInit ()
 
virtual void OnInit ()
 
virtual void OnShutdown ()
 
virtual void OnReset ()
 
virtual void OnWindowResize ()
 
virtual void OnRefreshSkins ()
 
virtual void OnRender ()
 
virtual void OnNewSnapshot ()
 
virtual void OnRelease ()
 
virtual void OnMapLoad ()
 
virtual void OnMessage (int Msg, void *pRawMsg)
 
virtual bool OnCursorMove (float x, float y, IInput::ECursorType CursorType)
 
virtual bool OnInput (const IInput::CEvent &Event)
 

Private Types

enum  { MAX_PARTICLES = 1024 * 8 }
 

Private Member Functions

void RenderGroup (int Group)
 
void Update (float TimePassed)
 
bool ParticleIsVisibleOnScreen (const vec2 &CurPos, float CurSize)
 

Private Attributes

int m_ParticleQuadContainerIndex
 
int m_ExtraParticleQuadContainerIndex
 
CParticle m_aParticles [MAX_PARTICLES]
 
int m_FirstFree
 
int m_aFirstPart [NUM_GROUPS]
 
float m_FrictionFraction = 0.0f
 
int64_t m_LastRenderTime = 0
 
CRenderGroup< GROUP_PROJECTILE_TRAILm_RenderTrail
 
CRenderGroup< GROUP_TRAIL_EXTRAm_RenderTrailExtra
 
CRenderGroup< GROUP_EXPLOSIONSm_RenderExplosions
 
CRenderGroup< GROUP_EXTRAm_RenderExtra
 
CRenderGroup< GROUP_GENERALm_RenderGeneral
 

Friends

class CGameClient
 

Additional Inherited Members

- Protected Member Functions inherited from CComponent
class IKernelKernel () const
 
class IEngineEngine () const
 
class IGraphicsGraphics () const
 
class ITextRenderTextRender () const
 
class IInputInput () const
 
class IStorageStorage () const
 
class CUiUi () const
 
class ISoundSound () const
 
class CRenderToolsRenderTools () const
 
class IConfigManagerConfigManager () const
 
class CConfigConfig () const
 
class IConsoleConsole () const
 
class IDemoPlayerDemoPlayer () const
 
class IDemoRecorderDemoRecorder (int Recorder) const
 
class IFavoritesFavorites () const
 
class IServerBrowserServerBrowser () const
 
class CLayersLayers () const
 
class CCollisionCollision () const
 
int64_t time () const
 
float LocalTime () const
 
class IHttpHttp () const
 
- Protected Attributes inherited from CComponent
CGameClientm_pClient
 

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
GROUP_PROJECTILE_TRAIL 
GROUP_TRAIL_EXTRA 
GROUP_EXPLOSIONS 
GROUP_EXTRA 
GROUP_GENERAL 
NUM_GROUPS 

◆ anonymous enum

anonymous enum
private
Enumerator
MAX_PARTICLES 

Constructor & Destructor Documentation

◆ CParticles()

CParticles::CParticles ( )

Member Function Documentation

◆ Add()

void CParticles::Add ( int  Group,
CParticle pPart,
float  TimePassed = 0.f 
)

◆ OnInit()

void CParticles::OnInit ( )
overridevirtual

Called to let the components run initialization code.

Reimplemented from CComponent.

◆ OnRender()

void CParticles::OnRender ( )
overridevirtual

Called when the component should get rendered.

The render order depends on the component insertion order.

Reimplemented from CComponent.

◆ OnReset()

void CParticles::OnReset ( )
overridevirtual

Called to reset the component. This method is usually called on your component constructor to avoid code duplication.

See also
CHud::CHud()
CHud::OnReset()

Reimplemented from CComponent.

◆ ParticleIsVisibleOnScreen()

bool CParticles::ParticleIsVisibleOnScreen ( const vec2 CurPos,
float  CurSize 
)
private

◆ RenderGroup()

void CParticles::RenderGroup ( int  Group)
private

◆ Sizeof()

virtual int CParticles::Sizeof ( ) const
inlineoverridevirtual

Gets the size of the non-abstract component.

Implements CComponent.

◆ Update()

void CParticles::Update ( float  TimePassed)
private

Friends And Related Function Documentation

◆ CGameClient

friend class CGameClient
friend

Member Data Documentation

◆ m_aFirstPart

int CParticles::m_aFirstPart[NUM_GROUPS]
private

◆ m_aParticles

CParticle CParticles::m_aParticles[MAX_PARTICLES]
private

◆ m_ExtraParticleQuadContainerIndex

int CParticles::m_ExtraParticleQuadContainerIndex
private

◆ m_FirstFree

int CParticles::m_FirstFree
private

◆ m_FrictionFraction

float CParticles::m_FrictionFraction = 0.0f
private

◆ m_LastRenderTime

int64_t CParticles::m_LastRenderTime = 0
private

◆ m_ParticleQuadContainerIndex

int CParticles::m_ParticleQuadContainerIndex
private

◆ m_RenderExplosions

CRenderGroup<GROUP_EXPLOSIONS> CParticles::m_RenderExplosions
private

◆ m_RenderExtra

CRenderGroup<GROUP_EXTRA> CParticles::m_RenderExtra
private

◆ m_RenderGeneral

CRenderGroup<GROUP_GENERAL> CParticles::m_RenderGeneral
private

◆ m_RenderTrail

CRenderGroup<GROUP_PROJECTILE_TRAIL> CParticles::m_RenderTrail
private

◆ m_RenderTrailExtra

CRenderGroup<GROUP_TRAIL_EXTRA> CParticles::m_RenderTrailExtra
private

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