Skip to content

Commit

Permalink
Merge pull request #2 from BarthPaleologue/HPBD
Browse files Browse the repository at this point in the history
Last minute changes
  • Loading branch information
BarthPaleologue authored Feb 9, 2024
2 parents e2187b5 + 8d1db60 commit 8a9683c
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
Binary file added HXPBD_report.pdf
Binary file not shown.
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,15 @@ The entire code for the physics engine is available in the `core/physics` direct
- Collision LoD using HPBD
- Constraints and bounding boxes helpers

A detailed report is available in the root directory of the project.

## Main controls

- Mouse drag: Rotate the camera
- Ctrl + Mouse drag: Pan the camera
- Mouse wheel: Zoom in/out
- Shift + Mouse drag: lock rotation to pick an object

### How to build

#### Dependencies
Expand Down
3 changes: 2 additions & 1 deletion core/physics/HXPbdSolver.h
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,8 @@ class HXPbdSolver {
if(!body->mesh()->isEnabled()) continue;

// solve hierarchy of distance constraints
for (const auto &distanceConstraints: body->distanceConstraintsPerLevel()) {
for (int level = body->distanceConstraintsPerLevel().size() - 1; level >= 0; level--) {
auto distanceConstraints = body->distanceConstraintsPerLevel()[level];
for (const auto& distanceConstraint: distanceConstraints) {
distanceConstraint->solve(subTimeStep);
}
Expand Down

0 comments on commit 8a9683c

Please sign in to comment.