Client API. The Codename One framework your app is built on: this runs on the device, not in a backend.

public class FrictionJoint

  1. Object
  2. Joint
  3. FrictionJoint

Constructors

protected FrictionJoint(IWorldPool argWorldPool, FrictionJointDef def)

Methods

public Vec2 getLocalAnchorA()
public Vec2 getLocalAnchorB()
public void getAnchorA(Vec2 argOut)get the anchor point on bodyA in world coordinates.
public void getAnchorB(Vec2 argOut)get the anchor point on bodyB in world coordinates.
public void getReactionForce(float inv_dt, Vec2 argOut)get the reaction force on body2 at the joint anchor in Newtons.
public float getReactionTorque(float inv_dt)get the reaction torque on body2 in N*m.
public void setMaxForce(float force)
public float getMaxForce()
public void setMaxTorque(float torque)
public float getMaxTorque()
public void initVelocityConstraints(SolverData data)
public void solveVelocityConstraints(SolverData data)
public boolean solvePositionConstraints(SolverData data)This returns true if the position errors are within tolerance.

Inherited fields

Inherited methods

Constructor details

FrictionJoint

protected FrictionJoint(IWorldPool argWorldPool, FrictionJointDef def)

Method details

getLocalAnchorA

public Vec2 getLocalAnchorA()

getLocalAnchorB

public Vec2 getLocalAnchorB()

getAnchorA

public void getAnchorA(Vec2 argOut)
get the anchor point on bodyA in world coordinates.

Parameters

argOut Vec2
receives the anchor point

getAnchorB

public void getAnchorB(Vec2 argOut)
get the anchor point on bodyB in world coordinates.

Parameters

argOut Vec2
receives the anchor point

getReactionForce

public void getReactionForce(float inv_dt, Vec2 argOut)
get the reaction force on body2 at the joint anchor in Newtons.

Parameters

inv_dt float
the inverse of the time step
argOut Vec2
receives the reaction force

getReactionTorque

public float getReactionTorque(float inv_dt)
get the reaction torque on body2 in N*m.

setMaxForce

public void setMaxForce(float force)

getMaxForce

public float getMaxForce()

setMaxTorque

public void setMaxTorque(float torque)

getMaxTorque

public float getMaxTorque()

initVelocityConstraints

public void initVelocityConstraints(SolverData data)

solveVelocityConstraints

public void solveVelocityConstraints(SolverData data)

solvePositionConstraints

public boolean solvePositionConstraints(SolverData data)
This returns true if the position errors are within tolerance.

Parameters

data SolverData
the solver state for this step

Returns

true if the position errors are within tolerance