#include <flare_shape.h>
Inheritance diagram for NL3D::CFlareShape:
Nevrax France
Definition at line 53 of file flare_shape.h.
Public Member Functions | |
virtual bool | clip (const std::vector< CPlane > &pyramid, const CMatrix &worldMatrix) |
inherited from IShape | |
virtual CTransformShape * | createInstance (CScene &scene) |
inherited from IShape | |
void | enableDazzle (bool enable=true) |
enable dazzle when the flare is near the center of the screen | |
virtual void | flushTextures (IDriver &driver, uint selectedTexture) |
inherited from ishape | |
virtual void | getAABBox (NLMISC::CAABBox &bbox) const |
inherited from IShape | |
bool | getAttenuable (void) const |
check wether radial :attenuation is on | |
float | getAttenuationRange (void) const |
get the attenuation range | |
virtual std::string | getClassName ()=0 |
NLMISC::CRGBA | getColor (void) const |
get the color of flares | |
float | getDazzleAttenuationRange (void) const |
get the attenuation range of Dazzle | |
NLMISC::CRGBA | getDazzleColor (void) const |
float | getDistMax () const |
bool | getFirstFlareKeepSize (void) const |
test wether the first flare keep its real size | |
bool | getFlareAtInfiniteDist (void) const |
test wether the flare is at the infinite | |
float | getFlareSpacing (void) const |
float | getMaxViewDist (void) const |
get the max view dist | |
float | getMaxViewDistRatio (void) const |
get the max view dist ratio | |
virtual float | getNumTriangles (float distance) |
inherited from ishape | |
TAnimationTime | getPersistence (void) const |
const sint & | getRefCount () const |
float | getRelativePos (uint index) const |
get the relative pos of the nth flare | |
float | getSize (uint index) const |
const ITexture * | getTexture (uint index) const |
get the texture used by the flare (const version) | |
ITexture * | getTexture (uint index) |
bool | hasDazzle (void) const |
check wether dazzle is enabled | |
NLMISC_DECLARE_CLASS (CFlareShape) | |
virtual void | profileSceneRender (CRenderTrav *rdrTrav, CTransformShape *trans, bool opaquePass) |
virtual void | render (IDriver *drv, CTransformShape *trans, bool opaquePass) |
inherited from IShape. Does nothing. A new traverseRender() was set for that | |
void | setAttenuable (bool enable=true) |
force radial attenuation of the flares | |
void | setAttenuationRange (float range) |
set the range for attenuation | |
void | setColor (NLMISC::CRGBA col) |
set the color of flares | |
void | setDazzleAttenuationRange (float range) |
void | setDazzleColor (NLMISC::CRGBA col) |
void | setDistMax (float distMax) |
void | setFirstFlareKeepSize (bool enable=true) |
force the first flare to keep its real size (e.g the isze on screen doesn't remains constant) | |
void | setFlareAtInfiniteDist (bool enabled=true) |
void | setFlareSpacing (float spacing) |
set the flares spacing | |
void | setMaxViewDist (float dist) |
void | setMaxViewDistRatio (float ratio) |
void | setPersistence (TAnimationTime persistence) |
set the persistence of this shape, in second (the time it takes to fade from white to black) | |
void | setRelativePos (uint index, float pos) |
void | setSize (uint index, float size) |
void | setTexture (uint index, ITexture *tex) |
Object | |
CFlareShape () | |
Constructor. | |
void | serial (NLMISC::IStream &f) throw (NLMISC::EStream) |
serial this shape | |
access default tracks. | |
CTrackDefaultVector * | getDefaultPos () |
Data Fields | |
CTrackDefaultVector | _DefaultPos |
Transform default tracks. | |
sint | crefs |
CPtrInfo * | pinfo |
Static Public Attributes | |
CPtrInfo | NullPtrInfo |
Protected Attributes | |
bool | _Attenuable |
float | _AttenuationRange |
NLMISC::CRGBA | _Color |
float | _DazzleAttenuationRange |
NLMISC::CRGBA | _DazzleColor |
bool | _DazzleEnabled |
float | _DistMax |
Default to -1. | |
bool | _FirstFlareKeepSize |
bool | _InfiniteDist |
float | _MaxViewDist |
float | _MaxViewDistRatio |
TAnimationTime | _Persistence |
float | _Pos [MaxFlareNum] |
float | _Size [MaxFlareNum] |
float | _Spacing |
NLMISC::CSmartPtr< ITexture > | _Tex [MaxFlareNum] |
Friends | |
class | CFlareModel |
struct | CPtrInfo |
|
Constructor.
Definition at line 39 of file flare_shape.cpp. References NL3D::MaxFlareNum, NL3D::IShape::setDistMax(), NL3D::CTrackDefaultBlendable< CVector >::setValue(), and uint.
00039 : _Color(NLMISC::CRGBA::White), 00040 _DazzleColor(NLMISC::CRGBA::Black), 00041 _Persistence(1), 00042 _Spacing(1), 00043 _Attenuable(false), 00044 _AttenuationRange (1.0f), 00045 _FirstFlareKeepSize(false), 00046 _DazzleEnabled(false), 00047 _DazzleAttenuationRange(0.f), 00048 _MaxViewDistRatio (0.9f), 00049 _InfiniteDist(false) 00050 { 00051 // init default pos 00052 for (uint k = 0; k < MaxFlareNum; ++k) 00053 { 00054 _Tex [k] = NULL; 00055 _Size[k] = 1.f; 00056 _Pos[k] = k * (1.f / MaxFlareNum); 00057 } 00058 _DefaultPos.setValue(CVector::Null); 00059 setDistMax(1000); 00060 } |
|
inherited from IShape
Reimplemented from NL3D::IShape. Definition at line 120 of file flare_shape.cpp. References NLMISC::CMatrix::getPos().
00121 { 00122 // compute flare pos in world basis : 00123 const NLMISC::CVector pos = worldMatrix.getPos(); 00124 for (std::vector<NLMISC::CPlane>::const_iterator it = pyramid.begin(); it != pyramid.end(); ++it) 00125 { 00126 if ((*it) * pos > 0) return false; 00127 } 00128 return true; 00129 } |
|
inherited from IShape
Reimplemented from NL3D::IShape. Definition at line 100 of file flare_shape.cpp. References NL3D::CFlareModel::_Scene, NL3D::CAnimatedValueVector, NL3D::CScene::createModel(), NL3D::FlareModelClassId, NL3D::CTrackDefaultBlendable< CVector >::getValue(), and NL3D::CTransformShape::Shape.
00101 { 00102 CFlareModel *fm = NLMISC::safe_cast<CFlareModel *>(scene.createModel(FlareModelClassId) ); 00103 fm->Shape = this; 00104 fm->_Scene = &scene; 00105 // set default pos 00106 fm->ITransformable::setPos( ((CAnimatedValueVector&)_DefaultPos.getValue()).Value ); 00107 return fm; 00108 } |
|
enable dazzle when the flare is near the center of the screen
Definition at line 208 of file flare_shape.h. References _DazzleEnabled.
00208 { _DazzleEnabled = enable; } |
|
inherited from ishape
Implements NL3D::IShape. Definition at line 140 of file flare_shape.cpp. References NL3D::MaxFlareNum, NL3D::IDriver::setupTexture(), and uint.
00141 { 00142 // Flush each texture 00143 for (uint tex=0; tex<MaxFlareNum; tex++) 00144 { 00145 if (_Tex[tex] != NULL) 00146 { 00147 // Select the good texture 00148 _Tex[tex]->selectTexture (selectedTexture); 00149 00150 // Flush texture 00151 driver.setupTexture (*_Tex[tex]); 00152 } 00153 } 00154 } |
|
inherited from IShape
Reimplemented from NL3D::IShape. Definition at line 132 of file flare_shape.cpp. References NLMISC::CAABBox::setCenter(), and NLMISC::CAABBox::setHalfSize().
00133 { 00134 // the flare himself is a point 00135 bbox.setCenter(CVector::Null); 00136 bbox.setHalfSize(CVector::Null); 00137 } |
|
check wether radial :attenuation is on
Definition at line 192 of file flare_shape.h. References _Attenuable. Referenced by NL3D::CFlareModel::traverseRender().
00192 { return _Attenuable; } |
|
get the attenuation range
Definition at line 198 of file flare_shape.h. References _AttenuationRange. Referenced by NL3D::CFlareModel::traverseRender().
00198 { return _AttenuationRange; } |
|
Implemented in NLAIAGENT::CNumericIndex, NLAIC::IPointerGestion, NLAIC::CIdentType, and CAutomataDesc. Referenced by NLMISC::CClassRegistry::checkObject(), and NL3D::GetTextureSize(). |
|
get the color of flares
Definition at line 154 of file flare_shape.h. References _Color. Referenced by NL3D::CFlareModel::traverseRender().
00155 { 00156 return _Color; 00157 } |
|
get the attenuation range of Dazzle
Definition at line 230 of file flare_shape.h. References _DazzleAttenuationRange.
00230 { return _DazzleAttenuationRange; } |
|
get Dazzle color
Definition at line 221 of file flare_shape.h. References _DazzleColor.
00221 { return _DazzleColor; } |
|
Definition at line 264 of file flare_shape.h.
00264 {return &_DefaultPos;} |
|
return the DistMax where the shape is no more displayed. Default is to return -1, meaning DistMax = infinite. Definition at line 112 of file shape.h.
00112 {return _DistMax;} |
|
test wether the first flare keep its real size
Definition at line 205 of file flare_shape.h. References _FirstFlareKeepSize. Referenced by NL3D::CFlareModel::traverseRender().
00205 { return _FirstFlareKeepSize; } |
|
test wether the flare is at the infinite
Definition at line 256 of file flare_shape.h. References _InfiniteDist. Referenced by NL3D::CFlareModel::traverseRender().
00256 { return _InfiniteDist; } |
|
Get the flares spacing : A spacing of 1.f means thta the last flare will reach the center of the screen , a spacing of 0.5f means only the half way to the middle of the screen will be reached Definition at line 168 of file flare_shape.h. References _Spacing. Referenced by NL3D::CFlareModel::traverseRender().
00169 { 00170 return _Spacing; 00171 } |
|
get the max view dist
Definition at line 239 of file flare_shape.h. References _MaxViewDist. Referenced by NL3D::CFlareModel::traverseRender().
00239 { return _MaxViewDist; } |
|
get the max view dist ratio
Definition at line 247 of file flare_shape.h. References _MaxViewDistRatio. Referenced by NL3D::CFlareModel::traverseRender().
00247 { return _MaxViewDistRatio; } |
|
inherited from ishape
Implements NL3D::IShape. Definition at line 110 of file flare_shape.cpp. References count, NL3D::MaxFlareNum, and uint.
|
|
get the persistence of this shape
Definition at line 182 of file flare_shape.h. References _Persistence, and NL3D::TAnimationTime. Referenced by NL3D::CFlareModel::traverseRender().
00183 { 00184 return _Persistence; 00185 } |
|
Definition at line 70 of file smart_ptr.h. References NLMISC::CRefCount::crefs, and sint.
00071 { 00072 return crefs; 00073 } |
|
get the relative pos of the nth flare
Definition at line 141 of file flare_shape.h. References index, NL3D::MaxFlareNum, nlassert, and uint. Referenced by NL3D::CFlareModel::traverseRender().
|
|
get the size of the nth flare
Definition at line 125 of file flare_shape.h. Referenced by NL3D::CFlareModel::traverseRender().
|
|
get the texture used by the flare (const version)
Definition at line 107 of file flare_shape.h. References index, NL3D::MaxFlareNum, nlassert, and uint.
|
|
get the nth texture used by the flare.
Definition at line 100 of file flare_shape.h. References index, NL3D::MaxFlareNum, nlassert, and uint. Referenced by NL3D::CFlareModel::traverseRender().
|
|
check wether dazzle is enabled
Definition at line 211 of file flare_shape.h. References _DazzleEnabled.
00211 { return _DazzleEnabled; } |
|
|
|
Profiling. Called in RenderPass if Current Frame profiled. No-Op by default Informations must be added in rdrTrav->Scene Reimplemented in NL3D::CMesh, NL3D::CMeshMRM, NL3D::CMeshMRMSkinned, and NL3D::CMeshMultiLod. Definition at line 123 of file shape.h.
00123 {} |
|
inherited from IShape. Does nothing. A new traverseRender() was set for that
Implements NL3D::IShape. Definition at line 76 of file flare_shape.h.
00076 {} |
|
serial this shape
Implements NLMISC::IStreamable. Definition at line 63 of file flare_shape.cpp. References NL3D::MaxFlareNum, NL3D::ITexture::serial(), and uint.
00064 { 00065 int ver = f.serialVersion(3); 00066 f.serial(_Color, _Persistence, _Spacing); 00067 f.serial(_Attenuable); 00068 if (_Attenuable) 00069 { 00070 f.serial(_AttenuationRange); 00071 } 00072 f.serial(_FirstFlareKeepSize); 00073 for (uint k = 0; k < MaxFlareNum; ++k) 00074 { 00075 ITexture *tex = _Tex[k]; 00076 f.serialPolyPtr(tex); 00077 if (f.isReading()) 00078 { 00079 _Tex[k] = tex; 00080 } 00081 f.serial(_Size[k], _Pos[k]); 00082 } 00083 f.serial(_InfiniteDist); 00084 if (!_InfiniteDist) 00085 { 00086 f.serial(_MaxViewDist, _MaxViewDistRatio); 00087 } 00088 f.serial(_DazzleEnabled); 00089 if (_DazzleEnabled) 00090 { 00091 f.serial(_DazzleColor, _DazzleAttenuationRange); 00092 } 00093 f.serial(_InfiniteDist); 00094 00095 if (ver >= 2) 00096 f.serial( _DistMax ); 00097 } |
|
force radial attenuation of the flares
Definition at line 189 of file flare_shape.h. References _Attenuable.
00189 { _Attenuable = enable; } |
|
set the range for attenuation
Definition at line 195 of file flare_shape.h. References _AttenuationRange, and range.
00195 { _AttenuationRange = range; } |
|
set the color of flares
Definition at line 148 of file flare_shape.h. References _Color.
00149 { 00150 _Color = col; 00151 } |
|
Set Dazzle attenuation range. It is the same than with attenuationRange. 1 mean that the dazzle stops when the flare is at the border of screen. 0.5, for the half way between center and border etc .
Definition at line 227 of file flare_shape.h. References _DazzleAttenuationRange, and range.
00227 { _DazzleAttenuationRange = range; } |
|
set Dazzle color
Definition at line 216 of file flare_shape.h. References _DazzleColor.
00216 { _DazzleColor = col; } |
|
setup the DistMax where the shape is no more displayed. Take effect only for the next created instances. setting <0 means -1 and so means DistMax = infinite. Definition at line 66 of file shape.cpp. Referenced by CFlareShape().
|
|
force the first flare to keep its real size (e.g the isze on screen doesn't remains constant)
Definition at line 202 of file flare_shape.h. References _FirstFlareKeepSize.
00202 { _FirstFlareKeepSize = enable; } |
|
The flare is considered to be at the infinite. This mean that it is always drawn And that there's no attenuation with dist. The real flare must be created far from the camera for this to work. The defualt is false Definition at line 253 of file flare_shape.h. References _InfiniteDist.
00253 { _InfiniteDist = enabled; } |
|
set the flares spacing
Definition at line 160 of file flare_shape.h. References _Spacing.
00161 { 00162 _Spacing = spacing; 00163 } |
|
set the maxViewDist for the flares The default is 1000 Definition at line 235 of file flare_shape.h. References _MaxViewDist.
00235 { _MaxViewDist = dist; } |
|
set a distance ratio. when dist / maxViewDist is above this ratio, the flares will start to fade The default is 0.9 Definition at line 244 of file flare_shape.h. References _MaxViewDistRatio.
00244 { _MaxViewDistRatio = ratio; } |
|
set the persistence of this shape, in second (the time it takes to fade from white to black)
Definition at line 174 of file flare_shape.h. References _Persistence, and NL3D::TAnimationTime.
00175 { 00176 _Persistence = persistence; 00177 } |
|
set the relative position of the nth flares. The default goes linearly from 0 (which appear at the position of the flare) to 1 (which appears at the center of the screen when the flare spaving is set to 1
Definition at line 134 of file flare_shape.h. References index, NL3D::MaxFlareNum, nlassert, and uint.
|
|
set the size of the nth flare flare
Definition at line 116 of file flare_shape.h. References index, NL3D::MaxFlareNum, nlassert, size, and uint.
|
|
set a texture for the flare
Definition at line 91 of file flare_shape.h. References index, NL3D::MaxFlareNum, nlassert, and uint.
|
|
return !NULL if this shape can support MeshBlock rendering for a special instance. NB: Mesh Block render cannot occurs if the Mesh is Skinned/MeshMorphed. NB: Mesh Block render can occurs only in Opaque pass NB: Mesh block render can occurs only for CMeshBase meshes.
Reimplemented in NL3D::CMesh, NL3D::CMeshMRM, NL3D::CMeshMRMSkinned, and NL3D::CMeshMultiLod. Definition at line 158 of file shape.h.
00158 {return NULL;}
|
|
tells if the shape wants LocalAttenuation for RealTime lighting. Default is false Reimplemented in NL3D::CMeshBase. Definition at line 142 of file shape.h.
00142 {return false;} |
|
Definition at line 269 of file flare_shape.h. |
|
Definition at line 67 of file smart_ptr.h. |
|
Definition at line 277 of file flare_shape.h. Referenced by getAttenuable(), and setAttenuable(). |
|
Definition at line 278 of file flare_shape.h. Referenced by getAttenuationRange(), and setAttenuationRange(). |
|
Definition at line 271 of file flare_shape.h. Referenced by getColor(), and setColor(). |
|
Definition at line 281 of file flare_shape.h. Referenced by getDazzleAttenuationRange(), and setDazzleAttenuationRange(). |
|
Definition at line 272 of file flare_shape.h. Referenced by getDazzleColor(), and setDazzleColor(). |
|
Definition at line 280 of file flare_shape.h. Referenced by enableDazzle(), and hasDazzle(). |
|
Transform default tracks.
Definition at line 259 of file flare_shape.h. |
|
Default to -1.
|
|
Definition at line 279 of file flare_shape.h. Referenced by getFirstFlareKeepSize(), and setFirstFlareKeepSize(). |
|
Definition at line 284 of file flare_shape.h. Referenced by getFlareAtInfiniteDist(), and setFlareAtInfiniteDist(). |
|
Definition at line 282 of file flare_shape.h. Referenced by getMaxViewDist(), and setMaxViewDist(). |
|
Definition at line 283 of file flare_shape.h. Referenced by getMaxViewDistRatio(), and setMaxViewDistRatio(). |
|
Definition at line 275 of file flare_shape.h. Referenced by getPersistence(), and setPersistence(). |
|
Definition at line 274 of file flare_shape.h. |
|
Definition at line 273 of file flare_shape.h. |
|
Definition at line 276 of file flare_shape.h. Referenced by getFlareSpacing(), and setFlareSpacing(). |
|
Definition at line 270 of file flare_shape.h. |
|
Definition at line 79 of file smart_ptr.h. Referenced by NLMISC::CRefCount::CRefCount(), NLMISC::CRefCount::getRefCount(), and NLMISC::CRefCount::~CRefCount(). |
|
Referenced by NLMISC::CRefCount::CRefCount(). |
|
Definition at line 80 of file smart_ptr.h. Referenced by NLMISC::CRefCount::CRefCount(), and NLMISC::CRefCount::~CRefCount(). |