Particle Universe  1.2
ParticleUniverse::SphereSet Class Reference

#include <ParticleUniverseSphereSet.h>

Inheritance diagram for ParticleUniverse::SphereSet:

Public Member Functions

 SphereSet (const String &name, unsigned int poolSize=20, bool externalData=false)
 
 SphereSet (void)
 
virtual ~SphereSet (void)
 
SpherecreateSphere (const Vector3 &position)
 
SpherecreateSphere (Real x, Real y, Real z)
 
unsigned int getNumSpheres (void) const
 
void setAutoextend (bool autoextend)
 
bool isAutoextend (void) const
 
void setPoolSize (size_t size)
 
unsigned int getPoolSize (void) const
 
void clear (void)
 
SpheregetSphere (unsigned int index) const
 
void removeSphere (unsigned int index)
 
void removeSphere (Sphere *sphere)
 
void setDefaultRadius (Real radius)
 
Real getDefaultRadius (void) const
 
void setNumberOfRings (unsigned int numberOfRings)
 
unsigned int getNumberOfRings (void) const
 
void setNumberOfSegments (unsigned int numberOfSegments)
 
unsigned int getNumberOfSegments (void) const
 
void beginSpheres (size_t numSpheres=0)
 
void injectSphere (Sphere &sphere)
 
void endSpheres (void)
 
void setBounds (const AxisAlignedBox &box, Real radius)
 
virtual void _updateRenderQueue (Ogre::RenderQueue *queue)
 
virtual void getRenderOperation (Ogre::RenderOperation &op)
 
virtual const StringgetMovableType (void) const
 
virtual void _updateBounds (void)
 
void setSpheresInWorldSpace (bool ws)
 
- Public Member Functions inherited from ParticleUniverse::PrimitiveShapeSet
 PrimitiveShapeSet (const String &name, unsigned int poolSize=20, bool externalData=false)
 
 PrimitiveShapeSet (void)
 
virtual ~PrimitiveShapeSet (void)
 
virtual void setZRotated (bool zRotated)
 
virtual bool isZRotated (void) const
 
virtual void _notifyZRotated (void)
 
virtual void setMaterialName (const String &name)
 
virtual const StringgetMaterialName (void) const
 
virtual void _notifyResized (void)
 
virtual void _notifyCurrentCamera (Camera *cam)
 
virtual const AxisAlignedBoxgetBoundingBox (void) const
 
virtual Real getBoundingRadius (void) const
 
virtual const Ogre::MaterialPtrgetMaterial (void) const
 
virtual void getWorldTransforms (Ogre::Matrix4 *xform) const
 
virtual const QuaterniongetWorldOrientation (void) const
 
virtual const Vector3getWorldPosition (void) const
 
virtual bool isCullIndividually (void) const
 
virtual void setCullIndividually (bool cullIndividual)
 
virtual Real getSquaredViewDepth (const Camera *cam) const
 
virtual const Ogre::LightListgetLights (void) const
 
virtual uint32 getTypeFlags (void) const
 
virtual void rotateTexture (Real speed)
 
virtual void visitRenderables (Ogre::Renderable::Visitor *visitor, bool debugRenderables=false)
 
- Public Member Functions inherited from Ogre::MovableObject
 MovableObject ()
 
 MovableObject (const String &name)
 
virtual ~MovableObject ()
 
MovableObjectFactory_getCreator (void) const
 
LightList_getLightList ()
 
SceneManager_getManager (void) const
 
virtual const Matrix4_getParentNodeFullTransform (void) const
 
virtual void _notifyAttached (Node *parent, bool isTagPoint=false)
 
virtual void _notifyCreator (MovableObjectFactory *fact)
 
virtual void _notifyManager (SceneManager *man)
 
virtual void _notifyMoved (void)
 
virtual void _releaseManualHardwareResources ()
 
virtual void _restoreManualHardwareResources ()
 
void addQueryFlags (uint32 flags)
 
void addVisibilityFlags (uint32 flags)
 
virtual AnimableValuePtr createAnimableValue (const String &valueName)
 
void detachFromParent (void)
 
const StringVectorgetAnimableValueNames (void) const
 
bool getCastShadows (void) const
 
const AxisAlignedBoxgetDarkCapBounds (const Light &light, Real dirLightExtrusionDist) const
 
EdgeDatagetEdgeList (void)
 
const AxisAlignedBoxgetLightCapBounds (void) const
 
uint32 getLightMask () const
 
ListenergetListener (void) const
 
const StringgetName (void) const
 
NodegetParentNode (void) const
 
SceneNodegetParentSceneNode (void) const
 
Real getPointExtrusionDistance (const Light *l) const
 
uint32 getQueryFlags (void) const
 
