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


C++ CAI_Stalker::sight方法代码示例

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


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

示例1:

void CScriptGameObject::set_sight		(const CMemoryInfo *memory_object, bool	torso_look)
{
	CAI_Stalker					*stalker = smart_cast<CAI_Stalker*>(&object());
	if (!stalker)
		ai().script_engine().script_log					(ScriptStorage::eLuaMessageTypeError,"CSightManager : cannot access class member set_sight!");
	else
		stalker->sight().setup	(memory_object,torso_look);
}
开发者ID:,项目名称:,代码行数:8,代码来源:

示例2: Fvector

CSightParams CScriptGameObject::sight_params	()
{
	CAI_Stalker						*stalker = smart_cast<CAI_Stalker*>(&object());
	if (!stalker) {
		ai().script_engine().script_log			(ScriptStorage::eLuaMessageTypeError,"CAI_Stalker : cannot access class member sight_params!");

		CSightParams				result;
		result.m_object				= 0;
		result.m_vector				= Fvector().set(flt_max,flt_max,flt_max);
		result.m_sight_type			= SightManager::eSightTypeDummy;
		return						(result);
	}

	const CSightControlAction		&action = stalker->sight().current_action();
	CSightParams					result;
	result.m_sight_type				= action.sight_type();
	result.m_object					= action.object_to_look() ? action.object_to_look()->lua_game_object() : 0;
	result.m_vector					= action.vector3d();
	return							(result);
}
开发者ID:OLR-xray,项目名称:XRay-NEW,代码行数:20,代码来源:script_game_object4.cpp

示例3:

TEMPLATE_SPECIALIZATION
void _detail::callback		(CBoneInstance *B)
{
	CAI_Stalker*			A = static_cast<CAI_Stalker*>(B->Callback_Param);
	VERIFY					(_valid(B->mTransform));
	Fvector c				= B->mTransform.c;
	Fmatrix					spin;
	float					yaw_factor = 0, pitch_factor = 0;
	if (A->sight().use_torso_look()) {
		yaw_factor			= yaw_factor_fire/100.f;
		pitch_factor		= pitch_factor_fire/100.f;
	}
	else {
		yaw_factor			= yaw_factor_non_fire/100.f;
		pitch_factor		= pitch_factor_non_fire/100.f;
	}

	float					effector_yaw = 0.f, effector_pitch = 0.f;
	if (A->weapon_shot_effector().IsActive()) {
		Fvector				temp;
		A->weapon_shot_effector().GetDeltaAngle(temp);
		effector_yaw		= temp.y;
		VERIFY				(_valid(effector_yaw));
		effector_pitch		= temp.x;
		VERIFY				(_valid(effector_pitch));
	}

	VERIFY					(_valid(A->movement().head_orientation().current.yaw));
	VERIFY					(_valid(A->movement().body_orientation().current.yaw));
	VERIFY					(_valid(A->NET_Last.o_torso.pitch));

	float					yaw		= angle_normalize_signed(-yaw_factor * angle_normalize_signed(A->movement().head_orientation().current.yaw + effector_yaw - (A->movement().body_orientation().current.yaw)));
	float					pitch	= angle_normalize_signed(-pitch_factor * angle_normalize_signed(A->NET_Last.o_torso.pitch + effector_pitch));
	VERIFY					(_valid(yaw));
	VERIFY					(_valid(pitch));

	spin.setXYZ				(pitch, yaw, 0);
	VERIFY					(_valid(spin));
	B->mTransform.mulA_43	(spin);
	B->mTransform.c			= c;
}
开发者ID:OLR-xray,项目名称:OLR-3.0,代码行数:41,代码来源:stalker_animation_callbacks.cpp


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