1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 |
- //
- // RedMixAnimationBakeModel.hpp
- // cocos2d_libs
- //
- // Created by Liang zhong on 2022/11/12.
- //
- #ifndef RedMixAnimationBakeModel_h
- #define RedMixAnimationBakeModel_h
- #include "RedAnimationBakeModel.h"
- #include "RedSpineBakeManage.h"
- #include <stdio.h>
- struct MIX_BAKE_FRAME_PLAY {
- bool slotCanBemixed;
- cocos2d::Texture2D *texture;
- BlendFunc blendFuc;
- cocos2d::TrianglesCommand::Triangles preTriangles;
- cocos2d::TrianglesCommand::Triangles nextTriangles;
- cocos2d::TrianglesCommand::Triangles currentTriangles;
- };
- struct link_Bone_Point{
- Point nextPos;
- Point prePos;
- };
- //x1+(x2-x1)currentFrame/totalFrame;
- class RedMixAnimationBakeModel:public RedAnimationBakeModel{
- public:
- static bool animationCanbeMix(std::string aPreAniName,std::string aNextAniName,std::string aFileName);
- ~RedMixAnimationBakeModel();
- bool setMixInfo(int currentFrame,float mixTime,const std::map<int,BKAE_FRAME_PLAY> aPreAniBakeFrame,std::string aNextAniName,std::string aPreAniName,std::string aFileName,Point aDis);
- bool isMixAnimation() override;
- int getSlotCount() override;
-
-
- cocos2d::Texture2D* getTexture(int slotIndex);
- BlendFunc getBlendFunc(int slotIndex);
- cocos2d::TrianglesCommand::Triangles getTriangles(int slotIndex,float aRealCurrentBakeFrame);
- RedAnimationBakeModel *getNextAnimation();
- std::vector<int> getMixBakeFrameArrAllKey();
-
- const Point& getABakeModePoint(std::string aName,int aFrame) override;
-
- private:
- RedAnimationBakeModel *nextAnimation = nullptr; //下一个要播放的动画
- RedAnimationBakeModel *preAnimation = nullptr; //下一个要播放的动画
-
-
-
- std::map<int,BKAE_FRAME_PLAY> preBakeFrameArr;
- std::map<int,BKAE_FRAME_PLAY> nextBakeFrameArr;
- std::map<int,MIX_BAKE_FRAME_PLAY> mixBakeFrameArr;
-
- std::map<std::string,link_Bone_Point> mixLinkBone;
- Point currentDisPos; //用来处理两个Node连接初始位子偏移问题
- Point currentBonePos; //当前骨骼位移,临时变量,防止getABakeModePoint自动释放pos用
- };
- #endif /* RedMixAnimationBakeModel_h */
|