Skip to content

Commit f634656

Browse files
committed
Merge branch 'InteractiveComputerGraphics:master' into fix-macos
2 parents a430592 + 515ca6c commit f634656

File tree

328 files changed

+47008
-13752
lines changed

Some content is hidden

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

328 files changed

+47008
-13752
lines changed

CMake/Common.cmake

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,12 @@
1-
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/bin")
1+
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/bin" CACHE INTERNAL "Where to place executables and dlls")
22
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG "${CMAKE_SOURCE_DIR}/bin")
3-
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE "${CMAKE_SOURCE_DIR}/bin")
3+
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE "${CMAKE_SOURCE_DIR}/bin" CACHE INTERNAL "Where to place executables and dlls in release mode")
44
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELWITHDEBINFO "${CMAKE_SOURCE_DIR}/bin")
55
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_MINSIZEREL "${CMAKE_SOURCE_DIR}/bin")
6-
set(LIBRARY_OUTPUT_PATH ${CMAKE_SOURCE_DIR}/lib)
6+
set(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/lib)
77
set(CMAKE_DEBUG_POSTFIX "_d")
8-
set(CMAKE_RELWITHDEBINFO_POSTFIX "")
9-
set(CMAKE_MINSIZEREL_POSTFIX "")
10-
11-
set(PBD_BINARY_DEBUG_POSTFIX "_d" CACHE INTERNAL "Postfix for executables")
12-
set(PBD_BINARY_RELWITHDEBINFO_POSTFIX "_rd" CACHE INTERNAL "Postfix for executables")
13-
set(PBD_BINARY_MINSIZEREL_POSTFIX "_ms" CACHE INTERNAL "Postfix for executables")
8+
set(CMAKE_RELWITHDEBINFO_POSTFIX "_rd")
9+
set(CMAKE_MINSIZEREL_POSTFIX "_ms")
1410

1511
include(CMakeDependentOption)
1612

Changelog.txt

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
2.2.2
2+
- added documentation files
3+
- moved build directory for lib files
4+
- fixed encoding of some source files
5+
- updated numpy version
6+
7+
2.1.1
8+
- fixed Python interface for function addFace
9+
10+
2.1.0
11+
- added XPBD FEM constraint for deformable solids
12+
- updated to Eigen 3.4.0
13+
114
2.0.1
215
- extended and modified Python interface
316
- more Python examples

Demos/BarDemo/CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@ find_package( Eigen3 REQUIRED )
4343
include_directories( ${EIGEN3_INCLUDE_DIR} )
4444

4545
set_target_properties(BarDemo PROPERTIES FOLDER "Demos")
46-
set_target_properties(BarDemo PROPERTIES DEBUG_POSTFIX ${PBD_BINARY_DEBUG_POSTFIX})
47-
set_target_properties(BarDemo PROPERTIES RELWITHDEBINFO_POSTFIX ${PBD_BINARY_RELWITHDEBINFO_POSTFIX})
48-
set_target_properties(BarDemo PROPERTIES MINSIZEREL_POSTFIX ${PBD_BINARY_MINSIZEREL_POSTFIX})
46+
set_target_properties(BarDemo PROPERTIES DEBUG_POSTFIX ${CMAKE_DEBUG_POSTFIX})
47+
set_target_properties(BarDemo PROPERTIES RELWITHDEBINFO_POSTFIX ${CMAKE_RELWITHDEBINFO_POSTFIX})
48+
set_target_properties(BarDemo PROPERTIES MINSIZEREL_POSTFIX ${CMAKE_MINSIZEREL_POSTFIX})
4949
add_dependencies(BarDemo ${SIMULATION_DEPENDENCIES})
5050
target_link_libraries(BarDemo ${SIMULATION_LINK_LIBRARIES})
5151
VIS_SOURCE_GROUPS()

Demos/BarDemo/main.cpp

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,8 @@ int main( int argc, char **argv )
7979

