Public Member Functions | Public Attributes | Private Member Functions | Private Attributes

fx::MediumParticleDrawable Class Reference

This is an OSG Drawable object that directly renders point-sprites. More...

List of all members.

Public Member Functions

 META_Object (Palomino, MediumParticleDrawable) MediumParticleDrawable(const RGBA color
const fp const fp const fp mColor (color)
const fp const fp const fp mRange (range)
const fp const fp const fp mRangeInv (1.0f/range)
const fp const fp const fp mMinWidth (minWidth)
const fp const fp const fp mMaxWidth (maxWidth)
const fp const fp const fp mVertexArray ()
const fp const fp const fp mBoundingBox ()
 MediumParticleDrawable (void)
 MediumParticleDrawable (const MediumParticleDrawable &other, const osg::CopyOp &copyop=osg::CopyOp::SHALLOW_COPY)
virtual ~MediumParticleDrawable ()
virtual void drawImplementation (osg::RenderInfo &renderInfo) const
osg::BoundingBox computeBound () const
void AttachParticle (const osg::Vec3 &v)
uint GetVertexCount (void) const
void SetColorAll (const RGBA color)

Public Attributes

const fp range
const fp const fp minWidth
const fp const fp const fp maxWidth: osg::Drawable()

Private Member Functions

void Init (void)
 DECLARE_TYPESIG (TYPESIG_MEDIUM_PARTICLE_DRAWABLE)

Private Attributes

RGBA mColor
 color of all point sprites
const fp mRange
 width of point-sprite is minimized at limit of range
const fp mRangeInv
const fp mMinWidth
 minimum size of point-sprites
const fp mMaxWidth
 maximum size of point-sprites
std::vector< osg::Vec3 > mVertexArray
 not osg::Vec3Array which lacks swap()
osg::BoundingBox mBoundingBox
 no need for ref_ptr (isn't derived from osg::Referenced)

Detailed Description

This is an OSG Drawable object that directly renders point-sprites.

The reason for directly-rendering is to that the size of every point-sprite needs to be computed individually. Issuing glPointSize() for every particle is faster and less-cumbersome than composing nodes with various point sizes.

When OSG has called drawImplementation(), OSG has set OpenGL state for rendering OpenGL "point sprites".


Constructor & Destructor Documentation

fx::MediumParticleDrawable::MediumParticleDrawable ( void   )  [inline]
fx::MediumParticleDrawable::MediumParticleDrawable ( const MediumParticleDrawable other,
const osg::CopyOp &  copyop = osg::CopyOp::SHALLOW_COPY 
) [inline]
virtual fx::MediumParticleDrawable::~MediumParticleDrawable (  )  [inline, virtual]

Member Function Documentation

void fx::MediumParticleDrawable::AttachParticle ( const osg::Vec3 &  v  )  [inline]

Add particle.

osg::BoundingBox fx::MediumParticleDrawable::computeBound (  )  const [inline]

Compute bound of medium particles. Which is the fastest? Bounding all point-sprites in one box or dividing them into multiple boxes (?).

fx::MediumParticleDrawable::DECLARE_TYPESIG ( TYPESIG_MEDIUM_PARTICLE_DRAWABLE   )  [private]
virtual void fx::MediumParticleDrawable::drawImplementation ( osg::RenderInfo &  renderInfo  )  const [inline, virtual]

Draw array of medium particles.

uint fx::MediumParticleDrawable::GetVertexCount ( void   )  const [inline]
Returns:
Vertex count (amount of particles).
void fx::MediumParticleDrawable::Init ( void   )  [inline, private]

ctor subroutine.

const fp const fp const fp fx::MediumParticleDrawable::mBoundingBox (  )  [inline]
const fp const fp const fp fx::MediumParticleDrawable::mColor ( color   ) 
fx::MediumParticleDrawable::META_Object ( Palomino  ,
MediumParticleDrawable   
) const

ctor/dtor.

Parameters:
color Applied to all particles.
range Distance in world space where particle is scaled-down to mediumest size.
minWidth,maxWidth Limits of point size scaled by distance of their vertex from viewpoint. This simulates 3D:2D projection.
const fp const fp const fp fx::MediumParticleDrawable::mMaxWidth ( maxWidth   ) 
const fp const fp const fp fx::MediumParticleDrawable::mMinWidth ( minWidth   ) 
const fp const fp const fp fx::MediumParticleDrawable::mRange ( range   ) 
const fp const fp const fp fx::MediumParticleDrawable::mRangeInv ( 1.0f/  range  ) 
const fp const fp const fp fx::MediumParticleDrawable::mVertexArray (  ) 
void fx::MediumParticleDrawable::SetColorAll ( const RGBA  color  )  [inline]

Set color of all particles.


Member Data Documentation

osg::BoundingBox fx::MediumParticleDrawable::mBoundingBox [private]

no need for ref_ptr (isn't derived from osg::Referenced)

color of all point sprites

maximum size of point-sprites

minimum size of point-sprites

width of point-sprite is minimized at limit of range

std::vector<osg::Vec3> fx::MediumParticleDrawable::mVertexArray [private]

not osg::Vec3Array which lacks swap()


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Palomino Flight Simulator documents generated by doxygen 1.7.1 on Tue May 15 2012 22:40:11