Skip to content

Commit

Permalink
cmakelist: add math defines
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaoyaoing committed Mar 20, 2023
1 parent 74edc10 commit 3870c23
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ if(MSVC)
add_compile_options("/MP")
add_compile_options("$<$<C_COMPILER_ID:MSVC>:/utf-8>")
add_compile_options("$<$<CXX_COMPILER_ID:MSVC>:/utf-8>")
add_definitions(-D_USE_MATH_DEFINES)
endif(MSVC)

if(WIN32)
Expand Down Expand Up @@ -80,6 +81,7 @@ if(APPLE)
set(EMBREE_DLL ${LIBS_PATH}/libembree3.3.dylib ${LIBS_PATH}/libtbb.12.2.dylib)
endif()


target_link_directories(Moer PUBLIC ${LIBS_PATH})
target_link_directories(Moer PUBLIC ${PROJECT_SOURCE_DIR}/target/lib)

Expand Down
2 changes: 1 addition & 1 deletion src/CoreLayer/Math/Function.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ template <typename T> T clamp(T t, T lower, T upper) {
return t;
}

//* 求解二元一次方程组
//* 求解一元二次方程组
inline bool Quadratic(float A, float B, float C, float *t0, float *t1) {
float discrim = B * B - 4 * A * C;
if (discrim < 0.) return false;
Expand Down

0 comments on commit 3870c23

Please sign in to comment.