add exception class

This commit is contained in:
arthur.jamet
2021-05-23 17:43:34 +02:00
parent 57ebac7813
commit 1f7b19b345
6 changed files with 95 additions and 7 deletions

View File

@@ -6,6 +6,7 @@
*/
#include "Model/Model.hpp"
#include "Exceptions/RayError.hpp"
RAY::Model::Model(const std::string &filename):
_model(LoadModel(filename.c_str()))
@@ -49,7 +50,7 @@ bool RAY::Model::unloadKeepMeshes()
bool RAY::Model::setAnimation(const RAY::ModelAnimation &animation)
{
if (!IsModelAnimationValid(this->_model, animation))
return false;
throw RAY::Exception::NotCompatibleError("The animation is not compatible with the model");
UpdateModelAnimation(this->_model, animation, animation.getFrameCounter());
return true;
}