/*
 * FXGL - JavaFX Game Library. The MIT License (MIT).
 * Copyright (c) AlmasB (almaslvl@gmail.com).
 * See LICENSE for details.
 */
/**
 * Created at 7:23:39 AM Jan 20, 2011
 */
package com.almasb.fxgl.physics.box2d.dynamics.joints;

import com.almasb.fxgl.core.math.Vec2;
import com.almasb.fxgl.physics.box2d.dynamics.Body;
import com.almasb.fxgl.physics.box2d.dynamics.World;

/**
 * Friction joint definition.
 *
 * @author Daniel Murphy
 */
public class FrictionJointDef extends JointDef<FrictionJoint> {


    /**
     * The local anchor point relative to bodyA's origin.
     */
    public final Vec2 localAnchorA;

    /**
     * The local anchor point relative to bodyB's origin.
     */
    public final Vec2 localAnchorB;

    /**
     * The maximum friction force in N.
     */
    public float maxForce;

    /**
     * The maximum friction torque in N-m.
     */
    public float maxTorque;

    public FrictionJointDef() {
        localAnchorA = new Vec2();
        localAnchorB = new Vec2();
        maxForce = 0f;
        maxTorque = 0f;
    }

    /**
     * Initialize the bodies, anchors, axis, and reference angle using the world anchor and world
     * axis.
     */
    public void initialize(Body bA, Body bB, Vec2 anchor) {
        setBodyA(bA);
        setBodyB(bB);
        bA.getLocalPointToOut(anchor, localAnchorA);
        bB.getLocalPointToOut(anchor, localAnchorB);
    }

    @Override
    protected FrictionJoint createJoint(World world) {
        return new FrictionJoint(world.getPool(), this);
    }
}

@@ -132,54 +132,9 @@
  */%0A
-/**%0A * Created at 7:23:39 AM Jan 20, 2011%0A */
 %0A
+
 pack
@@ -461,17 +461,16 @@
 int%3E %7B%0A%0A
-%0A
     /**%0A
@@ -569,16 +569,29 @@
 lAnchorA
+ = new Vec2()
 ;%0A%0A    /
@@ -693,16 +693,29 @@
 lAnchorB
+ = new Vec2()
 ;%0A%0A    /
@@ -790,16 +790,21 @@
 maxForce
+ = 0f
 ;%0A%0A    /
@@ -887,165 +887,14 @@
 rque
-;%0A%0A    public FrictionJointDef() %7B%0A        localAnchorA = new Vec2();%0A        localAnchorB = new Vec2();%0A        maxForce = 0f;%0A        maxTorque = 0f;%0A    %7D
+ = 0f;
 %0A%0A  

clean up