1 #ifndef RAYLIB_CPP_INCLUDE_MODEL_HPP_
2 #define RAYLIB_CPP_INCLUDE_MODEL_HPP_
6 #include "./raylib.hpp"
7 #include "./raylib-cpp-utils.hpp"
16 Model(const ::Model& model) {
20 Model(
const std::string& fileName) {
21 set(::LoadModel(fileName.c_str()));
24 Model(const ::Mesh& mesh) {
25 set(::LoadModelFromMesh(mesh));
32 GETTERSETTER(::
Matrix, Transform, transform)
33 GETTERSETTER(
int, MeshCount, meshCount)
34 GETTERSETTER(
int, MaterialCount, materialCount)
35 GETTERSETTER(::
Mesh *, Meshes, meshes)
36 GETTERSETTER(::
Material *, Materials, materials)
37 GETTERSETTER(
int *, MeshMaterial, meshMaterial)
38 GETTERSETTER(
int, BoneCount, boneCount)
39 GETTERSETTER(::BoneInfo *, Bones, bones)
40 GETTERSETTER(::Transform *, BindPoe, bindPose)
51 if (meshes != NULL || materials != NULL) {
62 ::UnloadModelKeepMeshes(*
this);
70 ::SetModelMeshMaterial(
this, meshId, materialId);
78 return ::GetCollisionRayModel(ray, *
this);
85 ::UpdateModelAnimation(*
this, anim, frame);
93 return ::IsModelAnimationValid(*
this, anim);
101 ::
Color tint = {255, 255, 255, 255}) {
102 ::DrawModel(*
this, position, scale, tint);
112 float rotationAngle = 0.0f,
113 ::
Vector3 scale = {1.0f, 1.0f, 1.0f},
114 ::Color tint = {255, 255, 255, 255}) {
115 ::DrawModelEx(*
this, position, rotationAxis, rotationAngle, scale, tint);
124 ::
Color tint = {255, 255, 255, 255}) {
125 ::DrawModelWires(*
this, position, scale, tint);
135 float rotationAngle = 0.0f,
136 ::
Vector3 scale = {1.0f, 1.0f, 1.0f},
137 ::Color tint = {255, 255, 255, 255}) {
138 ::DrawModelWiresEx(*
this, position, rotationAxis, rotationAngle, scale, tint);
143 inline void set(const ::Model& model) {
144 transform = model.transform;
146 meshCount = model.meshCount;
147 materialCount = model.materialCount;
148 meshes = model.meshes;
149 materials = model.materials;
150 meshMaterial = model.meshMaterial;
152 boneCount = model.boneCount;
154 bindPose = model.bindPose;
159 #endif // RAYLIB_CPP_INCLUDE_MODEL_HPP_