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
RevoluteJoint

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.RevoluteJoint

Class Overview

A joint that forces two shapes to share a common anchor point, allowing only the relative rotation between them to change.


Summary

Public Constructors
RevoluteJoint(Shape firstShape, Shape secondShape, Anchor anchor)
Creates a new revolute joint.
Public Methods
Anchor getAnchor()
TODO document
float getLowerAngle()
float getUpperAngle()
void setLowerAngle(float angle)
void setUpperAngle(float angle)
Protected Methods
RevoluteJointDef createB2JointDef()
Subclasses must override this method to create the appropriate Box2D JointDef instance that represents the specific type of joint.
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 RevoluteJoint (Shape firstShape, Shape secondShape, Anchor anchor)

Creates a new revolute joint.

Parameters
firstShape
the first shape to connect by the joint
secondShape
the second shape to connect by the joint
anchor
the anchor on the first shape about which the second shape will be rotated

Public Methods

public Anchor getAnchor ()

TODO document

public float getLowerAngle ()

public float getUpperAngle ()

public void setLowerAngle (float angle)

public void setUpperAngle (float angle)


Protected Methods

protected RevoluteJointDef createB2JointDef ()

Subclasses must override this method to create the appropriate Box2D JointDef instance that represents the specific type of joint. This method should fill in all required properties of the joint, including the bodyA and bodyB references.

Returns

the subclass of JointDef that represents this specific type of joint