Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private final Array<Joint> tmpJoints = new Array<Joint>();
- private float timestep = 1 / 60f, maxReactionForceLen2 = 1000, maxReactionTorque = 1;
- @Override
- public void render(float delta) {
- world.getJoints(tmpJoints);
- for(Joint joint : tmpJoints)
- if(joint.getReactionForce(1 / timestep).len2() > maxReactionForceLen2 ||
- joint.getReactionTorque(1 / timestep) > maxReactionTorque)
- world.destroyJoint(joint);
- world.step(timestep, 8, 3);
- // ...
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement