From 3fd122391c5efeb6d40ca327cecbb2342f91f9d4 Mon Sep 17 00:00:00 2001 From: yangxiao Date: Mon, 18 Aug 2014 18:01:57 +0800 Subject: [PATCH] reset sprite3dtest --- .../Classes/Sprite3DTest/Sprite3DTest.cpp | 55 +++++++++---------- 1 file changed, 27 insertions(+), 28 deletions(-) diff --git a/tests/cpp-tests/Classes/Sprite3DTest/Sprite3DTest.cpp b/tests/cpp-tests/Classes/Sprite3DTest/Sprite3DTest.cpp index a9b76173ce..2410ffb068 100644 --- a/tests/cpp-tests/Classes/Sprite3DTest/Sprite3DTest.cpp +++ b/tests/cpp-tests/Classes/Sprite3DTest/Sprite3DTest.cpp @@ -46,7 +46,6 @@ static int sceneIdx = -1; static std::function createFunctions[] = { - CL(Sprite3DMirrorTest), CL(Sprite3DBasicTest), CL(Sprite3DHitTest), #if (CC_TARGET_PLATFORM != CC_PLATFORM_WP8) && (CC_TARGET_PLATFORM != CC_PLATFORM_WINRT) @@ -1272,17 +1271,17 @@ std::string Sprite3DMirrorTest::subtitle() const void Sprite3DMirrorTest::addNewSpriteWithCoords(Vec2 p) { - std::string fileName = "Sprite3DTest/orc.c3t"; + std::string fileName = "Sprite3DTest/orc.c3b"; auto sprite = Sprite3D::create(fileName); - sprite->setScale(6); + sprite->setScale(5); sprite->setRotation3D(Vec3(0,180,0)); addChild(sprite); sprite->setPosition( Vec2( p.x - 80, p.y) ); -// //test attach -// auto sp = Sprite3D::create("Sprite3DTest/axe.c3b"); -// sprite->getAttachNode("Bip001 R Hand")->addChild(sp); -// + //test attach + auto sp = Sprite3D::create("Sprite3DTest/axe.c3b"); + sprite->getAttachNode("Bip001 R Hand")->addChild(sp); + auto animation = Animation3D::create(fileName); if (animation) { @@ -1293,25 +1292,25 @@ void Sprite3DMirrorTest::addNewSpriteWithCoords(Vec2 p) _sprite = sprite; _hasWeapon = true; -// //create mirror Sprite3D -// sprite = Sprite3D::create(fileName); -// sprite->setScale(5); -// sprite->setScaleX(-5); -// sprite->setCullFace(GL_FRONT); -// sprite->setRotation3D(Vec3(0,180,0)); -// addChild(sprite); -// sprite->setPosition( Vec2( p.x + 80, p.y) ); -// -// //test attach -// sp = Sprite3D::create("Sprite3DTest/axe.c3b"); -// sprite->getAttachNode("Bip001 R Hand")->addChild(sp); -// -// animation = Animation3D::create(fileName); -// if (animation) -// { -// auto animate = Animate3D::create(animation); -// -// sprite->runAction(RepeatForever::create(animate)); -// } -// _mirrorSprite = sprite; + //create mirror Sprite3D + sprite = Sprite3D::create(fileName); + sprite->setScale(5); + sprite->setScaleX(-5); + sprite->setCullFace(GL_FRONT); + sprite->setRotation3D(Vec3(0,180,0)); + addChild(sprite); + sprite->setPosition( Vec2( p.x + 80, p.y) ); + + //test attach + sp = Sprite3D::create("Sprite3DTest/axe.c3b"); + sprite->getAttachNode("Bip001 R Hand")->addChild(sp); + + animation = Animation3D::create(fileName); + if (animation) + { + auto animate = Animate3D::create(animation); + + sprite->runAction(RepeatForever::create(animate)); + } + _mirrorSprite = sprite; }