Libraries.Game.Physics.SolverItem3D Documentation

This class is a temporary storage location for the properties of a 3D item so that the actions inside CollisionSolver3D can run a little quicker.

Inherits from: Libraries.Language.Object

Actions Documentation

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)

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)

GetAngularFactor()

This action returns the angular factor.

Return

number: the angular factor.

GetAngularVelocity()

This action returns the angular velocity stored inside this SolverItem3D class.

Return

Libraries.Compute.Vector3: the angular velocity stored inside this SolverItem3D class.

GetCenterOfMassPosition()

This action returns where the center of the 3D object is.

Return

Libraries.Compute.Vector3: the center of the 3D object.

GetFriction()

This action returns the friction stored inside this SolverItem3D class.

Return

number: the coefficient of friction.

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()

GetInverseMass()

This action returns the 1/mass value stored inside this SolverItem3D class.

Return

number: the 1/mass value stored inside this SolverItem3D class.

GetLinearVelocity()

This action returns the linear velocity stored inside this SolverItem3D class.

Return

Libraries.Compute.Vector3: the linear velocity of the 3D object.

GetOriginalItem()

This action returns which 3D object is attached to this SolverItem3D.

Return

Libraries.Interface.Item3D: the 3D object is attached to this SolverItem3D.

GetPushVelocity()

This action returns the push velocity.

Return

Libraries.Compute.Vector3: the push velocity.

GetTurnVelocity()

This action returns the turn velocity.

Return

Libraries.Compute.Vector3: the turn velocity.

GetVelocityInLocalPoint(Libraries.Compute.Vector3 relativePosition, Libraries.Compute.Vector3 velocity)

This action lets you know the linear velocity of a point "Vector3 relativePosition" on this 3D object.

Parameters

InternalApplyImpulse(Libraries.Compute.Vector3 linearComponent, Libraries.Compute.Vector3 angularComponent, number impulseMagnitude)

This action allows you to add linear velocity, "Vector3 linearComponent," and add angular velocity, "Vector3 angularComponent," both scaled by "number impulseMagnitude" to the current linear velocity and angular velocity of this 3D object.

Parameters

InternalApplyPushImpulse(Libraries.Compute.Vector3 linearComponent, Libraries.Compute.Vector3 angularComponent, number impulseMagnitude)

This action allows you to add linear velocity, "Vector3 linearComponent," and add angular velocity, "Vector3 angularComponent," both scaled by "number impulseMagnitude" to the current push linear velocity and push angular velocity of this 3D object.

Parameters

ReadVelocity()

This action stores the linear and angular velocities of the 3D item that is attached to this SolverItem3D inside this SolverItem3D so that if we need the same linear and angular velocities again, we don't have to as the Item3D class to give us these velocities, which will make our program quicker.

SetAngularFactor(number factor)

This action sets the angular factor.

Parameters

  • number factor

SetAngularVelocity(Libraries.Compute.Vector3 velocity)

This action sets the angular velocity stored inside this SolverItem3D class.

Parameters

SetCenterOfMassPosition(Libraries.Compute.Vector3 position)

This action sets where the center of the 3D object is.

Parameters

SetFriction(number friction)

This action sets the friction stored inside this SolverItem3D class.

Parameters

  • number friction: The coefficient of friction.

SetInverseMass(number inverseMass)

This action sets the 1/mass value stored inside this SolverItem3D class.

Parameters

  • number inverseMass

SetLinearVelocity(Libraries.Compute.Vector3 velocity)

This action sets the linear velocity stored inside this SolverItem3D class.

Parameters

SetOriginalItem(Libraries.Interface.Item3D item)

This action sets which 3D object is attached to this SolverItem3D.

Parameters

SetPushVelocity(Libraries.Compute.Vector3 velocity)

This action sets the push velocity.

Parameters

SetTurnVelocity(Libraries.Compute.Vector3 velocity)

This action sets the turn velocity.

Parameters

WriteBackVelocity(number timeStep)

This action updates the angular and linear velocities in the 3D object that is attached to this SolverItem3D using a predicted angular and linear velocities. This also updates that 3D object's position with a predicted position.

Parameters

  • number timeStep: The time of simulation.

WriteBackVelocity()

This action updates the angular and linear velocities in the 3D object that is attached to this SolverItem3D.