Sofia API Reference

  • Package Index
  • Class Index
  • Packages
  • sofia.app
  • sofia.content
  • sofia.data
  • sofia.graphics
    • Interfaces
    • Joint
    • PropertyTransformer
    • Classes
    • AbstractJoint
    • Anchor
    • Color
    • CoordinateSystem
    • DirectionalPad
    • DistanceJoint
    • ElasticInInterpolator
    • ElasticInOutInterpolator
    • ElasticOutInterpolator
    • FillableShape
    • FillableShape.Animator
    • Geometry
    • Image
    • LineShape
    • MotionStep
    • OvalShape
    • PointAndAnchor
    • Polygon
    • PolygonShape
    • Predicate
    • RectangleShape
    • RevoluteJoint
    • Shape
    • Shape.Animator
    • Shape.Filter
    • ShapeField
    • ShapeFilter
    • ShapeSet
    • ShapeView
    • SizeF
    • StrokedShape
    • StrokedShape.Animator
    • TextShape
    • TextShape.Animator
    • Timings
    • ViewEdges
    • ZIndexComparator
    • Enums
    • RepeatMode
    • ShapeMotion
  • sofia.util
  • sofia.view
  • sofia.widget

public class
DistanceJoint

extends AbstractJoint<JointType extends Joint, JointDefType extends JointDef>

Inheritance

  • java.lang.Object
    • sofia.graphics.AbstractJoint<JointType extends org.jbox2d.dynamics.joints.Joint, JointDefType extends org.jbox2d.dynamics.joints.JointDef>
      • sofia.graphics.DistanceJoint

Class Overview

A joint that forces the distance between two shapes to always remain constant, or within a certain amount of each other (like a spring-damper).


Summary

Public Constructors
DistanceJoint(Shape firstShape, Shape secondShape, Anchor firstShapeAnchor, Anchor secondShapeAnchor)
TODO document
Public Methods
float getDampingRatio()
TODO document
Anchor getFirstShapeAnchor()
TODO document
float getFrequency()
TODO document
Anchor getSecondShapeAnchor()
TODO document
void setDampingRatio(float newDampingRatio)
TODO document
void setFrequency(float newFrequency)
TODO document
Protected Methods
DistanceJointDef createB2JointDef()
TODO document
Methods inherited from class sofia.graphics.AbstractJoint
boolean canShapesCollide()
Gets a value indicating whether the two shapes connected by this joint are allowed to collide.
void connect()
Activates the joint.
abstract JointDefType createB2JointDef()
Subclasses must override this method to create the appropriate Box2D JointDef instance that represents the specific type of joint.
void disconnect()
Deactivates the joint, releasing the connection between the two shapes.
JointType getB2Joint()
Gets the underlying JBox2D joint object.
JointDefType getB2JointDef()
Gets the underlying JBox2D joint definition object.
Shape getFirstShape()
Gets the first shape connected by this joint.
Shape getSecondShape()
Gets the second shape connected by this joint.
void setCanShapesCollide(boolean collide)
Sets a value indicating whether the two shapes connected by this joint are allowed to collide.
Methods inherited from class java.lang.Object
Object clone()
boolean equals(Object arg0)
void finalize()
final Class<?> getClass()
int hashCode()
final void notify()
final void notifyAll()
String toString()
final void wait()
final void wait(long arg0, int arg1)
final void wait(long arg0)
Methods inherited from interface sofia.graphics.Joint
abstract void connect()
Activates the joint.
abstract void disconnect()
Deactivates the joint, releasing the connection between the two shapes.
abstract org.jbox2d.dynamics.joints.Joint getB2Joint()
Gets the underlying JBox2D joint object.
abstract org.jbox2d.dynamics.joints.JointDef getB2JointDef()
Gets the underlying JBox2D joint definition object.
abstract Shape getFirstShape()
Gets the first shape connected by this joint.
abstract Shape getSecondShape()
Gets the second shape connected by this joint.

Public Constructors

public DistanceJoint (Shape firstShape, Shape secondShape, Anchor firstShapeAnchor, Anchor secondShapeAnchor)

TODO document


Public Methods

public float getDampingRatio ()

TODO document

public Anchor getFirstShapeAnchor ()

TODO document

public float getFrequency ()

TODO document

public Anchor getSecondShapeAnchor ()

TODO document

public void setDampingRatio (float newDampingRatio)

TODO document

public void setFrequency (float newFrequency)

TODO document


Protected Methods

protected DistanceJointDef createB2JointDef ()

TODO document

Returns

the subclass of JointDef that represents this specific type of joint