mirror of
https://github.com/zoriya/Bomberman.git
synced 2025-12-20 13:25:10 +00:00
model is now a 3D drawable
This commit is contained in:
@@ -8,8 +8,8 @@
|
||||
#include "Model/Model.hpp"
|
||||
#include "Exceptions/RayError.hpp"
|
||||
|
||||
RAY::Model::Model(const std::string &filename):
|
||||
_model(LoadModel(filename.c_str()))
|
||||
RAY::Model::Model(const std::string &filePath, const RAY::Vector3 &position, const RAY::Vector3 &rotationAxis, float rotationAngle, const RAY::Vector3 &scale):
|
||||
ADrawable3D(position, WHITE), _model(LoadModel(filename.c_str()), position, rotationAxis, rotationAngle, scale)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -69,4 +69,42 @@ RAY::Model::operator ::Model() const
|
||||
int RAY::Model::getBoneCount() const
|
||||
{
|
||||
return this->_model.boneCount;
|
||||
}
|
||||
|
||||
RAY::Model &RAY::Model::setRotationAngle(float rotationAngle)
|
||||
{
|
||||
this->_rotationAngle = rotationAngle;
|
||||
return *this;
|
||||
}
|
||||
|
||||
float RAY::Model::getRotationAngle(void)
|
||||
{
|
||||
return this->_rotationAngle;
|
||||
}
|
||||
|
||||
RAY::Model &RAY::Model::setRotationAxix(const RAY::Vector3 &scale)
|
||||
{
|
||||
this->_scale = scale;
|
||||
return *this;
|
||||
}
|
||||
|
||||
const RAY::Vector3 &RAY::Model::getRotationAxix(void)
|
||||
{
|
||||
return this->_rotationAxis;
|
||||
}
|
||||
|
||||
RAY::Model &RAY::Model::setScale(const RAY::Vector3 &scale)
|
||||
{
|
||||
this->_scale = scale;
|
||||
return *this;
|
||||
}
|
||||
|
||||
const RAY::Vector3 &RAY::Model::getScale(void)
|
||||
{
|
||||
return this->_scale;
|
||||
}
|
||||
|
||||
void RAY::Model::drawOn(RAY::Window &)
|
||||
{
|
||||
DrawModelEx(this->_model, this->_position, this->_rotationAxis, this->_rotationAngle, this->_scale, this->_color);
|
||||
}
|
||||
Reference in New Issue
Block a user