body lag when many shapes #love.physics #box2d

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
chu
Prole
Posts: 1
Joined: Fri Aug 10, 2018 1:25 pm

body lag when many shapes #love.physics #box2d

Post by chu »

Hellö dear devs,

I have a question about physics.

I'm currently trying to build a sandbox, some kind of space minecraft with gravitation laws applied, but I've been stuck for a long time with the Body/Fixture/Shape trio.

In my game, i have what i call molecules, made of atoms.

A molecule has a Body, and an array of Fixtures(+Shape) attached to it (the atoms).

When two molecules collide, my goal is to merge them into one molecule.

My problem is that when i add a lot of Fixtures(+Shape) to a Body, the game is exponentially laggy :(

Does anyone know if :
- there's a simple solution ? a setting like friction, damping or whatever that i can change ?
- this is a box2d limitation ?
- this is the current implementation of box2d in love2d limitation ?
- this is my f****** code that is limited ? :ultraglee:
- there is an other physics engine that allow me to build shapes with a lot of edges / build bodies with a lot of shapes

Thanks for your attention !

Image
Post Reply

Who is online

Users browsing this forum: Bing [Bot], Semrush [Bot], Yahoo [Bot] and 4 guests