Skip to content
Sign UpLog In
This post is read-only. Explore Repls and connect with other creators on Community.View Community
The info in this post might be out of date, check out our docs instead. View docs
76

SortaBomber - Explosion Physics

tussiez
tussiez

SortaBomber

Blow up stuff.

This is my replica of Roblox's "welds" system. This groups static objects together, e.g buildings, but when hit above a set speed, the building will break.

Controls

  • (RIGHT) click and drag to look around.
  • (LEFT) click to fire explosives.

Improvements

I modified Physijs to work with the WASM version of Ammo, which has improved performance by.. a lot. It's now possible to simulate a few hundred blocks now without any lag. I would update the car physics game with this, but there are a few underlying problems with Physijs itself and Ammo (I spent a few hours getting collisions to work correctly), which means more bug fixing :/

How it works

Objects are first added to a parent object. This makes them a compound shape. Explosions are calculated by their position and force. The overall group has a set "strength", and this is reduced by repeated explosions, amplifying the damage done. The velocity of an object is reduced by the distance it is from the explosion, and increased by the explosion force. Objects farther away from the bomb move slower, and vice versa. Because objects cannot move independently from their parent, the ones nearest to the explosion are orphaned and made dynamic. Simply removing the object from the parent and adding it to the scene doesn't work, so I clone the object (probably a bad idea) instead.

Enjoy!

Play new version! (with buildings)

Play it!

Not working?

This Repl uses experimental technology that may not yet be supported across all platforms and browsers. For the best experience, use the following:

  • A home desktop/laptop computer, some schools may block some files
  • Chrome 89 or as recent as possible

What may be the issue:

  • WASM
  • Module Web Workers
  • WebGL
  • ES6 (Don't use Internet Explorer 😭)
2 years ago
You are viewing a single comment. View All
3
OldWizard209
OldWizard209

Wait, firstly, it says:

image

Assuming it is "Physics" with a "C", How in the "PHYSICS WORLD" does this make sense?:

image

Oh or probably it is just the subject of "Physijs" not "Physics".

2 years ago
2
IronStarkMan
IronStarkMan

Well, IMMA call Mr.Neil deGrasse, this can't be tolerated.

@OldWizard209

2 years ago
1
DavidHilsee
DavidHilsee

@OldWizard209
it says physijs because it is written in javascript (aka js)

2 years ago