# Home    # nevrax.com   
Nevrax
Nevrax.org
#News
#Mailing-list
#Documentation
#CVS
#Bugs
#License
Docs
 
Documentation  
Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages   Search  

NL3D::CFlareShape Class Reference

shape for a flare. More...

#include <flare_shape.h>

Inheritance diagram for NL3D::CFlareShape:

NL3D::IShape NLMISC::CRefCount NLMISC::IStreamable NLMISC::IClassable List of all members.

Public Methods

 NLMISC_DECLARE_CLASS (CFlareShape)
virtual CTransformShapecreateInstance (CScene &scene)
 inherited from IShape. More...

virtual bool clip (const std::vector< CPlane > &pyramid, const CMatrix &worldMatrix)
 inherited from IShape. More...

virtual void render (IDriver *drv, CTransformShape *trans, bool opaquePass)
 inherited from IShape. Does nothing. A new observer was set for that. More...

virtual void getAABBox (NLMISC::CAABBox &bbox) const
 inherited from IShape. More...

virtual float getNumTriangles (float distance)
 inherited from ishape. More...

virtual void flushTextures (IDriver &driver)
 inherited from ishape. More...

void setTexture (uint index, ITexture *tex)
 set a texture for the flare. More...

ITexturegetTexture (uint index)
 get the nth texture used by the flare. More...

const ITexturegetTexture (uint index) const
 get the texture used by the flare (const version). More...

void setSize (uint index, float size)
 set the size of the nth flare flare. More...

float getSize (uint index) const
 get the size of the nth flare. More...

void setRelativePos (uint index, float pos)
 set the relative position of the nth flares. More...

float getRelativePos (uint index) const
 get the relative pos of the nth flare. More...

void setColor (NLMISC::CRGBA col)
 set the color of flares. More...

NLMISC::CRGBA getColor (void) const
 get the color of flares. More...

void setFlareSpacing (float spacing)
 set the flares spacing. More...

float getFlareSpacing (void) const
 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. More...

void setPersistence (TAnimationTime persistence)
 set the persistence of this shape, in second (the time it takes to fade from white to black). More...

TAnimationTime getPersistence (void) const
 get the persistence of this shape. More...

void setAttenuable (bool enable=true)
 force radial attenuation of the flares. More...

bool getAttenuable (void) const
 check wether radial :attenuation is on. More...

void setAttenuationRange (float range)
 set the range for attenuation. More...

float getAttenuationRange (void) const
 get the attenuation range. More...

