Innovations in Physical Simulations: More Interaction
*With the collaboration of David Ávila.
We continue working on the utilities of our 3D graphics engine, Evergine. Today we want to present you one that makes us incredibly excited and that can help you to simulate movements as different as particle collisions or the effect of the air on a static car inside a wind tunnel.
What we have done
Until now, when you looked for physics engine demos in a web browser, they used to have significantly reduced functionalities: few objects and limited ways to interact… Instead, as you can see below, we have brought all the functionality of an advanced physics engine (Bullet Physics) to web browsers. This allows for more advanced ways to create real-time physics simulations. In the following example, you can see a simulation using joints, which interconnect different physical objects with each other (the various links of the bridge) and react dynamically with the rest of the cubes in the scene:
We're continuing working to bring #BulletPhysic to Web in the next #Evergine Release 🙂
Now, a small demo using physic joints.
But, how are we doing that?
🧵Thread 👇#GameDev #dotnet #net6 #blazor pic.twitter.com/0U5Ye3EFC9— David Ávila (@davilovick) December 22, 2022
It wasn’t easy to achieve this level of physics in a web browser. In the following video, you have even more elements, and it is possible to see how they interact with each other when hit by physical projectiles:
As a result, we use the same physic library on each platform supported by #Evergine (including Web in the next release😉).
This will allows our users to increase the interactivity in Web applications, now that we have #WebXR support.I hope that you like this technical thread 🙂 pic.twitter.com/6ExdmgoTH5
— David Ávila (@davilovick) December 22, 2022
What it is used for
Various industries can use this innovation. For example, in the representation of particle collisions, something that research laboratories, universities, or other educational centers also take advantage of. It can also be used for virtual wind tunnels to test the air resistance of vehicles, airplanes, or bridges. Also, from now on, it would be okay to mathematically ‘throw’ lightning bolts in reproducing atmospheric phenomena within web applications. In addition, achieving realistic physical simulations allows the design of advanced machine-learning environments.
WebXR can also take advantage of web support for physical simulations. For example, it is launching a WebXR-enabled web application on a cell phone that allows interaction with physical objects placed virtually in the real world via AR (Augmented Reality) from the screen.
How we have achieved it
At Evergine, our main physics engine is an open-source graphics engine called Bullet Physic or just Bullet. Recently we have managed to get Bullet to compile in WASM, a binary code format for web browsers.
All the graphics engines we know use external physics engines and compile to Javascript or S.js, but only some have compiled to WASM. We have achieved this thanks to Emscripten, which allows us to collect WASM from C++ code, and to Microsoft‘s latest developments in Blazor compilers, which will enable us to link the Bullet Physics library and use it in the Evergine engine. All this has been possible thanks to the latest developments that Microsoft has released in Blazor.NET6, another of the company’s frameworks for application development.
In short, this innovation puts us at the forefront of graphics engines and 3D image generation in web browsers. If you want to know more about what’s new in Evergine thanks to the advances of Blazor and .NET6, we will be happy to help you.