Skip to content

Commit

Permalink
[fix] inv mass
Browse files Browse the repository at this point in the history
  • Loading branch information
MrsRina committed Sep 29, 2024
1 parent ca2895c commit f2a1816
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions meow/src/meow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -316,9 +316,9 @@ int32_t main(int32_t, char**) {

bicudo::physics::placement *p_cow {new bicudo::physics::placement({
.p_tag = "vakinha",
.mass = 2000.0f,
.friction = 0.8f,
.restitution = 0.2f,
.mass = 20.0f,
.friction = 1.0f,
.restitution = 0.0f,
.pos = {20, 20},
.size = {144, 144},
.acc = gravity
Expand All @@ -327,8 +327,8 @@ int32_t main(int32_t, char**) {
bicudo::physics::placement *p_cow_2 {new bicudo::physics::placement({
.p_tag = "gatinho",
.mass = 20.0f,
.friction = 0.8f,
.restitution = 0.2f,
.friction = 1.0f,
.restitution = 0.0f,
.pos = {200, 20},
.size = {400, 50},
.acc = gravity
Expand Down
2 changes: 1 addition & 1 deletion src/bicudo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ void bicudo::update_position(
p_placement->inertia = 0.0f;
p_placement->mass = 0.0f;
} else {
p_placement->mass = p_placement->mass;
p_placement->mass = (1.0f/ p_placement->mass);
p_placement->inertia = (1.0f / p_placement->mass) * p_placement->size.magnitude_no_sq() / p_runtime->intertia_const;
p_placement->inertia = 1.0f / p_placement->inertia;
}
Expand Down

0 comments on commit f2a1816

Please sign in to comment.