mirror of https://github.com/axmolengine/axmol.git
node frame animation test and resource
This commit is contained in:
parent
ecfd66cda3
commit
f93dffdeb0
|
@ -139,26 +139,14 @@ Node* findChildByNameRecursively(Node* node, const std::string &childName)
|
|||
//! called before the action start. It will also set the target.
|
||||
void Animate3D::startWithTarget(Node *target)
|
||||
{
|
||||
// Sprite3D* sprite = dynamic_cast<Sprite3D*>(target);
|
||||
// CCASSERT(sprite && sprite->getSkeleton() && _animation, "Animate3D apply to Sprite3D only");
|
||||
|
||||
ActionInterval::startWithTarget(target);
|
||||
|
||||
_boneCurves.clear();
|
||||
_nodeCurves.clear();
|
||||
|
||||
// auto skin = sprite->getSkeleton();
|
||||
bool hasCurve = false;
|
||||
// for (int i = 0; i < skin->getBoneCount(); i++) {
|
||||
// auto bone = skin->getBoneByIndex(static_cast<unsigned int>(i));
|
||||
// auto curve = _animation->getBoneCurveByName(bone->getName());
|
||||
// if (curve)
|
||||
// {
|
||||
// _boneCurves[bone] = curve;
|
||||
// hasCurve = true;
|
||||
// }
|
||||
// }
|
||||
Sprite3D* sprite = dynamic_cast<Sprite3D*>(target);
|
||||
|
||||
if(sprite)
|
||||
{
|
||||
if (_animation)
|
||||
|
|
|
@ -478,6 +478,7 @@ void Sprite3D::createNode(NodeData* nodedata, Node* root, const MaterialDatas& m
|
|||
{
|
||||
if(it->bones.size() > 0 || singleSprite)
|
||||
{
|
||||
this->setName(nodedata->id);
|
||||
auto mesh = Mesh::create(nodedata->id, getMeshIndexData(it->subMeshId));
|
||||
if(mesh)
|
||||
{
|
||||
|
|
|
@ -71,7 +71,8 @@ static std::function<Layer*()> createFunctions[] =
|
|||
CL(QuaternionTest),
|
||||
CL(Sprite3DEmptyTest),
|
||||
CL(UseCaseSprite3D),
|
||||
CL(Sprite3DForceDepthTest)
|
||||
CL(Sprite3DForceDepthTest),
|
||||
CL(NodeFrameAnimationTest)
|
||||
};
|
||||
|
||||
#define MAX_LAYER (sizeof(createFunctions) / sizeof(createFunctions[0]))
|
||||
|
@ -2338,7 +2339,7 @@ void UseCaseSprite3D::update(float delta)
|
|||
}
|
||||
|
||||
/////////////////////////////////////////////
|
||||
// KeyFrameAnimate
|
||||
// Node Frame Animation
|
||||
NodeFrameAnimationTest::NodeFrameAnimationTest()
|
||||
:_vectorIndex(0)
|
||||
{
|
||||
|
|
|
@ -491,6 +491,7 @@ protected:
|
|||
std::string _useCaseTitles[(int)USECASE::MAX_CASE_NUM];
|
||||
};
|
||||
|
||||
// node fame animation test
|
||||
class NodeFrameAnimationTest : public Sprite3DTestDemo
|
||||
{
|
||||
public:
|
||||
|
|
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue