Small tunneling with Body.setVelocity
See original GitHub issueHi !
I’m trying to do a platformer game with matter.js.
And I got trouble when pressing right key, that set Body.setVelocity X to -10 and jumping that set Body.setVelocity Y to -10.
The problem is that the body enter slightly in the body next to him even with :
inertia : Infinity, frictionStatic : 0, friction : 0, slop : 0,
So because of this, the body collide with a body above him, and it should not. It’ supposed to “glide” on the other body.
Img :
Issue Analytics
- State:
- Created 7 years ago
- Reactions:1
- Comments:14 (5 by maintainers)
Top Results From Across the Web
Matter.Body Module - Matter.js Physics Engine API Docs - brm.io
setVelocity. (body, velocity). Sets the linear velocity of the body instantly. Position, angle, force etc. are unchanged. See also Body.applyForce .
Read more >Fast moving bodies and tunneling - Real-Time Physics ...
The is a lot of problems, actually; the biggest is well-known fast body tunneling. Relatively small objects that form the ragdoll suffer
Read more >moving mesh zone, set velocity to all cells of rotation zone.
I want to simulate rotational propeller. I created the rotation zone and static zone. then setup mesh motion for rotation zone. and also...
Read more >Physics2D Module | Package Manager UI website
Tiny supports a subset of Unity 2D Physics referred to as the Physics2D module. ... A Static body does not move under simulation...
Read more >Energy expenditure during flight in relation to body mass: effects of ...
Little direct information on the effect of body mass on flight costs is ... was not an option for our birds flying in...
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
I experienced this as well. I shaped the player’s body to have angles at the bottom to avoid the problem.
https://landgreen.github.io/sidescroller/ Press T to enter testing to see the player shape.
@hilde2 Did you find a good solution? Here is my current approach: https://jsfiddle.net/a7wjrh4u/2 . Movement: <kbd>w</kbd><kbd>a</kbd><kbd>d</kbd>
The
{ chamfer: 8 }
(thanks @liabru) helps a bit, but not completely. Another trick would be to simply not stack static bodies, and instead have a big one, like this: https://jsfiddle.net/a7wjrh4u/8 .I’m not sure if movement is correctly done, the jumping feels a bit strange.
@hilde2 for your first pictures you could try putting the static bodies into each other, like this: https://jsfiddle.net/a7wjrh4u/9/