bool getReceivesShadows ()
 
Real getRenderingDistance (void) const
 
Real getRenderingMinPixelSize () const
 
uint8 getRenderQueueGroup (void) const
 
ShadowRenderableListIterator getShadowVolumeRenderableIterator (ShadowTechnique shadowTechnique, const Light *light, HardwareIndexBufferSharedPtr *indexBuffer, size_t *indexBufferUsedSize, bool extrudeVertices, Real extrusionDist, unsigned long flags=0)
 
const AnygetUserAny (void) const
 
UserObjectBindingsgetUserObjectBindings ()
 
const UserObjectBindingsgetUserObjectBindings () const
 
uint32 getVisibilityFlags (void) const
 
bool getVisible (void) const
 
virtual const AxisAlignedBoxgetWorldBoundingBox (bool derive=false) const
 
virtual const SpheregetWorldBoundingSphere (bool derive=false) const
 
bool hasEdgeList (void)
 
bool isAttached (void) const
 
bool isDebugDisplayEnabled (void) const
 
virtual bool isInScene (void) const
 
bool isParentTagPoint () const
 
virtual bool isVisible (void) const
 
const LightListqueryLights (void) const
 
void removeQueryFlags (uint32 flags)
 
void removeVisibilityFlags (uint32 flags)
 
void setCastShadows (bool enabled)
 
void setDebugDisplayEnabled (bool enabled)
 
void setLightMask (uint32 lightMask)
 
void setListener (Listener *listener)
 
void setQueryFlags (uint32 flags)
 
void setRenderingDistance (Real dist)
 
void setRenderingMinPixelSize (Real pixelSize)
 
virtual void setRenderQueueGroup (uint8 queueID)
 
virtual void setRenderQueueGroupAndPriority (uint8 queueID, ushort priority)
 
void setUserAny (const Any &anything)
 
void setVisibilityFlags (uint32 flags)
 
void setVisible (bool visible)
 
- Public Member Functions inherited from Ogre::ShadowCaster
virtual ~ShadowCaster ()
 
- Public Member Functions inherited from Ogre::AnimableObject
 AnimableObject ()
 
virtual ~AnimableObject ()
 
const StringVectorgetAnimableValueNames (void) const
 
- Public Member Functions inherited from Ogre::Renderable
 Renderable ()
 
virtual ~Renderable ()
 
virtual void _updateCustomGpuParameter (const GpuProgramParameters::AutoConstantEntry &constantEntry, GpuProgramParameters *params) const
 
virtual bool getCastsShadows (void) const
 
const Vector4getCustomParameter (size_t index) const
 
virtual unsigned short getNumWorldTransforms (void) const
 
bool getPolygonModeOverrideable (void) const
 
const RenderSystemDataPtrgetRenderSystemData () const
 
virtual TechniquegetTechnique (void) const
 
bool getUseIdentityProjection (void) const
 
bool getUseIdentityView (void) const
 
const AnygetUserAny (void) const
 
UserObjectBindingsgetUserObjectBindings ()
 
const UserObjectBindingsgetUserObjectBindings () const
 
bool hasCustomParameter (size_t index) const
 
virtual void postRender (SceneManager *sm, RenderSystem *rsys)
 
virtual bool preRender (SceneManager *sm, RenderSystem *rsys)
 
void removeCustomParameter (size_t index)
 
void setCustomParameter (size_t index, const Vector4 &value)
 
void setPolygonModeOverrideable (bool override)
 
void setRenderSystemData (RenderSystemDataPtr val) const
 
void setUseIdentityProjection (bool useIdentityProjection)
 
void setUseIdentityView (bool useIdentityView)
 
void setUserAny (const Any &anything)
 

Protected Types

typedef list< Sphere * > ActiveSphereList
 
typedef list< Sphere * > FreeSphereList
 
typedef vector< Sphere * > SpherePool
 
typedef vector< Ogre::FloatRectTextureCoordSets
 

Protected Member Functions

bool sphereVisible (Camera *cam, const Sphere &sphere)
 
void increasePool (size_t size)
 
void _genVertices (Sphere &sphere)
 
void _calculateVertexAndIndexPerSphere (void)
 

Protected Attributes

Real mDefaultRadius
 
bool mAutoExtendPool
 
ActiveSphereList mActiveSpheres
 
FreeSphereList mFreeSpheres
 
SpherePool mSpherePool
 
Ogre::VertexDatamVertexData
 
size_t mVertexCountPerSphere
 
Ogre::HardwareVertexBufferSharedPtr mMainBuf
 
float * mLockPtr
 
ushortpIdx
 
Ogre::IndexDatamIndexData
 
size_t mIndexCountPerSphere
 
TextureCoordSets mTextureCoords
 
