java.lang.Object
sofia.graphics.AbstractJoint<JointType extends org.jbox2d.dynamics.joints.Joint, JointDefType extends org.jbox2d.dynamics.joints.JointDef>
![]()
|
The abstract base class for all Sofia classes representing JBox2D joints. Most users will not need to use this class directly, unless they want to implement a type of joint that Sofia does not yet support.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
|
AbstractJoint(Shape firstShape, Shape secondShape)
Initializes a new joint with the specified shapes.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
boolean
|
canShapesCollide()
Gets a value indicating whether the two shapes connected by this joint
are allowed to collide.
| ||||||||||
void
|
connect()
Activates the 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.
|
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
abstract
JointDefType
|
createB2JointDef()
Subclasses must override this method to create the appropriate Box2D
JointDef instance that represents the specific type of joint. |
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.
|
Initializes a new joint with the specified shapes.
Gets a value indicating whether the two shapes connected by this joint are allowed to collide.
true if the two shapes connected by this joint are allowed to collide, otherwise false
Activates the joint. You must call this method after creating the joint object if you want it to have any effect.
Deactivates the joint, releasing the connection between the two shapes.
Gets the underlying JBox2D joint object. For advanced usage only.
the underlying JBox2D joint object
Gets the underlying JBox2D joint definition object. For advanced usage only.
the underlying JBox2D joint definition object
Gets the first shape connected by this joint.
the first shape connected by this joint
Gets the second shape connected by this joint.
the second shape connected by this joint
Sets a value indicating whether the two shapes connected by this joint are allowed to collide.
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.
the subclass of JointDef
that represents this specific
type of joint