MCPcopy Create free account
hub / github.com/TombEngine/TombEngine / IsOffscreen

Method IsOffscreen

TombEngine/Game/Hud/PickupSummary.cpp:17–31  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

15namespace TEN::Hud
16{
17 bool DisplayPickup::IsOffscreen() const
18 {
19 constexpr auto SCREEN_THRESHOLD_COEFF = 0.1f;
20 constexpr auto SCREEN_THRESHOLD = Vector2(DISPLAY_SPACE_RES.x * SCREEN_THRESHOLD_COEFF, DISPLAY_SPACE_RES.y * SCREEN_THRESHOLD_COEFF);
21
22 if (Position.x <= -SCREEN_THRESHOLD.x ||
23 Position.y <= -SCREEN_THRESHOLD.y ||
24 Position.x >= (DISPLAY_SPACE_RES.x + SCREEN_THRESHOLD.x) ||
25 Position.y >= (DISPLAY_SPACE_RES.y + SCREEN_THRESHOLD.y))
26 {
27 return true;
28 }
29
30 return false;
31 }
32
33 void DisplayPickup::Update(bool isHead)
34 {

Callers 2

DrawMethod · 0.80

Calls 1

Vector2Function · 0.50

Tested by

no test coverage detected