cocos2d-x  3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
MeshInfo Class Reference

Class that constructs mesh information of a given mesh name. More...

#include <CCPUMeshSurfaceEmitter.h>

Public Types

enum  MeshSurfaceDistribution {
  MSD_HOMOGENEOUS, MSD_HETEROGENEOUS_1, MSD_HETEROGENEOUS_2, MSD_VERTEX,
  MSD_EDGE
}
 Defining several methods to emit particles on the mesh surface. More...
 

Public Member Functions

 MeshInfo (const std::string &meshName, const MeshSurfaceDistribution distribution=MSD_HOMOGENEOUS, const Quaternion &orientation=Quaternion(), const Vec3 &scale=Vec3::ZERO)
 Constructor. More...
 
 MeshInfo ( var meshName, var MSD_HOMOGENEOUS, var ZERO)
 Constructor. More...
 
 MeshInfo ( local meshName, local MSD_HOMOGENEOUS, local ZERO)
 Constructor. More...
 
 ~MeshInfo (void)
 Destructor. More...
 
float getGaussianRandom (float high, float cutoff=4)
 Generate a random number. More...
 
const PUTrianglegetTriangle (size_t triangleIndex)
 Retrieve vertex info. More...
 
local getTriangle ( local triangleIndex)
 Retrieve vertex info. More...
 
const size_t getRandomTriangleIndex (void)
 Get a random triangle (index) from the mesh. More...
 
size_t getTriangleCount () const
 Get triangle number. More...
 
const PUTriangle::PositionAndNormal getRandomPositionAndNormal (const size_t triangleIndex)
 Returns both a random point on a given triangle and its normal vector. More...
 
local getRandomPositionAndNormal ( local triangleIndex)
 Returns both a random point on a given triangle and its normal vector. More...
 

Protected Attributes

Triangles _triangles
MeshSurfaceDistribution mDistribution
var mDistribution
local 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 

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 

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

MeshInfo ( const std::string &  meshName,
const MeshSurfaceDistribution  distribution = MSD_HOMOGENEOUS,
const Quaternion orientation = Quaternion(),
const Vec3 scale = Vec3::ZERO 
)

Constructor.

var MeshInfo ( var  meshName,
var  distribution = MSD_HOMOGENEOUS,
var  orientation = Quaternion(),
var  scale = Vec3::ZERO 
)

Constructor.

local MeshInfo ( local  meshName,
local  distribution = MSD_HOMOGENEOUS,
local  orientation = Quaternion(),
local  scale = Vec3::ZERO 
)

Constructor.

~MeshInfo ( void  )

Destructor.

var ~MeshInfo (   )

Destructor.

local ~MeshInfo (   )

Destructor.

Member Function Documentation

float getGaussianRandom ( float  high,
float  cutoff = 4 
)

Generate a random number.

The ´high?argument determines that numbers are returned between [0..high]

var getGaussianRandom ( var  high,
var  cutoff = 4 
)

Generate a random number.

The ´high?argument determines that numbers are returned between [0..high]

local getGaussianRandom ( local  high,
local  cutoff = 4 
)

Generate a random number.

The ´high?argument determines that numbers are returned between [0..high]

const
PUTriangle::PositionAndNormal
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.

var getRandomPositionAndNormal ( var  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.

local getRandomPositionAndNormal ( local  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 getRandomTriangleIndex ( void  )

Get a random triangle (index) from the mesh.

var getRandomTriangleIndex (   )

Get a random triangle (index) from the mesh.

local getRandomTriangleIndex (   )

Get a random triangle (index) from the mesh.

const PUTriangle& getTriangle ( size_t  triangleIndex)

Retrieve vertex info.

Get a triangle based on the index.

var getTriangle ( var  triangleIndex)

Retrieve vertex info.

Get a triangle based on the index.

local getTriangle ( local  triangleIndex)

Retrieve vertex info.

Get a triangle based on the index.

size_t getTriangleCount ( ) const
inline

Get triangle number.

var getTriangleCount ( )
inline

Get triangle number.

local getTriangleCount ( )
inline

Get triangle number.

Member Data Documentation

Triangles _triangles
protected
MeshSurfaceDistribution
mDistribution
protected
var mDistribution
protected
local mDistribution
protected

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