Skip to content

Commit ce9da76

Browse files
committed
removed useless stuff
1 parent 2488388 commit ce9da76

File tree

12 files changed

+13
-89
lines changed

12 files changed

+13
-89
lines changed

.gitmodules

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
11
[submodule "extlibs/googletest"]
22
path = extlibs/googletest
3-
url = https://github.com/google/googletest.git
4-
[submodule "extlibs/glm"]
5-
path = extlibs/glm
6-
url = https://github.com/g-truc/glm.git
3+
url = https://github.com/google/googletest.git

extlibs/glm

Lines changed: 0 additions & 1 deletion
This file was deleted.

include/omath/engines/OpenGL/Constants.hpp

Lines changed: 0 additions & 14 deletions
This file was deleted.

include/omath/engines/OpenGL/Formulas.hpp

Lines changed: 0 additions & 4 deletions
This file was deleted.

include/omath/engines/OpenGL/OpenGL.hpp

Lines changed: 0 additions & 45 deletions
This file was deleted.

include/omath/engines/Source/Formulas.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
#pragma once
55
#include "Constants.h"
66

7-
87
namespace omath::source
98
{
109
[[nodiscard]]

include/omath/engines/Unity/Unity.hpp

Lines changed: 0 additions & 12 deletions
This file was deleted.

include/omath/prediction/Target.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ namespace omath::prediction
1313
public:
1414

1515
[[nodiscard]]
16-
constexpr Vector3 PredictPosition(float time, float gravity) const
16+
constexpr Vector3 PredictPosition(const float time, const float gravity) const
1717
{
1818
auto predicted = m_origin + m_velocity * time;
1919

source/prediction/Engine.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ namespace omath::prediction
5858
return std::nullopt;
5959

6060
root = std::sqrt(root);
61-
const float angle = std::atan((std::pow(projectile.m_launchSpeed, 2.f) - root) / (bulletGravity * distance2d));
61+
const float angle = std::atan((launchSpeedSqr - root) / (bulletGravity * distance2d));
6262

6363
return angles::RadiansToDegrees(angle);
6464
}

source/prediction/Projectile.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,12 @@ namespace omath::prediction
1010
{
1111
Vector3 Projectile::PredictPosition(const float pitch, const float yaw, const float time, const float gravity) const
1212
{
13-
auto currentPos = m_origin + omath::source::ForwardVector({source::PitchAngle::FromDegrees(-pitch), source::YawAngle::FromDegrees(yaw), source::RollAngle::FromDegrees(0)}) * m_launchSpeed * time;
14-
currentPos.z -= (gravity * m_gravityScale) * std::pow(time, 2.f) * 0.5f;
13+
auto currentPos = m_origin + source::ForwardVector({source::PitchAngle::FromDegrees(-pitch),
14+
source::YawAngle::FromDegrees(yaw),
15+
source::RollAngle::FromDegrees(0)}) *
16+
m_launchSpeed * time;
17+
currentPos.z -= (gravity * m_gravityScale) * (time * time) * 0.5f;
1518

1619
return currentPos;
1720
}
18-
}
21+
} // namespace omath::prediction

0 commit comments

Comments
 (0)