Particle Universe  1.2
ParticleUniverse::MeshInfo Class Reference

#include <ParticleUniverseMeshSurfaceEmitter.h>

Public Types

enum  MeshSurfaceDistribution {
  MSD_HOMOGENEOUS, MSD_HETEROGENEOUS_1, MSD_HETEROGENEOUS_2, MSD_VERTEX,
  MSD_EDGE
}
 

Public Member Functions

 MeshInfo (const String &meshName, const MeshSurfaceDistribution distribution=MSD_HOMOGENEOUS, const Quaternion &orientation=Quaternion::IDENTITY, const Vector3 &scale=Vector3::ZERO)
 
 ~MeshInfo (void)
 
Real getGaussianRandom (Real high, Real cutoff=4)
 
void getMeshInformation (Ogre::MeshPtr mesh, const Vector3 &position=Vector3::ZERO, const Quaternion &orient=Quaternion::IDENTITY, const Vector3 &scale=Vector3::UNIT_SCALE)
 
const TrianglegetTriangle (size_t triangleIndex)
 
const size_t getRandomTriangleIndex (void)
 
const Triangle::PositionAndNormal getRandomPositionAndNormal (const size_t triangleIndex)
 

Protected Attributes

Triangles _triangles
 
MeshSurfaceDistribution mDistribution
 

Detailed Description

Class that constructs mesh information of a given mesh name

Remarks

Member Enumeration Documentation

Defining several methods to emit particles on the mesh surface

Remarks
Sometimes the difference is not always visible, for example if the mesh contains triangles with more or less the same size. Only in case a mesh contains both small and large triangles the difference between the various distribution methods is more obvious.
Enumerator
MSD_HOMOGENEOUS 
MSD_HETEROGENEOUS_1 
MSD_HETEROGENEOUS_2 
MSD_VERTEX 
MSD_EDGE 

Constructor & Destructor Documentation

ParticleUniverse::MeshInfo::MeshInfo ( const String meshName,
const MeshSurfaceDistribution  distribution = MSD_HOMOGENEOUS,
const Quaternion orientation = Quaternion::IDENTITY,
const Vector3 scale = Vector3::ZERO 
)

Constructor

ParticleUniverse::MeshInfo::~MeshInfo ( void  )

Destructor

Member Function Documentation

Real ParticleUniverse::MeshInfo::getGaussianRandom ( Real  high,
Real  cutoff = 4 
)

Generate a random number. The ´high´ argument determines that numbers are returned between [0..high]

void ParticleUniverse::MeshInfo::getMeshInformation ( Ogre::MeshPtr  mesh,
const Vector3 position = Vector3::ZERO,
const Quaternion orient = Quaternion::IDENTITY,
const Vector3 scale = Vector3::UNIT_SCALE 
)

Retrieve vertex info

const Triangle::PositionAndNormal ParticleUniverse::MeshInfo::getRandomPositionAndNormal ( const size_t  triangleIndex)

Returns both a random point on a given triangle and its normal vector. How the random point and the normal are determined depends on the distribution type.

const size_t ParticleUniverse::MeshInfo::getRandomTriangleIndex ( void  )

Get a random triangle (index) from the mesh.

const Triangle& ParticleUniverse::MeshInfo::getTriangle ( size_t  triangleIndex)

Get a triangle based on the index.

Member Data Documentation

Triangles ParticleUniverse::MeshInfo::_triangles
protected
MeshSurfaceDistribution ParticleUniverse::MeshInfo::mDistribution
protected

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