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

Public Member Functions

 Model (const ::Mesh &mesh)
 
 Model (const ::Model &model)
 
 Model (const std::string &fileName)
 
 ~Model ()
 
Model & Draw (::Vector3 position, ::Vector3 rotationAxis, float rotationAngle=0.0f, ::Vector3 scale={1.0f, 1.0f, 1.0f}, ::Color tint={255, 255, 255, 255})
 Draw a model with extended parameters. More...
 
Model & Draw (::Vector3 position, float scale=1.0f, ::Color tint={255, 255, 255, 255})
 Draw a model (with texture if set) More...
 
Model & DrawWires (::Vector3 position, ::Vector3 rotationAxis, float rotationAngle=0.0f, ::Vector3 scale={1.0f, 1.0f, 1.0f}, ::Color tint={255, 255, 255, 255})
 Draw a model wires (with texture if set) with extended parameters. More...
 
Model & DrawWires (::Vector3 position, float scale=1.0f, ::Color tint={255, 255, 255, 255})
 Draw a model wires (with texture if set) More...
 
inline ::Transform * GetBindPoe () const
 
int GetBoneCount () const
 
inline ::BoneInfo * GetBones () const
 
RayHitInfo GetCollision (const ::Ray &ray) const
 Get collision info between ray and model. More...
 
int GetMaterialCount () const
 
inline ::Material * GetMaterials () const
 
int GetMeshCount () const
 
inline ::Mesh * GetMeshes () const
 
int * GetMeshMaterial () const
 
inline ::Matrix GetTransform () const
 
bool IsModelAnimationValid (const ::ModelAnimation &anim) const
 Check model animation skeleton match. More...
 
Model & operator= (const ::Model &model)
 
void SetBindPoe (::Transform *value)
 
void SetBoneCount (int value)
 
void SetBones (::BoneInfo *value)
 
void SetMaterialCount (int value)
 
void SetMaterials (::Material *value)
 
void SetMeshCount (int value)
 
void SetMeshes (::Mesh *value)
 
void SetMeshMaterial (int *value)
 
Model & SetMeshMaterial (int meshId, int materialId)
 Set material for a mesh. More...
 
void SetTransform (::Matrix value)
 
void Unload ()
 Unload model (including meshes) from memory (RAM and/or VRAM) More...
 
Model & UnloadKeepMeshes ()
 Unload model (but not meshes) from memory (RAM and/or VRAM) More...
 
Model & UpdateModelAnimation (const ::ModelAnimation &anim, int frame)
 Update model animation pose. More...
 

Protected Member Functions

void set (const ::Model &model)
 

Detailed Description

Definition at line 35 of file Model.hpp.

Constructor & Destructor Documentation

◆ Model() [1/3]

raylib::Model::Model ( const ::Model &  model)
inline

Definition at line 37 of file Model.hpp.

References set().

◆ Model() [2/3]

raylib::Model::Model ( const std::string &  fileName)
inline

Definition at line 41 of file Model.hpp.

References set().

◆ Model() [3/3]

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

Definition at line 45 of file Model.hpp.

References set().

◆ ~Model()

raylib::Model::~Model ( )
inline

Definition at line 49 of file Model.hpp.

References Unload().

Member Function Documentation

◆ Draw() [1/2]

Model& raylib::Model::Draw ( ::Vector3  position,
::Vector3  rotationAxis,
float  rotationAngle = 0.0f,
::Vector3  scale = {1.0f, 1.0f, 1.0f},
::Color  tint = {255, 255, 255, 255} 
)
inline

Draw a model with extended parameters.

Definition at line 130 of file Model.hpp.

◆ Draw() [2/2]

Model& raylib::Model::Draw ( ::Vector3  position,
float  scale = 1.0f,
::Color  tint = {255, 255, 255, 255} 
)
inline

Draw a model (with texture if set)

Definition at line 120 of file Model.hpp.

◆ DrawWires() [1/2]

Model& raylib::Model::DrawWires ( ::Vector3  position,
::Vector3  rotationAxis,
float  rotationAngle = 0.0f,
::Vector3  scale = {1.0f, 1.0f, 1.0f},
::Color  tint = {255, 255, 255, 255} 
)
inline

Draw a model wires (with texture if set) with extended parameters.

Definition at line 153 of file Model.hpp.

◆ DrawWires() [2/2]

