当前位置: 首页>>代码示例>>C++>>正文


C++ Animation::addActionInFrame方法代码示例

本文整理汇总了C++中Animation::addActionInFrame方法的典型用法代码示例。如果您正苦于以下问题:C++ Animation::addActionInFrame方法的具体用法?C++ Animation::addActionInFrame怎么用?C++ Animation::addActionInFrame使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Animation的用法示例。


在下文中一共展示了Animation::addActionInFrame方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: prepareJumpAnim

void prepareJumpAnim(Scene* s) {
	Animation* prepareJump = new Animation;
	prepareJump->setFrameDuration(0.5);
	prepareJump->setScene(s);

	Animation* stand = new Animation;
	stand->setFrameDuration(0.5);
	stand->setScene(s);
	
	float h1pos1[3] = {0.0, 0.0, 0.0};
	float h1pos2[3] = {-30.0, 0.0, 0.0};
	float h2pos1[3] = {0.0, 0.0, 0.0};
	float h2pos2[3] = {120.0, 0.0, 0.0};
	float h3pos1[3] = {0.0, 0.0, 0.0};
	float h3pos2[3] = {-120.0, 0.0, 0.0};
	float cpos1[3] = {0.0, 0.0, 0.0};
	float cpos2[3] = {30.0, 0.0, 0.0};
	
	prepareJump->addActionInFrame("haste1R", h1pos1, 'r', 0);
	prepareJump->addActionInFrame("haste1R", h1pos2, 'r', 1);
	prepareJump->addActionInFrame("haste2R", h2pos1, 'r', 0);
	prepareJump->addActionInFrame("haste2R", h2pos2, 'r', 1);
	prepareJump->addActionInFrame("haste3R", h3pos1, 'r', 0);
	prepareJump->addActionInFrame("haste3R", h3pos2, 'r', 1);
	prepareJump->addActionInFrame("cupulaR", cpos1, 'r', 0);
	prepareJump->addActionInFrame("cupulaR", cpos2, 'r', 1);

	stand->addActionInFrame("haste1R", h1pos2, 'r', 0);
	stand->addActionInFrame("haste1R", h1pos1, 'r', 1);
	stand->addActionInFrame("haste2R", h2pos2, 'r', 0);
	stand->addActionInFrame("haste2R", h2pos1, 'r', 1);
	stand->addActionInFrame("haste3R", h3pos2, 'r', 0);
	stand->addActionInFrame("haste3R", h3pos1, 'r', 1);
	stand->addActionInFrame("cupulaR", cpos2, 'r', 0);
	stand->addActionInFrame("cupulaR", cpos1, 'r', 1);

	s->addAnimation(prepareJump, "prepareJump");	
	s->addAnimation(stand, "stand");
}
开发者ID:Sudoka,项目名称:SceneGraph-1,代码行数:39,代码来源:testScenes.cpp

示例2: jumpAnim

