Atoms Crowd  7.0.0
AtomsUtils::Mesh Class Reference

Mesh class. More...

#include <Mesh.h>

Classes

struct  UVData
 

Public Types

enum  GridMode { kKdtree = 0 , kBvh = 1 }
 

Public Member Functions

 Mesh ()
 Constructor.
 
virtual ~Mesh ()
 Destructor.
 
 Mesh (const Mesh &rhs)
 Copy constructor.
 
Meshoperator= (const Mesh &rhs)
 Assign operator.
 
bool hasGrid ()
 Check if it has underlying kdtree grid.
 
std::vector< AtomsMath::Vector3f > & points ()
 Get point positions.
 
const std::vector< AtomsMath::Vector3f > & points () const
 
std::vector< AtomsMath::Vector3f > & normals ()
 Get point normal (normal per face per vertex)
 
const std::vector< AtomsMath::Vector3f > & normals () const
 
std::vector< unsigned int > & indices ()
 Get point indices.
 
const std::vector< unsigned int > & indices () const
 
std::vector< unsigned int > & vertexCount ()
 Get Vertex count.
 
const std::vector< unsigned int > & vertexCount () const
 
std::vector< AtomsMath::Vector2f > & uvs ()
 Get uvs.
 
const std::vector< AtomsMath::Vector2f > & uvs () const
 
unsigned int numberOfFaces () const
 Get number of faces.
 
unsigned int numberOfVertices () const
 Get number of vertices.
 
std::vector< AtomsMath::Vector3f > & jointWeights ()
 Get the skin joint weights.
 
const std::vector< AtomsMath::Vector3f > & jointWeights () const
 Get the skin joint weights.
 
std::vector< AtomsMath::Vector3i > & jointIndices ()
 Get skin joint indices.
 
const std::vector< AtomsMath::Vector3i > & jointIndices () const
 Get skin joint indices.
 
std::vector< UVData > & uvSets ()
 Get uv sets.
 
const std::vector< UVData > & uvSets () const
 Get uv sets.
 
void buildIntersectionGrid (short gridMode=kKdtree)
 Build kd tree.
 
void multiplyPointsByMatrix (const AtomsMath::Matrix &matrix)
 Multiply all points by the given matrix.
 
virtual bool intersect (const AtomsMath::Vector3f &orig, const AtomsMath::Vector3f &dir, float &param, unsigned int &outFaceId, float &outU, float &outV, bool bothDirection=false) const
 intersect
 
virtual bool closestPoint (const AtomsMath::Vector3f &inP, AtomsMath::Vector3f &outP, unsigned int &outFaceId, float &outU, float &outV, float &sqrDistance) const
 Closets point.
 
virtual bool isInside (const AtomsMath::Vector3f &point) const
 Check if a point is inside this mesh.
 
void clear ()
 Clear mesh data.
 
void computeSoftEdgeNormals ()
 Compute averaged face vertex normals.
 
void clearIntersectionGrid ()
 Clear the intersection grid.
 
void triangulate ()
 Triangulate.
 
void transform (const AtomsMath::Matrixf &matrix)
 Transform.
 
void merge (Mesh &inMesh)
 Merge a mesh.
 
void createBox (const AtomsMath::Box3f &b)
 Create a box.
 
void createPlane (const AtomsMath::Box2f &b, const AtomsMath::Vector2i &divisions)
 Create a plane.
 
void createSphere (float radius, unsigned int sectorCount, unsigned int stackCount)
 Create a sphere.
 
void createPyramid (float radius, float height, unsigned int faceCount)
 Create a pyramid.
 
void createDisk (float radius, unsigned int sectorCount)
 Create a disk.
 
void changeWindingOrder ()
 Change winding order.
 
AtomsMath::Box3f boundingBox (const AtomsMath::Matrixf &matrix) const
 

Static Public Member Functions

static void triangulateMesh (const Mesh &input, Mesh &output)
 

Detailed Description

Mesh class.

When used with opengl use this class to store triangles mesh only!!! In order to be compatible with opengl the uv/normal vertex data is stored as per vertex per face


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