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

Summary

Actions Summary Table

ActionsDescription
AddCollisionListener(Libraries.Interface.Events.CollisionListener3D listener)This action adds a CollisionListener3D to the current CollisionManager3D.
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.
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 a CompareResult.
Destroy(Libraries.Interface.Events.CollisionEvent3D collision)This action tests deletes a CollisionEvent3D in a doubly linked list of CollisionEvent3D.
Equals(Libraries.Language.Object object)This action determines if two objects are equal based on their hash code values.
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.
GetCollisionCount()This class returns how many CollisionEvent3D is available in this CollisionManager3D.
GetCollisionList()This action returns the first event in the doubly linked list of CollisionEvent2D.
GetHashCode()This action gets the hash code for an object.
RemoveCollisionListener(Libraries.Interface.Events.CollisionListener3D listener)This action removes a CollisionListener3D from the current CollisionManager3D.
SetLayer(Libraries.Game.Layer3D layer)This action sets the 3D layer which the objects lie on.

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 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.

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.

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.

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.

Example Code

Object o
        integer hash = o:GetHashCode()

Return

integer: The integer hash code of the object.

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