hello, I'm studying about BoxWrap2D.
but I have a qeustion.
I'd like to select circles with mouse and drag it.
here coding.
--------------------------------------------------------------------------------
-
import org.jbox2d.testbed.*;
import org.jbox2d.dynamics.contacts.*;
import org.jbox2d.p5.*;
import org.jbox2d.dynamics.*;
import org.jbox2d.common.*;
import org.jbox2d.collision.*;
import org.jbox2d.dynamics.joints.*;
// Physics things we must store
Physics physics;
Body randomBod ;
void setup() {
size(640,480,P3D);
frameRate(60);
initScene();
}
void draw() {
background(0);
}
void initScene() {
physics = new Physics(this, width, height);
physics.setDensity(1.0f);
for(int i=0; i<10; i++){
float x0 = random(0,width);
float y0 = random(0,height);
randomBod = physics.createCircle(x0, y0, random(5.0f,15f));
Vec2 vel = new Vec2(random(-30.0f,30.0f),random(-30.0f,30.0f));
randomBod.setLinearVelocity(vel);
}
}
------------------------------------------------------------------------------
How can I select a circle and drag or throw it?
thank you