ReGameDLL_CS/regamedll/dlls/plane.cpp
s1lentq 3d252fe527 Refactoring and cleanup.
Fixed some critical bugs and typos (carrer_task, tutor, zbot and other)
Added command line option `-bots` to run bots in CS 1.6
Removed the tests demo record/player from myself the project and also dependency of the steam library.
Fixed the progress bar when generating a nav file.
2016-02-23 05:23:45 +06:00

31 lines
517 B
C++

#include "precompiled.h"
CPlane::CPlane()
{
m_fInitialized = FALSE;
}
NOXREF void CPlane::InitializePlane(const Vector &vecNormal, const Vector &vecPoint)
{
m_vecNormal = vecNormal;
m_fInitialized = TRUE;
m_flDist = DotProduct(m_vecNormal, vecPoint);
}
NOXREF BOOL CPlane::PointInFront(const Vector &vecPoint)
{
if (!m_fInitialized)
{
return FALSE;
}
float flFace = DotProduct(m_vecNormal, vecPoint) - m_flDist;
if (flFace >= 0.0f)
{
return TRUE;
}
return FALSE;
}