raylib-cpp
C++ object-oriented wrapper library for raylib.
Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
raylib::Mesh Class Reference

Public Member Functions

 Mesh (const ::Mesh &mesh)
 
 Mesh (int VertexCount=0, int TriangleCount=0)
 
 ~Mesh ()
 
Mesh & Binormals ()
 Compute mesh binormals (aka bitangent) More...
 
raylib::BoundingBox BoundingBox () const
 Compute mesh bounding box limits. More...
 
bool Export (const std::string &fileName)
 Export mesh data to file. More...
 
float * GetAnimNormals () const
 
float * GetAnimVertices () const
 
int * GetBoneIds () const
 
float * GetBoneWeights () const
 
unsigned char * GetColors () const
 
unsigned short * GetIndices () const
 
float * GetNormals () const
 
float * GetTangents () const
 
float * GetTexCoords () const
 
float * GetTexCoords2 () const
 
int GetTriangleCount () const
 
unsigned int GetVaoId () const
 
unsigned int * GetVboId () const
 
int GetVertexCount () const
 
float * GetVertices () const
 
raylib::Model LoadModelFrom () const
 Load model from generated mesh. More...
 
Mesh & NormalsSmooth ()
 Smooth (average) vertex normals. More...
 
 operator raylib::BoundingBox ()
 Compute mesh bounding box limits. More...
 
 operator raylib::Model ()
 Load model from generated mesh. More...
 
Mesh & operator= (const ::Mesh &mesh)
 
void SetAnimNormals (float *value)
 
void SetAnimVertices (float *value)
 
void SetBoneIds (int *value)
 
void SetBoneWeights (float *value)
 
void SetColors (unsigned char *value)
 
void SetIndices (unsigned short *value)
 
void SetNormals (float *value)
 
void SetTangents (float *value)
 
void SetTexCoords (float *value)
 
void SetTexCoords2 (float *value)
 
void SetTriangleCount (int value)
 
void SetVaoId (unsigned int value)
 
void SetVboId (unsigned int *value)
 
void SetVertexCount (int value)
 
void SetVertices (float *value)
 
Mesh & Tangents ()
 Compute mesh tangents. More...
 
void Unload ()
 

Static Public Member Functions

::Mesh Cube (float width, float height, float length)
 Generate cuboid mesh. More...
 
::Mesh Cubicmap (const ::Image &cubicmap, ::Vector3 cubeSize)
 Generate cubes-based map mesh from image data. More...
 
::Mesh Cylinder (float radius, float height, int slices)
 Generate cylinder mesh. More...
 
::Mesh Heightmap (const ::Image &heightmap, ::Vector3 size)
 Generate heightmap mesh from image data. More...
 
::Mesh HemiSphere (float radius, int rings, int slices)
 Generate half-sphere mesh (no bottom cap) More...
 
::Mesh Knot (float radius, float size, int radSeg, int sides)
 Generate trefoil knot mesh. More...
 
static std::vector< Mesh > Load (const std::string &fileName)
 Load meshes from model file. More...
 
::Mesh Plane (float width, float length, int resX, int resZ)
 Generate plane mesh (with subdivisions) More...
 
::Mesh Poly (int sides, float radius)
 Generate polygonal mesh. More...
 
::Mesh Sphere (float radius, int rings, int slices)
 Generate sphere mesh (standard sphere) More...
 
::Mesh Torus (float radius, float size, int radSeg, int sides)
 Generate torus mesh. More...
 

Protected Member Functions

void set (const ::Mesh &mesh)
 

Detailed Description

Definition at line 37 of file Mesh.hpp.

Constructor & Destructor Documentation

◆ Mesh() [1/2]

raylib::Mesh::Mesh ( const ::Mesh &  mesh)
inline

Definition at line 39 of file Mesh.hpp.

References set().

◆ Mesh() [2/2]

raylib::Mesh::Mesh ( int  VertexCount = 0,
int  TriangleCount = 0 
)
inline

Definition at line 43 of file Mesh.hpp.

◆ ~Mesh()

raylib::Mesh::~Mesh ( )
inline

Definition at line 148 of file Mesh.hpp.

References Unload().

Member Function Documentation

◆ Binormals()

Mesh& raylib::Mesh::Binormals ( )
inline

Compute mesh binormals (aka bitangent)

Definition at line 192 of file Mesh.hpp.

◆ BoundingBox()

