void C_WeaponPortalgun::OnDataChanged( DataUpdateType_t updateType )
{
	BaseClass::OnDataChanged( updateType );

	if ( updateType == DATA_UPDATE_CREATED )
	{
		// Start thinking (Baseclass stops it)
		SetNextClientThink( CLIENT_THINK_ALWAYS );

		{
			C_BaseAnimating::AutoAllowBoneAccess boneaccess( true, true );
			StartEffects();
		}

		DoEffect( m_EffectState );
	}

	// Update effect state when out of parity with the server
	else if ( m_nOldEffectState != m_EffectState || m_bOldCanFirePortal1 != m_bCanFirePortal1 || m_bOldCanFirePortal2 != m_bCanFirePortal2 )
	{
		DoEffect( m_EffectState );
		m_nOldEffectState = m_EffectState;

		m_bOldCanFirePortal1 = m_bCanFirePortal1;
		m_bOldCanFirePortal2 = m_bCanFirePortal2;
	}
}
예제 #2
0
파일: ragdoll.cpp 프로젝트: BoXorz/MSS
//-----------------------------------------------------------------------------
// Purpose:
// Output : 	virtual void
//-----------------------------------------------------------------------------
void C_ServerRagdoll::UpdateOnRemove()
{
    C_BaseAnimating *anim = m_hUnragdoll.Get();
    if ( NULL != anim &&
            anim->GetModel() &&
            ( anim->GetModel() == GetModel() ) )
    {
        // Need to tell C_BaseAnimating to blend out of the ragdoll data that we received last
        C_BaseAnimating::AutoAllowBoneAccess boneaccess( true, false );
        anim->CreateUnragdollInfo( this );
    }

    // Do last to mimic destrictor order
    BaseClass::UpdateOnRemove();
}
예제 #3
0
//-----------------------------------------------------------------------------
// Returns the attachment render origin + origin
//-----------------------------------------------------------------------------
void C_VGuiScreen::GetAimEntOrigin( IClientEntity *pAttachedTo, Vector *pOrigin, QAngle *pAngles )
{
	C_BaseEntity *pEnt = pAttachedTo->GetBaseEntity();
	const char* panelName = PanelName();
	vgui::Panel panel = m_PanelWrapper.GetPanel();
		
	if ( Q_strcmp(panelName, "health_screen") == 0 )
	{
		QAngle weapAngles = pEnt->GetAbsAngles();
		Vector weapForward, weapRight, weapUp;
		AngleVectors(weapAngles, &weapForward, &weapRight, &weapUp);
		
		VMatrix worldFromPanel;
		AngleMatrix(weapAngles, worldFromPanel.As3x4());
		MatrixRotate(worldFromPanel, Vector(0, 0, 1), 180.f);
		MatrixRotate(worldFromPanel, Vector(1, 0, 0), -90.f);
		MatrixAngles(worldFromPanel.As3x4(), *pAngles);
	
		// move it right and over
		*pOrigin = pEnt->GetAbsOrigin() + weapRight*1.75 + weapUp*2.3 + weapForward*5;
		
		return;
	}
	
	//todo: set alpha per view ... m_PanelWrapper.GetPanel()->SetAlpha(200);
	
	if (pEnt && (m_nAttachmentIndex > 0))
	{
		{
			C_BaseAnimating::AutoAllowBoneAccess boneaccess( true, true );
			pEnt->GetAttachment( m_nAttachmentIndex, *pOrigin, *pAngles );
		}
		
		if ( IsAttachedToViewModel() )
		{
			FormatViewModelAttachment( *pOrigin, true );
		}
	}
	else
	{
		BaseClass::GetAimEntOrigin( pAttachedTo, pOrigin, pAngles );
	}

	// Msg("%s origin %.1f %.1f %.1f angles %.1f %.1f %.1f \n", PanelName(), pOrigin->x, pOrigin->y, pOrigin->z, pAngles->x, pAngles->y, pAngles->z);

}
//-----------------------------------------------------------------------------
// Returns the attachment render origin + origin
//-----------------------------------------------------------------------------
void C_VGuiScreen::GetAimEntOrigin( IClientEntity *pAttachedTo, Vector *pOrigin, QAngle *pAngles )
{
	C_BaseEntity *pEnt = pAttachedTo->GetBaseEntity();
	if (pEnt && (m_nAttachmentIndex > 0))
	{
		{
			C_BaseAnimating::AutoAllowBoneAccess boneaccess( true, true );
			pEnt->GetAttachment( m_nAttachmentIndex, *pOrigin, *pAngles );
		}
		
		if ( IsAttachedToViewModel() )
		{
			FormatViewModelAttachment( *pOrigin, true );
		}
	}
	else
	{
		BaseClass::GetAimEntOrigin( pAttachedTo, pOrigin, pAngles );
	}
}