unsigned short mNumVisibleSpheres
 
unsigned int mNumberOfRings
 
unsigned int mNumberOfSegments
 
unsigned short mVertexIndex
 
- Protected Attributes inherited from ParticleUniverse::PrimitiveShapeSet
AxisAlignedBox mAABB
 
Real mBoundingRadius
 
String mMaterialName
 
Ogre::MaterialPtr mpMaterial
 
bool mCullIndividual
 
bool mWorldSpace
 
CameramCurrentCamera
 
bool mZRotated
 
bool mAllDefaultSize
 

Private Member Functions

void _createBuffers (void)
 
void _destroyBuffers (void)
 

Private Attributes

bool mBuffersCreated
 
size_t mPoolSize
 
bool mExternalData
 

Additional Inherited Members

- Public Types inherited from Ogre::MovableObject
typedef vector< ShadowRenderable * >::type ShadowRenderableList
 
typedef VectorIterator< ShadowRenderableListShadowRenderableListIterator
 
- Public Types inherited from Ogre::ShadowCaster
typedef vector< ShadowRenderable * >::type ShadowRenderableList
 
typedef VectorIterator< ShadowRenderableListShadowRenderableListIterator
 
- Public Types inherited from Ogre::Renderable
typedef SharedPtr< RenderSystemDataRenderSystemDataPtr
 
- Static Public Member Functions inherited from Ogre::MovableObject
static void clearShadowRenderableList (ShadowRenderableList &shadowRenderables)
 
static void extrudeVertices (const HardwareVertexBufferSharedPtr &vertexBuffer, size_t originalVertexCount, const Vector4 &lightPos, Real extrudeDist)
 
static uint32 getDefaultQueryFlags ()
 
static uint32 getDefaultVisibilityFlags ()
 
static void setDefaultQueryFlags (uint32 flags)
 
static void setDefaultVisibilityFlags (uint32 flags)
 
- Static Public Member Functions inherited from Ogre::ShadowCaster
static void clearShadowRenderableList (ShadowRenderableList &shadowRenderables)
 
static void extrudeVertices (const HardwareVertexBufferSharedPtr &vertexBuffer, size_t originalVertexCount, const Vector4 &lightPos, Real extrudeDist)
 

Detailed Description

The SphereSet and Sphere classes are comparable with the BillboardSet and Billboard classes in Ogre, instead Spheres are rendered.

Member Typedef Documentation

Constructor & Destructor Documentation

ParticleUniverse::SphereSet::SphereSet ( const String name,
unsigned int  poolSize = 20,
bool  externalData = false 
)

Default constructor.

ParticleUniverse::SphereSet::SphereSet ( void  )

Default constructor.

virtual ParticleUniverse::SphereSet::~SphereSet ( void  )
virtual

Default destructor.

Member Function Documentation

void ParticleUniverse::SphereSet::_calculateVertexAndIndexPerSphere ( void  )
protected

Helper function to calculate number of number of vertices and indices per sphere

void ParticleUniverse::SphereSet::_createBuffers ( void  )
private

Internal method creates vertex and index buffers.

void ParticleUniverse::SphereSet::_destroyBuffers ( void  )
private

Internal method destroys vertex and index buffers.

void ParticleUniverse::SphereSet::_genVertices ( Sphere sphere)
protected

Internal method for generating vertex data

virtual void ParticleUniverse::SphereSet::_updateBounds ( void  )
virtual

Update the bounds of the sphere set

virtual void ParticleUniverse::SphereSet::_updateRenderQueue ( Ogre::RenderQueue queue)
virtual

Overridden from MovableObject

See also
MovableObject

Implements Ogre::MovableObject.

void ParticleUniverse::SphereSet::beginSpheres ( size_t  numSpheres = 0)

Begin injection of sphere data; applicable when constructing the SphereSet for external data use.

void ParticleUniverse::SphereSet::clear ( void  )

Empties this set of all spheres.

Sphere* ParticleUniverse::SphereSet::createSphere ( const Vector3 position)

Creates a new sphere and adds it to this set.

Sphere* ParticleUniverse::SphereSet::createSphere ( Real  x,
Real  y,
Real  z 
)

Creates a new sphere and adds it to this set.

void ParticleUniverse::SphereSet::endSpheres ( void  )

Finish defining spheres.

Real ParticleUniverse::SphereSet::getDefaultRadius ( void  ) const

See setDefaultRadius

virtual const String& ParticleUniverse::SphereSet::getMovableType ( void  ) const
virtual

Overridden from MovableObject

Implements Ogre::MovableObject.

unsigned int ParticleUniverse::SphereSet::getNumberOfRings ( void  ) const

Get the number of rings of which this sphere consists.

unsigned int ParticleUniverse::SphereSet::getNumberOfSegments ( void  ) const