8080
TwType enumType2 = TwDefineEnum("SimulationMethodType", NULL, 0);
8181
TwAddVarCB(MiniGL::getTweakBar(), "SimulationMethod", enumType2, setSimulationMethod, getSimulationMethod, &simulationMethod,
82-
" label='Simulation method' enum='0 {None}, 1 {Volume constraints}, 2 {FEM based PBD}, 3 {Strain based dynamics (no inversion handling)}, 4 {Shape matching (no inversion handling)}, 5 {XPBD volume constraints}' group=Simulation");
82+
" label='Simulation method' enum='0 {None}, 1 {Volume constraints}, 2 {FEM based PBD}, 3 {FEM based XPBD}, \
83+
4 {Strain based dynamics (no inversion handling)}, 5 {Shape matching (no inversion handling)}, 6 {XPBD volume constraints}' group=Simulation");
8384
TwAddVarCB(MiniGL::getTweakBar(), "stiffness", TW_TYPE_REAL, setStiffness, getStiffness, model, " label='Stiffness' min=0.0 step=0.1 precision=4 group='Solid' ");
8485
TwAddVarCB(MiniGL::getTweakBar(), "poissonRatio", TW_TYPE_REAL, setPoissonRatio, getPoissonRatio, model, " label='Poisson ratio' min=0.0 step=0.1 precision=4 group='Solid' ");
8586
TwAddVarCB(MiniGL::getTweakBar(), "normalizeStretch", TW_TYPE_BOOL32, setNormalizeStretch, getNormalizeStretch, model, " label='Normalize stretch' group='Solid' ");
@@ -167,11 +168,13 @@ void createMesh()
167168

168169
// init constraints
169170
stiffness = 1.0;
170-
if (simulationMethod == 5)
171+
if (simulationMethod == 3)
172+
stiffness = 1000000;
173+
if (simulationMethod == 6)
171174
stiffness = 100000;
172175

