#include <env_effect.h>
Nevrax France
Definition at line 98 of file env_effect.h.
Public Member Functions | |
void | addEnvNum (TEnvEffectPreset num, const std::string &tag="", float customsize=-1.0f) |
CEnvEffect () | |
Constructor. | |
IBoundingShape * | getBoundingShape () |
Access the bounding shape (EDIT). | |
TEnvEffectPreset | getEnvNum () const |
Return the environment type. | |
float | getEnvSize () const |
Return the environment size. | |
bool | include (const NLMISC::CVector &pos) |
Return true if the environment includes the specified point. | |
void | selectEnv (const std::string &tag) |
Select the current environment. | |
void | serial (NLMISC::IStream &s) |
Serialize. | |
void | setBoundingShape (IBoundingShape *bs) |
Set the bounding shape (EDIT). | |
virtual | ~CEnvEffect () |
Destructor. | |
Static Public Member Functions | |
uint32 | load (std::vector< CEnvEffect * > &container, NLMISC::IStream &s) |
Load several EnvEffects and return the number of effects loaded. | |
void | save (const std::vector< CEnvEffect > &container, NLMISC::IStream &s) |
Save (output stream only) (EDIT). | |
void | serialFileHeader (NLMISC::IStream &s, uint32 &nb) |
Serialize file header. | |
Private Attributes | |
IBoundingShape * | _BoundingShape |
uint8 | _Current |
std::vector< TEnvEffectRoom > | _EnvNums |
std::vector< std::string > | _Tags |
|
Constructor.
Definition at line 39 of file env_effect.cpp. Referenced by load().
00039 : _Current(0), _BoundingShape(NULL) 00040 { 00041 } |
|
Destructor.
Definition at line 105 of file env_effect.h.
00105 {} |
|
Set the environment type (EDIT). The size of the environment is computed with the bounding shape, unless the argument customshape is positive. Definition at line 87 of file env_effect.cpp. References _EnvNums, _Tags, and num.
|
|
Access the bounding shape (EDIT).
Definition at line 135 of file env_effect.h. References _BoundingShape.
00135 { return _BoundingShape; } |
|
Return the environment type.
Definition at line 124 of file env_effect.h. References _Current, _EnvNums, and NLSOUND::TEnvEffectPreset.
|
|
Return the environment size.
Definition at line 97 of file env_effect.cpp. References _BoundingShape, _Current, and _EnvNums.
00098 { 00099 if ( _EnvNums[_Current].Size > 0 ) 00100 { 00101 return _EnvNums[_Current].Size; 00102 } 00103 else 00104 { 00105 return _BoundingShape->getDiameter(); 00106 } 00107 } |
|
Return true if the environment includes the specified point.
Definition at line 120 of file env_effect.h. References _BoundingShape.
00120 { return _BoundingShape->include( pos ); } |
|
Load several EnvEffects and return the number of effects loaded.
Definition at line 62 of file env_effect.cpp. References CEnvEffect(), nlstop, s, serialFileHeader(), and uint32.
00063 { 00064 if ( s.isReading() ) 00065 { 00066 uint32 i, nb; 00067 serialFileHeader( s, nb ); 00068 for ( i=0; i!=nb; i++ ) 00069 { 00070 CEnvEffect *enveffect = new CEnvEffect(); 00071 s.serial( *enveffect ); 00072 container.push_back( enveffect ); 00073 } 00074 return nb; 00075 } 00076 else 00077 { 00078 nlstop; 00079 return 0; 00080 } 00081 } |
|
Save (output stream only) (EDIT).
Definition at line 133 of file env_effect.cpp. References nlassert, s, serialFileHeader(), and uint32.
00134 { 00135 nlassert( ! s.isReading() ); 00136 00137 uint32 nb=container.size(), i; 00138 serialFileHeader( s, nb ); 00139 for ( i=0; i!=nb; i++ ) 00140 { 00141 s.serial( const_cast<CEnvEffect&>(container[i]) ); 00142 } 00143 } |
|
Select the current environment.
Definition at line 113 of file env_effect.cpp. References _Current, _Tags, nldebug, and uint.
00114 { 00115 uint i; 00116 for ( i=0; i!= _Tags.size(); i++ ) 00117 { 00118 if ( _Tags[i] == tag ) 00119 { 00120 _Current = i; 00121 nldebug( "AM: EnvEffect: Environment changed to %s", tag.c_str() ); 00122 return; 00123 } 00124 } 00125 nldebug( "AM: EnvEffect: Environment %s not found", tag.c_str() ); 00126 // Don't change _Current if not found 00127 } |
|
Serialize.
Definition at line 107 of file env_effect.h. References _BoundingShape, _EnvNums, _Tags, and s.
|
|
Serialize file header.
Definition at line 47 of file env_effect.cpp. Referenced by load(), and save().
|
|
Set the bounding shape (EDIT).
Definition at line 137 of file env_effect.h. References _BoundingShape.
00137 { _BoundingShape = bs; } |
|
Definition at line 154 of file env_effect.h. Referenced by getBoundingShape(), getEnvSize(), include(), serial(), and setBoundingShape(). |
|
Definition at line 145 of file env_effect.h. Referenced by getEnvNum(), getEnvSize(), and selectEnv(). |
|
Definition at line 148 of file env_effect.h. Referenced by addEnvNum(), getEnvNum(), getEnvSize(), and serial(). |
|
Definition at line 151 of file env_effect.h. Referenced by addEnvNum(), selectEnv(), and serial(). |