Skip to content

Commit

Permalink
noggit: fix pi constant
Browse files Browse the repository at this point in the history
- fix msvc builds
  • Loading branch information
ihm-tswow committed Nov 25, 2021
1 parent 58ee1dc commit 064e5fb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/noggit/MapView.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// This file is part of Noggit3, licensed under GNU General Public License (version 3).

#include <math/projection.hpp>
#include <math/constants.hpp>
#include <noggit/Brush.h> // brush
#include <noggit/DBC.h>
#include <noggit/Log.h>
Expand Down Expand Up @@ -67,7 +68,6 @@
#include <string>
#include <vector>


static const float XSENS = 15.0f;
static const float YSENS = 15.0f;

Expand Down Expand Up @@ -2147,7 +2147,7 @@ void MapView::tick (float dt)
<< "\nscale: " << instance->scale

<< "\nServer-side position X: " << (ZEROPOINT - instance->pos.z) << " Y: " << (ZEROPOINT - instance->pos.x) << " Z: " << instance->pos.y
<< "\nServer-side orientation: " << fabs(2 * pi - pi / 180.0 * (float(instance->dir.y) < 0 ? fabs(float(instance->dir.y)) + 180.0 : fabs(float(instance->dir.y) - 180.0)))
<< "\nServer-side orientation: " << fabs(2 * math::constants::pi - math::constants::pi / 180.0 * (float(instance->dir.y) < 0 ? fabs(float(instance->dir.y)) + 180.0 : fabs(float(instance->dir.y) - 180.0)))

<< "\ntextures Used: " << instance->model->header.nTextures
<< "\nsize category: " << instance->size_cat;
Expand All @@ -2174,7 +2174,7 @@ void MapView::tick (float dt)
<< "\ndoodad set: " << instance->doodadset()

<< "\nServer-side position X: " << (ZEROPOINT - instance->pos.z) << " Y: " << (ZEROPOINT - instance->pos.x) << " Z: " << instance->pos.y
<< "\nServer-side orientation: " << fabs(2 * pi - pi / 180.0 * (float(instance->dir.y) < 0 ? fabs(float(instance->dir.y)) + 180.0 : fabs(float(instance->dir.y) - 180.0)))
<< "\nServer-side orientation: " << fabs(2 * math::constants::pi - math::constants::pi / 180.0 * (float(instance->dir.y) < 0 ? fabs(float(instance->dir.y)) + 180.0 : fabs(float(instance->dir.y) - 180.0)))

<< "\ntextures used: " << instance->wmo->textures.size();

Expand Down

2 comments on commit 064e5fb

@bloerwald
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While you’re at it, this is some radians conversion stuff. We have nice wrappers to do it automatically and without doubt of correctness

@ihm-tswow
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i can look at that tomorrow, i gotta sleep now

Please sign in to comment.