Comments (5)
For one thing, restitution is strictly [0,1] so a value of 2 is invalid (creates energy).
Also, as it stands, restitution may not be particularly accurately simulated - I think it may require some more work.
Another problem is avoid using high friction values, since they are unstable (a known issue with the friction system) - a reasonable value is more like 0.1.
Regarding the effect of shape on response - I've looked into this before.
I'm not yet 100% sure if shape should or should not have an effect in this simulation.
In real life, it does, but I'm not sure if this is for reasons that are not simulated in this engine.
For example, in real life, consider a super elastic metal ball bearing dropped to the ground - when it hits it bounces back a significant amount.
Now consider if the same material of that ball were stretched out into a thin tube, and you drop it again in real life.
Does it bounce as well as a ball, assuming it impacts exactly edge parallel on its longest edge like in the simulation?
I don't think it will?
Is there a difference in response between bouncing on the long edge vs bouncing on the ends? I think there is?
E.g. It's possible to get a long wooden stick to bounce if it hits on its ends, rather than falling flat on its longest side.
Why is this? I'm not 100% sure whether its due to material properties (e.g. internal compression / decompressions) which are not simulated or whether it naturally falls out of the kinetic equations regarding contact normals vs velocity and torque and the offset to centre of mass.
I'll have to investigate, thanks for providing the report.
from matter-js.
Two things I've discovered:
- Dropping a rectangle at a 45 degree angle will have it behave more like a circle
- The above example was using the default frictionAir value of 0.01. When set to 0, a 45-degree rectangle will be mostly elastic at 1.0 restitution. I say mostly because sometimes it will bounce lower and sometimes higher than its starting point. I'm not sure if there's some other variable getting in the way.
I don't have enough physics knowledge to comment on whether it is accurate to materials, but in general one of the first things I do with a physics engine is drop a box and see it bounce, and this was not inline with expectations (and I believe some other engines I played with).
from matter-js.
I've just realized something else on this issue - to test restitution you need to make sure to set frictionAir
on the body to 0
and also I'd set friction
to 0
too. Air friction is probably why you wasn't getting a 100% response.
I just tried it, and a restitution value of 1
seems to work as expected (or at least, close enough).
from matter-js.
Yes, I realized that later as well. From (2) in #13 (comment) , even when frictionAir is 0 and being a circle there's still a bit of instability in how high the object bounces, but it is much better.
from matter-js.
I'm going to close this for now - from my testing the results seem close enough given the above, albeit not always completely perfect but I think this is close enough for Matter's intended uses.
Feel free to comment further if you find more problems on this though
from matter-js.
Related Issues (20)
- Render.setSize is not present in the build
- Trying to change seed, to take control of deterministic behavior
- How to suppress body tremors? HOT 2
- Why does the attractor only work on one of the two BODYs? HOT 1
- Using compound bodies with Bodies.fromVertices does not work it just shows a filled in shape. HOT 1
- Why don't bodies sometimes collide? HOT 1
- Constraints with distance limits (e.g. for ropes)
- Why might there be such an error? HOT 1
- Simple Polygon Physics Issues HOT 1
- How to add project to the Wiki gallery ?
- How to scale the world? HOT 2
- [Phaser 3] Position of matter sprite's image not correct in container HOT 1
- loss of sprite quality on mobile HOT 1
- `Composite.translate` didn't move the bodies included
- Create Matter.Bodies.fromVertices with rounded vertices
- MouseConstraint preventing clicks on buttons on mobile. HOT 2
- Vulnerability related to the formula of universal gravitation
- Body with high mass and low inertia behaves erratically
- The startdrag event of dragging a body does not trigger after losing focus.
- How to move camera in matter.js world?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from matter-js.