bool valid
This value will be true if the object contains valid data.

uint id
The id of this joint. This id is unique in the scene.

void select()
Selects the joint.

void deselect()
Deselects the joint.

bool isSelected()
Returns true if the joint is currently selected.

string getName()
Returns the name of the joint.

void setName(string)
Sets the name of the joint.

void setBodyA(int bodyId)
Sets the body to use as body A of this joint. If the specified body is already being used as body B, bodies A and B of the joint will be switched and a warning will be printed to the script console.

void setBodyB(int bodyId)
Sets the body to use as body B of this joint. If the specified body is already being used as body A, bodies A and B of the joint will be switched and a warning will be printed to the script console.

void setBodyA(body)
Sets the body to use as body A of this joint. If the specified body is already being used as body A, bodies A and B of the joint will be switched and a warning will be printed to the script console.

void setBodyB(body)
Sets the body to use as body B of this joint. If the specified body is already being used as body A, bodies A and B of the joint will be switched and a warning will be printed to the script console.

body getBodyA()
Returns the body A of this joint.

body getBodyB()
Returns the body B of this joint.

void setLocalAnchorA(float x, float y)
Sets the position of the joint anchor in body A, in local coordinates.

void setLocalAnchorB(float x, float y)
Sets the position of the joint anchor in body B, in local coordinates.

void setLocalAnchorA(vec2)
Sets the position of the joint anchor in body A, in local coordinates.

void setLocalAnchorB(vec2)
Sets the position of the joint anchor in body B, in local coordinates.

void setCollideConnected(int)
Sets whether the two bodies connected by the joint should respond to collisions with each other.

void setEnableLimit(int)
Sets whether the joint limits should be enabled.

void setEnableMotor(int)
Sets whether the joint motor should be enabled.

void setReferenceAngle(float)
Sets the reference angle for the joint. This is the between the two connected bodies at which the joint angle is considered to be zero.

void setLowerLimit(float)
Sets the value of the lower limit of the joint. For revolute joints this is an angle in radians. For prismatic joints this is a distance along the axis.

void setUpperLimit(float)
Sets the value of the upper limit of the joint. For revolute joints this is an angle in radians. For prismatic joints this is a distance along the axis.

void setMotorSpeed(float)
Sets the desired motor speed of the joint. For revolute joints this is an angular velocity in radians/sec. For prismatic joints this is a linear velocity along the axis.

void setMaxMotorTorque(float)
Sets the maximum torque the motor can apply to maintain the desired motor speed (revolute and wheel joints only).

void setMaxMotorForce(float)
Sets the maximum force the motor can apply to maintain the desired motor speed (prismatic joints only).

void setLength(float)
Sets the length of the joint (distance and rope joints only).

void setFrequency(float)
Sets the damping frequency of the joint (distance and wheel joints only).

void setDampingRatio(float)
Sets the damping ratio of the joint (distance and wheel joints only).

void setCorrectionFactor(float)
Sets the correction factor of the joint (for motor joints).

void setLocalAxis(float x, float y)
Sets the sliding axis of the joint in local coordinates of bodyA (prismatic and wheel joints only).

void setLocalAxis(vec2)
Sets the sliding axis of the joint in local coordinates of bodyA (prismatic and wheel joints only).

void delete()
Deletes the joint.

float getLength()
Returns the target length of the joint (distance and rope joints only).

vec2 getWorldAnchorA()
Returns the position of the joint anchor in body A, in world coordinates.

vec2 getWorldAnchorB()
Returns the position of the joint anchor in body B, in world coordinates.

string[] getCustomProperties()
Returns an array of the names of all custom properties for which a value actually exists.

bool hasCustomProperty(string propertyName)
Returns true if a value exists for the named property.

string getCustomPropertyType(string propertyName)
Returns the type of the named custom property. This will be one of int, float, string, vec2 or bool.

int getCustomInt(string propertyName, int defaultValue = 0)
Returns the value of the named custom property if it exists. If not, the optional default value will be returned. You can use hasCustomProperty to check if a value exists.

float getCustomFloat(string propertyName, float defaultValue = 0)
Returns the value of the named custom property if it exists. If not, the optional default value will be returned. You can use hasCustomProperty to check if a value exists.

string getCustomString(string propertyName, string defaultValue = "")
Returns the value of the named custom property if it exists. If not, the optional default value will be returned. You can use hasCustomProperty to check if a value exists.

vec2 getCustomVec2(string propertyName, vec2 defaultValue)
Returns the value of the named custom property if it exists. If not, the given default value will be returned. You can use hasCustomProperty to check if a value exists.

vec2 getCustomVec2(string propertyName)
Returns the value of the named custom property if it exists. If not, the vector 0,0 will be returned.

bool getCustomBool(string propertyName, bool defaultValue = false)
Returns the value of the named custom property if it exists. If not, the optional default value will be returned. You can use hasCustomProperty to check if a value exists.

vec2 getCustomColor(string propertyName, color defaultValue)
Returns the value of the named custom property if it exists. If not, the given default value will be returned. You can use hasCustomProperty to check if a value exists.

vec2 getCustomColor(string propertyName)
Returns the value of the named custom property if it exists. If not, the color 255,255,255,255 will be returned.

void setCustomInt(string propertyName, int)
Sets the value of the named custom property.

void setCustomFloat(string propertyName, float)
Sets the value of the named custom property.

void setCustomString(string propertyName, string)
Sets the value of the named custom property.

void setCustomVec2(string propertyName, vec2)
Sets the value of the named custom property.

void setCustomBool(string propertyName, bool)
Sets the value of the named custom property.

void setCustomColor(string propertyName, color)
Sets the value of the named custom property.

void clearCustomProperty(string propertyName)
Removes all values for the named custom property.