Libraries.Game.Physics.Joints.DistanceJoint2D Documentation

This action records a joint that sets a fixed distance between two objects. The two objects are allowed to oscillate relative to each other.

Inherits from: Libraries.Language.Object, Libraries.Game.Physics.Joints.Joint2D

Summary

Actions Summary Table

ActionsDescription
Compare(Libraries.Language.Object object)This action compares two object hash codes and returns a CompareResult.
Equals(Libraries.Language.Object object)This action determines if two objects are equal based on their hash code values.
GetAnchorA()This action returns the point that the first item will rotate about, but the whole system of objects A and B can move as they please.
GetAnchorB()This action returns the point that the second item will rotate about, but the whole system of objects A and B can move as they please.
GetCollideConnected()This action returns whether the connected joints can collide or not.
GetDampingRatio()This action returns a number that tells you how fast the two objects that are joined with the DistanceJoint2D will stop oscillating.
GetDistance()This action returns the fixed distance between the two objects.
GetEdgeA()This action returns the first JointEdge2D stored inside this Joint2D.
GetEdgeB()This action returns the second JointEdge2D stored inside this Joint2D.
GetFrequency()This action returns how much the two objects will oscillate relative to each other.
GetHashCode()This action gets the hash code for an object.
GetItemA()This action returns the first 2D item that is joined by this Joint2D.
GetItemB()This action returns the second 2D item that is joined by this Joint2D.
GetLength()This action returns the fixed distance between the two objects.
GetLocalAnchorA()This action returns the point that the first item will rotate about relative to the first item, but the whole system of objects A and B can move as they please.
GetLocalAnchorB()This action returns the point that the second item will rotate about relative to the second item, but the whole system of objects A and B can move as they please.
GetNext()This action gets you the next information about a joint (stored in another Joint2D) inside a linked list of Joint2Ds.
GetPrevious()This action gets you the previous information about a joint (stored in another Joint2D) inside a linked list of Joint2Ds.
GetReactionForce(number inverseTimeStep)This action returns the amount of force that is exerted on the two items joined together because of the joint constraints.
GetReactionTorque(number inverseTimeStep)This action returns 0 for DistanceJoint2D because a distance joint will not rotate the objects.
GetState()This action returns whether this joint is INACTIVE, AT_LOWER, AT_UPPER, or EQUAL.
GetType()This action returns the type of joint that you have.
InCollisionGroup()This action returns whether the items in this joint is in a collision group with other items.
Initialize(Libraries.Interface.Item2D itemA, Libraries.Interface.Item2D itemB, Libraries.Compute.Vector2 anchorA, Libraries.Compute.Vector2 anchorB)This action stores the variables passed in inside this DistanceJoint2D.
InitializeVelocityConstraints(Libraries.Game.Physics.Joints.JointSolverData2D data)This action sends in velocity constraints to a JointSolverData2D so that a joint solver can solve for the limitations that this joint has exerted on the two objects.
SetAnchorA(Libraries.Compute.Vector2 anchor)This action sets the point that the first item will rotate about, but the whole system of objects A and B can move as they please.
SetAnchorB(Libraries.Compute.Vector2 anchor)This action sets the point that the second item will rotate about, but the whole system of objects A and B can move as they please.
SetCollideConnected(boolean collide)This action sets whether the connected joints can collide or not.
SetDampingRatio(number ratio)This action sets a number that tells you how fast the two objects that are joined with the DistanceJoint2D will stop oscillating.
SetDistance(number distance)This action sets the fixed distance between the two objects.
SetEdgeA(Libraries.Game.Physics.Joints.JointEdge2D edgeA)This action sets the first JointEdge2D stored inside this Joint2D.
SetEdgeB(Libraries.Game.Physics.Joints.JointEdge2D edgeB)This action sets the second JointEdge2D stored inside this Joint2D.
SetFrequency(number hz)This action sets how much the two objects will oscillate relative to each other.
SetInCollisionGroup(boolean flag)This action sets whether the items in this joint is in a collision group with other items.
SetItemA(Libraries.Interface.Item2D item)This action sets the first 2D item that is joined by this Joint2D.
SetItemB(Libraries.Interface.Item2D item)This action sets the second 2D item that is joined by this Joint2D.
SetLength(number passedLength)This action sets the fixed distance between the two objects.
SetNext(Libraries.Game.Physics.Joints.Joint2D next)This action lets you store another information about a joint (stored in another Joint2D) as a next link to the current Joint2D.
SetPrevious(Libraries.Game.Physics.Joints.Joint2D previous)This action lets you store another information about a joint (stored in another Joint2D) as a previous link to the current Joint2D.
SetState(integer newState)This action sets whether this joint is INACTIVE, AT_LOWER, AT_UPPER, or EQUAL.
SetType(integer type)This action sets the type of joint that you have.
SolvePositionConstraints(Libraries.Game.Physics.Joints.JointSolverData2D data)This action makes sure that the position constraints on the two items are met.
SolveVelocityConstraints(Libraries.Game.Physics.Joints.JointSolverData2D data)This action makes sure that the velocity constraints on the two items joined together are met.

