PRooFPS-dd Dev Doc 1.0
PRooFPS-dd Developer Documentation
Loading...
Searching...
No Matches
proofps_dd::Smoke Class Reference

Detailed Description

Definition at line 19 of file Smoke.h.

#include <Smoke.h>

+ Inheritance diagram for proofps_dd::Smoke:

Classes

struct  SmokeEmitOperValues
 

Public Types

enum class  SmokeConfigAmount { None = 0 , Moderate , Normal , Extreme }
 

Public Member Functions

 Smoke (PgeObjectPoolBase &parentPool, PR00FsUltimateRenderingEngine &gfx)
 
virtual ~Smoke ()
 
 Smoke (const Smoke &)=delete
 
Smokeoperator= (const Smoke &)=delete
 
 Smoke (Smoke &&)=delete
 
Smokeoperator= (Smoke &&)=delete
 
void init (const PurePosUpTarget &put, bool bGoingLeft, TPureFloat fClrRedAsFloat=1.f, TPureFloat fClrGreenAsFloat=1.f, TPureFloat fClrBlueAsFloat=1.f, TPureFloat fClrAltDarkRedAsFloat=1.f, TPureFloat fClrAltDarkGreenAsFloat=1.f, TPureFloat fClrAltDarkBlueAsFloat=1.f)
 
virtual void onSetUsed () override
 
CConsole & getConsole () const
 Returns access to console preset with logger module name as this class.
 
void update (const unsigned int &nFactor)
 
PureObject3D & getObject3D ()
 
const PureObject3D & getObject3D () const
 

Static Public Member Functions

static SmokeConfigAmount enumFromSmokeAmountString (const char *zstring)
 
static bool isValidSmokeAmountString (const std::string &str)
 
static void updateSmokeConfigAmount (const SmokeConfigAmount &eSmokeConfigAmount)
 Config::validate() invokes this (config load/change), so we always know about the config here.
 
static const char * getLoggerModuleName ()
 Returns the logger module name of this class.
 
static void destroyReferenceObject ()
 

Static Public Attributes

static constexpr auto validSmokeConfigAmountStringValues
 
static constexpr auto smokeEmitOperValues
 Based on user configuration SmokeConfigAmount, this table shows operational values used for smoke generation.
 
static constexpr char * szCVarGfxSmokeAmount = "gfx_smoke_amount"
 

Private Member Functions

void build3dObject ()
 

Private Attributes

PR00FsUltimateRenderingEngine & m_gfx
 
PureObject3D * m_obj
 Associated Pure object to be rendered.
 
TPureFloat m_fScaling
 To be increased during animation.
 
PurePosUpTarget m_put
 PUT to calculate next position.
 
bool m_bGoingLeft
 True if bullet and smoke going to left, false otherwise.
 
TPureFloat m_fInitialClrRedAsFloat
 
TPureFloat m_fInitialClrGreenAsFloat
 
TPureFloat m_fInitialClrBlueAsFloat
 

Static Private Attributes

static PureObject3D * m_pSmokeRefObject = nullptr
 
static SmokeConfigAmount m_eSmokeConfigAmount = Smoke::SmokeConfigAmount::Normal
 Updated by Config when smoke config changes.
 

Member Enumeration Documentation

◆ SmokeConfigAmount

Enumerator
None 
Moderate 
Normal 
Extreme 

Definition at line 23 of file Smoke.h.

Constructor & Destructor Documentation

◆ Smoke() [1/3]

proofps_dd::Smoke::Smoke ( PgeObjectPoolBase & parentPool,
PR00FsUltimateRenderingEngine & gfx )

Definition at line 71 of file Smoke.cpp.

◆ ~Smoke()

proofps_dd::Smoke::~Smoke ( )
virtual

Definition at line 86 of file Smoke.cpp.

◆ Smoke() [2/3]

proofps_dd::Smoke::Smoke ( const Smoke & )
delete

◆ Smoke() [3/3]

proofps_dd::Smoke::Smoke ( Smoke && )
delete

Member Function Documentation

◆ build3dObject()

void proofps_dd::Smoke::build3dObject ( )
private

Definition at line 216 of file Smoke.cpp.

◆ destroyReferenceObject()

void proofps_dd::Smoke::destroyReferenceObject ( )
static

Definition at line 61 of file Smoke.cpp.

◆ enumFromSmokeAmountString()

proofps_dd::Smoke::SmokeConfigAmount proofps_dd::Smoke::enumFromSmokeAmountString ( const char * zstring)
static

Definition at line 21 of file Smoke.cpp.

◆ getConsole()

CConsole & proofps_dd::Smoke::getConsole ( ) const

Returns access to console preset with logger module name as this class.

Definition at line 161 of file Smoke.cpp.

◆ getLoggerModuleName()

const char * proofps_dd::Smoke::getLoggerModuleName ( )
static

Returns the logger module name of this class.

Definition at line 56 of file Smoke.cpp.

◆ getObject3D() [1/2]

PureObject3D & proofps_dd::Smoke::getObject3D ( )

Definition at line 206 of file Smoke.cpp.

◆ getObject3D() [2/2]

const PureObject3D & proofps_dd::Smoke::getObject3D ( ) const

