TEST_F(AnimationAnimationStackTest, ElementAnimationsSorted) { play(makeAnimation(makeAnimationEffect(CSSPropertyFontSize, AnimatableDouble::create(1))).get(), 10); play(makeAnimation(makeAnimationEffect(CSSPropertyFontSize, AnimatableDouble::create(2))).get(), 15); play(makeAnimation(makeAnimationEffect(CSSPropertyFontSize, AnimatableDouble::create(3))).get(), 5); WillBeHeapHashMap<CSSPropertyID, RefPtrWillBeMember<Interpolation>> result = AnimationStack::activeInterpolations(&element->elementAnimations()->defaultStack(), 0, 0, Animation::DefaultPriority, 0); EXPECT_EQ(1u, result.size()); EXPECT_TRUE(interpolationValue(result.get(CSSPropertyFontSize))->equals(AnimatableDouble::create(3).get())); }
TEST_F(AnimationAnimationStackTest, CancelledAnimationPlayers) { WillBeHeapHashSet<RawPtrWillBeMember<const AnimationPlayer>> cancelledAnimationPlayers; RefPtrWillBeRawPtr<AnimationPlayer> player = play(makeAnimation(makeAnimationEffect(CSSPropertyFontSize, AnimatableDouble::create(1))).get(), 0); cancelledAnimationPlayers.add(player.get()); play(makeAnimation(makeAnimationEffect(CSSPropertyZIndex, AnimatableDouble::create(2))).get(), 0); WillBeHeapHashMap<CSSPropertyID, RefPtrWillBeMember<Interpolation>> result = AnimationStack::activeInterpolations(&element->elementAnimations()->defaultStack(), 0, &cancelledAnimationPlayers, Animation::DefaultPriority, 0); EXPECT_EQ(1u, result.size()); EXPECT_TRUE(interpolationValue(result.get(CSSPropertyZIndex))->equals(AnimatableDouble::create(2).get())); }
//캐릭터 생성함수 void CBaseChar::makeChar(const char * playerName, int x, int y) { std::string path; path.append("Resource/Char/"); path.append(playerName); path.append("/"); std::string bodypath; bodypath = path + "idel_0.png"; m_pBody = CSprite::create(bodypath.c_str()); std::string armpath; armpath = path; switch(m_eNowWeapon) { case Weapon_Nomal: armpath.append("handgun_1.png"); break; case Weapon_Double: armpath.append("handgun_2.png"); break; case Weapon_Tripel: armpath.append("handgun_3.png"); break; case Weapon_Multiple: armpath.append("itemgun_1.png"); break; case Weapon_BigMulti: armpath.append("itemgun_2.png"); break; } m_pArm = CSprite::create(armpath.c_str()); m_pBody->setAcp(ccp(0.5,0.5)); m_pBody->setPos(ccp(0,0)); addChild(m_pBody); m_pArm->setAcp(ccp(0.5,0.5)); m_pArm->setPos(ccp(x,y)); //setRect(m_pBody->getRect()); setAcp(ccp(0.5,0.5)); setBoundBox(m_pBody->getRect()); addChild(m_pArm); m_pIdel = makeAnimation(path.c_str(),"idel",true,2); m_pWalk = makeAnimation(path.c_str(),"run",true,4); m_pDie = makeAnimation(path.c_str(),"die",false,1); m_pNowAni = m_pIdel; }
TEST_F(AnimationAnimationStackTest, NewAnimations) { play(makeAnimation(makeAnimationEffect(CSSPropertyFontSize, AnimatableDouble::create(1))).get(), 15); play(makeAnimation(makeAnimationEffect(CSSPropertyZIndex, AnimatableDouble::create(2))).get(), 10); WillBeHeapVector<RawPtrWillBeMember<InertAnimation>> newAnimations; RefPtrWillBeRawPtr<InertAnimation> inert1 = makeInertAnimation(makeAnimationEffect(CSSPropertyFontSize, AnimatableDouble::create(3))); RefPtrWillBeRawPtr<InertAnimation> inert2 = makeInertAnimation(makeAnimationEffect(CSSPropertyZIndex, AnimatableDouble::create(4))); newAnimations.append(inert1.get()); newAnimations.append(inert2.get()); WillBeHeapHashMap<CSSPropertyID, RefPtrWillBeMember<Interpolation>> result = AnimationStack::activeInterpolations(&element->elementAnimations()->defaultStack(), &newAnimations, 0, Animation::DefaultPriority, 10); EXPECT_EQ(2u, result.size()); EXPECT_TRUE(interpolationValue(result.get(CSSPropertyFontSize))->equals(AnimatableDouble::create(3).get())); EXPECT_TRUE(interpolationValue(result.get(CSSPropertyZIndex))->equals(AnimatableDouble::create(4).get())); }
void testApp::setup(){ w = ofGetWidth(); h = ofGetHeight(); cout << ofGetVersionInfo() << endl; ofSetVerticalSync(true); ofSetFrameRate(60); attractor::init(); gps = new gpuPictoString(); cam.reset(); //cam.setOrientation(ofQuaternion(180, ofVec3f(1,0,0))); wc.loadImage("testPicture.jpg"); bg.set(240, 240, 240); gpuPictoString::prm.fontSize = 0.4; gpuPictoString::prm.iconDensity = 0.002; gpuPictoString::prm.iconSize = 0.03; gpuPictoString::prm.lineHeight = 1.1; gpuPictoString::prm.fontRandomness = 0.1; gpuPictoString::prm.letterSpacing = 1.1; gpuPictoString::prm.speed = 14; gpuPictoString::prm.accel = 14; gpuPictoString::prm.vibration = 0; gpuPictoString::prm.message = "ABC"; makeAnimation(); }
osg::Node* OpenGLESGeometryOptimizer::optimize(osg::Node& node) { osg::ref_ptr<osg::Node> model = osg::clone(&node); // animation: process bones/weights or remove all animation data if disabled makeAnimation(model.get()); // wireframe if (!_wireframe.empty()) { makeWireframe(model.get()); } // bind per vertex makeBindPerVertex(model.get()); // index (merge exact duplicates + uses simple triangles & lines i.e. no strip/fan/loop) makeIndexMesh(model.get()); // smooth vertex normals (if geometry has no normal compute smooth normals) makeSmoothNormal(model.get()); // tangent space if (_generateTangentSpace) { makeTangentSpace(model.get()); } if(!_useDrawArray) { // split geometries having some primitive index > _maxIndexValue makeSplit(model.get()); } // strip if(!_disableTriStrip) { makeTriStrip(model.get()); } if(_useDrawArray) { // drawelements to drawarrays makeDrawArray(model.get()); } else if(!_disablePreTransform) { // pre-transform makePreTransform(model.get()); } // detach wireframe makeDetach(model.get()); return model.release(); }