Samuel Girardin

Energy.js playground

Recommended Posts

Hi, 

I've made few playgrounds using energy.js (it's a physic engine) , so you can test the engine live. It's still an alpha version, but you can fun ! 

bounce box

ball joint

wood machine

vehicle (arrow keys)

Typescript sources, grunt, etc : github

It's quite  tricky to get the engine works on the playground (append script and refresh), maybe you can have after multiple run a memory error).

sam

 

 

 

 

 

Share this post


Link to post
Share on other sites
Quote

VM162:140 Mixed Content: The page at 'https://www.babylonjs-playground.com/#URPXQB' was loaded over HTTPS, but requested an insecure script 'http://www.visualiser.fr/energy_playground/energy.js'. This request has been blocked; the content must be served over HTTPS.

Chrome redirects to https for me.  I was finally able to view the PGs in Firefox, though.  Thanks

Share this post


Link to post
Share on other sites
12 hours ago, Deltakosh said:

And a plugin for bjs? :) (pretty please?)

Pretty pretty pretty please :)

How is Energy.js compared to ammo.js.... 

Can Energy.js handle Terrain meshes or heightmaps and use other colliders besides sphere like cannon issues???

Can you do Cloth with energy js...

I too was about to start playing with porting Ammo.js as well... I cant tell how far @BitOfGold or @RaananW got with this... so was going to give it shot myself...

BTW... How far are guys... can i check out anything ???

 

 

Share this post


Link to post
Share on other sites

@MackeyK24

 

ammo vs energy : about the native engines, bullet (ammo is based on bullet) was developed after Ode (energy is based on ode), so I suppose Ammo is better. About the asm or wasm port with emscripten, ammo is a kind of automatic port, on my side all is done manually I expose only needed classes and methods. 

About perfs, I really don't know, but the matter is not to say, the engine handle 1000 boxes at 60 fps,. I think physic engine are really tricky, hard to tune, you really have to test and test to perform good simulation., and to learn the engine. 

About the car demo ,  both trimesh and heighmap,  line 52 set the last boolean to true, and search subdivide repalce 512 by 256, finally it s here http://www.babylonjs-playground.com/#A5NDZJ#48

Cloth : no. About the plugin I will answer later this day in demo and project topic

Share this post


Link to post
Share on other sites
28 minutes ago, Samuel Girardin said:

@MackeyK24

 

ammo vs energy : about the native engines, bullet (ammo is based on bullet) was developed after Ode (energy is based on ode), so I suppose Ammo is better. About the asm or wasm port with emscripten, ammo is a kind of automatic port, on my side all is done manually I expose only needed classes and methods. 

About perfs, I really don't know, but the matter is not to say, the engine handle 1000 boxes at 60 fps,. I think physic engine are really tricky, hard to tune, you really have to test and test to perform good simulation., and to learn the engine. 

About the car demo ,  both trimesh and heighmap,  line 52 set the last boolean to true, and search subdivide repalce 512 by 256, finally it s here http://www.babylonjs-playground.com/#A5NDZJ#48

Cloth : no. About the plugin I will answer later this day in demo and project topic

Wow... That is amazing... the car demo on a terrain....

I am creating a Terrain Building System For The Babylon Toolkit... But Cannon cant quite handle terrains that well and the heightmap and mesh support sucks.

I love your demo... I been debating if i am going to go with doing a port of Ammo.js ... But i would hate to go thru ALL the tedious shit in port Babylon.CannonJSPlugin to work with the Ammo.js C++ Bindings and someone else Like @BitOfGold or @RaananW has already got that working... Would love to hear from you guys on that :)

 

Share this post


Link to post
Share on other sites

@MackeyK24 I'm using Ammo through colyseus.js on the server side, and in a separate worker script with game logic in browser. It's really different from a BABYLON plugin so I think i cannot make a plugin from that. (It's mixed with game logic)
Ammo is really fast with the WASM version of it, I really don't know Energy js is faster or slower.

Most of my problems with Ammo/wasm is its really easy to make memory leaks and then it chrashes.
Yes it's tedious to interface with Ammo/Bullet, but its several times faster than cannon.

 

Share this post


Link to post
Share on other sites

This is awesome! Great to hear this is still being worked on!

I'd be happy to integrate Energy into a demo I'm working on that compares the engines. I've got Cannon, Oimo and Ammo running the same collapsing blocks demo. Be great to integrate this.

I plan to release it this week. Would love to add it before release but could always add it later.

Share this post


Link to post
Share on other sites
1 hour ago, PhilT said:

This is awesome! Great to hear this is still being worked on!

I'd be happy to integrate Energy into a demo I'm working on that compares the engines. I've got Cannon, Oimo and Ammo running the same collapsing blocks demo. Be great to integrate this.

I plan to release it this week. Would love to add it before release but could always add it later.

How did you get Ammo.js working ???

Share this post


Link to post
Share on other sites

So I integrated Energy into my collapsing wall demo which I'll be publishing this weekend. Initial tests seems indicate it's about on par with Cannon.js so one of the slower ones. However, I appreciate it's alpha and my implementation is probably less than optimal so take it with a grain of salt.

I basically ripped some code out of the bouncing box demo and added some friction with mu surface parameters. It kinda looks similar to the other demos but they all behave slightly differently anyway (another interesting thing to see).

Share this post


Link to post
Share on other sites

The comparison is now live at: http://games-matter.com/assets/enginetest/

The fact the bricks fall in different ways could affect the framerate here as well. Cannon for example seems to hold the wall together quite well but as a result I think it's having to do a lot of work.

@Samuel Girardin do you think tweaking the surface parameters would help performance here?

Share this post


Link to post
Share on other sites

@PhilT Thank you, this is cool!
Good to see a base comparison between engines!

I was searching for this for weeks.
Now we have several comparisons, yours,  @lo.th 's Labs...
https://lo-th.github.io/Energy.lab/#basic
http://lo-th.github.io/Ammo.lab/#basic

Ammo's broadphase is very good when less objects are moving and more are static (jumps up to 60FPS when bricks stop moving)
It is ideal for games, as this the frequent case with a few moving characters, objects, triggers and many static elements.
A very good signal is that playcanvas uses Ammo now.
 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

  • Recently Browsing   0 members

    No registered users viewing this page.