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
- 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)
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)
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()
GetTurnVelocity()
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
- Libraries.Compute.Vector3: A point on the 3D object.
- Libraries.Compute.Vector3: Where velocity will be stored.
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
- Libraries.Compute.Vector3: Linear impulse.
- Libraries.Compute.Vector3: Angular impulse.
- number impulseMagnitude: Magnitude of the impulse.
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
- Libraries.Compute.Vector3: Linear push impulse.
- Libraries.Compute.Vector3: Angular turn impulse.
- number impulseMagnitude: Magnitude of the impulse.
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
- Libraries.Compute.Vector3: the angular velocity stored inside this SolverItem3D class.
SetCenterOfMassPosition(Libraries.Compute.Vector3 position)
This action sets where the center of the 3D object is.
Parameters
- Libraries.Compute.Vector3: The center of the 3D object.
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
- Libraries.Compute.Vector3: the linear velocity of the 3D object.
SetOriginalItem(Libraries.Interface.Item3D item)
This action sets which 3D object is attached to this SolverItem3D.
Parameters
- Libraries.Interface.Item3D: The 3D object to be attached to this SolverItem3D.
SetPushVelocity(Libraries.Compute.Vector3 velocity)
SetTurnVelocity(Libraries.Compute.Vector3 velocity)
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.
On this page
Variables TableAction Documentation- Compare(Libraries.Language.Object object)
- Equals(Libraries.Language.Object object)
- GetAngularFactor()
- GetAngularVelocity()
- GetCenterOfMassPosition()
- GetFriction()
- GetHashCode()
- GetInverseMass()
- GetLinearVelocity()
- GetOriginalItem()
- GetPushVelocity()
- GetTurnVelocity()
- GetVelocityInLocalPoint(Libraries.Compute.Vector3 relativePosition, Libraries.Compute.Vector3 velocity)
- InternalApplyImpulse(Libraries.Compute.Vector3 linearComponent, Libraries.Compute.Vector3 angularComponent, number impulseMagnitude)
- InternalApplyPushImpulse(Libraries.Compute.Vector3 linearComponent, Libraries.Compute.Vector3 angularComponent, number impulseMagnitude)
- ReadVelocity()
- SetAngularFactor(number factor)
- SetAngularVelocity(Libraries.Compute.Vector3 velocity)
- SetCenterOfMassPosition(Libraries.Compute.Vector3 position)
- SetFriction(number friction)
- SetInverseMass(number inverseMass)
- SetLinearVelocity(Libraries.Compute.Vector3 velocity)
- SetOriginalItem(Libraries.Interface.Item3D item)
- SetPushVelocity(Libraries.Compute.Vector3 velocity)
- SetTurnVelocity(Libraries.Compute.Vector3 velocity)
- WriteBackVelocity(number timeStep)
- WriteBackVelocity()