void setFirstFlareKeepSize (bool enable=true)
 force the first flare to keep its real size (e.g the isze on screen doesn't remains constant). More...

bool getFirstFlareKeepSize (void) const
 test wether the first flare keep its real size. More...

void enableDazzle (bool enable=true)
 enable dazzle when the flare is near the center of the screen. More...

bool hasDazzle (void) const
 check wether dazzle is enabled. More...

void setDazzleColor (NLMISC::CRGBA col)
 set Dazzle color. More...

NLMISC::CRGBA getDazzleColor (void) const
 get Dazzle color. More...

void setDazzleAttenuationRange (float range)
 Set Dazzle attenuation range. More...

float getDazzleAttenuationRange (void) const
 get the attenuation range of Dazzle. More...

void setMaxViewDist (float dist)
 set the maxViewDist for the flares The default is 1000. More...

float getMaxViewDist (void) const
 get the max view dist. More...

void setMaxViewDistRatio (float ratio)
 set a distance ratio. More...

float getMaxViewDistRatio (void) const
 get the max view dist ratio. More...

void setFlareAtInfiniteDist (bool enabled=true)
 The flare is considered to be at the infinite. More...

bool getFlareAtInfiniteDist (void) const
 test wether the flare is at the infinite. More...

Object
 CFlareShape ()
 Constructor. More...

void serial (NLMISC::IStream &f) throw (NLMISC::EStream)
 serial this shape. More...

access default tracks.
CTrackDefaultVectorgetDefaultPos ()

Public Attributes

CTrackDefaultVector _DefaultPos
 Transform default tracks. More...


Protected Attributes

NLMISC::CSmartPtr< ITexture_Tex [MaxFlareNum]
NLMISC::CRGBA _Color
NLMISC::CRGBA _DazzleColor
float _Size [MaxFlareNum]
float _Pos [MaxFlareNum]
TAnimationTime _Persistence
float _Spacing
bool _Attenuable
float _AttenuationRange
bool _FirstFlareKeepSize
bool _DazzleEnabled
float _DazzleAttenuationRange
float _MaxViewDist
float _MaxViewDistRatio
bool _InfiniteDist

Friends

class CFlareModel

Detailed Description

shape for a flare.

Author:
Nicolas Vizerie , Nevrax France
Date:
2001

Definition at line 53 of file flare_shape.h.


Constructor & Destructor Documentation

NL3D::CFlareShape::CFlareShape  
 

Constructor.

Definition at line 39 of file flare_shape.cpp.

References _DefaultPos, _Pos, _Size, _Tex, NL3D::MaxFlareNum, and NL3D::IShape::setDistMax.


Member Function Documentation

bool NL3D::CFlareShape::clip const std::vector< CPlane > &    pyramid,
const CMatrix &    worldMatrix
[virtual]
 

inherited from IShape.

Reimplemented from NL3D::IShape.

Definition at line 120 of file flare_shape.cpp.

CTransformShape * NL3D::CFlareShape::createInstance CScene   scene [virtual]
 

inherited from IShape.

Reimplemented from NL3D::IShape.

Definition at line 100 of file flare_shape.cpp.

References _DefaultPos, NL3D::CAnimatedValueVector, CFlareModel, and NL3D::FlareModelClassId.

void NL3D::CFlareShape::enableDazzle bool    enable = true [inline]
 

enable dazzle when the flare is near the center of the screen.

Definition at line 208 of file flare_shape.h.

References _DazzleEnabled.

void NL3D::CFlareShape::flushTextures IDriver   driver [virtual]
 

inherited from ishape.

Implements NL3D::IShape.

Definition at line 140 of file flare_shape.cpp.

References _Tex, and NL3D::MaxFlareNum.

void NL3D::CFlareShape::getAABBox NLMISC::CAABBox   bbox const [virtual]
 

inherited from IShape.

Reimplemented from NL3D::IShape.

Definition at line 132 of file flare_shape.cpp.

References NLMISC::CAABBox::setCenter, and NLMISC::CAABBox::setHalfSize.

bool NL3D::CFlareShape::getAttenuable void    const [inline]
 

check wether radial :attenuation is on.

Definition at line 192 of file flare_shape.h.

References _Attenuable.

float NL3D::CFlareShape::getAttenuationRange void    const [inline]
 

get the attenuation range.

Definition at line 198 of file flare_shape.h.

References _AttenuationRange.

NLMISC::CRGBA NL3D::CFlareShape::getColor void    const [inline]
 

get the color of flares.

Definition at line 154 of file flare_shape.h.

References _Color.

float NL3D::CFlareShape::getDazzleAttenuationRange void    const [inline]
 

get the attenuation range of Dazzle.

Definition at line 230 of file flare_shape.h.

References _DazzleAttenuationRange.

NLMISC::CRGBA NL3D::CFlareShape::getDazzleColor void    const [inline]
 

get Dazzle color.

See also:
enableDazzle()

Definition at line 221 of file flare_shape.h.

References _DazzleColor.

CTrackDefaultVector* NL3D::CFlareShape::getDefaultPos   [inline]
 

Definition at line 264 of file flare_shape.h.

References _DefaultPos.

bool NL3D::CFlareShape::getFirstFlareKeepSize void    const [inline]
 

test wether the first flare keep its real size.

Definition at line 205 of file flare_shape.h.

References _FirstFlareKeepSize.

bool NL3D::CFlareShape::getFlareAtInfiniteDist void    const [inline]
 

test wether the flare is at the infinite.

Definition at line 256 of file flare_shape.h.

References _InfiniteDist.

float NL3D::CFlareShape::getFlareSpacing void    const [inline]
 

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.

float NL3D::CFlareShape::getMaxViewDist void    const [inline]
 

get the max view dist.

Definition at line 239 of file flare_shape.h.

References _MaxViewDist.

float NL3D::CFlareShape::getMaxViewDistRatio void    const [inline]
 

get the max view dist ratio.

Definition at line 247 of file flare_shape.h.

References _MaxViewDistRatio.

float NL3D::CFlareShape::getNumTriangles float    distance [virtual]
 

inherited from ishape.

Implements NL3D::IShape.

Definition at line 110 of file flare_shape.cpp.

References _Tex, and NL3D::MaxFlareNum.

TAnimationTime NL3D::CFlareShape::getPersistence void    const [inline]
 

get the persistence of this shape.

See also:
setPersistence

Definition at line 182 of file flare_shape.h.

References _Persistence, and NL3D::TAnimationTime.

float NL3D::CFlareShape::getRelativePos uint    index const [inline]
 

get the relative pos of the nth flare.

Definition at line 141 of file flare_shape.h.

References _Pos, index, NL3D::MaxFlareNum, and nlassert.

float NL3D::CFlareShape::getSize uint    index const [inline]
 

get the size of the nth flare.

Parameters:
index  the index of the flare to set. Value ranges from 0 to MaxFlareNum - 1

Definition at line 125 of file flare_shape.h.

References _Size, and index.

const ITexture* NL3D::CFlareShape::getTexture uint    index const [inline]
 

get the texture used by the flare (const version).

Definition at line 107 of file flare_shape.h.

References _Tex, index, NL3D::MaxFlareNum, and nlassert.

ITexture* NL3D::CFlareShape::getTexture uint    index [inline]
 

get the nth texture used by the flare.

Parameters:
index  the index of the flare to set. Value ranges from 0 to MaxFlareNum - 1

Definition at line 100 of file flare_shape.h.

References _Tex, index, NL3D::MaxFlareNum, and nlassert.

bool NL3D::CFlareShape::hasDazzle void    const [inline]
 

check wether dazzle is enabled.

Definition at line 211 of file flare_shape.h.

References _DazzleEnabled.

NL3D::CFlareShape::NLMISC_DECLARE_CLASS CFlareShape   
 

virtual void NL3D::CFlareShape::render IDriver   drv,
CTransformShape   trans,
bool    opaquePass
[inline, virtual]
 

inherited from IShape. Does nothing. A new observer was set for that.

Implements NL3D::IShape.

Definition at line 76 of file flare_shape.h.

void NL3D::CFlareShape::serial NLMISC::IStream   f throw (NLMISC::EStream) [virtual]
 

serial this shape.

Implements NLMISC::IStreamable.

Definition at line 63 of file flare_shape.cpp.

References NL3D::MaxFlareNum.

void NL3D::CFlareShape::setAttenuable bool    enable = true [inline]
 

force radial attenuation of the flares.

Definition at line 189 of file flare_shape.h.

References _Attenuable.

void NL3D::CFlareShape::setAttenuationRange float    range [inline]
 

set the range for attenuation.

Definition at line 195 of file flare_shape.h.

References _AttenuationRange, and range.

void NL3D::CFlareShape::setColor NLMISC::CRGBA    col [inline]
 

set the color of flares.

Definition at line 148 of file flare_shape.h.

References _Color.

void NL3D::CFlareShape::setDazzleAttenuationRange float    range [inline]
 

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 .

See also:
enableDazzle()

Definition at line 227 of file flare_shape.h.

References _DazzleAttenuationRange, and range.

void NL3D::CFlareShape::setDazzleColor NLMISC::CRGBA    col [inline]
 

set Dazzle color.

See also:
enableDazzle()

Definition at line 216 of file flare_shape.h.

References _DazzleColor.

void NL3D::CFlareShape::setFirstFlareKeepSize bool    enable = true [inline]
 

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.

void NL3D::CFlareShape::setFlareAtInfiniteDist bool    enabled = true [inline]
 

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.

void NL3D::CFlareShape::setFlareSpacing float    spacing [inline]
 

set the flares spacing.

Definition at line 160 of file flare_shape.h.

References _Spacing.

void NL3D::CFlareShape::setMaxViewDist float    dist [inline]
 

set the maxViewDist for the flares The default is 1000.

Definition at line 235 of file flare_shape.h.

References _MaxViewDist.

void NL3D::CFlareShape::setMaxViewDistRatio float    ratio [inline]
 

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.

void NL3D::CFlareShape::setPersistence TAnimationTime    persistence [inline]
 

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.

void NL3D::CFlareShape::setRelativePos uint    index,
float    pos
[inline]
 

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

See also:
setFlareSpacing()

Definition at line 134 of file flare_shape.h.

References _Pos, index, NL3D::MaxFlareNum, and nlassert.

void NL3D::CFlareShape::setSize uint    index,
float    size
[inline]
 

set the size of the nth flare flare.

Parameters:
index  the index of the flare to set. Value ranges from 0 to MaxFlareNum - 1

Definition at line 116 of file flare_shape.h.

References _Size, index, NL3D::MaxFlareNum, and nlassert.

void NL3D::CFlareShape::setTexture uint    index,
ITexture   tex
[inline]
 

set a texture for the flare.

Parameters:
index  the index of the flare to set. Vaklue ranges from 0 to MaxFlareNum - 1
tex  the texture to set. NULL removes the texture

Definition at line 91 of file flare_shape.h.

References _Tex, index, NL3D::MaxFlareNum, and nlassert.


Friends And Related Function Documentation

friend class CFlareModel [friend]
 

Definition at line 269 of file flare_shape.h.

Referenced by createInstance.


Member Data Documentation

bool NL3D::CFlareShape::_Attenuable [protected]
 

Definition at line 277 of file flare_shape.h.

Referenced by getAttenuable, and setAttenuable.

float NL3D::CFlareShape::_AttenuationRange [protected]
 

Definition at line 278 of file flare_shape.h.

Referenced by getAttenuationRange, and setAttenuationRange.

NLMISC::CRGBA NL3D::CFlareShape::_Color [protected]
 

Definition at line 271 of file flare_shape.h.

Referenced by getColor, and setColor.

float NL3D::CFlareShape::_DazzleAttenuationRange [protected]
 

Definition at line 281 of file flare_shape.h.

Referenced by getDazzleAttenuationRange, and setDazzleAttenuationRange.

NLMISC::CRGBA NL3D::CFlareShape::_DazzleColor [protected]
 

Definition at line 272 of file flare_shape.h.

Referenced by getDazzleColor, and setDazzleColor.

bool NL3D::CFlareShape::_DazzleEnabled [protected]
 

Definition at line 280 of file flare_shape.h.

Referenced by enableDazzle, and hasDazzle.

CTrackDefaultVector NL3D::CFlareShape::_DefaultPos
 

Transform default tracks.

Definition at line 259 of file flare_shape.h.

Referenced by CFlareShape, createInstance, and getDefaultPos.

bool NL3D::CFlareShape::_FirstFlareKeepSize [protected]
 

Definition at line 279 of file flare_shape.h.

Referenced by getFirstFlareKeepSize, and setFirstFlareKeepSize.

bool NL3D::CFlareShape::_InfiniteDist [protected]
 

Definition at line 284 of file flare_shape.h.

Referenced by getFlareAtInfiniteDist, and setFlareAtInfiniteDist.

float NL3D::CFlareShape::_MaxViewDist [protected]
 

Definition at line 282 of file flare_shape.h.

Referenced by getMaxViewDist, and setMaxViewDist.

float NL3D::CFlareShape::_MaxViewDistRatio [protected]
 

Definition at line 283 of file flare_shape.h.

Referenced by getMaxViewDistRatio, and setMaxViewDistRatio.

TAnimationTime NL3D::CFlareShape::_Persistence [protected]
 

Definition at line 275 of file flare_shape.h.

Referenced by getPersistence, and setPersistence.

float NL3D::CFlareShape::_Pos[MaxFlareNum] [protected]
 

Definition at line 274 of file flare_shape.h.

Referenced by CFlareShape, getRelativePos, and setRelativePos.

float NL3D::CFlareShape::_Size[MaxFlareNum] [protected]
 

Definition at line 273 of file flare_shape.h.

Referenced by CFlareShape, getSize, and setSize.

float NL3D::CFlareShape::_Spacing [protected]
 

Definition at line 276 of file flare_shape.h.

Referenced by getFlareSpacing, and setFlareSpacing.

NLMISC::CSmartPtr<ITexture> NL3D::CFlareShape::_Tex[MaxFlareNum] [protected]
 

Definition at line 270 of file flare_shape.h.

Referenced by CFlareShape, flushTextures, getNumTriangles, getTexture, and setTexture.


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