Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add macro for calculating radians #317

Merged
merged 6 commits into from
Jun 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions src/consts.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,13 @@
// PPS: 650 @ 5+1, 650 @ 5+3
#define PACKET_BUNDLING_BUFFERED 2

#define DEG_0 0.f
#define DEG_90 -PI / 2
#define DEG_180 PI
#define DEG_270 PI / 2
// Get radian for a given angle from 0° to 360° (2*PI*r, solve for r given an angle, range -180° to 180°)
#define DEG_X(deg) ((((deg) < 180.0f ? 0 : 360.0f) - (deg)) * PI / 180.0f)

#define DEG_0 DEG_X(0.0f)
#define DEG_90 DEG_X(90.0f)
#define DEG_180 DEG_X(180.0f)
#define DEG_270 DEG_X(270.0f)
Pespiri marked this conversation as resolved.
Show resolved Hide resolved

#define CONST_EARTH_GRAVITY 9.80665

Expand Down
2 changes: 1 addition & 1 deletion src/network/connection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -547,7 +547,7 @@ void Connection::searchForServer() {
}

// receive incoming UDP packets
int len = m_UDP.read(m_Packet, sizeof(m_Packet));
int len __attribute__((unused)) = m_UDP.read(m_Packet, sizeof(m_Packet));

#ifdef DEBUG_NETWORK
m_Logger.trace(
Expand Down
Loading