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)
77 if (meshes != NULL || materials != NULL) {
88 ::UnloadModelKeepMeshes(*
this);
96 ::SetModelMeshMaterial(
this, meshId, materialId);
104 return ::GetCollisionRayModel(ray, *
this);
119 return ::IsModelAnimationValid(*
this, anim);
127 ::
Color tint = {255, 255, 255, 255}) {
128 ::DrawModel(*
this, position, scale, tint);
138 float rotationAngle = 0.0f,
139 ::
Vector3 scale = {1.0f, 1.0f, 1.0f},
140 ::Color tint = {255, 255, 255, 255}) {
141 ::DrawModelEx(*
this, position, rotationAxis, rotationAngle, scale, tint);
150 ::
Color tint = {255, 255, 255, 255}) {
151 ::DrawModelWires(*
this, position, scale, tint);
161 float rotationAngle = 0.0f,
162 ::
Vector3 scale = {1.0f, 1.0f, 1.0f},
163 ::Color tint = {255, 255, 255, 255}) {
164 ::DrawModelWiresEx(*
this, position, rotationAxis, rotationAngle, scale, tint);
169 inline void set(const ::Model& model) {
170 transform = model.transform;
172 meshCount = model.meshCount;
173 materialCount = model.materialCount;
174 meshes = model.meshes;
175 materials = model.materials;
176 meshMaterial = model.meshMaterial;
178 boneCount = model.boneCount;
180 bindPose = model.bindPose;
185 #endif // RAYLIB_CPP_INCLUDE_MODEL_HPP_