123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112 |
- #pragma once
- #include "Array.h"
- #include "ReferenceCounter.h"
- #include "Vec3.h"
- namespace Framework
- {
- class Skeleton;
- class Bone;
- struct KeyFrame
- {
- double time = 0;
- Vec3<float> pos;
- Vec3<float> rot;
- };
- class BoneAnimation : public virtual ReferenceCounter
- {
- private:
- KeyFrame* frames;
- int boneId;
- KeyFrame current;
- int frameCount;
- double maxTime;
- bool loop;
- public:
-
-
-
-
-
-
- DLLEXPORT BoneAnimation(
- int boneId, Vec3<float> originPos, Vec3<float> originRot);
-
- DLLEXPORT ~BoneAnimation();
-
- DLLEXPORT void setLoop(bool loop);
-
-
-
-
-
- DLLEXPORT void addKeyFrame(
- double time, Vec3<float> pos, Vec3<float> rot);
-
-
-
- DLLEXPORT bool doNothingUntil(double time);
-
-
- DLLEXPORT void tick(double time);
-
-
- DLLEXPORT void apply(Skeleton* zSkelett) const;
-
-
- DLLEXPORT bool isFinished() const;
-
- DLLEXPORT int getBoneId() const;
-
- DLLEXPORT double getMaxTime() const;
- };
- class SkeletonAnimation : public virtual ReferenceCounter
- {
- private:
- RCArray<BoneAnimation> subAnimations;
- bool loop;
- public:
-
- DLLEXPORT SkeletonAnimation();
-
- DLLEXPORT void setLoop(bool loop);
-
-
-
-
-
-
- DLLEXPORT bool addAnimation(
- int boneId, Vec3<float> originPos, Vec3<float> originRot);
-
-
-
-
-
-
-
-
-
- DLLEXPORT bool addKeyFrame(
- int boneId, double time, Vec3<float> pos, Vec3<float> rot);
-
-
- DLLEXPORT void apply(Skeleton* zS) const;
-
-
- DLLEXPORT void tick(double time);
-
-
- DLLEXPORT bool isFinished() const;
-
- DLLEXPORT double getMaxTime() const;
-
- DLLEXPORT BoneAnimation* zAnimation(int boneId) const;
- };
- }
|