Go to the documentation of this file.
31 Model(
const std::string &filePath,
bool lonely =
false,
32 std::optional<std::pair<MaterialType, std::string>> texture = std::nullopt,
34 float rotationAngle = 0,
40 Model(
const Mesh::AMesh &mesh,
41 std::optional<std::pair<MaterialType, std::string>> texture = std::nullopt,
43 float rotationAngle = 0,
54 ~Model()
override =
default;
121 operator ::Model()
const;
A Three-dimensionnal Vector data type.
Definition: Vector3.hpp:15
Object representation of a texture.
Definition: Texture.hpp:19
::Shader _originalShader
The original shaderId used to disable a shader effect.
Definition: Model.hpp:115
static RAY::Cache<::Model > _modelsCache
Definition: Model.hpp:117
Definition: Window.hpp:32
A Holder for Model Animations.
Definition: ModelAnimation.hpp:16
bool unloadKeepMeshes()
Unload model (excluding meshes) from memory (RAM and/or VRAM)
Definition: Model.cpp:57
void resetShader()
Set the original shader (used to disable a shader)
Definition: Model.cpp:158
std::shared_ptr<::Model > _model
Raw data from raylib.
Definition: Model.hpp:105
Model & operator=(const Model &model)=default
A model is assignable.
::MaterialMapIndex MaterialType
Definition: Model.hpp:26
const RAY::Vector3 & getScale(void)
Definition: Model.cpp:123
Model & setRotationAngle(float roationAngle)
Set rotation angle.
Definition: Model.cpp:95
Model & setScale(const RAY::Vector3 &scale)
Set Scale.
Definition: Model.cpp:117
~Model() override=default
Model destructor, model's data will be deleted if it's the last entity alive.
RAY::Vector3 _rotationAxis
Rotation property.
Definition: Model.hpp:109
Abstraction of any three-dimensionnal drawable.
Definition: ADrawable3D.hpp:17
const RAY::Vector3 & getRotationAxis(void)
Definition: Model.cpp:112
Texture & getTextureByMaterial(MaterialType materialType)
Definition: Model.cpp:80
void setShader(const RAY::Shader &shader)
Set a shader on the model.
Definition: Model.cpp:152
Definition: Circle.cpp:10
float getRotationAngle(void)
Definition: Model.cpp:101
Model & setRotationAxis(const RAY::Vector3 &rotationAxis)
Set Rotation Axis.
Definition: Model.cpp:106
Model(const std::string &filePath, bool lonely=false, std::optional< std::pair< MaterialType, std::string >> texture=std::nullopt, const RAY::Vector3 &scale=RAY::Vector3(1, 1, 1), float rotationAngle=0, const RAY::Vector3 &position={0, 0, 0}, const RAY::Vector3 &rotationAxis=RAY::Vector3(0, 1, 0))
Create an model, loading a file.
Definition: Model.cpp:24
void drawWiresOn(RAY::Window &) override
Draw model's wires on window.
Definition: Model.cpp:138
std::unordered_map< MaterialType, Texture > _textureList
The list of textures that can be applied to this model.
Definition: Model.hpp:107
float _rotationAngle
Rotation property.
Definition: Model.hpp:111
bool setAnimation(const RAY::ModelAnimation &animation)
Update model animation pose.
Definition: Model.cpp:63
void drawOn(RAY::Window &) override
Draw drawble on window.
Definition: Model.cpp:128
bool setTextureToMaterial(MaterialType materialType, const std::string &texture)
Sets a texture to the Nth material.
Definition: Model.cpp:71
Basic 3D Model type.
Definition: Model.hpp:23
A templated class used to cache ressources, indexed with a string.
Definition: Cache.hpp:23
RAY::Vector3 _scale
Scale of the shape.
Definition: Model.hpp:113
Definition: Shaders.hpp:16
int getBoneCount() const
Definition: Model.cpp:90