Model& raylib::Model::DrawWires ( ::Vector3  position,
float  scale = 1.0f,
::Color  tint = {255, 255, 255, 255} 
)
inline

Draw a model wires (with texture if set)

Definition at line 143 of file Model.hpp.

◆ GetBindPoe()

inline ::Transform* raylib::Model::GetBindPoe ( ) const
inline

Definition at line 61 of file Model.hpp.

◆ GetBoneCount()

int raylib::Model::GetBoneCount ( ) const
inline

Definition at line 59 of file Model.hpp.

◆ GetBones()

inline ::BoneInfo* raylib::Model::GetBones ( ) const
inline

Definition at line 60 of file Model.hpp.

◆ GetCollision()

RayHitInfo raylib::Model::GetCollision ( const ::Ray &  ray) const
inline

Get collision info between ray and model.

Definition at line 98 of file Model.hpp.

◆ GetMaterialCount()

int raylib::Model::GetMaterialCount ( ) const
inline

Definition at line 55 of file Model.hpp.

◆ GetMaterials()

inline ::Material* raylib::Model::GetMaterials ( ) const
inline

Definition at line 57 of file Model.hpp.

◆ GetMeshCount()

int raylib::Model::GetMeshCount ( ) const
inline

Definition at line 54 of file Model.hpp.

◆ GetMeshes()

inline ::Mesh* raylib::Model::GetMeshes ( ) const
inline

Definition at line 56 of file Model.hpp.

◆ GetMeshMaterial()

int* raylib::Model::GetMeshMaterial ( ) const
inline

Definition at line 58 of file Model.hpp.

◆ GetTransform()

inline ::Matrix raylib::Model::GetTransform ( ) const
inline

Definition at line 53 of file Model.hpp.

◆ IsModelAnimationValid()

bool raylib::Model::IsModelAnimationValid ( const ::ModelAnimation &  anim) const
inline

Check model animation skeleton match.

Definition at line 113 of file Model.hpp.

◆ operator=()

Model& raylib::Model::operator= ( const ::Model &  model)
inline

Definition at line 63 of file Model.hpp.

References set().

◆ set()

void raylib::Model::set ( const ::Model &  model)
inlineprotected

Definition at line 164 of file Model.hpp.

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

◆ SetBindPoe()

void raylib::Model::SetBindPoe ( ::Transform *  value)
inline

Definition at line 61 of file Model.hpp.

◆ SetBoneCount()

void raylib::Model::SetBoneCount ( int  value)
inline

Definition at line 59 of file Model.hpp.

◆ SetBones()

void raylib::Model::SetBones ( ::BoneInfo *  value)
inline

Definition at line 60 of file Model.hpp.

◆ SetMaterialCount()

void raylib::Model::SetMaterialCount ( int  value)
inline

Definition at line 55 of file Model.hpp.

◆ SetMaterials()

void raylib::Model::SetMaterials ( ::Material *  value)
inline

Definition at line 57 of file Model.hpp.

◆ SetMeshCount()

void raylib::Model::SetMeshCount ( int  value)
inline

Definition at line 54 of file Model.hpp.

◆ SetMeshes()

void raylib::Model::SetMeshes ( ::Mesh *  value)
inline

Definition at line 56 of file Model.hpp.

◆ SetMeshMaterial() [1/2]

void raylib::Model::SetMeshMaterial ( int *  value)
inline

Definition at line 58 of file Model.hpp.

◆ SetMeshMaterial() [2/2]

Model& raylib::Model::SetMeshMaterial ( int  meshId,
int  materialId 
)
inline

Set material for a mesh.

Definition at line 90 of file Model.hpp.

◆ SetTransform()

void raylib::Model::SetTransform ( ::Matrix  value)
inline

Definition at line 53 of file Model.hpp.

◆ Unload()

void raylib::Model::Unload ( )
inline

Unload model (including meshes) from memory (RAM and/or VRAM)

Definition at line 71 of file Model.hpp.

Referenced by ~Model().

◆ UnloadKeepMeshes()

Model& raylib::Model::UnloadKeepMeshes ( )
inline

Unload model (but not meshes) from memory (RAM and/or VRAM)

Definition at line 82 of file Model.hpp.

◆ UpdateModelAnimation()

Model& raylib::Model::UpdateModelAnimation ( const ::ModelAnimation &  anim,
int  frame 
)
inline

Update model animation pose.

Definition at line 105 of file Model.hpp.