Libraries.Game.Physics.CollisionGroup2D Documentation

This class is used to solve the physics between 2D objects that are in the same group. For example, a chain of joints would be considered to be in the same group. Groups are also known as island

Inherits from: Libraries.Language.Object

Summary

Actions Summary Table

ActionsDescription
Add(Libraries.Interface.Events.CollisionEvent2D collision)This action adds a CollisionEvent2D that is associated with an item that is inside this CollisionGroup2D.
Add(Libraries.Game.Physics.Joints.Joint2D joint)This action adds a contraint to the items.
Add(Libraries.Interface.Item2D item)This action adds a Item2D into the array of existing items to group these the new Item2D into the existing items.
Compare(Libraries.Language.Object object)This action compares two object hash codes and returns an integer.
Empty()This action resets all of the arrays involved in the class to an empty stat
Equals(Libraries.Language.Object object)This action determines if two objects are equal based on their hash code values.
GetCollision(integer index)This action returns the CollisionEvent2D requested at the index passed in.
GetCollisionCount()This action returns the number of collision events that is associated with this CollisionGroup2D.
GetHashCode()This action gets the hash code for an object.
GetItem(integer index)This action returns the Item2D requested at the index passed in.
GetItemCount()This action returns how many items are in the collision group.
GetJoint(integer index)This action returns the Join2D requested at the index passed in.
GetJointCount()This action returns how many joints are in this collision group.
GetSimulationThreshold()This action returns the maximum linear velocity that a sleeping object can have.
SetSimulationThreshold(number threshold)This action sets the maximum linear velocity that a sleeping object can have.
Solve(Libraries.Game.Physics.TimeStep step, Libraries.Compute.Vector2 gravity, boolean requireSimulation)This action solves the collision for objects inside this CollisionGroup2D.
SolveTimeOfImpact(Libraries.Game.Physics.TimeStep subStep, integer timeOfImpactIndexA, integer timeOfImpactIndexB)This action solves the time of impact for the objects that are in this CollisionGroup2

Actions Documentation

Add(Libraries.Interface.Events.CollisionEvent2D collision)

This action adds a CollisionEvent2D that is associated with an item that is inside this CollisionGroup2D.

Parameters

Add(Libraries.Game.Physics.Joints.Joint2D joint)

This action adds a contraint to the items.

Parameters

Add(Libraries.Interface.Item2D item)

This action adds a Item2D into the array of existing items to group these the new Item2D into the existing items.

Parameters

Compare(Libraries.Language.Object object)

This action compares two object hash codes and returns an integer. The result is larger if this hash code is larger than the object passed as a parameter, smaller, or equal. In this case, -1 means smaller, 0 means equal, and 1 means larger. This action was changed in Quorum 7 to return an integer, instead of a CompareResult object, because the previous implementation was causing efficiency issues.

Example Code

Object o
        Object t
        integer result = o:Compare(t) //1 (larger), 0 (equal), or -1 (smalle

Parameters

Return

integer: The Compare result, Smaller, Equal, or Larger.

Empty()

This action resets all of the arrays involved in the class to an empty stat

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(

Parameters

Return

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

GetCollision(integer index)

This action returns the CollisionEvent2D requested at the index passed in.

Parameters

Return

Libraries.Interface.Events.CollisionEvent2D: a 2D collision even

GetCollisionCount()

This action returns the number of collision events that is associated with this CollisionGroup2D.

Return

integer: the number of collision event

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.

GetItem(integer index)

This action returns the Item2D requested at the index passed in.

Parameters

Return

Libraries.Interface.Item2D: a 2D ite

GetItemCount()

This action returns how many items are in the collision group.

Return

integer: the number of items are in the collision grou

GetJoint(integer index)

This action returns the Join2D requested at the index passed in.

Parameters

Return

Libraries.Game.Physics.Joints.Joint2D: a 2D join

GetJointCount()

This action returns how many joints are in this collision group.

Return

integer: the number of joints are in this collision grou

GetSimulationThreshold()

This action returns the maximum linear velocity that a sleeping object can have.

Return

number: the maximum linear velocit

SetSimulationThreshold(number threshold)

This action sets the maximum linear velocity that a sleeping object can have.

Parameters

Solve(Libraries.Game.Physics.TimeStep step, Libraries.Compute.Vector2 gravity, boolean requireSimulation)

This action solves the collision for objects inside this CollisionGroup2D.

Parameters

SolveTimeOfImpact(Libraries.Game.Physics.TimeStep subStep, integer timeOfImpactIndexA, integer timeOfImpactIndexB)

This action solves the time of impact for the objects that are in this CollisionGroup2

Parameters