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

Model type. More...

Public Member Functions

 Model (const ::Mesh &mesh)
 
 Model (const ::Model &model)
 
 Model (const Model &)=delete
 
 Model (const std::string &fileName)
 
 Model (Model &&other)
 
ModelDraw (::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.
 
ModelDraw (::Vector3 position, float scale=1.0f, ::Color tint={255, 255, 255, 255})
 Draw a model (with texture if set)
 
ModelDrawWires (::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.
 
ModelDrawWires (::Vector3 position, float scale=1.0f, ::Color tint={255, 255, 255, 255})
 Draw a model wires (with texture if set)
 
::Transform * GetBindPoe () const
 Retrieves the bindPose value for the object. More...
 
int GetBoneCount () const
 Retrieves the boneCount value for the object. More...
 
::BoneInfo * GetBones () const
 Retrieves the bones value for the object. More...
 
BoundingBox GetBoundingBox () const
 Compute model bounding box limits (considers all meshes)
 
RayCollision GetCollision (const ::Ray &ray) const
 Get collision info between ray and model.
 
int GetMaterialCount () const
 Retrieves the materialCount value for the object. More...
 
::MaterialGetMaterials () const
 Retrieves the materials value for the object. More...
 
int GetMeshCount () const
 Retrieves the meshCount value for the object. More...
 
::MeshGetMeshes () const
 Retrieves the meshes value for the object. More...
 
int * GetMeshMaterial () const
 Retrieves the meshMaterial value for the object. More...
 
::Matrix GetTransform () const
 Retrieves the transform value for the object. More...
 
bool IsModelAnimationValid (const ::ModelAnimation &anim) const
 Check model animation skeleton match.
 
bool IsReady () const
 Determines whether or not the Model has data in it.
 
bool Load (const ::Mesh &mesh)
 Loads a Model from the given Mesh. More...
 
bool Load (const std::string &fileName)
 Loads a Model from the given file. More...
 
 operator BoundingBox () const
 Compute model bounding box limits (considers all meshes)
 
Modeloperator= (const ::Model &model)
 
Modeloperator= (const Model &)=delete
 
Modeloperator= (Model &&other)
 
void SetBindPoe (::Transform *value)
 Sets the bindPose value for the object. More...
 
void SetBoneCount (int value)
 Sets the boneCount value for the object. More...
 
void SetBones (::BoneInfo *value)
 Sets the bones value for the object. More...
 
void SetMaterialCount (int value)
 Sets the materialCount value for the object. More...
 
void SetMaterials (::Material *value)
 Sets the materials value for the object. More...
 
void SetMeshCount (int value)
 Sets the meshCount value for the object. More...
 
void SetMeshes (::Mesh *value)
 Sets the meshes value for the object. More...
 
void SetMeshMaterial (int *value)
 Sets the meshMaterial value for the object. More...
 
ModelSetMeshMaterial (int meshId, int materialId)
 Set material for a mesh.
 
void SetTransform (::Matrix value)
 Sets the transform value for the object. More...
 
void Unload ()
 Unload model (including meshes) from memory (RAM and/or VRAM)
 
ModelUnloadKeepMeshes ()
 Unload model (but not meshes) from memory (RAM and/or VRAM)
 
ModelUpdateAnimation (const ::ModelAnimation &anim, int frame)
 Update model animation pose.
 

Detailed Description

Model type.

Definition at line 15 of file Model.hpp.

Member Function Documentation

◆ GetBindPoe()

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

Retrieves the bindPose value for the object.

Returns
The bindPose value of the object.

Definition at line 59 of file Model.hpp.

◆ GetBoneCount()

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

Retrieves the boneCount value for the object.

Returns
The boneCount value of the object.

Definition at line 57 of file Model.hpp.

◆ GetBones()

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

Retrieves the bones value for the object.

Returns
The bones value of the object.

Definition at line 58 of file Model.hpp.

◆ GetMaterialCount()

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

Retrieves the materialCount value for the object.

Returns
The materialCount value of the object.

Definition at line 53 of file Model.hpp.

◆ GetMaterials()

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

Retrieves the materials value for the object.

Returns
The materials value of the object.

Definition at line 55 of file Model.hpp.

◆ GetMeshCount()

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

Retrieves the meshCount value for the object.

Returns
The meshCount value of the object.

Definition at line 52 of file Model.hpp.

◆ GetMeshes()

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

Retrieves the meshes value for the object.

Returns
The meshes value of the object.

Definition at line 54 of file Model.hpp.

◆ GetMeshMaterial()

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

Retrieves the meshMaterial value for the object.

Returns
The meshMaterial value of the object.

Definition at line 56 of file Model.hpp.

◆ GetTransform()

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

Retrieves the transform value for the object.

Returns
The transform value of the object.

Definition at line 51 of file Model.hpp.

◆ Load() [1/2]

bool raylib::Model::Load ( const ::Mesh mesh)
inline

Loads a Model from the given Mesh.

Returns
True of false depending on whether or not the model was successfully loaded.

Definition at line 218 of file Model.hpp.

References IsReady().

◆ Load() [2/2]

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

Loads a Model from the given file.

Returns
True of false depending on whether or not the model was successfully loaded.

Definition at line 208 of file Model.hpp.

References IsReady().

◆ SetBindPoe()

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

Sets the bindPose value for the object.

Parameters
valueThe value of which to set bindPose to.

Definition at line 59 of file Model.hpp.

◆ SetBoneCount()

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

Sets the boneCount value for the object.

Parameters
valueThe value of which to set boneCount to.

Definition at line 57 of file Model.hpp.

◆ SetBones()

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

Sets the bones value for the object.

Parameters
valueThe value of which to set bones to.

Definition at line 58 of file Model.hpp.

◆ SetMaterialCount()

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

Sets the materialCount value for the object.

Parameters
valueThe value of which to set materialCount to.

Definition at line 53 of file Model.hpp.

◆ SetMaterials()

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

Sets the materials value for the object.

Parameters
valueThe value of which to set materials to.

Definition at line 55 of file Model.hpp.

◆ SetMeshCount()

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

Sets the meshCount value for the object.

Parameters
valueThe value of which to set meshCount to.

Definition at line 52 of file Model.hpp.

◆ SetMeshes()

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

Sets the meshes value for the object.

Parameters
valueThe value of which to set meshes to.

Definition at line 54 of file Model.hpp.

◆ SetMeshMaterial()

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

Sets the meshMaterial value for the object.

Parameters
valueThe value of which to set meshMaterial to.

Definition at line 56 of file Model.hpp.

◆ SetTransform()

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

Sets the transform value for the object.

Parameters
valueThe value of which to set transform to.

Definition at line 51 of file Model.hpp.