Beispiel #1
0
bool CColTube::DoHitDetection ( const CVector& vecNowPosition )
{
    // FIXME: What about radius in height?

    // First see if we're within the circle. Then see if we're within its height
    return ( IsPointNearPoint2D ( vecNowPosition, m_vecPosition, m_fRadius ) &&
             vecNowPosition.fZ >= m_vecPosition.fZ &&
             vecNowPosition.fZ <= m_vecPosition.fZ + m_fHeight );
}
Beispiel #2
0
bool CClientCheckpoint::IsHit ( const CVector& vecPosition ) const
{
    // Grab the type and do a 2D or 3D distance check depending on what type it is
    unsigned long ulType = GetCheckpointType ();
    if ( ulType == CClientCheckpoint::TYPE_NORMAL )
    {
        return IsPointNearPoint2D ( m_Matrix.vPos, vecPosition, m_fSize + 4 );
    }
    else
    {
        return IsPointNearPoint3D ( m_Matrix.vPos, vecPosition, m_fSize + 4 );
    }
}