Skip to content

Commit 9f9edfe

Browse files
committed
- fixed single precision build
1 parent 8957240 commit 9f9edfe

54 files changed

Lines changed: 3392 additions & 5223 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CMake/Common.cmake

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,8 @@ endif()
3232
set (CMAKE_CXX_STANDARD 11)
3333

3434
add_definitions(-D_CRT_SECURE_NO_DEPRECATE)
35+
36+
OPTION(USE_DOUBLE_PRECISION "Use double precision" ON)
37+
if (USE_DOUBLE_PRECISION)
38+
add_definitions( -DUSE_DOUBLE)
39+
endif (USE_DOUBLE_PRECISION)

CMakeLists.txt

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ set_property(GLOBAL PROPERTY USE_FOLDERS ON)
1111
include(${PROJECT_PATH}/CMake/Common.cmake)
1212

1313
if (WIN32)
14-
subdirs(extern/freeglut extern/AntTweakBar extern/glew extern/md5 Demos PositionBasedDynamics)
14+
subdirs(extern/freeglut extern/AntTweakBar extern/glew extern/md5 Demos PositionBasedDynamics Simulation Utils)
1515
else()
16-
subdirs(extern/AntTweakBar extern/glew extern/md5 Demos PositionBasedDynamics)
16+
subdirs(extern/AntTweakBar extern/glew extern/md5 Demos PositionBasedDynamics Simulation Utils)
1717
endif()
1818

1919
include(ExternalProject)
@@ -29,11 +29,21 @@ ExternalProject_Add(
2929
ExternalProject_Discregrid
3030
PREFIX "${CMAKE_SOURCE_DIR}/extern/Discregrid"
3131
GIT_REPOSITORY https://github.com/InteractiveComputerGraphics/Discregrid.git
32-
GIT_TAG "f16a29afebf7a7f43139d5832bbfc7124c5d98db"
32+
GIT_TAG "573c2f51f433c74de832454272e47f590140e80b"
3333
INSTALL_DIR ${ExternalInstallDir}/Discregrid
3434
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=${ExternalInstallDir}/Discregrid -DBUILD_CMD_EXECUTABLE:BOOL=0 -DEIGEN3_INCLUDE_DIR:PATH=${EigenDir}
3535
)
3636

37+
## GenericParameters
38+
ExternalProject_Add(
39+
ExternalProject_GenericParameters
40+
PREFIX "${CMAKE_SOURCE_DIR}/extern/GenericParameters"
41+
GIT_REPOSITORY https://github.com/InteractiveComputerGraphics/GenericParameters.git
42+
GIT_TAG "1ec904bf8555e78ae0d8ba2f9f9a395371c5d4eb"
43+
INSTALL_DIR ${ExternalInstallDir}/GenericParameters
44+
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=${ExternalInstallDir}/GenericParameters -DGENERICPARAMETERS_NO_TESTS:BOOL=1
45+
)
46+
3747
install(DIRECTORY ./Common
3848
DESTINATION include
3949
FILES_MATCHING PATTERN "*.h")

Changelog.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
- fixed single precision build
2+
- cleanup code
3+
- using GenericParameters
14
- Crispin Deul added the implementation of his paper Deul, Kugelstadt, Weiler, Bender, "Direct Position-Based Solver for Stiff Rods", Computer Graphics Forum 2018 and a corresponding demo
25

36
1.6.0

Common/Common.h

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,32 @@
44
#include <Eigen/Dense>
55
#include <float.h>
66

7-
#define USE_DOUBLE
7+
//#define USE_DOUBLE
88
#define MIN_PARALLEL_SIZE 64
99

1010
#ifdef USE_DOUBLE
1111
typedef double Real;
1212

1313
#define REAL_MAX DBL_MAX
1414
#define REAL_MIN DBL_MIN
15+
#define RealParameter DoubleParameter
16+
#define RealParameterType ParameterBase::DOUBLE
17+
#define RealVectorParameterType ParameterBase::VEC_DOUBLE
1518
#else
1619
typedef float Real;
1720

1821
#define REAL_MAX FLT_MAX
1922
#define REAL_MIN FLT_MIN
23+
#define RealParameter FloatParameter
24+
#define RealParameterType ParameterBase::FLOAT
25+
#define RealVectorParameterType ParameterBase::VEC_FLOAT
2026
#endif
2127

2228
using Vector2r = Eigen::Matrix<Real, 2, 1>;
2329
using Vector3r = Eigen::Matrix<Real, 3, 1>;
2430
using Vector4r = Eigen::Matrix<Real, 4, 1>;
31+
using Vector5r = Eigen::Matrix<Real, 5, 1>;
32+
using Vector6r = Eigen::Matrix<Real, 6, 1>;
2533
using Matrix2r = Eigen::Matrix<Real, 2, 2>;
2634
using Matrix3r = Eigen::Matrix<Real, 3, 3>;
2735
using Matrix4r = Eigen::Matrix<Real, 4, 4>;

Demos/BarDemo/CMakeLists.txt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,19 @@ else()
1515
)
1616
endif()
1717

18+
############################################################
19+
# GenericParameters
20+
############################################################
21+
include_directories(${PROJECT_PATH}/extern/install/GenericParameters/include)
22+
set(SIMULATION_DEPENDENCIES ${SIMULATION_DEPENDENCIES} ExternalProject_GenericParameters)
23+
1824
add_executable(BarDemo
1925
main.cpp
26+
27+
../Common/TweakBarParameters.cpp
28+
../Common/TweakBarParameters.h
29+
../Common/DemoBase.cpp
30+
../Common/DemoBase.h
2031

2132
${VIS_FILES}
2233
${PROJECT_PATH}/Common/Common.h

0 commit comments

Comments
 (0)