173176
volumeStiffness = 1.0;
174-
if (simulationMethod == 5)
177+
if (simulationMethod == 6)
175178
volumeStiffness = 100000;
176179
for (unsigned int cm = 0; cm < model->getTetModels().size(); cm++)
177180
{
@@ -201,6 +204,7 @@ void TW_CALL setStiffness(const void* value, void* clientData)
201204
{
202205
stiffness = *(const Real*)(value);
203206
((SimulationModel*)clientData)->setConstraintValue<FEMTetConstraint, Real, &FEMTetConstraint::m_stiffness>(stiffness);
207+
((SimulationModel*)clientData)->setConstraintValue<XPBD_FEMTetConstraint, Real, &XPBD_FEMTetConstraint::m_stiffness>(stiffness);
204208
((SimulationModel*)clientData)->setConstraintValue<StrainTetConstraint, Real, &StrainTetConstraint::m_stretchStiffness>(stiffness);
205209
((SimulationModel*)clientData)->setConstraintValue<StrainTetConstraint, Real, &StrainTetConstraint::m_shearStiffness>(stiffness);
206210
((SimulationModel*)clientData)->setConstraintValue<DistanceConstraint, Real, &DistanceConstraint::m_stiffness>(stiffness);
@@ -234,6 +238,7 @@ void TW_CALL setPoissonRatio(const void* value, void* clientData)
234238
{
235239
poissonRatio = *(const Real*)(value);
236240
((SimulationModel*)clientData)->setConstraintValue<FEMTetConstraint, Real, &FEMTetConstraint::m_poissonRatio>(poissonRatio);
241+
((SimulationModel*)clientData)->setConstraintValue<XPBD_FEMTetConstraint, Real, &XPBD_FEMTetConstraint::m_poissonRatio>(poissonRatio);
237242
}
238243

239244
void TW_CALL getNormalizeStretch(void* value, void* clientData)

Demos/ClothDemo/CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,9 @@ include_directories(${PROJECT_PATH}/extern/freeglut/include)
4646
include_directories(${PROJECT_PATH}/extern/glew/include)
4747

4848
set_target_properties(ClothDemo PROPERTIES FOLDER "Demos")
49-
set_target_properties(ClothDemo PROPERTIES DEBUG_POSTFIX ${PBD_BINARY_DEBUG_POSTFIX})
50-
set_target_properties(ClothDemo PROPERTIES RELWITHDEBINFO_POSTFIX ${PBD_BINARY_RELWITHDEBINFO_POSTFIX})
51-
set_target_properties(ClothDemo PROPERTIES MINSIZEREL_POSTFIX ${PBD_BINARY_MINSIZEREL_POSTFIX})
49+
set_target_properties(ClothDemo PROPERTIES DEBUG_POSTFIX ${CMAKE_DEBUG_POSTFIX})
50+
set_target_properties(ClothDemo PROPERTIES RELWITHDEBINFO_POSTFIX ${CMAKE_RELWITHDEBINFO_POSTFIX})
51+
set_target_properties(ClothDemo PROPERTIES MINSIZEREL_POSTFIX ${CMAKE_MINSIZEREL_POSTFIX})
5252
add_dependencies(ClothDemo ${SIMULATION_DEPENDENCIES})
5353
target_link_libraries(ClothDemo ${SIMULATION_LINK_LIBRARIES})
5454
VIS_SOURCE_GROUPS()

Demos/CosseratRodsDemo/CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@ include_directories(${PROJECT_PATH}/extern/freeglut/include)
4545
include_directories(${PROJECT_PATH}/extern/glew/include)
4646

4747
set_target_properties(CosseratRodsDemo PROPERTIES FOLDER "Demos")
48-
set_target_properties(CosseratRodsDemo PROPERTIES DEBUG_POSTFIX ${PBD_BINARY_DEBUG_POSTFIX})
49-
set_target_properties(CosseratRodsDemo PROPERTIES RELWITHDEBINFO_POSTFIX ${PBD_BINARY_RELWITHDEBINFO_POSTFIX})
50-
set_target_properties(CosseratRodsDemo PROPERTIES MINSIZEREL_POSTFIX ${PBD_BINARY_MINSIZEREL_POSTFIX})
48+
set_target_properties(CosseratRodsDemo PROPERTIES DEBUG_POSTFIX ${CMAKE_DEBUG_POSTFIX})
49+
set_target_properties(CosseratRodsDemo PROPERTIES RELWITHDEBINFO_POSTFIX ${CMAKE_RELWITHDEBINFO_POSTFIX})
50+
set_target_properties(CosseratRodsDemo PROPERTIES MINSIZEREL_POSTFIX ${CMAKE_MINSIZEREL_POSTFIX})
5151
add_dependencies(CosseratRodsDemo ${SIMULATION_DEPENDENCIES})
5252
target_link_libraries(CosseratRodsDemo ${SIMULATION_LINK_LIBRARIES})
5353
VIS_SOURCE_GROUPS()

Demos/CouplingDemos/CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@ add_executable(RigidBodyClothCouplingDemo
3838
)
3939

4040
set_target_properties(RigidBodyClothCouplingDemo PROPERTIES FOLDER "Demos")
41-
set_target_properties(RigidBodyClothCouplingDemo PROPERTIES DEBUG_POSTFIX ${PBD_BINARY_DEBUG_POSTFIX})
42-
set_target_properties(RigidBodyClothCouplingDemo PROPERTIES RELWITHDEBINFO_POSTFIX ${PBD_BINARY_RELWITHDEBINFO_POSTFIX})
43-
set_target_properties(RigidBodyClothCouplingDemo PROPERTIES MINSIZEREL_POSTFIX ${PBD_BINARY_MINSIZEREL_POSTFIX})
41+
set_target_properties(RigidBodyClothCouplingDemo PROPERTIES DEBUG_POSTFIX ${CMAKE_DEBUG_POSTFIX})
42+
set_target_properties(RigidBodyClothCouplingDemo PROPERTIES RELWITHDEBINFO_POSTFIX ${CMAKE_RELWITHDEBINFO_POSTFIX})
43+
set_target_properties(RigidBodyClothCouplingDemo PROPERTIES MINSIZEREL_POSTFIX ${CMAKE_MINSIZEREL_POSTFIX})
4444
add_dependencies(RigidBodyClothCouplingDemo ${SIMULATION_DEPENDENCIES})
4545
target_link_libraries(RigidBodyClothCouplingDemo ${SIMULATION_LINK_LIBRARIES})
4646

Demos/DistanceFieldDemos/CMakeLists.txt

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@ add_executable(ClothCollisionDemo
3939
)
4040

4141
set_target_properties(ClothCollisionDemo PROPERTIES FOLDER "Demos")
42-
set_target_properties(ClothCollisionDemo PROPERTIES DEBUG_POSTFIX ${PBD_BINARY_DEBUG_POSTFIX})
43-
set_target_properties(ClothCollisionDemo PROPERTIES RELWITHDEBINFO_POSTFIX ${PBD_BINARY_RELWITHDEBINFO_POSTFIX})
44-
set_target_properties(ClothCollisionDemo PROPERTIES MINSIZEREL_POSTFIX ${PBD_BINARY_MINSIZEREL_POSTFIX})
42+
set_target_properties(ClothCollisionDemo PROPERTIES DEBUG_POSTFIX ${CMAKE_DEBUG_POSTFIX})
43+
set_target_properties(ClothCollisionDemo PROPERTIES RELWITHDEBINFO_POSTFIX ${CMAKE_RELWITHDEBINFO_POSTFIX})
44+
set_target_properties(ClothCollisionDemo PROPERTIES MINSIZEREL_POSTFIX ${CMAKE_MINSIZEREL_POSTFIX})
4545
add_dependencies(ClothCollisionDemo ${SIMULATION_DEPENDENCIES})
4646
target_link_libraries(ClothCollisionDemo ${SIMULATION_LINK_LIBRARIES})
4747

@@ -61,9 +61,9 @@ add_executable(DeformableCollisionDemo
6161
)
6262

6363
set_target_properties(DeformableCollisionDemo PROPERTIES FOLDER "Demos")
64-
set_target_properties(DeformableCollisionDemo PROPERTIES DEBUG_POSTFIX ${PBD_BINARY_DEBUG_POSTFIX})
65-
set_target_properties(DeformableCollisionDemo PROPERTIES RELWITHDEBINFO_POSTFIX ${PBD_BINARY_RELWITHDEBINFO_POSTFIX})
66-
set_target_properties(DeformableCollisionDemo PROPERTIES MINSIZEREL_POSTFIX ${PBD_BINARY_MINSIZEREL_POSTFIX})
64+
set_target_properties(DeformableCollisionDemo PROPERTIES DEBUG_POSTFIX ${CMAKE_DEBUG_POSTFIX})
65+
set_target_properties(DeformableCollisionDemo PROPERTIES RELWITHDEBINFO_POSTFIX ${CMAKE_RELWITHDEBINFO_POSTFIX})
66+
set_target_properties(DeformableCollisionDemo PROPERTIES MINSIZEREL_POSTFIX ${CMAKE_MINSIZEREL_POSTFIX})
6767
add_dependencies(DeformableCollisionDemo ${SIMULATION_DEPENDENCIES})
6868
target_link_libraries(DeformableCollisionDemo ${SIMULATION_LINK_LIBRARIES})
6969

@@ -83,9 +83,9 @@ add_executable(RigidBodyCollisionDemo
8383
)
8484

8585
set_target_properties(RigidBodyCollisionDemo PROPERTIES FOLDER "Demos")
86-
set_target_properties(RigidBodyCollisionDemo PROPERTIES DEBUG_POSTFIX ${PBD_BINARY_DEBUG_POSTFIX})
87-
set_target_properties(RigidBodyCollisionDemo PROPERTIES RELWITHDEBINFO_POSTFIX ${PBD_BINARY_RELWITHDEBINFO_POSTFIX})
88-
set_target_properties(RigidBodyCollisionDemo PROPERTIES MINSIZEREL_POSTFIX ${PBD_BINARY_MINSIZEREL_POSTFIX})
86+
set_target_properties(RigidBodyCollisionDemo PROPERTIES DEBUG_POSTFIX ${CMAKE_DEBUG_POSTFIX})
87+
set_target_properties(RigidBodyCollisionDemo PROPERTIES RELWITHDEBINFO_POSTFIX ${CMAKE_RELWITHDEBINFO_POSTFIX})
88+
set_target_properties(RigidBodyCollisionDemo PROPERTIES MINSIZEREL_POSTFIX ${CMAKE_MINSIZEREL_POSTFIX})
8989
add_dependencies(RigidBodyCollisionDemo ${SIMULATION_DEPENDENCIES})
9090
target_link_libraries(RigidBodyCollisionDemo ${SIMULATION_LINK_LIBRARIES})
9191

Demos/DistanceFieldDemos/DeformableCollisionDemo.cpp

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,8 @@ int main( int argc, char **argv )
8888

8989
TwType enumType2 = TwDefineEnum("SimulationMethodType", NULL, 0);
9090
TwAddVarCB(MiniGL::getTweakBar(), "SimulationMethod", enumType2, setSimulationMethod, getSimulationMethod, &simulationMethod,
91-
" label='Simulation method' enum='0 {None}, 1 {Volume constraints}, 2 {FEM based PBD}, 3 {Strain based dynamics (no inversion handling)}, 4 {Shape matching (no inversion handling)}, 5 {XPBD volume constraints}' group=Simulation");
92-
TwAddVarCB(MiniGL::getTweakBar(), "stiffness", TW_TYPE_REAL, setStiffness, getStiffness, model, " label='Stiffness' min=0.0 step=0.1 precision=4 group='Solid' ");
91+
" label='Simulation method' enum='0 {None}, 1 {Volume constraints}, 2 {FEM based PBD}, 3 {FEM based XPBD}, \
92+
4 {Strain based dynamics (no inversion handling)}, 5 {Shape matching (no inversion handling)}, 6 {XPBD volume constraints}' group=Simulation"); TwAddVarCB(MiniGL::getTweakBar(), "stiffness", TW_TYPE_REAL, setStiffness, getStiffness, model, " label='Stiffness' min=0.0 step=0.1 precision=4 group='Solid' ");
9393
TwAddVarCB(MiniGL::getTweakBar(), "poissonRatio", TW_TYPE_REAL, setPoissonRatio, getPoissonRatio, model, " label='Poisson ratio' min=0.0 step=0.1 precision=4 group='Solid' ");
9494
TwAddVarCB(MiniGL::getTweakBar(), "normalizeStretch", TW_TYPE_BOOL32, setNormalizeStretch, getNormalizeStretch, model, " label='Normalize stretch' group='Solid' ");
9595
TwAddVarCB(MiniGL::getTweakBar(), "normalizeShear", TW_TYPE_BOOL32, setNormalizeShear, getNormalizeShear, model, " label='Normalize shear' group='Solid' ");
@@ -276,11 +276,13 @@ void createMesh()
276276

277277
// init constraints
278278
stiffness = 1.0;
279-
if (simulationMethod == 5)
279+
if (simulationMethod == 3)
280+
stiffness = 1000000;
281+
if (simulationMethod == 6)
280282
stiffness = 100000;
281283

282284
volumeStiffness = 1.0;
283-
if (simulationMethod == 5)
285+
if (simulationMethod == 6)
284286
volumeStiffness = 100000;
285287

286288
ParticleData& pd = model->getParticles();
@@ -301,6 +303,7 @@ void TW_CALL setStiffness(const void* value, void* clientData)
301303
{
302304
stiffness = *(const Real*)(value);
303305
((SimulationModel*)clientData)->setConstraintValue<FEMTetConstraint, Real, &FEMTetConstraint::m_stiffness>(stiffness);
306+
((SimulationModel*)clientData)->setConstraintValue<XPBD_FEMTetConstraint, Real, &XPBD_FEMTetConstraint::m_stiffness>(stiffness);
304307
((SimulationModel*)clientData)->setConstraintValue<StrainTetConstraint, Real, &StrainTetConstraint::m_stretchStiffness>(stiffness);
305308
((SimulationModel*)clientData)->setConstraintValue<StrainTetConstraint, Real, &StrainTetConstraint::m_shearStiffness>(stiffness);
306309
((SimulationModel*)clientData)->setConstraintValue<DistanceConstraint, Real, &DistanceConstraint::m_stiffness>(stiffness);
@@ -334,6 +337,7 @@ void TW_CALL setPoissonRatio(const void* value, void* clientData)
334337
{
335338
poissonRatio = *(const Real*)(value);
336339
((SimulationModel*)clientData)->setConstraintValue<FEMTetConstraint, Real, &FEMTetConstraint::m_poissonRatio>(poissonRatio);
340+
((SimulationModel*)clientData)->setConstraintValue<XPBD_FEMTetConstraint, Real, &XPBD_FEMTetConstraint::m_poissonRatio>(poissonRatio);
337341
}
338342

339343
void TW_CALL getNormalizeStretch(void* value, void* clientData)

Demos/FluidDemo/CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@ include_directories(${PROJECT_PATH}/extern/freeglut/include)
3737
include_directories(${PROJECT_PATH}/extern/glew/include)
3838

3939
set_target_properties(FluidDemo PROPERTIES FOLDER "Demos")
40-
set_target_properties(FluidDemo PROPERTIES DEBUG_POSTFIX ${PBD_BINARY_DEBUG_POSTFIX})
41-
set_target_properties(FluidDemo PROPERTIES RELWITHDEBINFO_POSTFIX ${PBD_BINARY_RELWITHDEBINFO_POSTFIX})
42-
set_target_properties(FluidDemo PROPERTIES MINSIZEREL_POSTFIX ${PBD_BINARY_MINSIZEREL_POSTFIX})
40+
set_target_properties(FluidDemo PROPERTIES DEBUG_POSTFIX ${CMAKE_DEBUG_POSTFIX})
41+
set_target_properties(FluidDemo PROPERTIES RELWITHDEBINFO_POSTFIX ${CMAKE_RELWITHDEBINFO_POSTFIX})
42+
set_target_properties(FluidDemo PROPERTIES MINSIZEREL_POSTFIX ${CMAKE_MINSIZEREL_POSTFIX})
4343
add_dependencies(FluidDemo ${SIMULATION_DEPENDENCIES})
4444
target_link_libraries(FluidDemo ${SIMULATION_LINK_LIBRARIES})
4545
VIS_SOURCE_GROUPS()

0 commit comments

Comments
 (0)