Libraries.Game.Collision.CollisionManager3D Documentation

This class can be seen as a "manager" class that uses CollisionEvent3D class and the BoardphaseCollision3D class to record if a collision occured, to decide if a collision occured. This class uses the CollisionEvent3D to record all of the collision that has occured during the current physics step. This class also uses the BroadphaseCollision3D class to determine whether a possible collision has happened.

Inherits from: Libraries.Language.Object

Actions Documentation

AddCollisionListener(Libraries.Interface.Events.CollisionListener3D listener)

This action adds a CollisionListener3D to the current CollisionManager3D.

Parameters

AddPair(Libraries.Game.Collision.Item3DNode nodeA, Libraries.Game.Collision.Item3DNode nodeB)

This action compares the two nodes in the DynamicBoundingVolumeTree3D to determine whether the items in the two nodes collide. If the items in the two nodes do collide, then the collision will be recorded inside this CollisionManager3D.

Parameters

Collide()

This action resolve every collision that is recorded in the CollisionEvent3D doubly linked list.

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.

Parameters

Return

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

Example

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

Destroy(Libraries.Interface.Events.CollisionEvent3D collision)

This action tests deletes a CollisionEvent3D in a doubly linked list of CollisionEvent3D.

Parameters

Equals(Libraries.Language.Object object)

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

Parameters

Return

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

Example

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

FindNewCollisions()

This action uses the broadphase linked to this CollisionManager3D to test if two nodes are colliding.

GetBroadphase()

This action returns the BroadphaseCollision3D that is used by this CollisionManager3D.

Return

Libraries.Game.Collision.BroadphaseCollision3D: the BroadphaseCollision3D that is used to solve a collision.

GetCollisionCount()

This class returns how many CollisionEvent3D is available in this CollisionManager3D.

Return

integer: the number of CollisionEvent3Ds.

GetCollisionList()

This action returns the first event in the doubly linked list of CollisionEvent2D.

Return

Libraries.Interface.Events.CollisionEvent3D: the first CollisionEvent2D.

GetHashCode()

This action gets the hash code for an object.

Return

integer: The integer hash code of the object.

Example

Object o
integer hash = o:GetHashCode()

RemoveCollisionListener(Libraries.Interface.Events.CollisionListener3D listener)

This action removes a CollisionListener3D from the current CollisionManager3D.

Parameters

SetLayer(Libraries.Game.Layer3D layer)

This action sets the 3D layer which the objects lie on.

Parameters