mesh encapsulation done

This commit is contained in:
Clément Le Bihan
2021-06-16 18:17:17 +02:00
parent c9753577da
commit 7fdb5a051d
8 changed files with 99 additions and 5 deletions
+2 -2
View File
@@ -32,14 +32,14 @@ namespace RAY::Drawables::Drawables3D
this->setTextureToMaterial(texture->first, texture->second);
}
Model::Model(const Mesh &mesh,
Model::Model(const Mesh::AMesh &mesh,
std::optional<std::pair<MaterialType, std::string>> texture,
const RAY::Vector3 &scale,
const RAY::Vector3 &position,
const RAY::Vector3 &rotationAxis,
float rotationAngle)
: ADrawable3D(position, WHITE),
_model(std::make_shared<::Model>(LoadModelFromMesh(mesh))),
_model(std::make_shared<::Model>(LoadModelFromMesh(*mesh.getRaylibMesh()))),
_rotationAxis(rotationAxis),
_rotationAngle(rotationAngle),
_scale(scale)
+2 -1
View File
@@ -13,6 +13,7 @@
#include "Model/ModelAnimation.hpp"
#include "Shaders/Shaders.hpp"
#include <raylib.h>
#include "Meshes/AMesh.hpp"
#include <vector>
#include <optional>
#include "Utils/Cache.hpp"
@@ -36,7 +37,7 @@ namespace RAY::Drawables::Drawables3D {
//! @brief Create an model, loading a file
//! @param mesh: mesh to load
Model(const Mesh &mesh,
Model(const Mesh::AMesh &mesh,
std::optional<std::pair<MaterialType, std::string>> texture = std::nullopt,
const RAY::Vector3 &scale = RAY::Vector3(1, 1, 1),
const RAY::Vector3 &position = {0, 0, 0},