Cocos2d-x  v3.10
PUTriangle Class Reference

Definition of a Triangle. More...

## Classes

struct  PositionAndNormal
The struct is used to return both the position and the normal. More...

## Public Member Functions

PUTriangle (void)
Normal of edge v3-v1. More...

void calculateSquareSurface (void)
Calculate the (square) surface of the triangle.

void calculateSurfaceNormal (void)
Calculate the surface normal of the triangle.

void calculateEdgeNormals (void)
Calculate the edge normals of the 3 edges.

const Vec3 getRandomTrianglePosition (void)
Determine a random position on this triangle. More...

const PositionAndNormal getRandomEdgePositionAndNormal (void)
Determine a random position including its normal on a one of the edges. More...

local getRandomEdgePositionAndNormal ()
Determine a random position including its normal on a one of the edges. More...

const PositionAndNormal getRandomVertexAndNormal (void)
Determine a random vertex including its normal of this triangle. More...

local getRandomVertexAndNormal ()
Determine a random vertex including its normal of this triangle. More...

## Public Attributes

float squareSurface
Public attributes.

Vec3 v1
Normal of triangle v1-v2-v3.

Vec3 v2
Vertex v1.

Vec3 v3
Vertex v2.

Vec3 vn1
Vertex v3.

Vec3 vn2
Normal of vertex v1.

Vec3 vn3
Normal of vertex v2.

Vec3 en1
Normal of vertex v3.

Vec3 en2
Normal of edge v1-v2.

Vec3 en3
Normal of edge v2-v3.

## Detailed Description

Definition of a Triangle.

## Constructor & Destructor Documentation

 PUTriangle ( void )
inline

Normal of edge v3-v1.

Constructor.

 var PUTriangle ( )
inline

Normal of edge v3-v1.

Constructor.

 local PUTriangle ( )
inline

Normal of edge v3-v1.

Constructor.

## Member Function Documentation

 const Vec3 getRandomTrianglePosition ( void )

Determine a random position on this triangle.

A random position on this triangle.

 var getRandomTrianglePosition ( )

Determine a random position on this triangle.

A random position on this triangle.

 local getRandomTrianglePosition ( )

Determine a random position on this triangle.

A random position on this triangle.

 const PositionAndNormal getRandomEdgePositionAndNormal ( void )

Determine a random position including its normal on a one of the edges.

Position and normal.

 var getRandomEdgePositionAndNormal ( )

Determine a random position including its normal on a one of the edges.

Position and normal.

 local getRandomEdgePositionAndNormal ( )

Determine a random position including its normal on a one of the edges.

Position and normal.

 const PositionAndNormal getRandomVertexAndNormal ( void )

Determine a random vertex including its normal of this triangle.

Position and normal.

 var getRandomVertexAndNormal ( )

Determine a random vertex including its normal of this triangle.

Position and normal.

 local getRandomVertexAndNormal ( )

Determine a random vertex including its normal of this triangle.

Position and normal.

The documentation for this class was generated from the following file:
• CCPUMeshSurfaceEmitter.h