raylib::BoundingBox raylib::Mesh::BoundingBox ( ) const
inline

Compute mesh bounding box limits.

Definition at line 170 of file Mesh.hpp.

Referenced by operator raylib::BoundingBox().

◆ Cube()

::Mesh raylib::Mesh::Cube ( float  width,
float  height,
float  length 
)
inlinestatic

Generate cuboid mesh.

Definition at line 74 of file Mesh.hpp.

◆ Cubicmap()

::Mesh raylib::Mesh::Cubicmap ( const ::Image &  cubicmap,
::Vector3  cubeSize 
)
inlinestatic

Generate cubes-based map mesh from image data.

Definition at line 123 of file Mesh.hpp.

◆ Cylinder()

::Mesh raylib::Mesh::Cylinder ( float  radius,
float  height,
int  slices 
)
inlinestatic

Generate cylinder mesh.

Definition at line 95 of file Mesh.hpp.

◆ Export()

bool raylib::Mesh::Export ( const std::string &  fileName)
inline

Export mesh data to file.

Definition at line 155 of file Mesh.hpp.

◆ GetAnimNormals()

float* raylib::Mesh::GetAnimNormals ( ) const
inline

Definition at line 137 of file Mesh.hpp.

◆ GetAnimVertices()

float* raylib::Mesh::GetAnimVertices ( ) const
inline

Definition at line 136 of file Mesh.hpp.

◆ GetBoneIds()

int* raylib::Mesh::GetBoneIds ( ) const
inline

Definition at line 138 of file Mesh.hpp.

◆ GetBoneWeights()

float* raylib::Mesh::GetBoneWeights ( ) const
inline

Definition at line 139 of file Mesh.hpp.

◆ GetColors()

unsigned char* raylib::Mesh::GetColors ( ) const
inline

Definition at line 134 of file Mesh.hpp.

◆ GetIndices()

unsigned short* raylib::Mesh::GetIndices ( ) const
inline

Definition at line 135 of file Mesh.hpp.

◆ GetNormals()

float* raylib::Mesh::GetNormals ( ) const
inline

Definition at line 132 of file Mesh.hpp.

◆ GetTangents()

float* raylib::Mesh::GetTangents ( ) const
inline

Definition at line 133 of file Mesh.hpp.

◆ GetTexCoords()

float* raylib::Mesh::GetTexCoords ( ) const
inline

Definition at line 130 of file Mesh.hpp.

◆ GetTexCoords2()

float* raylib::Mesh::GetTexCoords2 ( ) const
inline

Definition at line 131 of file Mesh.hpp.

◆ GetTriangleCount()

int raylib::Mesh::GetTriangleCount ( ) const
inline

Definition at line 128 of file Mesh.hpp.

◆ GetVaoId()

unsigned int raylib::Mesh::GetVaoId ( ) const
inline

Definition at line 140 of file Mesh.hpp.

◆ GetVboId()

unsigned int* raylib::Mesh::GetVboId ( ) const
inline

Definition at line 141 of file Mesh.hpp.

◆ GetVertexCount()

int raylib::Mesh::GetVertexCount ( ) const
inline

Definition at line 127 of file Mesh.hpp.

◆ GetVertices()

float* raylib::Mesh::GetVertices ( ) const
inline

Definition at line 129 of file Mesh.hpp.

◆ Heightmap()

::Mesh raylib::Mesh::Heightmap ( const ::Image &  heightmap,
::Vector3  size 
)
inlinestatic

Generate heightmap mesh from image data.

Definition at line 116 of file Mesh.hpp.

◆ HemiSphere()

::Mesh raylib::Mesh::HemiSphere ( float  radius,
int  rings,
int  slices 
)
inlinestatic

Generate half-sphere mesh (no bottom cap)

Definition at line 88 of file Mesh.hpp.

◆ Knot()

::Mesh raylib::Mesh::Knot ( float  radius,
float  size,
int  radSeg,
int  sides 
)
inlinestatic

Generate trefoil knot mesh.

Definition at line 109 of file Mesh.hpp.

◆ Load()

static std::vector<Mesh> raylib::Mesh::Load ( const std::string &  fileName)
inlinestatic

Load meshes from model file.

Definition at line 51 of file Mesh.hpp.

◆ LoadModelFrom()

raylib::Model raylib::Mesh::LoadModelFrom ( ) const
inline

Load model from generated mesh.

Definition at line 208 of file Mesh.hpp.

◆ NormalsSmooth()

