Skip to content

Instantly share code, notes, and snippets.

@PoetaKodu
Created April 8, 2017 19:42
Show Gist options
  • Save PoetaKodu/0d8c4a079debbff32bdb921cb8453943 to your computer and use it in GitHub Desktop.
Save PoetaKodu/0d8c4a079debbff32bdb921cb8453943 to your computer and use it in GitHub Desktop.
////////////////////////////////////////////////
bool CSightSense::SetSightDistance(const float & sightDistance)
{
/* Musimy zapobiedz ustawieniu ujemnego zasiegu wzroku. */
if (sightDistance > 0)
{
m_sightDistance = sightDistance;
return true;
}
return false;
}
////////////////////////////////////////////////
bool CSightSense::SetSightAngle(const float & sightAngle)
{
/* Musimy zapobiedz ustawieniu ujemnego kata widzenia lub kata > 180.
Przy kacie 180 stopni postac widzi 180 st. w lewo i 180st w prawo,
wiec obejmuje to caly obszar naokolo niego.
*/
if (sightAngle > 0 && sightAngle <= 180)
{
m_sightAngle = sightAngle;
return true;
}
return false;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment