Hello, i’m working with the Fisica library by Ricard Marxer. There were no problems until we started using classes and objects to make the code look more understandable. The problem seems to be in the world.step function, that gives me this error:
“AssertionError: Too many pairs (16384 shape AABB overlaps) - this usually means you have too many bodies, or you need to increase Settings.maxPairs.”
Here is a part of my code:
import fisica.*; // IMPORTAMOS LIBRERIA
FWorld mundo; // DECLARAMOS MUNDO
ladrillos_1n l1n;
void setup() {
// INICIALIZAMOS LIBRERIA Y MUNDO
Fisica.init( this );
mundo = new FWorld();
size( 800, 800 );
mundo.setGravity(0, 1000); // ASIGNAMOS GRAVEDAD
mundo.setGrabbable(false); // OBJETOS NO CLICKEABLES
l1n= new ladrillos_1n();
}
void draw() {
mundo.step();
mundo.draw();
background(255);
l1n.dibujarLadrillos_1n(200, 350, 600, 350);
}
class ladrillos_1n {
float posX1_, posY1_, posX2_, posY2_;
ladrillos_1n() {
posX1_= 0;
posY1_= 0;
posX2_= 0;
posY2_= 0;
}
void dibujarLadrillos_1n(float posX1_, float posY1_, float posX2_, float posY2_) {
FBox ladrillo1 = new FBox( 70, 15 );
ladrillo1.setPosition( posX1_, posY1_ );
ladrillo1.setStatic( true );
ladrillo1.setFill(200);
mundo.add( ladrillo1 );
FBox ladrillo2 = new FBox( 70, 15 );
ladrillo2.setPosition( posX2_, posY2_ );
ladrillo2.setStatic(true);
ladrillo2.setFill(200);
mundo.add( ladrillo2 );
}
}