本文整理汇总了C++中CBaseAnimating::IsDissolving方法的典型用法代码示例。如果您正苦于以下问题:C++ CBaseAnimating::IsDissolving方法的具体用法?C++ CBaseAnimating::IsDissolving怎么用?C++ CBaseAnimating::IsDissolving使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CBaseAnimating
的用法示例。
在下文中一共展示了CBaseAnimating::IsDissolving方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: StartTouch
//-----------------------------------------------------------------------------
// Purpose: Called when an entity starts touching us.
// Input : pOther - The entity that is touching us.
//-----------------------------------------------------------------------------
void CTriggerPortalCleanser::StartTouch( CBaseEntity *pOther )
{
if ( PassesTriggerFilters(pOther) )
{
EHANDLE hOther;
hOther = pOther;
bool bAdded = false;
if ( m_hTouchingEntities.Find( hOther ) == m_hTouchingEntities.InvalidIndex() )
{
m_hTouchingEntities.AddToTail( hOther );
bAdded = true;
}
m_OnStartTouch.FireOutput(pOther, this);
if ( bAdded && ( m_hTouchingEntities.Count() == 1 ) )
{
// First entity to touch us that passes our filters
m_OnStartTouchAll.FireOutput( pOther, this );
}
if ( portal_cleanser_debug.GetBool() )
{
Msg("%s START-TOUCH: for %s\n", GetDebugName(), pOther->GetDebugName() );
}
if ( !pOther->IsPlayer() )
{
CBaseAnimating *pAnim = pOther->GetBaseAnimating();
if ( !pAnim )
return;
// Can't dissolve twice.
if ( pAnim->IsDissolving() )
return;
// Force player to drop this object.
Pickup_ForcePlayerToDropThisObject( pOther );
if ( !FClassnameIs( pOther, "prop_physics" ) )
{
if ( FClassnameIs( pOther, "simple_physics_prop" ) || FClassnameIs( pOther, "simple_physics_brush" ) )
{
// simple_physics_prop ?
return;
}
if ( portal_cleanser_debug.GetBool() )
{
Msg("%s IS CREATING: simple_physics_prop\n", GetDebugName());
}
// Other object needs to be replaced by simple_physics_prop.
pOther = CreateSimplePhysicsObject( pOther );
// Dissolve the entity.
CBaseAnimating *pAnim = pOther->GetBaseAnimating();
pAnim->Dissolve( NULL, gpGlobals->curtime, false, ENTITY_DISSOLVE_NORMAL );
if ( portal_cleanser_debug.GetBool() )
{
Msg("%s DISSOLVE SIMPLE PHYSICS: %s\n", GetDebugName(), pOther->GetDebugName() );
}
// Outputs
m_hActivator = pOther;
m_OnDissolve.FireOutput(m_hActivator, this);
return;
}
IPhysicsObject *pPhysics = pOther->VPhysicsGetObject();
if ( pPhysics )
{
// Dissolve the entity.
pAnim->Dissolve( NULL, gpGlobals->curtime, false, ENTITY_DISSOLVE_NORMAL );
if ( portal_cleanser_debug.GetBool() )
{
Msg("%s DISSOLVE PHYSICS: %s\n", GetDebugName(), pOther->GetDebugName() );
}
// Turn off the gravity for this object.
pPhysics->EnableGravity( false );
// Slow down and push up the object.
Vector vecVelocity, vecAngular;
pPhysics->GetVelocity( &vecVelocity, &vecAngular );
vecVelocity /= 2;
vecAngular /= 2;
vecVelocity.z += 10;
pPhysics->SetVelocity( &vecVelocity, &vecAngular );
// Outputs
m_hActivator = pOther;
m_OnDissolve.FireOutput(m_hActivator, this);
//.........这里部分代码省略.........