Actions Documentation

Compare(Libraries.Language.Object object)

This action compares two object hash codes and returns a CompareResult. The compare result is either larger if this hash code is larger than the object passed as a parameter, smaller, or equal.

Example Code

use Libraries.Language.Support.CompareResult
        Object o
        Object t
        CompareResult result = o:Compare(t)

Parameters

Return

Libraries.Language.Support.CompareResult: The Compare result, Smaller, Equal, or Larger.

Equals(Libraries.Language.Object object)

This action determines if two objects are equal based on their hash code values.

Example Code

use Libraries.Language.Object
        use Libraries.Language.Types.Text
        Object o
        Text t
        boolean result = o:Equals(t)

Parameters

Return

boolean: True if the hash codes are equal and false if they are not equal.

GetAnchorA()

This action returns the point that the first item will rotate about, but the whole system of objects A and B can move as they please. Parameter: Returns the point that the first item will rotate about, but the whole system of objects A and B can move as they please.

Return

Libraries.Compute.Vector2:

GetAnchorB()

This action returns the point that the second item will rotate about, but the whole system of objects A and B can move as they please. Parameter: Returns the point that the second item will rotate about, but the whole system of objects A and B can move as they please.

Return

Libraries.Compute.Vector2:

GetCollideConnected()

This action returns whether the connected joints can collide or not.

Return

boolean: whether the connected joints can collide or not.

GetDampingRatio()

This action returns a number that tells you how fast the two objects that are joined with the DistanceJoint2D will stop oscillating.

Return

number: the damping ratio.

GetDistance()

This action returns the fixed distance between the two objects.

Return

number: the fixed distance between the two objects in meters.

GetEdgeA()

This action returns the first JointEdge2D stored inside this Joint2D.

Return

Libraries.Game.Physics.Joints.JointEdge2D: the first JointEdge2D stored inside this Joint2D.

GetEdgeB()

This action returns the second JointEdge2D stored inside this Joint2D.

Return

Libraries.Game.Physics.Joints.JointEdge2D: the second JointEdge2D stored inside this Joint2D.

GetFrequency()

This action returns how much the two objects will oscillate relative to each other.

Return

number: the frequency at which the two objects will oscillate relative to each other.

GetHashCode()

This action gets the hash code for an object.

Example Code

Object o
        integer hash = o:GetHashCode()

Return

integer: The integer hash code of the object.

GetItemA()

This action returns the first 2D item that is joined by this Joint2D.

Return

Libraries.Interface.Item2D: the first 2D item that is joined by this Joint2D.

GetItemB()

This action returns the second 2D item that is joined by this Joint2D.

Return

Libraries.Interface.Item2D: the second 2D item that is joined by this Joint2D.

GetLength()

This action returns the fixed distance between the two objects.

Return

number: the fixed distance between the two objects in meters.

GetLocalAnchorA()

This action returns the point that the first item will rotate about relative to the first item, but the whole system of objects A and B can move as they please. Parameter: Returns the point that the first item will rotate about relative to the first item, but the whole system of objects A and B can move as they please.

Return

Libraries.Compute.Vector2:

GetLocalAnchorB()

This action returns the point that the second item will rotate about relative to the second item, but the whole system of objects A and B can move as they please. Parameter: Returns the point that the second item will rotate about relative to the second item, but the whole system of objects A and B can move as they please.

