25 #ifndef RAYLIB_CPP_INCLUDE_MODEL_HPP_
26 #define RAYLIB_CPP_INCLUDE_MODEL_HPP_
30 #include "./raylib.hpp"
31 #include "./raylib-cpp-utils.hpp"
41 Model(
const std::string& fileName) {
42 set(::LoadModel(fileName.c_str()));
46 set(::LoadModelFromMesh(mesh));
53 GETTERSETTER(::
Matrix, Transform, transform)
54 GETTERSETTER(
int, MeshCount, meshCount)
55 GETTERSETTER(
int, MaterialCount, materialCount)
56 GETTERSETTER(::
Mesh *, Meshes, meshes)
57 GETTERSETTER(::
Material *, Materials, materials)
58 GETTERSETTER(
int *, MeshMaterial, meshMaterial)
59 GETTERSETTER(
int, BoneCount, boneCount)
60 GETTERSETTER(::BoneInfo *, Bones, bones)
61 GETTERSETTER(::Transform *, BindPoe, bindPose)
72 if (meshes != NULL || materials != NULL) {
83 ::UnloadModelKeepMeshes(*
this);
91 ::SetModelMeshMaterial(
this, meshId, materialId);
99 return ::GetCollisionRayModel(ray, *
this);
114 return ::IsModelAnimationValid(*
this, anim);
122 ::
Color tint = {255, 255, 255, 255}) {
123 ::DrawModel(*
this, position, scale, tint);
133 float rotationAngle = 0.0f,
134 ::
Vector3 scale = {1.0f, 1.0f, 1.0f},
135 ::Color tint = {255, 255, 255, 255}) {
136 ::DrawModelEx(*
this, position, rotationAxis, rotationAngle, scale, tint);
145 ::
Color tint = {255, 255, 255, 255}) {
146 ::DrawModelWires(*
this, position, scale, tint);
156 float rotationAngle = 0.0f,
157 ::
Vector3 scale = {1.0f, 1.0f, 1.0f},
158 ::Color tint = {255, 255, 255, 255}) {
159 ::DrawModelWiresEx(*
this, position, rotationAxis, rotationAngle, scale, tint);
164 inline void set(const ::Model& model) {
165 transform = model.transform;
167 meshCount = model.meshCount;
168 materialCount = model.materialCount;
169 meshes = model.meshes;
170 materials = model.materials;
171 meshMaterial = model.meshMaterial;
173 boneCount = model.boneCount;
175 bindPose = model.bindPose;
180 #endif // RAYLIB_CPP_INCLUDE_MODEL_HPP_