Skip to content

Commit

Permalink
Merge branch 'develop' of https://github.com/sgumhold/cgv into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
sgumhold committed Jan 28, 2025
2 parents 544fb94 + 0329046 commit 3baea42
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions plugins/examples/rigid_body.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ class rigid_body_test :
bool do_normalize = true;
bool integrate_omega = false;
double time_scale = 1.0f;
bool use_food_points = true;
bool use_foot_points = true;
std::vector<rigid_body<float>> B;
std::vector<rigid_body<double>> dB;
std::vector<cgv::vec3> foot_points;
Expand Down Expand Up @@ -168,14 +168,14 @@ class rigid_body_test :
void integrate(double dt)
{
std::vector<cgv::vec3> foot_points_word;
if (use_food_points)
if (use_foot_points)
compute_foot_points_world(foot_points_word);
size_t i = 0;
if (use_double) {
for (auto& b : dB) {
cgv::dvec3 G(0.0, apply_gravity ? double(-gravity / b.iM) : 0.0, 0.0);
cgv::dvec3 T(0.0);
if (use_food_points) {
if (use_foot_points) {
if (foot_points_word[i][1] < -9.99999) {
b.X[1] -= foot_points_word[i][1] + 9.999995;
T = cross(cgv::dvec3(foot_points_word[i]) - b.X, -G);
Expand All @@ -190,7 +190,7 @@ class rigid_body_test :
for (auto& b : B) {
cgv::vec3 G(0.0f, apply_gravity ? (-gravity / b.iM) : 0.0f, 0.0f);
cgv::vec3 T(0.0f);
if (use_food_points) {
if (use_foot_points) {
if (foot_points_word[i][1] < -9.99999f) {
b.X[1] -= foot_points_word[i][1] + 9.999995f;
T = cross(foot_points_word[i] - b.X, -G);
Expand Down Expand Up @@ -413,7 +413,7 @@ class rigid_body_test :
r.set_radius(ctx, 0.2f);
r.render(ctx, 0, B.size());
}
if (use_food_points) {
if (use_foot_points) {
std::vector<cgv::vec3> P;
compute_foot_points_world(P);
auto& r = cgv::render::ref_sphere_renderer(ctx);
Expand Down Expand Up @@ -459,7 +459,7 @@ class rigid_body_test :
add_member_control(this, "Time Scale", time_scale, "value_slider", "min=0.1;max=100.0;log=true;step=0.01");
add_member_control(this, "Step Size", h, "value_slider", "min=0.00001;max=0.1;log=true;step=0.000001");
add_member_control(this, "Apply Gravity", apply_gravity, "check", "shortcut='G'");
add_member_control(this, "Foot Points", use_food_points, "check", "shortcut='F'");
add_member_control(this, "Foot Points", use_foot_points, "check", "shortcut='F'");
add_member_control(this, "Show Boxes", show_boxes, "check", "shortcut='B'");
add_member_control(this, "Wireframe", wireframe, "check", "shortcut='W'");
add_member_control(this, "Show Centers", show_centers, "check", "shortcut='C'");
Expand Down

0 comments on commit 3baea42

Please sign in to comment.