コード例 #1
0
void CCharacterPhysicsSupport::update_interactive_anims	()
{
	if ( Type() != etStalker )
		return;
	VERIFY( m_EntityAlife.cast_stalker( ) );
	CAI_Stalker	*stalker = m_EntityAlife.cast_stalker( );
	CBlend *b = stalker->animation().global().blend();
	if( b && !m_interactive_animation && stalker->animation().global().callback_on_collision() )
		run_interactive	( b );
	if( m_interactive_animation && !m_interactive_animation->update( m_EntityAlife.XFORM( ) ) )
		xr_delete( m_interactive_animation );
		
}
コード例 #2
0
void CStalkerAnimationManager::script_play_callback(CBlend *blend)
{
	CAI_Stalker					*object = (CAI_Stalker*)blend->CallbackParam;
	VERIFY						(object);
	
	CStalkerAnimationManager	&animation_manager = object->animation();
	CStalkerAnimationPair		&pair = animation_manager.script();
	const SCRIPT_ANIMATIONS		&animations = animation_manager.script_animations();

#if 0
	Msg							(
		"%6d Script callback [%s]",
		Device.dwTimeGlobal,
		animations.empty()
		?
		"unknown"
		:
		animation_manager.m_skeleton_animated->LL_MotionDefName_dbg(animations.front().animation())
	);
#endif

	if	(
			pair.animation() && 
			!animations.empty() && 
			(pair.animation() == animations.front().animation())
		)
		animation_manager.pop_script_animation();

	animation_manager.m_call_script_callback	= true;

	pair.on_animation_end		();
}
コード例 #3
0
void CStalkerAnimationManager::legs_play_callback			(CBlend *blend)
{
	CAI_Stalker					*object = (CAI_Stalker*)blend->CallbackParam;
	VERIFY						(object);

	CStalkerAnimationPair		&pair = object->animation().legs();
	pair.on_animation_end		();
}
コード例 #4
0
int	CScriptGameObject::animation_count		() const
{
	CAI_Stalker			*stalker = smart_cast<CAI_Stalker*>(&object());
	if (!stalker) {
		ai().script_engine().script_log		(ScriptStorage::eLuaMessageTypeError,"CGameObject : cannot access class member clear_animations!");
		return			(-1);
	}
	return				((int)stalker->animation().script_animations().size());
}
コード例 #5
0
void CScriptGameObject::clear_animations		()
{
	CAI_Stalker			*stalker = smart_cast<CAI_Stalker*>(&object());
	if (!stalker) {
		ai().script_engine().script_log		(ScriptStorage::eLuaMessageTypeError,"CGameObject : cannot access class member clear_animations!");
		return;
	}
	stalker->animation().clear_script_animations();
}
コード例 #6
0
void CScriptGameObject::add_animation			(LPCSTR animation, bool hand_usage, bool use_movement_controller)
{
	CAI_Stalker			*stalker = smart_cast<CAI_Stalker*>(&object());
	if (!stalker) {
		ai().script_engine().script_log		(ScriptStorage::eLuaMessageTypeError,"CGameObject : cannot access class member add_animation!");
		return;
	}
	
	stalker->animation().add_script_animation(animation,hand_usage,use_movement_controller);
}
コード例 #7
0
bool CScriptGameObject::special_danger_move			()
{
	CAI_Stalker							*stalker = smart_cast<CAI_Stalker*>(&object());
	if (!stalker) {
		ai().script_engine().script_log	(ScriptStorage::eLuaMessageTypeError,"CAI_Stalker : cannot access class member special_danger_move!");
		return							(false);
	}

	return								(stalker->animation().special_danger_move());
}