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


C++ FnObject::SetParent方法代码示例

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


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

示例1: initLife

BOOL ActorStateMachine::initLife(){
	this->life = (int) MAX_LIFE;

	FnScene scene;
	scene.Object(sID);
	bloodID = scene.CreateObject(ROOT);
	FnObject blood;
	blood.Object(bloodID);
	//FnBillBoard blood;
	//blood.Object(bloodID, 0);
	FnActor actor;
	actor.Object(this->character);
	OBJECTid baseID = actor.GetBaseObject();

	float pos[3], size[2], color[3];
	pos[0] = 0.0f;
	pos[1] = 0.0f;
	pos[2] = 80.0f;
	size[0] = 50.0f;
	size[1] = 2.0f;
	color[0] = 1.0f; color[1] = color[2] = 0.0f;
	blood.Billboard(pos, size, NULL, 0, color);
	blood.SetParent(baseID);
	return TRUE;
}
开发者ID:trantorLiu,项目名称:GameProgramming,代码行数:25,代码来源:ActorStateMachine.cpp

示例2: OurAction


//.........这里部分代码省略.........
	ourHeavyAttack1Action->keyFrames[0]->damage_pt = 100;
	ourHeavyAttack1Action->keyFrames[1] = new OurFrame;
	ourHeavyAttack1Action->keyFrames[1]->frameNO = 42;
	ourHeavyAttack1Action->keyFrames[1]->start_angle = 270;
	ourHeavyAttack1Action->keyFrames[1]->plus_angle = 180;
	ourHeavyAttack1Action->keyFrames[1]->valid_dis = 200;
	ourHeavyAttack1Action->keyFrames[1]->damage_pt = 90;
	ourHeavyAttack1Action->keyFrames[2] = new OurFrame;
	ourHeavyAttack1Action->keyFrames[2]->frameNO = 70;
	ourHeavyAttack1Action->keyFrames[2]->start_angle = 0;
	ourHeavyAttack1Action->keyFrames[2]->plus_angle = 360;
	ourHeavyAttack1Action->keyFrames[2]->valid_dis = 200;
	ourHeavyAttack1Action->keyFrames[2]->damage_pt = 80;

	ourHeavyAttack2Action = new OurAction();
	ourHeavyAttack2Action->actID = actor.GetBodyAction(NULL, "HeavyAttack");
	ourHeavyAttack2Action->isAttack = true;
	ourHeavyAttack2Action->frames_num = 0;
	ourHeavyAttack2Action->play_speed = 1;
	ourHeavyAttack2Action->priority = ourAttack1Action->priority + 10;
	ourHeavyAttack2Action->type.value = Action_type::ACTION_ATTACK();
	ourHeavyAttack2Action->numOfKeyFrames = 2;
	ourHeavyAttack2Action->keyFrames = new OurFrame*[2];
	ourHeavyAttack2Action->keyFrames[0] = new OurFrame;
	ourHeavyAttack2Action->keyFrames[0]->frameNO = 31;
	ourHeavyAttack2Action->keyFrames[0]->start_angle = 0;
	ourHeavyAttack2Action->keyFrames[0]->plus_angle = 270;
	ourHeavyAttack2Action->keyFrames[0]->valid_dis = 190;
	ourHeavyAttack2Action->keyFrames[0]->damage_pt = 80;
	ourHeavyAttack2Action->keyFrames[1] = new OurFrame;
	ourHeavyAttack2Action->keyFrames[1]->frameNO = 41;
	ourHeavyAttack2Action->keyFrames[1]->start_angle = 270;
	ourHeavyAttack2Action->keyFrames[1]->plus_angle = 180;
	ourHeavyAttack2Action->keyFrames[1]->valid_dis = 200;
	ourHeavyAttack2Action->keyFrames[1]->damage_pt = 120;

	//DamageL
	ourDamageLAction = new OurAction();
	ourDamageLAction->actID = actor.GetBodyAction(NULL, "DamageL");
	ourDamageLAction->frames_num = 0;
	ourDamageLAction->play_speed = 1.5;
	ourDamageLAction->priority = 100;
	ourDamageLAction->type.value = DonzoAction::ACTION_DAMAGED();
	//fx
	ourDamageLAction->numOfFxFrames = 1;
	ourDamageLAction->fxFrames = new OurFxFrame*[1];
	ourDamageLAction->fxFrames[0] = new OurFxFrame;
	ourDamageLAction->fxFrames[0]->frameNO = 1;
	ourDamageLAction->fxFrames[0]->fxName = AllFx::SmallHurt01;

	//DamageH
	ourDamageHAction = new OurAction();
	ourDamageHAction->actID = actor.GetBodyAction(NULL, "DamageH");
	ourDamageHAction->frames_num = 0;
	ourDamageHAction->play_speed = 1.5;
	ourDamageHAction->priority = 100;
	ourDamageHAction->type.value = DonzoAction::ACTION_DAMAGED();
	//fx
	ourDamageHAction->numOfFxFrames = 1;
	ourDamageHAction->fxFrames = new OurFxFrame*[1];
	ourDamageHAction->fxFrames[0] = new OurFxFrame;
	ourDamageHAction->fxFrames[0]->frameNO = 1;
	ourDamageHAction->fxFrames[0]->fxName = AllFx::BigHurt01;

	//Die
	ourDieAction = new OurAction();
	ourDieAction->actID = actor.GetBodyAction(NULL, "Die");
	ourDieAction->frames_num = 0;
	ourDieAction->play_speed = 1;
	ourDieAction->priority = 1000;
	ourDieAction->type.value = DonzoAction::ACTION_DIE();
	//fx
	ourDieAction->numOfFxFrames = 1;
	ourDieAction->fxFrames = new OurFxFrame*[1];
	ourDieAction->fxFrames[0] = new OurFxFrame;
	ourDieAction->fxFrames[0]->frameNO = 1;
	ourDieAction->fxFrames[0]->fxName = AllFx::smoke;

	//blood
	{
		FnObject blood;
		float pos[3], size[2], color[3];
		blood_length = 50;
		blood_width = 2;

		bloodID = scene.CreateObject(ROOT);
		blood.Object(bloodID);
		
		pos[0] = 0.0f;
		pos[1] = 0.0f;
		pos[2] = 100.0f;
		size[0] = blood_length;
		size[1] = blood_width;
		color[0] = 1.0f; color[1] = 0.8; color[2] = 0.2f;

		blood.Billboard(pos, size, NULL, 0, color);
		blood.SetParent(actor.GetBaseObject());
	}
	this->blood.Object(bloodID,0);
}
开发者ID:fikacschoko,项目名称:NTUGameProgramming2011,代码行数:101,代码来源:Donzo.cpp


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