Restitution doesn't seem right sometimes
See original GitHub issueIn the following gif both cats share the same physics properties.
Cats’ restitution is set as 0.1
Ground restitution is set as 0.8
Everything was created using the Matter.Bodies.rectangle.create(x,y,w,h,o)
constructor.
The cats bounce normally unless their rotation is set to an angle between 71 and 109 degrees (~1.22 to ~1.91 radians). As soon as the rotation goes to 70 or 110 degrees the cats bounce normally.
Here’s a fiddle for reproducing this.
Is that expected behavior?
I’ve also noticed that static bodies’ restitution doesn’t play a role in physics simulation. Is that correct?
Issue Analytics
- State:
- Created 7 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
Three Reasons Conversion Doesn't Involve Restitution
We don't have to do anything to be accepted by God except repent and put our faith in Christ. Repentance Means Change Versus...
Read more >How is restitution calculated? A defense lawyer explains
Restitution is calculated by totaling the financial losses suffered by the victim of a crime. Different states use different systems.
Read more >Challenging Restitution: an Often Overlooked Area of Advocacy
If you provide the clear authority to give the judge a reason not to saddle your client with enormous debt, judges often do...
Read more >Restitution Process - Department of Justice
The Restitution Process (Fraud and/or Financial crimes). In federal court, a convicted offender may be ordered to reimburse victims for ...
Read more >QUESTION 62 Restitution Next we have to consider restitution ...
Therefore, restitution does not seem to be an act of any part of justice. ... both to substance and to the right of...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Setting inertia to infinity solves my problem entirely, but while your explanation on why this could be expected behavior seems right to me, I don’t get why this problem only happens for my simulation when the left rectangle is set to an angle EXACTLY between
-71
and-109
, and as soon as it go to-70
or-110
(same applies for positive rotations) the restitution fixes itself. Here’s a demo:-80° (it looks like this since -109°):
-71°:
-70°:
Seen from this perspective this looks like unexpected behavior, doesn’t it? Anyway, not a big issue after all, just a little weird collision response. Feel free to close the issue if you think this is not a bug at all.
Also, I’m okay with the static bodies’ predefined restitution.
little update - i figured it out, if you create a body like this:
var rect = Matter.Bodies.rectangle(x, y, width, height, { isStatic: true, restitution: 0.9 }
restitution is set to 0 anyway, you should modify restitution manually after body creation