Fixes
This commit is contained in:
@ -37,6 +37,20 @@ namespace ia::iae
|
||||
#endif
|
||||
}
|
||||
|
||||
Direction Engine::GetVectorPointingDirection(IN Vec2 v)
|
||||
{
|
||||
STATIC CONSTEXPR Direction DIRECTION_MAP[] = {Direction::RIGHT, Direction::DOWN_RIGHT, Direction::DOWN, Direction::DOWN_LEFT,
|
||||
Direction::LEFT, Direction::UP_LEFT, Direction::UP, Direction::UP_RIGHT};
|
||||
if ((abs(v.x) <= FLOAT32_EPSILON) && (abs(v.y) <= FLOAT32_EPSILON))
|
||||
return Direction::NONE;
|
||||
|
||||
auto angle = glm::degrees(atan2(v.y, v.x));
|
||||
if (angle < 0)
|
||||
angle += 360;
|
||||
|
||||
return DIRECTION_MAP[INT32((angle + 22.5) / 45) % 8];
|
||||
}
|
||||
|
||||
VOID Engine::ResizeDisplay(IN INT32 newWidth, IN INT32 newHeight)
|
||||
{
|
||||
Renderer::WaitForGPUIdle();
|
||||
|
||||
Reference in New Issue
Block a user