mirror of
https://github.com/HandmadeMath/HandmadeMath.git
synced 2025-12-28 15:44:33 +00:00
These changes were all made by @dev-dwarf. Many thanks for his work on this! * Renaming * First Pass on 2.0UpdateTool * Another pass on UpdateTool, changed name * Another pass on UpdateTool, changed name * Do Renaming * Working on Angles Consistency * Passing Coverage * Remove unused arc-tangent functions * Change macro defaults By default if user is overriding trig functions assume their input and internal units are the same. * wrap in AngleDeg instead of AngleRad * Remove HMM_PREFIX configuration * Fix for Slerp https://discord.com/channels/239737791225790464/489148972305350656/1055167647274246265 Justified by most implementations of Slerp. EX: http://number-none.com/product/Understanding%20Slerp,%20Then%20Not%20Using%20It/ * Handedness Changes * More renaming. C11 _Generics Generics enable by default when available (see lines 97-104). User can also force them by defining HANDMADE_MATH_C11_GENERICS Also fixed some missed things w.r.t renaming. My old tool didn't catch cases like HMM_MultiplyVec3f needing to be HMM_MulV3F instead of HMM_MulV3f. * Reuse more SSE codepaths for Quaternions Also improved quaternion tests. More work could be done here, see discussion here about optimizing slerp: https://discord.com/channels/239737791225790464/489148972305350656/1055167647274246265 * Just saving these alternate versions of SLerp * Reduce V4/M4 Linear Comb. codepaths * Simple implementation of 2x2 and 3x3 basic matrix operations. Also renamed Transpose to TransposeM4, so that we can have TransposeM2,M3 * Norm is dead! Long live Norm! As can be seen from the tests, precision has declined quite a bit from using the FastNorm implementations for various things. We can only guarantee about 0.001f precision for anything where a norm happens now. If this is undesired we can change back easily. * Started work on Matrix Inverses TODO: Tests for simple 4x4 Inverses * Matrix Inverses + Tests * Generics for Matrices and Rename MXd/f functions * Fixes + Better Output for UpdateTool * I think I count as a contributor : ) * Ported UpdateTool, Inlined my library code. * Moved tool to different repo https://github.com/dev-dwarf/HMM2.0UpdateTool * Remove small test change * Found some more references to atan functions * Standardize angle function names, use short names * Remove other slerp comments * woops that wasnt meant to be commited. * Finish changing ToRadians to ToRad * Fix [] overloads per https://discord.com/channels/239737791225790464/600063880533770251/1051600188302692402 * Tests for 2x2, 3x3 Matrices and Other Matrix Ops * Add an option to use Z: [0, 1] range for projection matrices. This will make HMM more convenient to use with other graphics APIs such as Direct3d and Metal. * Update test imports * #if should've been #ifdef! * Implement requested changes
79 lines
2.2 KiB
Makefile
79 lines
2.2 KiB
Makefile
BUILD_DIR=./build
|
|
|
|
CXXFLAGS+=-g -Wall -Wextra -pthread -Wno-missing-braces -Wno-missing-field-initializers -Wfloat-equal
|
|
|
|
all: c c_no_sse cpp cpp_no_sse build_c_without_coverage build_cpp_without_coverage
|
|
|
|
build_all: build_c build_c_no_sse build_cpp build_cpp_no_sse
|
|
|
|
clean:
|
|
rm -rf $(BUILD_DIR)
|
|
|
|
c: build_c
|
|
$(BUILD_DIR)/hmm_test_c
|
|
|
|
build_c: HandmadeMath.c test_impl
|
|
@echo "\nCompiling in C mode"
|
|
mkdir -p $(BUILD_DIR)
|
|
cd $(BUILD_DIR)\
|
|
&& $(CC) $(CPPFLAGS) $(CXXFLAGS) -std=c99 \
|
|
-c ../HandmadeMath.c ../hmm_test.c \
|
|
-lm \
|
|
&& $(CC) -ohmm_test_c HandmadeMath.o hmm_test.o -lm
|
|
|
|
c_no_sse: build_c_no_sse
|
|
$(BUILD_DIR)/hmm_test_c_no_sse
|
|
|
|
build_c_no_sse: HandmadeMath.c test_impl
|
|
@echo "\nCompiling in C mode (no SSE)"
|
|
mkdir -p $(BUILD_DIR)
|
|
cd $(BUILD_DIR) \
|
|
&& $(CC) $(CPPFLAGS) $(CXXFLAGS) -std=c99 \
|
|
-DHANDMADE_MATH_NO_SSE \
|
|
-c ../HandmadeMath.c ../hmm_test.c \
|
|
-lm \
|
|
&& $(CC) -ohmm_test_c_no_sse HandmadeMath.o hmm_test.o -lm
|
|
|
|
cpp: build_cpp
|
|
$(BUILD_DIR)/hmm_test_cpp
|
|
|
|
build_cpp: HandmadeMath.cpp test_impl
|
|
@echo "\nCompiling in C++ mode"
|
|
mkdir -p $(BUILD_DIR)
|
|
cd $(BUILD_DIR) \
|
|
&& $(CXX) $(CPPFLAGS) $(CXXFLAGS) -ohmm_test_cpp \
|
|
-DHANDMADE_MATH_CPP_MODE \
|
|
../HandmadeMath.cpp ../hmm_test.cpp
|
|
|
|
cpp_no_sse: build_cpp_no_sse
|
|
$(BUILD_DIR)/hmm_test_cpp_no_sse
|
|
|
|
build_cpp_no_sse: HandmadeMath.cpp test_impl
|
|
@echo "\nCompiling in C++ mode (no SSE)"
|
|
mkdir -p $(BUILD_DIR)
|
|
cd $(BUILD_DIR) \
|
|
&& $(CXX) $(CPPFLAGS) $(CXXFLAGS) -ohmm_test_cpp_no_sse \
|
|
-DHANDMADE_MATH_CPP_MODE -DHANDMADE_MATH_NO_SSE \
|
|
../HandmadeMath.cpp ../hmm_test.cpp
|
|
|
|
test_impl: hmm_test.cpp hmm_test.c
|
|
|
|
build_c_without_coverage: HandmadeMath.c test_impl
|
|
@echo "\nCompiling in C mode"
|
|
mkdir -p $(BUILD_DIR)
|
|
cd $(BUILD_DIR)\
|
|
&& $(CC) $(CPPFLAGS) $(CXXFLAGS) -std=c99 \
|
|
-DWITHOUT_COVERAGE \
|
|
-c ../HandmadeMath.c ../hmm_test.c \
|
|
-lm \
|
|
&& $(CC) -ohmm_test_c HandmadeMath.o hmm_test.o -lm
|
|
|
|
build_cpp_without_coverage: HandmadeMath.cpp test_impl
|
|
@echo "\nCompiling in C++ mode (no SSE)"
|
|
mkdir -p $(BUILD_DIR)
|
|
cd $(BUILD_DIR) \
|
|
&& $(CXX) $(CPPFLAGS) $(CXXFLAGS) -ohmm_test_cpp_no_sse \
|
|
-DHANDMADE_MATH_CPP_MODE -DWITHOUT_COVERAGE \
|
|
../HandmadeMath.cpp ../hmm_test.cpp
|
|
|