return new MouseJoint(world.getPool(), (MouseJointDef) def); case DISTANCE: return new DistanceJoint(world.getPool(), (DistanceJointDef) def); case PRISMATIC: return new PrismaticJoint(world.getPool(), (PrismaticJointDef) def); case REVOLUTE: return new RevoluteJoint(world.getPool(), (RevoluteJointDef) def); case WELD: return new WeldJoint(world.getPool(), (WeldJointDef) def); case FRICTION: return new FrictionJoint(world.getPool(), (FrictionJointDef) def); case WHEEL: return new WheelJoint(world.getPool(), (WheelJointDef) def); case GEAR: return new GearJoint(world.getPool(), (GearJointDef) def); case PULLEY: return new PulleyJoint(world.getPool(), (PulleyJointDef) def); case CONSTANT_VOLUME: return new ConstantVolumeJoint(world, (ConstantVolumeJointDef) def); case ROPE: return new RopeJoint(world.getPool(), (RopeJointDef) def); case MOTOR: return new MotorJoint(world.getPool(), (MotorJointDef) def); case UNKNOWN: default:
public ConstantVolumeJoint(World argWorld, ConstantVolumeJointDef def) { super(argWorld.getPool(), def); world = argWorld; if (def.bodies.size() <= 2) {
final Vec2 localCenter = m_world.getPool().popVec2(); localCenter.setZero(); final Vec2 temp = m_world.getPool().popVec2(); final MassData massData = pmd; for (Fixture f = m_fixtureList; f != null; f = f.m_next) { Vec2 oldCenter = m_world.getPool().popVec2(); m_linearVelocity.addLocal(temp2); m_world.getPool().pushVec2(3);
return new MouseJoint(world.getPool(), (MouseJointDef) def); case DISTANCE: return new DistanceJoint(world.getPool(), (DistanceJointDef) def); case PRISMATIC: return new PrismaticJoint(world.getPool(), (PrismaticJointDef) def); case REVOLUTE: return new RevoluteJoint(world.getPool(), (RevoluteJointDef) def); case WELD: return new WeldJoint(world.getPool(), (WeldJointDef) def); case FRICTION: return new FrictionJoint(world.getPool(), (FrictionJointDef) def); case WHEEL: return new WheelJoint(world.getPool(), (WheelJointDef) def); case GEAR: return new GearJoint(world.getPool(), (GearJointDef) def); case PULLEY: return new PulleyJoint(world.getPool(), (PulleyJointDef) def); case CONSTANT_VOLUME: return new ConstantVolumeJoint(world, (ConstantVolumeJointDef) def); case ROPE: return new RopeJoint(world.getPool(), (RopeJointDef) def); case MOTOR: return new MotorJoint(world.getPool(), (MotorJointDef) def); case UNKNOWN: default:
public float raycastCallback(final RayCastInput input, int proxyId) { Actor actor = (Actor) m_tree.getUserData(proxyId); RayCastOutput output = new RayCastOutput(); boolean hit = actor.aabb.raycast(output, input, getWorld().getPool()); if (hit) { m_rayCastOutput = output; m_rayActor = actor; m_rayActor.fraction = output.fraction; return output.fraction; } return input.maxFraction; }
public ConstantVolumeJoint(World argWorld, ConstantVolumeJointDef def) { super(argWorld.getPool(), def); world = argWorld; if (def.bodies.size() <= 2) {
getWorld().getPool()); if (hit) { bruteActor = m_actors[i];
final Vec2 localCenter = m_world.getPool().popVec2(); localCenter.setZero(); final Vec2 temp = m_world.getPool().popVec2(); final MassData massData = pmd; for (Fixture f = m_fixtureList; f != null; f = f.m_next) { Vec2 oldCenter = m_world.getPool().popVec2(); m_linearVelocity.addLocal(temp2); m_world.getPool().pushVec2(3);
/** * @see org.jbox2d.testbed.framework.TestbedTest#step(org.jbox2d.testbed.framework.TestbedSettings) */ @Override public void step(TestbedSettings settings) { super.step(settings); PolyShapesCallback callback = new PolyShapesCallback(getWorld().getPool()); callback.m_circle.m_radius = 2.0f; callback.m_circle.m_p.set(0.0f, 2.1f); callback.m_transform.setIdentity(); callback.debugDraw = getDebugDraw(); AABB aabb = new AABB(); callback.m_circle.computeAABB(aabb, callback.m_transform, 0); getWorld().queryAABB(callback, aabb); Color3f color = new Color3f(0.4f, 0.7f, 0.8f); getDebugDraw().drawCircle(callback.m_circle.m_p, callback.m_circle.m_radius, color); addTextLine("Press 1-5 to drop stuff"); addTextLine("Press 'a' to (de)activate some bodies"); addTextLine("Press 'd' to destroy a body"); addTextLine("Up to 30 bodies in the target circle are highlighted"); }
input.useRadii = true; cache.count = 0; getWorld().getPool().getDistance().distance(output, cache, input);
public static Joint create(World world, JointDef def) { switch (def.type) { case MOUSE: return new MouseJoint(world.getPool(), (MouseJointDef) def); case DISTANCE: return new DistanceJoint(world.getPool(), (DistanceJointDef) def); case PRISMATIC: return new PrismaticJoint(world.getPool(), (PrismaticJointDef) def); case REVOLUTE: return new RevoluteJoint(world.getPool(), (RevoluteJointDef) def); case WELD: return new WeldJoint(world.getPool(), (WeldJointDef) def); case FRICTION: return new FrictionJoint(world.getPool(), (FrictionJointDef) def); case WHEEL: return new WheelJoint(world.getPool(), (WheelJointDef) def); case GEAR: return new GearJoint(world.getPool(), (GearJointDef) def); case PULLEY: return new PulleyJoint(world.getPool(), (PulleyJointDef) def); case CONSTANT_VOLUME: return new ConstantVolumeJoint(world, (ConstantVolumeJointDef) def); case ROPE: return new RopeJoint(world.getPool(), (RopeJointDef) def); case MOTOR: return new MotorJoint(world.getPool(), (MotorJointDef) def); case UNKNOWN: default:
public static Joint create(World world, JointDef def) { // Joint joint = null; switch (def.type) { case MOUSE: return new MouseJoint(world.getPool(), (MouseJointDef) def); case DISTANCE: return new DistanceJoint(world.getPool(), (DistanceJointDef) def); case PRISMATIC: return new PrismaticJoint(world.getPool(), (PrismaticJointDef) def); case REVOLUTE: return new RevoluteJoint(world.getPool(), (RevoluteJointDef) def); case WELD: return new WeldJoint(world.getPool(), (WeldJointDef) def); case FRICTION: return new FrictionJoint(world.getPool(), (FrictionJointDef) def); case WHEEL: return new WheelJoint(world.getPool(), (WheelJointDef) def); case GEAR: return new GearJoint(world.getPool(), (GearJointDef) def); case PULLEY: return new PulleyJoint(world.getPool(), (PulleyJointDef) def); case CONSTANT_VOLUME: return new ConstantVolumeJoint(world, (ConstantVolumeJointDef) def); case ROPE: return new RopeJoint(world.getPool(), (RopeJointDef) def); case UNKNOWN: default: return null; } }
return new MouseJoint(world.getPool(), (MouseJointDef) def); case DISTANCE: return new DistanceJoint(world.getPool(), (DistanceJointDef) def); case PRISMATIC: return new PrismaticJoint(world.getPool(), (PrismaticJointDef) def); case REVOLUTE: return new RevoluteJoint(world.getPool(), (RevoluteJointDef) def); case WELD: return new WeldJoint(world.getPool(), (WeldJointDef) def); case FRICTION: return new FrictionJoint(world.getPool(), (FrictionJointDef) def); case WHEEL: return new WheelJoint(world.getPool(), (WheelJointDef) def); case GEAR: return new GearJoint(world.getPool(), (GearJointDef) def); case PULLEY: return new PulleyJoint(world.getPool(), (PulleyJointDef) def); case CONSTANT_VOLUME: return new ConstantVolumeJoint(world, (ConstantVolumeJointDef) def); case ROPE: return new RopeJoint(world.getPool(), (RopeJointDef) def); case MOTOR: return new MotorJoint(world.getPool(), (MotorJointDef) def); case UNKNOWN: default:
public float raycastCallback(final RayCastInput input, int proxyId) { Actor actor = (Actor) m_tree.getUserData(proxyId); RayCastOutput output = new RayCastOutput(); boolean hit = actor.aabb.raycast(output, input, getWorld().getPool()); if (hit) { m_rayCastOutput = output; m_rayActor = actor; m_rayActor.fraction = output.fraction; return output.fraction; } return input.maxFraction; }
public ConstantVolumeJoint(World argWorld, ConstantVolumeJointDef def) { super(argWorld.getPool(), def); world = argWorld; if (def.bodies.size() <= 2) {
getWorld().getPool()); if (hit) { bruteActor = m_actors[i];
/** * @see org.jbox2d.testbed.framework.TestbedTest#step(org.jbox2d.testbed.framework.TestbedSettings) */ @Override public void step(TestbedSettings settings) { super.step(settings); PolyShapesCallback callback = new PolyShapesCallback(getWorld().getPool()); callback.m_circle.m_radius = 2.0f; callback.m_circle.m_p.set(0.0f, 2.1f); callback.m_transform.setIdentity(); callback.debugDraw = getDebugDraw(); AABB aabb = new AABB(); callback.m_circle.computeAABB(aabb, callback.m_transform, 0); getWorld().queryAABB(callback, aabb); Color3f color = new Color3f(0.4f, 0.7f, 0.8f); getDebugDraw().drawCircle(callback.m_circle.m_p, callback.m_circle.m_radius, color); addTextLine("Press 1-5 to drop stuff"); addTextLine("Press 'a' to (de)activate some bodies"); addTextLine("Press 'd' to destroy a body"); addTextLine("Up to 30 bodies in the target circle are highlighted"); }
input.useRadii = true; cache.count = 0; getWorld().getPool().getDistance().distance(output, cache, input);