void jumpAnim(Scene* s) {
	Animation* jump = new Animation;
	jump->setScene(s);
	jump->setFrameDuration(0.5);
	s->addAnimation(jump, "jump");

	Animation* reverseJump = new Animation;
	reverseJump->setScene(s);
	reverseJump->setFrameDuration(0.5);
	s->addAnimation(reverseJump, "reverseJump");

	float h1pos1[3] = {-30.0, 0.0, 0.0};
	float h2pos1[3] = {120.0, 0.0, 0.0};
	float h3pos1[3] = {-120.0, 0.0, 0.0};
	float cpos1[3] = {30.0, 0.0, 0.0};

	jump->addActionInFrame("haste1R", h1pos1, 'r', 0);
	jump->addActionInFrame("haste2R", h2pos1, 'r', 0);
	jump->addActionInFrame("haste3R", h3pos1, 'r', 0);
	jump->addActionInFrame("cupulaR", cpos1, 'r', 0);

	float btpos2[3] = {0.0, 0.0, 0.0};
	float brpos2[3] = {0.0, 0.0, 0.0};
	float h1pos2[3] = {-40.0, 0.0, 0.0};
	float h2pos2[3] = {150.0, 0.0, 0.0};
	float h3pos2[3] = {-145.0, 0.0, 0.0};
	float cpos2[3] = {60.0, 0.0, 0.0};
	
	jump->addActionInFrame("baseR", brpos2, 'r', 1);
	jump->addActionInFrame("baseT", btpos2, 't', 1);
	jump->addActionInFrame("haste1R", h1pos2, 'r', 1);
	jump->addActionInFrame("haste2R", h2pos2, 'r', 1);
	jump->addActionInFrame("haste3R", h3pos2, 'r', 1);
	jump->addActionInFrame("cupulaR", cpos2, 'r', 1);

	float btpos3[3] = {0.0, 30.0, 50.0};
	float brpos3[3] = {-30.0, 0.0, 0.0};
	float h1pos3[3] = {10.0, 0.0, 0.0};
	float h2pos3[3] = {50.0, 0.0, 0.0};
	float h3pos3[3] = {-50.0, 0.0, 0.0};
	float cpos3[3] = {65.0, 0.0, 0.0};
	
	jump->addActionInFrame("baseR", brpos3, 'r', 2);
	jump->addActionInFrame("baseT", btpos3, 't', 2);
	jump->addActionInFrame("haste1R", h1pos3, 'r', 2);
	jump->addActionInFrame("haste2R", h2pos3, 'r', 2);
	jump->addActionInFrame("haste3R", h3pos3, 'r', 2);
	jump->addActionInFrame("cupulaR", cpos3, 'r', 2);
	
	float brpos4[3] = {0.0, 0.0, 0.0};
	float btpos4[3] = {0.0, 0.0, 90.0};
	float h1pos4[3] = {-60.0, 0.0, 0.0};
	float h2pos4[3] = {160.0, 0.0, 0.0};
	float h3pos4[3] = {-165.0, 0.0, 0.0};
	float cpos4[3] = {60.0, 0.0, 0.0};
	
	jump->addActionInFrame("baseR", brpos4, 'r', 3);
	jump->addActionInFrame("baseT", btpos4, 't', 3);
	jump->addActionInFrame("haste1R", h1pos4, 'r', 3);
	jump->addActionInFrame("haste2R", h2pos4, 'r', 3);
	jump->addActionInFrame("haste3R", h3pos4, 'r', 3);
	jump->addActionInFrame("cupulaR", cpos4, 'r', 3);
	
	float btpos5[3] = {0.0f, 0.0f, 90.0f};	

	jump->addActionInFrame("baseT", btpos5, 't', 4);
	//This part is exactly the first frame
	jump->addActionInFrame("haste1R", h1pos1, 'r', 4);
	jump->addActionInFrame("haste2R", h2pos1, 'r', 4);
	jump->addActionInFrame("haste3R", h3pos1, 'r', 4);
	jump->addActionInFrame("cupulaR", cpos1, 'r', 4);
	
	//Reversing the jump

	reverseJump->addActionInFrame("haste1R", h1pos1, 'r', 0);	
	reverseJump->addActionInFrame("haste2R", h2pos1, 'r', 0);	
	reverseJump->addActionInFrame("haste3R", h3pos1, 'r', 0);	
	reverseJump->addActionInFrame("cupulaR", cpos1, 'r', 0);	
		
	reverseJump->addActionInFrame("baseR", brpos4, 'r', 1);
	reverseJump->addActionInFrame("baseT", btpos4, 't', 1);
	reverseJump->addActionInFrame("haste1R", h1pos4, 'r', 1);
	reverseJump->addActionInFrame("haste2R", h2pos4, 'r', 1);
	reverseJump->addActionInFrame("haste3R", h3pos4, 'r', 1);
	reverseJump->addActionInFrame("cupulaR", cpos4, 'r', 1);
	
	reverseJump->addActionInFrame("baseR", brpos3, 'r', 2);
	reverseJump->addActionInFrame("baseT", btpos3, 't', 2);
	reverseJump->addActionInFrame("haste1R", h1pos3, 'r', 2);
	reverseJump->addActionInFrame("haste2R", h2pos3, 'r', 2);
	reverseJump->addActionInFrame("haste3R", h3pos3, 'r', 2);
	reverseJump->addActionInFrame("cupulaR", cpos3, 'r', 2);

	reverseJump->addActionInFrame("baseR", brpos2, 'r', 3);
	reverseJump->addActionInFrame("baseT", btpos2, 't', 3);
	reverseJump->addActionInFrame("haste1R", h1pos2, 'r', 3);
	reverseJump->addActionInFrame("haste2R", h2pos2, 'r', 3);
	reverseJump->addActionInFrame("haste3R", h3pos2, 'r', 3);
	reverseJump->addActionInFrame("cupulaR", cpos2, 'r', 3);
	
//.........这里部分代码省略.........
开发者ID:Sudoka,项目名称:SceneGraph-1,代码行数:101,代码来源:testScenes.cpp


注:本文中的Animation::addActionInFrame方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。