Definition at line 211 of file Smoke.cpp.

◆ init()

void proofps_dd::Smoke::init ( const PurePosUpTarget & put,
bool bGoingLeft,
TPureFloat fClrRedAsFloat = 1.f,
TPureFloat fClrGreenAsFloat = 1.f,
TPureFloat fClrBlueAsFloat = 1.f,
TPureFloat fClrAltDarkRedAsFloat = 1.f,
TPureFloat fClrAltDarkGreenAsFloat = 1.f,
TPureFloat fClrAltDarkBlueAsFloat = 1.f )

Definition at line 94 of file Smoke.cpp.

◆ isValidSmokeAmountString()

bool proofps_dd::Smoke::isValidSmokeAmountString ( const std::string & str)
static

Definition at line 39 of file Smoke.cpp.

◆ onSetUsed()

void proofps_dd::Smoke::onSetUsed ( )
overridevirtual

Definition at line 155 of file Smoke.cpp.

◆ operator=() [1/2]

Smoke & proofps_dd::Smoke::operator= ( const Smoke & )
delete

◆ operator=() [2/2]

Smoke & proofps_dd::Smoke::operator= ( Smoke && )
delete

◆ update()

void proofps_dd::Smoke::update ( const unsigned int & nFactor)

Definition at line 166 of file Smoke.cpp.

◆ updateSmokeConfigAmount()

void proofps_dd::Smoke::updateSmokeConfigAmount ( const SmokeConfigAmount & eSmokeConfigAmount)
static

Config::validate() invokes this (config load/change), so we always know about the config here.

Cannot use Config in Smoke, hence I need this dirty behavior.

Definition at line 51 of file Smoke.cpp.

Member Data Documentation

◆ m_bGoingLeft

bool proofps_dd::Smoke::m_bGoingLeft
private

True if bullet and smoke going to left, false otherwise.

Used by both PGE client and server instances.

Definition at line 121 of file Smoke.h.

◆ m_eSmokeConfigAmount

proofps_dd::Smoke::SmokeConfigAmount proofps_dd::Smoke::m_eSmokeConfigAmount = Smoke::SmokeConfigAmount::Normal
staticprivate

Updated by Config when smoke config changes.

Smoke does not access Config, hence we need this.

Definition at line 114 of file Smoke.h.

◆ m_fInitialClrBlueAsFloat

TPureFloat proofps_dd::Smoke::m_fInitialClrBlueAsFloat
private

Definition at line 124 of file Smoke.h.

◆ m_fInitialClrGreenAsFloat

TPureFloat proofps_dd::Smoke::m_fInitialClrGreenAsFloat
private

Definition at line 123 of file Smoke.h.

◆ m_fInitialClrRedAsFloat

TPureFloat proofps_dd::Smoke::m_fInitialClrRedAsFloat
private

Definition at line 122 of file Smoke.h.

◆ m_fScaling

TPureFloat proofps_dd::Smoke::m_fScaling
private

To be increased during animation.

Used by both PGE client and server instances.

Definition at line 119 of file Smoke.h.

◆ m_gfx

PR00FsUltimateRenderingEngine& proofps_dd::Smoke::m_gfx
private

Definition at line 116 of file Smoke.h.

◆ m_obj

PureObject3D* proofps_dd::Smoke::m_obj
private

Associated Pure object to be rendered.

Used by PGE server and client instances. TODO: shared ptr.

Definition at line 118 of file Smoke.h.

◆ m_pSmokeRefObject

PureObject3D * proofps_dd::Smoke::m_pSmokeRefObject = nullptr
staticprivate

Definition at line 113 of file Smoke.h.

◆ m_put

PurePosUpTarget proofps_dd::Smoke::m_put
private

PUT to calculate next position.

Used by both PGE client and server instances.

Definition at line 120 of file Smoke.h.

◆ smokeEmitOperValues

auto proofps_dd::Smoke::smokeEmitOperValues
staticconstexpr
Initial value:
= PFL::std_array_of<SmokeEmitOperValues>(
SmokeEmitOperValues{ 2.f, 6 },
SmokeEmitOperValues{ 2.f, 6 },
SmokeEmitOperValues{ 2.f, 3 },
SmokeEmitOperValues{ 2.f, 2 }
)

Based on user configuration SmokeConfigAmount, this table shows operational values used for smoke generation.

Due to current design, the max number of smokes at a time per bullet cannot be explicitly set, however with these values, it can be tuned:

  • higher scaling speed leads to less smoke objects at a time,
  • higher EmitInEveryNPhysicsIteration leads to less smoke objects at a time. The resulting max smoke objects per bullet with 60 Hz physics rate is mentioned near each setting.

Definition at line 56 of file Smoke.h.

◆ szCVarGfxSmokeAmount

char* proofps_dd::Smoke::szCVarGfxSmokeAmount = "gfx_smoke_amount"
staticconstexpr

Definition at line 67 of file Smoke.h.

◆ validSmokeConfigAmountStringValues

auto proofps_dd::Smoke::validSmokeConfigAmountStringValues
staticconstexpr
Initial value:
= PFL::std_array_of<const char*>(
"none",
"moderate",
"normal",
"extreme"
)

Definition at line 31 of file Smoke.h.


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