123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100 |
-
-
- #include <cstddef>
- #include "SkeletalModel.h"
-
- SkeletalModel::SkeletalModel() {
- model = NULL;
- mBoneFrame = 0;
- mAnimationFrame = 0;
- mIdleAnimation = 0;
- }
-
- SkeletalModel::~SkeletalModel() {
-
-
-
-
- }
-
- int SkeletalModel::getAnimation() {
- return mAnimationFrame;
- }
-
- int SkeletalModel::getFrame() {
- return mBoneFrame;
- }
-
- int SkeletalModel::getIdleAnimation() {
- return mIdleAnimation;
- }
-
- void SkeletalModel::setModel(skeletal_model_t *mdl) {
- if (mdl)
- model = mdl;
- }
-
- void SkeletalModel::setAnimation(int index) {
- if (!model)
- return;
-
- animation_frame_t *a = model->animation[index];
-
- if (a) {
- mAnimationFrame = index;
- mBoneFrame = 0;
- }
- }
-
- void SkeletalModel::setFrame(int index) {
- if (!model)
- return;
-
- animation_frame_t *a = model->animation[mAnimationFrame];
-
- if (a) {
- bone_frame_t *b = a->frame[index];
-
- if (b)
- mBoneFrame = index;
- }
- }
-
- void SkeletalModel::setIdleAnimation(int index) {
- if (!model)
- return;
-
- if (model->animation[index])
- mIdleAnimation = index;
- }
|