Skip to content

Commit 8e31c38

Browse files
committed
- added coupling demo
- added ball joint which links a rigid body and a particle
1 parent c06b300 commit 8e31c38

24 files changed

+2053
-17
lines changed

Changelog.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
- added coupling demo
2+
- added ball joint which links a rigid body and a particle
13
- added universal joint
24
- improved hinge joint
35
- added documentation for position based fluids

Demos/BarDemo/TimeStepTetModel.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ void TimeStepTetModel::clearAccelerations(TetModel &model)
6262
}
6363
}
6464

65-
void TimeStepTetModel::reset(TetModel &model)
65+
void TimeStepTetModel::reset()
6666
{
6767

6868
}

Demos/BarDemo/TimeStepTetModel.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ namespace PBD
2020
virtual ~TimeStepTetModel(void);
2121

2222
void step(TetModel &model);
23-
void reset(TetModel &model);
23+
void reset();
2424

2525
unsigned int getVelocityUpdateMethod() const { return m_velocityUpdateMethod; }
2626
void setVelocityUpdateMethod(unsigned int val) { m_velocityUpdateMethod = val; }

Demos/BarDemo/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ void cleanup()
9494
void reset()
9595
{
9696
model.reset();
97-
simulation.reset(model);
97+
simulation.reset();
9898
TimeManager::getCurrent()->setTime(0.0);
9999
}
100100

Demos/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
include(Visualization/CMakeLists.txt)
22

3-
subdirs(BarDemo ClothDemo FluidDemo RigidBodyDemos)
3+
subdirs(BarDemo ClothDemo FluidDemo RigidBodyDemos CouplingDemos)

Demos/ClothDemo/TimeStepTriangleModel.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ void TimeStepTriangleModel::clearAccelerations(TriangleModel &model)
6363
}
6464
}
6565

66-
void TimeStepTriangleModel::reset(TriangleModel &model)
66+
void TimeStepTriangleModel::reset()
6767
{
6868

6969
}

Demos/ClothDemo/TimeStepTriangleModel.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ namespace PBD
2121
virtual ~TimeStepTriangleModel(void);
2222

2323
void step(TriangleModel &model);
24-
void reset(TriangleModel &model);
24+
void reset();
2525

2626
unsigned int getVelocityUpdateMethod() const { return m_velocityUpdateMethod; }
2727
void setVelocityUpdateMethod(unsigned int val) { m_velocityUpdateMethod = val; }

Demos/ClothDemo/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ void cleanup()
117117
void reset()
118118
{
119119
model.reset();
120-
simulation.reset(model);
120+
simulation.reset();
121121
TimeManager::getCurrent()->setTime(0.0);
122122
}
123123

Demos/CouplingDemos/CMakeLists.txt

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
set(SIMULATION_LINK_LIBRARIES AntTweakBar glew PositionBasedDynamics)
2+
set(SIMULATION_DEPENDENCIES AntTweakBar glew PositionBasedDynamics)
3+
4+
if(WIN32)
5+
set(SIMULATION_LINK_LIBRARIES freeglut opengl32.lib glu32.lib ${SIMULATION_LINK_LIBRARIES})
6+
set(SIMULATION_DEPENDENCIES freeglut ${SIMULATION_DEPENDENCIES})
7+
else()
8+
find_package(GLUT REQUIRED)
9+
find_package(OpenGL REQUIRED)
10+
11+
set(SIMULATION_LINK_LIBRARIES
12+
${SIMULATION_LINK_LIBRARIES}
13+
${GLUT_LIBRARIES}
14+
${OPENGL_LIBRARIES}
15+
)
16+
endif()
17+
18+
add_executable(RigidBodyClothCouplingDemo
19+
RigidBodyClothCouplingDemo.cpp
20+
21+
TimeStepRigidBodyParticleModel.cpp
22+
TimeStepRigidBodyParticleModel.h
23+
RigidBodyParticleModel.cpp
24+
RigidBodyParticleModel.h
25+
26+
${VIS_FILES}
27+
${PROJECT_PATH}/Demos/Utils/Config.h
28+
${PROJECT_PATH}/Demos/Utils/TimeManager.cpp
29+
${PROJECT_PATH}/Demos/Utils/TimeManager.h
30+
${PROJECT_PATH}/Demos/Utils/RigidBody.h
31+
32+
CMakeLists.txt
33+
)
34+
35+
set_target_properties(RigidBodyClothCouplingDemo PROPERTIES FOLDER "Demos")
36+
add_dependencies(RigidBodyClothCouplingDemo ${SIMULATION_DEPENDENCIES})
37+
target_link_libraries(RigidBodyClothCouplingDemo ${SIMULATION_LINK_LIBRARIES})
38+
39+
40+
add_definitions(-DTW_NO_LIB_PRAGMA -DTW_STATIC)
41+
find_package( Eigen3 REQUIRED )
42+
include_directories( ${EIGEN3_INCLUDE_DIR} )
43+
include_directories(${PROJECT_PATH}/extern/freeglut/include)
44+
include_directories(${PROJECT_PATH}/extern/glew/include)
45+
46+
47+
VIS_SOURCE_GROUPS()

0 commit comments

Comments
 (0)