File tree 6 files changed +46
-8
lines changed
source/projectile_prediction
6 files changed +46
-8
lines changed Original file line number Diff line number Diff line change 1
1
/cmake-build /
2
2
/.idea
3
3
/out
4
+ * .DS_Store
Original file line number Diff line number Diff line change @@ -14,11 +14,12 @@ option(OMATH_BUILD_EXAMPLES "Build example projects with you can learn & play" O
14
14
option (OMATH_STATIC_MSVC_RUNTIME_LIBRARY "Force Omath to link static runtime" OFF )
15
15
16
16
if (OMATH_BUILD_AS_SHARED_LIBRARY)
17
- add_library (omath SHARED source /Matrix .cpp)
17
+ add_library (omath SHARED source /matrix .cpp)
18
18
else ()
19
- add_library (omath STATIC source /Matrix.cpp)
19
+ add_library (omath STATIC source /matrix.cpp
20
+ source /matrix.cpp)
20
21
endif ()
21
-
22
+ message ( STATUS "Building on ${CMAKE_HOST_SYSTEM_NAME} " )
22
23
add_library (omath::omath ALIAS omath)
23
24
24
25
if (OMATH_IMGUI_INTEGRATION)
Original file line number Diff line number Diff line change 64
64
"cacheVariables" : {
65
65
"CMAKE_BUILD_TYPE" : " Release"
66
66
}
67
+ },
68
+ {
69
+ "name" : " darwin-base" ,
70
+ "hidden" : true ,
71
+ "generator" : " Ninja" ,
72
+ "binaryDir" : " ${sourceDir}/cmake-build/build/${presetName}" ,
73
+ "installDir" : " ${sourceDir}/cmake-build/install/${presetName}" ,
74
+ "cacheVariables" : {
75
+ "CMAKE_C_COMPILER" : " clang" ,
76
+ "CMAKE_CXX_COMPILER" : " clang++"
77
+ },
78
+ "condition" : {
79
+ "type" : " equals" ,
80
+ "lhs" : " ${hostSystemName}" ,
81
+ "rhs" : " Darwin"
82
+ }
83
+ },
84
+ {
85
+ "name" : " darwin-debug" ,
86
+ "displayName" : " Darwin Debug" ,
87
+ "inherits" : " darwin-base" ,
88
+ "cacheVariables" : {
89
+ "CMAKE_BUILD_TYPE" : " Debug"
90
+ }
91
+ },
92
+ {
93
+ "name" : " darwin-release" ,
94
+ "displayName" : " Darwin Release" ,
95
+ "inherits" : " darwin-debug" ,
96
+ "cacheVariables" : {
97
+ "CMAKE_BUILD_TYPE" : " Release"
98
+ }
67
99
}
68
100
]
69
101
}
Original file line number Diff line number Diff line change @@ -124,9 +124,9 @@ namespace omath
124
124
}
125
125
126
126
#ifndef _MSC_VER
127
- [[nodiscard]] constexpr Type& Length () const
127
+ [[nodiscard]] constexpr Type Length () const
128
128
{
129
- return std::hypot (x, y);
129
+ return std::hypot (this -> x , this -> y );
130
130
}
131
131
132
132
[[nodiscard]] constexpr Vector2 Normalized () const
Original file line number Diff line number Diff line change @@ -121,12 +121,12 @@ namespace omath
121
121
#ifndef _MSC_VER
122
122
[[nodiscard]] constexpr Type Length () const
123
123
{
124
- return std::hypot (x, y, z);
124
+ return std::hypot (this -> x , this -> y , z);
125
125
}
126
126
127
127
[[nodiscard]] constexpr Type Length2D () const
128
128
{
129
- return Vector2::Length ();
129
+ return Vector2<Type> ::Length ();
130
130
}
131
131
[[nodiscard]] Type DistTo (const Vector3& vOther) const
132
132
{
Original file line number Diff line number Diff line change 4
4
#include " omath/projectile_prediction/proj_pred_engine_avx2.hpp"
5
5
#include " source_location"
6
6
7
+ #if defined(OMATH_USE_AVX2) && defined(__i386__) && defined(__x86_64__)
8
+ #include < immintrin.h>
9
+ #endif
10
+
7
11
namespace omath ::projectile_prediction
8
12
{
9
13
std::optional<Vector3<float >>
10
14
ProjPredEngineAVX2::MaybeCalculateAimPoint ([[maybe_unused]] const Projectile& projectile,
11
15
[[maybe_unused]] const Target& target) const
12
16
{
13
- #ifdef OMATH_USE_AVX2
17
+ #if defined( OMATH_USE_AVX2) && defined(__i386__) && defined(__x86_64__)
14
18
const float bulletGravity = m_gravityConstant * projectile.m_gravityScale ;
15
19
const float v0 = projectile.m_launchSpeed ;
16
20
const float v0Sqr = v0 * v0;
You can’t perform that action at this time.
0 commit comments