本文整理汇总了C++中CBaseDoor::GetLocalAvelocity方法的典型用法代码示例。如果您正苦于以下问题:C++ CBaseDoor::GetLocalAvelocity方法的具体用法?C++ CBaseDoor::GetLocalAvelocity怎么用?C++ CBaseDoor::GetLocalAvelocity使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CBaseDoor
的用法示例。
在下文中一共展示了CBaseDoor::GetLocalAvelocity方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Blocked
void CBaseDoor::Blocked( CBaseEntity *pOther )
{
// hurt the blocker a little.
if( pev->dmg ) pOther->TakeDamage( pev, pev, pev->dmg, DMG_CRUSH );
// if a door has a negative wait, it would never come back if blocked,
// so let it just squash the object to death real fast
if( m_flWait >= 0 )
{
if( !FBitSet( pev->spawnflags, SF_DOOR_SILENT ))
STOP_SOUND( edict(), CHAN_STATIC, STRING( pev->noise1 ));
if( m_iState == STATE_TURN_OFF )
{
DoorGoUp();
}
else
{
DoorGoDown();
}
}
// block all door pieces with the same targetname here.
if( !FStringNull( pev->targetname ))
{
CBaseDoor *pDoorList[64];
int doorCount = GetDoorMovementGroup( pDoorList, ARRAYSIZE( pDoorList ));
for( int i = 0; i < doorCount; i++ )
{
CBaseDoor *pDoor = pDoorList[i];
if( pDoor->m_flWait >= 0)
{
if( m_bDoorGroup && pDoor->pev->movedir == pev->movedir && pDoor->GetAbsVelocity() == GetAbsVelocity() && pDoor->GetLocalAvelocity() == GetLocalAvelocity( ))
{
pDoor->m_iPhysicsFrame = g_ulFrameCount; // don't run physics this frame if you haven't run yet
// this is the most hacked, evil, bastardized thing I've ever seen. kjb
if( !pDoor->IsRotatingDoor( ))
{
// set origin to realign normal doors
pDoor->SetLocalOrigin( GetLocalOrigin( ));
pDoor->SetAbsVelocity( g_vecZero ); // stop!
}
else
{
// set angles to realign rotating doors
pDoor->SetLocalAngles( GetLocalAngles( ));
pDoor->SetLocalAvelocity( g_vecZero );
}
}
if( pDoor->m_iState == STATE_TURN_OFF )
pDoor->DoorGoUp();
else pDoor->DoorGoDown();
}
}
}
}