Return

Libraries.Compute.Vector2:

GetNext()

This action gets you the next information about a joint (stored in another Joint2D) inside a linked list of Joint2Ds.

Return

Libraries.Game.Physics.Joints.Joint2D: the next joint.

GetPrevious()

This action gets you the previous information about a joint (stored in another Joint2D) inside a linked list of Joint2Ds.

Return

Libraries.Game.Physics.Joints.Joint2D: the previous joint.

GetReactionForce(number inverseTimeStep)

This action returns the amount of force that is exerted on the two items joined together because of the joint constraints.

Parameters

Return

Libraries.Compute.Vector2: the reaction force.

GetReactionTorque(number inverseTimeStep)

This action returns 0 for DistanceJoint2D because a distance joint will not rotate the objects.

Parameters

Return

number: the reaction torque.

GetState()

This action returns whether this joint is INACTIVE, AT_LOWER, AT_UPPER, or EQUAL.

Return

integer: the state of the joint.

GetType()

This action returns the type of joint that you have.

Return

integer: the type of joint that you have.

InCollisionGroup()

This action returns whether the items in this joint is in a collision group with other items.

Return

boolean: true if the items in this joint is in a collision group with other items.

Initialize(Libraries.Interface.Item2D itemA, Libraries.Interface.Item2D itemB, Libraries.Compute.Vector2 anchorA, Libraries.Compute.Vector2 anchorB)

This action stores the variables passed in inside this DistanceJoint2D.

Parameters

InitializeVelocityConstraints(Libraries.Game.Physics.Joints.JointSolverData2D data)

This action sends in velocity constraints to a JointSolverData2D so that a joint solver can solve for the limitations that this joint has exerted on the two objects.

Parameters

SetAnchorA(Libraries.Compute.Vector2 anchor)

This action sets the point that the first item will rotate about, but the whole system of objects A and B can move as they please.

Parameters

SetAnchorB(Libraries.Compute.Vector2 anchor)

This action sets the point that the second item will rotate about, but the whole system of objects A and B can move as they please.

Parameters

SetCollideConnected(boolean collide)

This action sets whether the connected joints can collide or not.

Parameters

SetDampingRatio(number ratio)

This action sets a number that tells you how fast the two objects that are joined with the DistanceJoint2D will stop oscillating.

Parameters

SetDistance(number distance)

This action sets the fixed distance between the two objects.

Parameters

SetEdgeA(Libraries.Game.Physics.Joints.JointEdge2D edgeA)

This action sets the first JointEdge2D stored inside this Joint2D.

Parameters

SetEdgeB(Libraries.Game.Physics.Joints.JointEdge2D edgeB)

This action sets the second JointEdge2D stored inside this Joint2D.

Parameters

SetFrequency(number hz)

This action sets how much the two objects will oscillate relative to each other.

Parameters

SetInCollisionGroup(boolean flag)

This action sets whether the items in this joint is in a collision group with other items.

Parameters

SetItemA(Libraries.Interface.Item2D item)

This action sets the first 2D item that is joined by this Joint2D.

Parameters

SetItemB(Libraries.Interface.Item2D item)

This action sets the second 2D item that is joined by this Joint2D.

Parameters

SetLength(number passedLength)

This action sets the fixed distance between the two objects.

Parameters

SetNext(Libraries.Game.Physics.Joints.Joint2D next)

This action lets you store another information about a joint (stored in another Joint2D) as a next link to the current Joint2D.

Parameters

SetPrevious(Libraries.Game.Physics.Joints.Joint2D previous)

This action lets you store another information about a joint (stored in another Joint2D) as a previous link to the current Joint2D.

Parameters

SetState(integer newState)

This action sets whether this joint is INACTIVE, AT_LOWER, AT_UPPER, or EQUAL.

Parameters

SetType(integer type)

This action sets the type of joint that you have.

Parameters

SolvePositionConstraints(Libraries.Game.Physics.Joints.JointSolverData2D data)

This action makes sure that the position constraints on the two items are met.

Parameters

Return

boolean: if the position constraints has been met through this solver.

SolveVelocityConstraints(Libraries.Game.Physics.Joints.JointSolverData2D data)

This action makes sure that the velocity constraints on the two items joined together are met.

Parameters