Get the number of segments of which this sphere consists.

unsigned int ParticleUniverse::SphereSet::getNumSpheres ( void  ) const

Returns the number of active spheres which currently make up this set.

unsigned int ParticleUniverse::SphereSet::getPoolSize ( void  ) const

Returns the current size of the sphere pool.

virtual void ParticleUniverse::SphereSet::getRenderOperation ( Ogre::RenderOperation op)
virtual

Overridden from MovableObject

See also
MovableObject

Implements Ogre::Renderable.

Sphere* ParticleUniverse::SphereSet::getSphere ( unsigned int  index) const

Returns a pointer to the sphere at the supplied index.

void ParticleUniverse::SphereSet::increasePool ( size_t  size)
protected

Internal method for increasing pool size

void ParticleUniverse::SphereSet::injectSphere ( Sphere sphere)

Define a sphere.

bool ParticleUniverse::SphereSet::isAutoextend ( void  ) const

Returns true if the sphere pool automatically extends.

void ParticleUniverse::SphereSet::removeSphere ( unsigned int  index)

Removes the sphere at the supplied index.

void ParticleUniverse::SphereSet::removeSphere ( Sphere sphere)

Removes a sphere from the set.

void ParticleUniverse::SphereSet::setAutoextend ( bool  autoextend)

Tells the set whether to allow automatic extension of the pool of spheres.

void ParticleUniverse::SphereSet::setBounds ( const AxisAlignedBox box,
Real  radius 
)

Set the bounds of the SphereSet.

void ParticleUniverse::SphereSet::setDefaultRadius ( Real  radius)

Sets the default radius of the spheres in this set.

void ParticleUniverse::SphereSet::setNumberOfRings ( unsigned int  numberOfRings)

Set the number of rings of which this sphere consists.

void ParticleUniverse::SphereSet::setNumberOfSegments ( unsigned int  numberOfSegments)

Set the number of segments of which this sphere consists.

void ParticleUniverse::SphereSet::setPoolSize ( size_t  size)

Adjusts the size of the pool of spheres available in this set.

void ParticleUniverse::SphereSet::setSpheresInWorldSpace ( bool  ws)
inline

Sets whether spheres should be treated as being in world space.

bool ParticleUniverse::SphereSet::sphereVisible ( Camera cam,
const Sphere sphere 
)
inlineprotected

Internal method for culling individual sphere

Member Data Documentation

ActiveSphereList ParticleUniverse::SphereSet::mActiveSpheres
protected

Active sphere list.

Remarks
This is a linked list of pointers to spheres in the sphere pool.
bool ParticleUniverse::SphereSet::mAutoExtendPool
protected

Flag indicating whether to autoextend pool

bool ParticleUniverse::SphereSet::mBuffersCreated
private

Flag indicating whether the HW buffers have been created.

Real ParticleUniverse::SphereSet::mDefaultRadius
protected

Default radius of each sphere

bool ParticleUniverse::SphereSet::mExternalData
private

Is external sphere data in use?

FreeSphereList ParticleUniverse::SphereSet::mFreeSpheres
protected

Free sphere queue.

size_t ParticleUniverse::SphereSet::mIndexCountPerSphere
protected

The number of indeces per sphere.

Ogre::IndexData* ParticleUniverse::SphereSet::mIndexData
protected

The vertex index data for all spheres in this set (1 set only)

float* ParticleUniverse::SphereSet::mLockPtr
protected

Locked pointer to buffer

Ogre::HardwareVertexBufferSharedPtr ParticleUniverse::SphereSet::mMainBuf
protected

Shortcut to main buffer

unsigned int ParticleUniverse::SphereSet::mNumberOfRings
protected

Number of rings of which the sphere consists

unsigned int ParticleUniverse::SphereSet::mNumberOfSegments
protected

Number of segments of which the sphere consists

unsigned short ParticleUniverse::SphereSet::mNumVisibleSpheres
protected

Number of visible sphere

size_t ParticleUniverse::SphereSet::mPoolSize
private

The number of spheres in the pool.

SpherePool ParticleUniverse::SphereSet::mSpherePool
protected

Pool of sphere instances for use and reuse in the active sphere list.

TextureCoordSets ParticleUniverse::SphereSet::mTextureCoords
protected
size_t ParticleUniverse::SphereSet::mVertexCountPerSphere
protected

The number of vertices per sphere.

Ogre::VertexData* ParticleUniverse::SphereSet::mVertexData
protected

The vertex position data for all spheres in this set.

unsigned short ParticleUniverse::SphereSet::mVertexIndex
protected

Internal vertex counter

ushort* ParticleUniverse::SphereSet::pIdx
protected

Locked pointer to index buffer


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