Skip to content

Commit

Permalink
Remove log, add comment
Browse files Browse the repository at this point in the history
  • Loading branch information
mflerackers committed Oct 4, 2024
1 parent 513cb41 commit e0327d9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/components/physics/body.ts
Original file line number Diff line number Diff line change
Expand Up @@ -213,18 +213,18 @@ export function body(opt: BodyCompOpt = {}): BodyComp {

const friction = Math.sqrt(
(col.source.friction || 0)
* (col.source.friction || 0),
* (col.target.friction || 0),
);
const restitution = Math.max(
col.source.restitution || 0,
col.source.restitution || 0,
col.target.restitution || 0,
);

if (restitution != 0) {
// TODO: if the other body is also not static, the magnitude of the velocity needs to be redistributed
this.vel = this.vel.reflect(col.normal).scale(
restitution,
);
console.log(this.vel);
}
},
);
Expand Down

0 comments on commit e0327d9

Please sign in to comment.