Updated raylib-cpp header files
This commit is contained in:
@@ -1,26 +1,24 @@
|
||||
#ifndef RAYLIB_CPP_INCLUDE_MODELANIMATION_HPP_
|
||||
#define RAYLIB_CPP_INCLUDE_MODELANIMATION_HPP_
|
||||
|
||||
#include <vector>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "./raylib.hpp"
|
||||
#include "./raylib-cpp-utils.hpp"
|
||||
#include "./Mesh.hpp"
|
||||
#include "./raylib-cpp-utils.hpp"
|
||||
#include "./raylib.hpp"
|
||||
|
||||
namespace raylib {
|
||||
/**
|
||||
* Model animation
|
||||
*/
|
||||
class ModelAnimation : public ::ModelAnimation {
|
||||
public:
|
||||
ModelAnimation(const ::ModelAnimation& model) {
|
||||
set(model);
|
||||
}
|
||||
public:
|
||||
ModelAnimation(const ::ModelAnimation& model) { set(model); }
|
||||
|
||||
ModelAnimation(const ModelAnimation&) = delete;
|
||||
|
||||
ModelAnimation(ModelAnimation&& other) {
|
||||
ModelAnimation(ModelAnimation&& other) noexcept {
|
||||
set(other);
|
||||
|
||||
other.boneCount = 0;
|
||||
@@ -29,9 +27,7 @@ class ModelAnimation : public ::ModelAnimation {
|
||||
other.framePoses = nullptr;
|
||||
}
|
||||
|
||||
~ModelAnimation() {
|
||||
Unload();
|
||||
}
|
||||
~ModelAnimation() { Unload(); }
|
||||
|
||||
/**
|
||||
* Load model animations from file
|
||||
@@ -77,35 +73,43 @@ class ModelAnimation : public ::ModelAnimation {
|
||||
/**
|
||||
* Unload animation data
|
||||
*/
|
||||
inline void Unload() {
|
||||
::UnloadModelAnimation(*this);
|
||||
}
|
||||
void Unload() { ::UnloadModelAnimation(*this); }
|
||||
|
||||
/**
|
||||
* Update model animation pose
|
||||
*/
|
||||
inline ModelAnimation& Update(const ::Model& model, int frame) {
|
||||
ModelAnimation& Update(const ::Model& model, int frame) {
|
||||
::UpdateModelAnimation(model, *this, frame);
|
||||
return *this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Update model animation mesh bone matrices (GPU skinning)
|
||||
*/
|
||||
ModelAnimation& UpdateBones(const ::Model& model, int frame) {
|
||||
::UpdateModelAnimationBones(model, *this, frame);
|
||||
return *this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check model animation skeleton match
|
||||
*/
|
||||
inline bool IsValid(const ::Model& model) const {
|
||||
return ::IsModelAnimationValid(model, *this);
|
||||
}
|
||||
|
||||
protected:
|
||||
[[nodiscard]] bool IsValid(const ::Model& model) const { return ::IsModelAnimationValid(model, *this); }
|
||||
protected:
|
||||
void set(const ::ModelAnimation& model) {
|
||||
boneCount = model.boneCount;
|
||||
frameCount = model.frameCount;
|
||||
bones = model.bones;
|
||||
framePoses = model.framePoses;
|
||||
|
||||
// Duplicate the name. TextCopy() uses the null terminator, which we ignore here.
|
||||
for (int i = 0; i < 32; i++) {
|
||||
name[i] = model.name[i];
|
||||
}
|
||||
}
|
||||
};
|
||||
} // namespace raylib
|
||||
} // namespace raylib
|
||||
|
||||
using RModelAnimation = raylib::ModelAnimation;
|
||||
|
||||
#endif // RAYLIB_CPP_INCLUDE_MODELANIMATION_HPP_
|
||||
#endif // RAYLIB_CPP_INCLUDE_MODELANIMATION_HPP_
|
||||
|
Reference in New Issue
Block a user