node frame animation test and resource

This commit is contained in:
lvlong 2015-03-26 09:25:37 +08:00
parent ecfd66cda3
commit f93dffdeb0
6 changed files with 13582 additions and 15 deletions

View File

@ -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)

View File

@ -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)
{

View File

@ -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)
{

View File

@ -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