liabru

Matter.js - v0.8.0 - a 2D physics engine for the web

Recommended Posts

Matter.js v0.8.0-alpha
 
a JavaScript 2D rigid body physics engine for the web
 

matter-js-screenshot-2.pngmatter-js-screenshot-1.png
matter-js-screenshot-4.pngmatter-js-screenshot-6.png
 
 
It's about time I opened a thread here for this, since I just released a new version!
 
Matter.js is (another!) 2D physics engine for HTML5 games. Competition is always good ;)
 
It's currently still alpha, but it's pretty stable and performance is very good (e.g. the mobile demo pulls 60FPS on a Nexus 4).
 
Note that it's not a complete game engine or a framework, but it has the components to get started including a game loop and renderer.
See the links at the start of the topic for lots more info.
 
Hope you guys like it, cheers!

Share this post


Link to post
Share on other sites

Matter.js v0.8.0-alpha
 
Released Matter.js version v0.8.0-alpha, see the changelog

Release highlights:

  • added Views demo
  • added Time Scaling demo
  • added Rounded Corners (Chamfering) demo
  • added Raycasting demo
  • added Query module, including raycasting
  • added 3 useful new Composite methods
  • added support for mouse wheel, mouse scaling and offsets
  • added Body.scale for scaling bodies on the fly
  • added Body.timeScale for slowing down bodies per-body
  • added Body.setStatic for correctly setting static
  • added Vertices.chamfer for rounding corners of any set of vertices
  • added integration of chamfer to body factories
  • added engine.timing.isFixed option to disable dynamic timing
  • added render.bounds for translating and scaling views
  • easier use of Engine.update and Engine.render for those using custom game loops
  • fixed issues with time scaling
  • fixed error in calculation of centre of mass
  • removed Matter.Gui in preparation for the MatterTools project launch

@Alvin 

 

Thanks, it's great to be here, this is seems like a pretty cool community

Share this post


Link to post
Share on other sites

First look: Reaaly good, this may now be my js physics engine of choice!

Tested on iPad 3 (ios 6): Oh, it was so promising at first...

 

Performance is not as good as I hoped.

 

Can you try out the mobile demo on your iPad and tell me what the FPS is (and if it goes fullscreen when you tap on it)?

 

Unfortunately I don't have an iPad available for testing my self at the moment, but I have tested on a Nexus 4 and an LG tablet and the mobile demo performs well (mostly 60fps) on mobile Chrome.

Something to note is that I generally find that performance can take a hit when the canvas isn't the only element on the page.

Share this post


Link to post
Share on other sites

Tester on some devices :

Android 4.2 mobile : Fullscreen OK, and 50/54 FPS
Nexus 7 tablet : Fullsscreen OK, but the scene is empty (I see the borders, the FPS text but no physics body)

iPad mini : 34/40 FPS, but no Fullscreen : this is normal since fullscreen API is not implemented on iPad

Android stock browser on a samsung galaxy S3 : no fullscreen, the scene and bodies shows but no touch interaction, when I flip the screen, some bodies fall down other are stick.

Share this post


Link to post
Share on other sites

Tester on some devices :

Android 4.2 mobile : Fullscreen OK, and 50/54 FPS

Nexus 7 tablet : Fullsscreen OK, but the scene is empty (I see the borders, the FPS text but no physics body)

iPad mini : 34/40 FPS, but no Fullscreen : this is normal since fullscreen API is not implemented on iPad

Android stock browser on a samsung galaxy S3 : no fullscreen, the scene and bodies shows but no touch interaction, when I flip the screen, some bodies fall down other are stick.

 

 

iPad 3 (iOS 6) - mostly 28-30 fps, no fullscreen

 

Thanks guys.

 

If you get time, could you guys please try this mobile demo:

http://brm.io/matter-test/mobile/

 

And tell me the FPS and exactly what device / browser / OS version you're using?

Make sure to close down background tasks too I think

Thanks

Share this post


Link to post
Share on other sites

A challenge for you... can you put the entire or parts of the engine on the GPU instead of CPU?

 

The NVidia PhysX engine, when run by the GPU, can see as much as 20x performance gain.

 

The thing is physics engine shouldn't take away too much CPU cycles from the game logics.

Share this post


Link to post
Share on other sites

I've been playing with this a bit, anyone else? I've been trying to find dummy or placeholder objects, does matter.js have those? Box2D has them as sensor objects "... they never collide with anything. But they do generate BeginContact/EndContact callbacks to let us know when they start or stop overlapping"

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.