Advertisement

Latest Box2D Activity

8Observer8
April 05, 2024 10:42 AM
How to set up Box2D-WASM with importmap and Rollup for JavaScript

​Playground: https://plnkr.co/edit/BGNYcIJRiJXpd9N4?preview

GitHub: https://github.com/8Observer8/how-to-set-up-box2dwasm-with-importmap-rollup-js

glMatrix is just a bonus:

index.html

<!DOCTYPE html>

<html lang="en">

<head>
    <meta charset="utf-8">
    <meta name="viewpor…
40,131 views
Advertisement
8Observer8
July 21, 2023 01:36 PM
The debug drawer of Box2D-WASM colliders using Melon.js and JavaScript

I added debug drawing of the circle collider using the Melon.js game engine and Box2D-WASM.

Live demo: https://8observer8.github.io/webgl10-js/debug-drawer-box2dwasm-melonjs-js/
GitHub repository: https://https://github.com/8Observer8/debug-drawer-box2dwasm-melonjs-js

Playgrounds/Sandboxes:

2,592 views

its_artem said:
Actually, I tried disabling the b2Bodies and setting their locations to the positions they would have fallen to, and they're still jittering.

Well, figuring out it's not because of physics is progress.

Just stating the obvious, but now you need to figure out what's the difference betwe…

4,030 views

Never used box2d, but as nobody else seems to have time, let's try.

I copy/pasted the code above and reformatted it to something readable. Compiling it fails with:

$ g++ something.cpp
something.cpp: In function ‘void AddBox(b2World&, int, int)’:
something.cpp:132:20: error: invalid conversion fro…
4,172 views

AntonioR said:
@SuperVGA Thanks. If you look at the textures you will actually find Abuse checkpoint texture there, but I did not implement checkpoints, because I did not finish the level. Back in 2012 I made a different Quake 2D game and everybody was also comparing it to Abuse, but I have not play…

4,612 views
8Observer8
January 29, 2021 11:48 PM
Usage of Planck.js with TypeScript (Planck.js is a port of Box2D Physics Engine)

My example shows how to use Ammo.js with TypeScript in Debug and Release modes: hello-planckjs-webgl10-ts

You should install these modules globally:

  • npm i typescript -g
  • npm i browserify -g
  • npm i uglify-js -g

Install all packages from `package.json` using the command: `npm i`

Comment/Uncomment Debug/Relea…

6,286 views
5 hours ago, Dirk Gregorius said:

Box2D does not use incremental manifolds, but builds full manifolds each frame. The contact and friction impulses are matched between frames using contact IDs. 

Erin has given a bunch of talks over the year which cover certain aspects of …

4,135 views

I think this is not correct if you mean general triangle meshes. Both SAT and GJK only work for collision/distance between *convex* polyhedra. Also, you use SAT for nearly all boolean overlap tests I am aware of. At least in a specialized form. It is the basic idea for these kind of tests. For di…

4,755 views

And yes, the first approach is a simplified version of the second approach. It is missing key features needed to avoid jittering and to let shapes stack nicely in piles.

11,001 views

I agree, this is actually what I'm doing. I was previous passing down the position and rotation of the parent object, and moving the sub-objects around to suit the new position.

Having a proper transformation matrix makes this really easy now as I simply pass a reference to the parent transf…

6,413 views
On 4/19/2018 at 10:50 PM, swiftcoder said:

I do not.

Ok, that makes it even easier, since you know by the key press which way they are flipping.

At the most basic, you just need to count how many times the bike passes 180 degrees rotation (assuming that 0º is up…

4,064 views
desdemian
April 14, 2018 07:54 PM
Working on the AI, a coreographic fight.

This week was full work on the AI, which was lacking a bit, to say the least. It is a simple state machine that changes based on the distance to the character (far? jump, close? punch/kick) and its own physical state (falling? stucked? idling? close to edge?).

Eventually I managed to make se…

2,463 views
lawnjelly
March 29, 2018 12:36 PM
Evaluating Box2D

I've been using my own internal physics so far for my jungle game, but had been meaning to try out Box2D as I had heard good things. Whether to use third party middleware for physics comes down to a few pros and cons for me:

Middleware
  • Mostly written already
  • Tested
3,259 views

This post game is about death, love and drugs.

Download - https://gamejolt.com/games/Dead_Dream/259419

 

 

 

2,572 views
desdemian
March 13, 2018 05:30 PM
The new tutorial

Refining the tutorial was probably one of the hardest part of the "later development". Everything was in place, but how to teach the player how to play the game was still a struggle.

The first time somebody tried my game, he was 15 minutes on level 1 and he couldnt even solved it. So this wa…

4,248 views
desdemian
February 20, 2018 05:26 PM
A new hud

Lately I've been working on updating the hud. The game is quite colorful (once you press play) so I thought adding a cardboard only hud to make the distinction.

Use to look like this:

Now it looks like this:

Top left is supposed to be the briefing about the current level. Wor…

2,448 views
[Android] JumpBall

Pretty nice game. Very relaxing.

3,079 views
Understanding Constraint Resolution in Physics Engine

Original Post: Limitless Curiosity

Out of various phases of the physics engine. Constraint Resolution was the hardest for me to understand personally. I need to read a lot of different papers and articles to fully understand how constraint resolution works. So I decided to write this article t…

28,831 views
desdemian
November 30, 2017 05:40 PM
Replicating a simulation with Box2d, part 3.

In the last post, I explained how to solve the box2d issue about cloning a world. It's pretty simple, fairly fast and reliable in its results.

I didn't use it. Why? Because there are some cases (like my game) that it doesn't w…

2,915 views
desdemian
November 27, 2017 05:33 PM
Replicating a simulation with Box2d, part 2.

So, in the previous post I said the main problem about duplicating a box2d world. The worlds differ.

Why would you want to duplicate a box2d world?

There are several reasons:

  • To replay a cool sequence.
  • To predic…
  • 4,194 views

    Very nice! Looks like it has everything! Can you create isometric games with this engine or just platform games?

    2,425 views
    behc
    August 14, 2017 08:47 PM
    Proof of Concept

    Greetings everyone!

    I finally managed to put together complete system that will be used as a backbone of my new game. The game itself is supposed to be a mix of Kerbal Space Program and Space Engineers in 2d, maybe with some added influences from other games. I'll get back to this later, whe…

    2,610 views
    Physically speaking, see if you could change the enemy's mass.

    Now speaking according to my personal experience with farsear for xna (which is based on box2d)
    If I'm not mistaken you can override the collision event of the enemy. Just make sure you return false and it'll be like the collision never…
    6,100 views
    Box2d is it fast?
    There has been some general discussion here about how physics engines are able to accelerate things, which makes it relevant to this forum even though there is a heavy box2d component. I will say, though, that I would rather not see a lengthy discussion of the internals of or how to use box2d here.…
    9,424 views
    Advertisement
    Advertisement