Libraries.Game.Physics.CollisionVelocityConstraint Documentation

This class is used internally by CollisionSolver2D to record the information that will help solve the velocity constraint.

Inherits from: Libraries.Language.Object

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.
GetCollisionIndex()This action returns the index on an array of LocalCollisionPoints2D that is associated with this CollisionVelocityConstraint.
GetFriction()This action returns the friction between the two objects.
GetHashCode()This action gets the hash code for an object.
GetIndexA()This action returns the group index of object A.
GetIndexB()This action returns the group index of object B.
GetInverseInertiaA()This action returns (1/mass moment of inertia of A).
GetInverseInertiaB()This action returns (1/mass moment of inertia of B).
GetInverseMassA()This action returns (1/massA).
GetInverseMassB()This action returns (1/massB).
GetInverseNormalMass()This action returns a table of values that represents the inverse properties of the 2D object that we can derive from the mass and shape of the 2D object.
GetNormal()This action returns the normal of collision.
GetNormalMass()This action returns a table of values that represents the properties of the 2D object that we can derive from the mass and shape of the 2D object.
GetPointCount()This action returns the number of velocity constraint points.
GetPoints()This action returns all of the velocity constraint points.
GetRestitution()This action returns the restitution between the two objects.
GetTangentSpeed()This action returns the relative speeds of the point of collision between the two objects a time step prior to the current time step.
InitializeInverseNormalMass()This action initializes a table of values that represents the inverse properties of the 2D object that we can derive from the mass and shape of the 2D object.
InitializeNormalMass()This action initializes a table of values that represents the properties of the 2D object that we can derive from the mass and shape of the 2D object.
SetCollisionIndex(integer index)This action sets the index on an array of LocalCollisionPoints2D that is associated with this CollisionVelocityConstraint.
SetFriction(number friction)This action sets the friction between the two objects.
SetIndexA(integer index)This action sets the group index of object A.
SetIndexB(integer index)This action sets the group index of object B.
SetInverseInertiaA(number inverseInertia)This action sets (1/mass moment of inertia of A).
SetInverseInertiaB(number inverseInertia)This action sets (1/mass moment of inertia of B).
SetInverseMassA(number inverseMass)This action sets (1/massA).
SetInverseMassB(number inverseMass)This action sets (1/massB).
SetNormal(Libraries.Compute.Vector2 normal)This action sets the normal of collision.
SetPointCount(integer pointCount)This action sets the number of velocity constraint points.
SetRestitution(number restitution)This action sets the restitution between the two objects.
SetTangentSpeed(number tangentSpeed)This action sets the relative speeds of the point of collision in the current time step.

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.

GetCollisionIndex()

This action returns the index on an array of LocalCollisionPoints2D that is associated with this CollisionVelocityConstraint. This is used by the CollisionSolver2D class.

Return

integer: the index of interest.

GetFriction()

This action returns the friction between the two objects.

Return

number: coefficient of friction.

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.

GetIndexA()

This action returns the group index of object A.

Return

integer: the group index of object A.

GetIndexB()

This action returns the group index of object B.

Return

integer: the group index of object B.

GetInverseInertiaA()

This action returns (1/mass moment of inertia of A).

Return

number: the (1/mass moment of inertia of A) value.

GetInverseInertiaB()

This action returns (1/mass moment of inertia of B).

Return

number: (1/mass moment of inertia of B) value.

GetInverseMassA()

This action returns (1/massA).

Return

number: (1/massA).

GetInverseMassB()

This action returns (1/massB).

Return

number: the (1/massB) value.

GetInverseNormalMass()

This action returns a table of values that represents the inverse properties of the 2D object that we can derive from the mass and shape of the 2D object.

Return

Libraries.Containers.Table: a table of inverse normal masses.

GetNormal()

This action returns the normal of collision.

Return

Libraries.Compute.Vector2: a vector representing the normal direction of collision.

GetNormalMass()

This action returns a table of values that represents the properties of the 2D object that we can derive from the mass and shape of the 2D object.

Return

Libraries.Containers.Table: a table of normal masses.

GetPointCount()

This action returns the number of velocity constraint points.

Return

integer: the number of velocity constraint points.

GetPoints()

This action returns all of the velocity constraint points.

Return

Libraries.Containers.Array: an array containing velocity constraint points.

GetRestitution()

This action returns the restitution between the two objects.

Return

number: coefficient of restitution.

GetTangentSpeed()

This action returns the relative speeds of the point of collision between the two objects a time step prior to the current time step.

Return

number: the old tangent speed.

InitializeInverseNormalMass()

This action initializes a table of values that represents the inverse properties of the 2D object that we can derive from the mass and shape of the 2D object.

InitializeNormalMass()

This action initializes a table of values that represents the properties of the 2D object that we can derive from the mass and shape of the 2D object.

SetCollisionIndex(integer index)

This action sets the index on an array of LocalCollisionPoints2D that is associated with this CollisionVelocityConstraint. This is used by the CollisionSolver2D class.

Parameters

SetFriction(number friction)

This action sets the friction between the two objects.

Parameters

SetIndexA(integer index)

This action sets the group index of object A.

Parameters

SetIndexB(integer index)

This action sets the group index of object B.

Parameters

SetInverseInertiaA(number inverseInertia)

This action sets (1/mass moment of inertia of A).

Parameters

SetInverseInertiaB(number inverseInertia)

This action sets (1/mass moment of inertia of B).

Parameters

SetInverseMassA(number inverseMass)

This action sets (1/massA).

Parameters

SetInverseMassB(number inverseMass)

This action sets (1/massB).

Parameters

SetNormal(Libraries.Compute.Vector2 normal)

This action sets the normal of collision.

Parameters

SetPointCount(integer pointCount)

This action sets the number of velocity constraint points.

Parameters

SetRestitution(number restitution)

This action sets the restitution between the two objects.

Parameters

SetTangentSpeed(number tangentSpeed)

This action sets the relative speeds of the point of collision in the current time step.

Parameters