Mesh& raylib::Mesh::NormalsSmooth ( )
inline

Smooth (average) vertex normals.

Definition at line 200 of file Mesh.hpp.

◆ operator raylib::BoundingBox()

raylib::Mesh::operator raylib::BoundingBox ( )
inline

Compute mesh bounding box limits.

Definition at line 177 of file Mesh.hpp.

References BoundingBox().

◆ operator raylib::Model()

raylib::Mesh::operator raylib::Model ( )
inline

Load model from generated mesh.

Definition at line 215 of file Mesh.hpp.

◆ operator=()

Mesh& raylib::Mesh::operator= ( const ::Mesh &  mesh)
inline

Definition at line 143 of file Mesh.hpp.

References set().

◆ Plane()

::Mesh raylib::Mesh::Plane ( float  width,
float  length,
int  resX,
int  resZ 
)
inlinestatic

Generate plane mesh (with subdivisions)

Definition at line 67 of file Mesh.hpp.

◆ Poly()

::Mesh raylib::Mesh::Poly ( int  sides,
float  radius 
)
inlinestatic

Generate polygonal mesh.

Definition at line 60 of file Mesh.hpp.

◆ set()

void raylib::Mesh::set ( const ::Mesh &  mesh)
inlineprotected

Definition at line 220 of file Mesh.hpp.

Referenced by Mesh(), and operator=().

◆ SetAnimNormals()

void raylib::Mesh::SetAnimNormals ( float *  value)
inline

Definition at line 137 of file Mesh.hpp.

◆ SetAnimVertices()

void raylib::Mesh::SetAnimVertices ( float *  value)
inline

Definition at line 136 of file Mesh.hpp.

◆ SetBoneIds()

void raylib::Mesh::SetBoneIds ( int *  value)
inline

Definition at line 138 of file Mesh.hpp.

◆ SetBoneWeights()

void raylib::Mesh::SetBoneWeights ( float *  value)
inline

Definition at line 139 of file Mesh.hpp.

◆ SetColors()

void raylib::Mesh::SetColors ( unsigned char *  value)
inline

Definition at line 134 of file Mesh.hpp.

◆ SetIndices()

void raylib::Mesh::SetIndices ( unsigned short *  value)
inline

Definition at line 135 of file Mesh.hpp.

◆ SetNormals()

void raylib::Mesh::SetNormals ( float *  value)
inline

Definition at line 132 of file Mesh.hpp.

◆ SetTangents()

void raylib::Mesh::SetTangents ( float *  value)
inline

Definition at line 133 of file Mesh.hpp.

◆ SetTexCoords()

void raylib::Mesh::SetTexCoords ( float *  value)
inline

Definition at line 130 of file Mesh.hpp.

◆ SetTexCoords2()

void raylib::Mesh::SetTexCoords2 ( float *  value)
inline

Definition at line 131 of file Mesh.hpp.

◆ SetTriangleCount()

void raylib::Mesh::SetTriangleCount ( int  value)
inline

Definition at line 128 of file Mesh.hpp.

◆ SetVaoId()

void raylib::Mesh::SetVaoId ( unsigned int  value)
inline

Definition at line 140 of file Mesh.hpp.

◆ SetVboId()

void raylib::Mesh::SetVboId ( unsigned int *  value)
inline

Definition at line 141 of file Mesh.hpp.

◆ SetVertexCount()

void raylib::Mesh::SetVertexCount ( int  value)
inline

Definition at line 127 of file Mesh.hpp.

◆ SetVertices()

void raylib::Mesh::SetVertices ( float *  value)
inline

Definition at line 129 of file Mesh.hpp.

◆ Sphere()

::Mesh raylib::Mesh::Sphere ( float  radius,
int  rings,
int  slices 
)
inlinestatic

Generate sphere mesh (standard sphere)

Definition at line 81 of file Mesh.hpp.

◆ Tangents()

Mesh& raylib::Mesh::Tangents ( )
inline

Compute mesh tangents.

Definition at line 184 of file Mesh.hpp.

◆ Torus()

::Mesh raylib::Mesh::Torus ( float  radius,
float  size,
int  radSeg,
int  sides 
)
inlinestatic

Generate torus mesh.

Definition at line 102 of file Mesh.hpp.

◆ Unload()

void raylib::Mesh::Unload ( )
inline

Definition at line 160 of file Mesh.hpp.

Referenced by ~Mesh().