Libraries.Game.Physics.CollisionGroup3D Documentation
When the physics algorithm groups objects together, they will be stored inside the same group. This class groups items together so that collisions between these items in this group can be treated independent of other groups. Usually, we only have one CollisionGroup3D per one physics world.
Inherits from: Libraries.Language.Object
Actions Documentation
Add(Libraries.Interface.Events.CollisionEvent3D collision)
This action records a collision that involves one of the items/joints in this CollisionGroup3D.
Parameters
- Libraries.Interface.Events.CollisionEvent3D: The collision event to add.
Add(Libraries.Game.Physics.Joints.Joint3D joint)
This action adds a joint to this CollisionGroup3D.
Parameters
- Libraries.Game.Physics.Joints.Joint3D: The joint to add.
Add(Libraries.Interface.Item3D item)
This action adds a 3D object to this CollisionGroup3D.
Parameters
- Libraries.Interface.Item3D: The 3D object to add.
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
- Libraries.Language.Object: The object to compare to.
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)
Empty()
This action sets all of the class variables to 0. This action needs to be called everytime you want to use the same CollisionGroup3D object for a different collision group.
Equals(Libraries.Language.Object object)
This action determines if two objects are equal based on their hash code values.
Parameters
- Libraries.Language.Object: The to be compared.
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)
GetCollision(integer index)
This action returns a container for all of the properties of a collision involving one of the items/joints in this CollisionGroup3D at an array index of "integer index."
Parameters
- integer index: The index of interest.
Return
Libraries.Interface.Events.CollisionEvent3D: the 3D collision event.
GetCollisionCount()
This action returns how many collisions have been recorded that involves an item/joint that is inside this CollisionGroup3D.
Return
integer: the number of collision counts.
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()
GetItem(integer index)
This action returns a 3D object that is inside this CollisionGroup3D at an array index of "integer index."
Parameters
- integer index: The index of interest.
Return
Libraries.Interface.Item3D: the 3D object.
GetItemCount()
This action returns how many 3D objects are inside this CollisionGroup3D.
Return
integer: the number of 3D objects.
GetJoint(integer index)
This action returns a Joint3D that is inside this CollisionGroup3D at an array index of "integer index."
Parameters
- integer index: The index of interest.
Return
Libraries.Game.Physics.Joints.Joint3D: the 3D joint.
GetJointCount()
This action returns how many joints are inside this CollisionGroup3D.
Return
integer: the number of joint counts.
SetSolverInformation(Libraries.Game.Physics.CollisionSolverInformation3D solverInformation)
This action connects a container for all of the constants/variables that a solver needs to this CollisionGroup3D to be used by this CollisionGroup3D.
Parameters
- Libraries.Game.Physics.CollisionSolverInformation3D: The data holder for information of the solver.
Solve(number seconds, Libraries.Compute.Vector3 gravity, boolean requireSimulation)
This action updates the positions of objects that is inside this CollisionGroup3D by solving physics.
Parameters
- number seconds: Amount of time to simulate.
- Libraries.Compute.Vector3: The gravitational force.
- boolean requireSimulation: Whether this object will react to forces or sleep.
On this page
Variables TableAction Documentation- Add(Libraries.Interface.Events.CollisionEvent3D collision)
- Add(Libraries.Game.Physics.Joints.Joint3D joint)
- Add(Libraries.Interface.Item3D item)
- Compare(Libraries.Language.Object object)
- Empty()
- Equals(Libraries.Language.Object object)
- GetCollision(integer index)
- GetCollisionCount()
- GetHashCode()
- GetItem(integer index)
- GetItemCount()
- GetJoint(integer index)
- GetJointCount()
- SetSolverInformation(Libraries.Game.Physics.CollisionSolverInformation3D solverInformation)
- Solve(number seconds, Libraries.Compute.Vector3 gravity, boolean requireSimulation)