Cocos2d-x  v3.12
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Groups
MeshInfo Class Reference

Definition of a Mesh. More...

Public Types

enum  MeshSurfaceDistribution { , 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.
 
 MeshInfo ( var meshName, var MSD_HOMOGENEOUS, var ZERO)
 Constructor.
 
 MeshInfo ( local meshName, local MSD_HOMOGENEOUS, local ZERO)
 Constructor.
 
 ~MeshInfo (void)
 Destructor.
 
 ~MeshInfo ()
 Destructor.
 
 ~MeshInfo ()
 Destructor.
 
float getGaussianRandom (float high, float cutoff=4)
 Generate a random number. More...
 
const PUTrianglegetTriangle (size_t triangleIndex)
 Retrieve vertex info. More...
 
var getTriangle ( var triangleIndex)
 Retrieve vertex info. More...
 
local getTriangle ( local triangleIndex)
 Retrieve vertex info. More...
 
const size_t getRandomTriangleIndex ()
 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...
 

Detailed Description

Definition of a Mesh.

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]. The cutoff.

Returns
The value.
var getGaussianRandom ( var  high,
var  cutoff = 4 
)

Generate a random number.

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

Returns
The value.
local getGaussianRandom ( local  high,
local  cutoff = 4 
)

Generate a random number.

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

Returns
The value.
const PUTriangle& getTriangle ( size_t  triangleIndex)

Retrieve vertex info.

Get one triangle. The index of triangle. The triangle.

var getTriangle ( var  triangleIndex)

Retrieve vertex info.

Get one triangle. The index of triangle. The triangle.

local getTriangle ( local  triangleIndex)

Retrieve vertex info.

Get one triangle. The index of triangle. The triangle.

const size_t getRandomTriangleIndex ( )

Get a random triangle (index) from the mesh.

The index of triangle.

var getRandomTriangleIndex ( )

Get a random triangle (index) from the mesh.

The index of triangle.

local getRandomTriangleIndex ( )

Get a random triangle (index) from the mesh.

The index of triangle.

size_t getTriangleCount ( ) const
inline

Get triangle number.

The number of triangle.

var getTriangleCount ( )
inline

Get triangle number.

The number of triangle.

local getTriangleCount ( )
inline

Get triangle number.

The number of triangle.

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. The index of triangle. Position and normal.

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. The index of triangle. Position and normal.

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. The index of triangle. Position and normal.


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