## Libraries.Game.Physics.PhysicsProperties3D Documentation

This class is a property holder for a 3D mass. This class is used internally by Item3D clas

*Inherits from: *Libraries.Language.Object

## Summary

### Variable Summary Table

Variables | Description |
---|---|

integer UNMOVABLE | static obje |

integer RESPONSIVE | object governed by kinematics (meaning, the object is affected by linear velocity and angular velocity setting |

integer NON_RESPONSIVE | static obje |

### Actions Summary Table

Actions | Description |
---|---|

ApplyAngularImpulse(Libraries.Compute.Vector3 impulse) | This action applied an angular impulse to the object which will cause the object to have a sudden change in angular velocity. |

ApplyDamping(number seconds) | This action applies the scale factors that will decrease the linear and angular velocities that we calculated. |

ApplyForce(Libraries.Compute.Vector3 force, Libraries.Compute.Vector3 point) | This action applies the force that you passed in to a point that you passed in. |

ApplyForceToCenter(Libraries.Compute.Vector3 force) | This action applies a force to the center pf mass of the object. |

ApplyLinearImpulse(Libraries.Compute.Vector3 impulse, Libraries.Compute.Vector3 point) | This action applies a linear impulse to the object at a specified point, which will lead to a sudden change in linear velocity of the object. |

ApplyLinearImpulseToCenter(Libraries.Compute.Vector3 impulse) | This action applies an linear impulse to the center of mass of this object. |

ApplyTorque(Libraries.Compute.Vector3 torque) | This action applies a torque to the center of mass of the object, which means this torque will only affect the angular velocity of the object but not the linear velocity of the object. |

CanRotate(boolean flag) | This action sets whether the 3D object attached to this property holder will be able to rotate or not. |

Compare(Libraries.Language.Object object) | This action compares two object hash codes and returns an integer. |

Copy() | This action allows another PhysicsProperties3D object to be assigned by the values stored inside the current PhysicsProperties3D object. |

Equals(Libraries.Language.Object object) | This action determines if two objects are equal based on their hash code values. |

FastMoving(boolean flag) | This action sets whether if the object attached to this property holder will be moving fast. |

GetAngularDamping() | This action returns a number that will be used to decrease the angular velocity to ensure that our linear velocity calculation isn't too big. |

GetAngularFactor() | This action returns a number that scales the torque applied to the 3D object. |

GetAngularVelocity() | This action returns the angular velocity of the 3D object. |

GetCollisionGroupFlag() | This action gets whether the object attached to this property holder will be inside a collision group. |

GetCollisionGroupIndex() | This action gets which collision group that this object will be in. |

GetForce() | This action gets the force that is stored inside thie PhysicsProperties3D property holder. |

GetFriction() | This action returns a number that lets you know how smooth thhe surface of this object is. |

GetHashCode() | This action gets the hash code for an object. |

GetInterpolatedAngularVelocity() | This action returns an approximation of angular velocity of the 3D object. |

GetInterpolatedLinearVelocity() | This action returns an approximation of linear velocity of the 3D object. |

GetInverseInertiaLocal() | This action returns the inverse mass moment of inertia of the 3D object relative to the local origin of the 3D object, where the components of the inverse mass moment of inertia is just the reciprocal of the local mass moment of inertia. |

GetInverseInertiaWorld() | This action returns the inertia tensor in global coordinates. |

GetInverseMass() | This action returns the reciprocal of the mass (1/mass) inside this property holder. |

GetItem() | This action returns the Item3D that is attached to these physical properties. |

GetLinearDamping() | This action returns a number that will be used to decrease the linear velocity to ensure that our linear velocity calculation isn't too big. |

GetLinearVelocity() | This action returns the linear velocity of the 3D object that is attached to this PhysicsProperties3D property holder. |

GetLinearVelocityAtLocalPoint(Libraries.Compute.Vector3 relativePosition) | This action lets you know the linear velocity of a point "Vector3 relativePosition" on this 3D object. |

GetMass() | This action returns the mass of the object. |

GetPushVelocity() | This action returns the push velocity that is used in a Split Impulse solver. |

GetResponsiveness() | This action returns how physics (linear velocity, angular velocity, force, torque) will affect the object. |

GetRestitution() | This action returns how much energy that this 3D object will loose after a collision. |

GetSleepTime() | This action gets how much time that the 3D object attached to this property holder will remain in its current position. |

GetTorque() | This action gets the torque that is stored inside this object. |

GetTurnVelocity() | This action returns the turn velocity that is used in a Split Impulse solver. |

IntegrateTransform(Libraries.Game.Collision.PhysicsPosition3D currentTransform, number seconds, Libraries.Game.Collision.PhysicsPosition3D predictedTransform) | This action calculates where the 3D object would be after a certain amount of time. |

IntegrateVelocities(number seconds) | This action estimates what the linear and angular velocities would be after a certain amount of time. |

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

IsFastMoving() | This action tells you whether if this object will be moving fast. |

IsRotationAllowed() | This action tells you if the 3D object attached to this property holder will be able to rotate. |

IsSimulated() | This action tells you if the object attached to this property holder is being simulated. |

IsSimulationRequired() | This action tells you whether if you need to move the object that is attached to this property holder. |

RequireSimulation(boolean flag) | This action sets whether if the object attached to this property holder will require its position to be moved. |

SaveKinematicState(number timeStep) | This action stores the angular, linear velocities of the 3D object before its angular and linear velocities are updated. |

SetAngularDamping(number angularDamping) | This action sets a number that will be used to decrease the angular velocity to ensure that our linear velocity calculation isn't too big. |

SetAngularVelocity(Libraries.Compute.Vector3 angularVelocity) | This action sets the angular velocity of the 3D object. |

SetCollisionGroupFlag(boolean flag) | This action sets whether the object attached to this property holder will be inside a collision group. |

SetCollisionGroupIndex(integer index) | This action sets which collision group that this object will be in. |

SetForce(Libraries.Compute.Vector3 force) | This action sets the force that will be applied to the object. |

SetFriction(number friction) | This action sets how smooth the surface of this object is. |

SetInterpolatedAngularVelocity(Libraries.Compute.Vector3 velocity) | This action stores an approximation of angular velocity of the 3D object. |

SetInterpolatedLinearVelocity(Libraries.Compute.Vector3 velocity) | This action stores an approximation of linear velocity of the 3D object. |

SetInverseInertiaLocal(Libraries.Compute.Vector3 inverseInertia) | This action sets the inverse mass moment of inertia of the 3D object relative to the local origin of the 3D object, where the components of the inverse mass moment of inertia is just the reciprocal of the local mass moment of inertia. |

SetInverseMass(number inverseMass) | This action sets the reciprocal of the mass (1/mass) inside this property holder. |

SetItem(Libraries.Interface.Item3D item) | This action attaches a 3D item, which includes the shape, friction, restitution, positions, and others of a 3D object as a part of the properties that this 3D item has. |

SetLinearDamping(number linearDamping) | This action sets a number that will be used to decrease the linear velocity to ensure that our linear velocity calculation isn't too big. |

SetLinearVelocity(Libraries.Compute.Vector3 linearVelocity) | This action sets the linear velocity of the 3D object. |

SetLinearVelocityX(number linearVelocityX) | This action sets the x component of the linear velocity of the 3D object. |

SetLinearVelocityY(number linearVelocityY) | This action sets the y component of the linear velocity of the 3D object. |

SetLinearVelocityZ(number linearVelocityZ) | This action sets the z component of the linear velocity of the 3D object. |

SetMass(number mass) | This action sets the mass of the this property holder, which will also set the density if a 3D item has been attached to this property holder. |

SetMassProperties(number mass, Libraries.Compute.Vector3 inertia) | This action updates the mass of the 3D object and the inertia of the 3D object relative to the local origin. |

SetResponsiveness(integer type) | This action sets how physics (linear velocity, angular velocity, force, torque) will affect the object. |

SetRestitution(number restitution) | This action sets how much energy that this 3D object will loose after a collision. |

SetSleepTime(number time) | This action sets how much time that the 3D object attached to this property holder will remain in its current position. |

SetTorque(Libraries.Compute.Vector3 torque) | This action sets the torque that could potentially be applied to the center of mass of this object. |

Simulate(boolean flag) | This action will change the variables in this property holder based on whether simulation is required of the object that is attached to this property holder. |

UpdateInertia(Libraries.Compute.Matrix3 basis) | This action recalculates the mass moment of inertia relative to the world axis. |

## Actions Documentation

### ApplyAngularImpulse(Libraries.Compute.Vector3 impulse)

This action applied an angular impulse to the object which will cause the object to have a sudden change in angular velocity.

#### Parameters

- Libraries.Compute.Vector3: The angular impuls

### ApplyDamping(number seconds)

This action applies the scale factors that will decrease the linear and angular velocities that we calculated.

#### Parameters

- number seconds: The amount of time in the futur

### ApplyForce(Libraries.Compute.Vector3 force, Libraries.Compute.Vector3 point)

This action applies the force that you passed in to a point that you passed in.

#### Parameters

- Libraries.Compute.Vector3: The force in local coordinates that you want to apply.
- Libraries.Compute.Vector3: The point in the local coordinants that you want the force to be applied t

### ApplyForceToCenter(Libraries.Compute.Vector3 force)

This action applies a force to the center pf mass of the object.

#### Parameters

- Libraries.Compute.Vector3: The force in local coordinates that you want to appl

### ApplyLinearImpulse(Libraries.Compute.Vector3 impulse, Libraries.Compute.Vector3 point)

This action applies a linear impulse to the object at a specified point, which will lead to a sudden change in linear velocity of the object. This will also lead to a sudden change in angular velocity of the object if the linear impulse is not applied at the center of mass of the object.

#### Parameters

- Libraries.Compute.Vector3: The impulse vector in local coordinates that you want to apply to the object.
- Libraries.Compute.Vector3: The point in the local coordinants that you want the linear impulse to be applied t

### ApplyLinearImpulseToCenter(Libraries.Compute.Vector3 impulse)

This action applies an linear impulse to the center of mass of this object.

#### Parameters

- Libraries.Compute.Vector3: The impulse vector in local coordinates that you want to apply to the objec

### ApplyTorque(Libraries.Compute.Vector3 torque)

This action applies a torque to the center of mass of the object, which means this torque will only affect the angular velocity of the object but not the linear velocity of the object.

#### Parameters

- Libraries.Compute.Vector3: The torque that could potentially be applied to this object to rotate this objec

### CanRotate(boolean flag)

This action sets whether the 3D object attached to this property holder will be able to rotate or not.

#### Parameters

- boolean flag: True if this object can rotat

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

**Example Code**

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

#### Parameters

- Libraries.Language.Object: The object to compare to.

#### Return

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

### Copy()

This action allows another PhysicsProperties3D object to be assigned by the values stored inside the current PhysicsProperties3D object.

#### Return

Libraries.Game.Physics.PhysicsProperties3D: the other PhysicsProperties3D to copy fro

### 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(
```

#### Parameters

- Libraries.Language.Object: The to be compared.

#### Return

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

### FastMoving(boolean flag)

This action sets whether if the object attached to this property holder will be moving fast. If the object will be moving fast, then there will be more careful of a calculation of how this object collides with other objects.

#### Parameters

- boolean flag: True if this object will be moving quickl

### GetAngularDamping()

This action returns a number that will be used to decrease the angular velocity to ensure that our linear velocity calculation isn't too big.

#### Return

number: the angular dampin

### GetAngularFactor()

This action returns a number that scales the torque applied to the 3D object. Having an angular factor less than 1 makes the object less sensitive to the torque applied to it.

#### Return

number: the angular facto

### GetAngularVelocity()

This action returns the angular velocity of the 3D object.

#### Return

Libraries.Compute.Vector3: how fast the 3D object will rotat

### GetCollisionGroupFlag()

This action gets whether the object attached to this property holder will be inside a collision group.

#### Return

boolean: false if the object is not in a collision grou

### GetCollisionGroupIndex()

This action gets which collision group that this object will be in.

#### Return

integer: the collision group that this object will be i

### GetForce()

This action gets the force that is stored inside thie PhysicsProperties3D property holder.

#### Return

Libraries.Compute.Vector3: the force that will be applied to the objec

### GetFriction()

This action returns a number that lets you know how smooth thhe surface of this object is.

#### Return

number: the coefficient of frictio

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

### GetInterpolatedAngularVelocity()

This action returns an approximation of angular velocity of the 3D object.

#### Return

Libraries.Compute.Vector3: an approximation of angular velocity of the 3D object

### GetInterpolatedLinearVelocity()

This action returns an approximation of linear velocity of the 3D object.

#### Return

Libraries.Compute.Vector3: the approximation of linear velocity of the 3D objec

### GetInverseInertiaLocal()

This action returns the inverse mass moment of inertia of the 3D object relative to the local origin of the 3D object, where the components of the inverse mass moment of inertia is just the reciprocal of the local mass moment of inertia.

#### Return

Libraries.Compute.Vector3: the inverse mass moment of inertia of the 3D object relative to the local origin of the 3D objec

### GetInverseInertiaWorld()

This action returns the inertia tensor in global coordinates.

#### Return

Libraries.Compute.Matrix3: the inertia tensor in global coordinate

### GetInverseMass()

This action returns the reciprocal of the mass (1/mass) inside this property holder.

#### Return

number: the (1/mass) valu

### GetItem()

This action returns the Item3D that is attached to these physical properties.

#### Return

Libraries.Interface.Item3D: the Item3D that is attached to these physical propertie

### GetLinearDamping()

This action returns a number that will be used to decrease the linear velocity to ensure that our linear velocity calculation isn't too big.

#### Return

number: linear dampin

### GetLinearVelocity()

This action returns the linear velocity of the 3D object that is attached to this PhysicsProperties3D property holder.

#### Return

Libraries.Compute.Vector3: the linear velocit

### GetLinearVelocityAtLocalPoint(Libraries.Compute.Vector3 relativePosition)

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

#### Parameters

- Libraries.Compute.Vector3: A point in object's local coodinate.

#### Return

Libraries.Compute.Vector3: the linear velocit

### GetMass()

This action returns the mass of the object.

#### Return

number: the mass of the objec

### GetPushVelocity()

This action returns the push velocity that is used in a Split Impulse solver.

#### Return

Libraries.Compute.Vector3: the push velocity that is used in a Split Impulse solve

### GetResponsiveness()

This action returns how physics (linear velocity, angular velocity, force, torque) will affect the object. There are three possible values to be returned: 0 indicates that the object is UNMOVABLE, which means no matter what forces or torques is applied to the object, the object will not move. 1 indicates that the object is NON_RESPONSIVE, which means that only setting the angular velocity and linear velocity of this object will affect how the object behaves. 2 indicates that the object is REPONSIVE, which means that this object will behave differently when you apply forces and torques to this object.

#### Return

integer: Returns how physics will affect the objec

### GetRestitution()

This action returns how much energy that this 3D object will loose after a collision.

#### Return

number: the coefficient of restitutio

### GetSleepTime()

This action gets how much time that the 3D object attached to this property holder will remain in its current position.

#### Return

number: how much time that the 2D object attached to this property holder will remain in its current positio

### GetTorque()

This action gets the torque that is stored inside this object.

#### Return

Libraries.Compute.Vector3: torqu

### GetTurnVelocity()

This action returns the turn velocity that is used in a Split Impulse solver.

#### Return

Libraries.Compute.Vector3: the turn velocity that is used in a Split Impulse solve

### IntegrateTransform(Libraries.Game.Collision.PhysicsPosition3D currentTransform, number seconds, Libraries.Game.Collision.PhysicsPosition3D predictedTransform)

This action calculates where the 3D object would be after a certain amount of time.

#### Parameters

- Libraries.Game.Collision.PhysicsPosition3D: The current position of the 3D object.
- number seconds: The amount of time in the future.
- Libraries.Game.Collision.PhysicsPosition3D: The predicted position of the 3D objec

### IntegrateVelocities(number seconds)

This action estimates what the linear and angular velocities would be after a certain amount of time.

#### Parameters

- number seconds: The amount of time in the futur

### 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 impuls

### IsFastMoving()

This action tells you whether if this object will be moving fast. If the object will be moving fast, then there will be more careful of a calculation of how this object collides with other objects.

#### Return

boolean: true if this object will be moving quickl

### IsRotationAllowed()

This action tells you if the 3D object attached to this property holder will be able to rotate.

#### Return

boolean: True if this object can rotat

### IsSimulated()

This action tells you if the object attached to this property holder is being simulated.

#### Return

boolean: True if you want to simulate the objec

### IsSimulationRequired()

This action tells you whether if you need to move the object that is attached to this property holder.

#### Return

boolean: true if will require its position to be move

### RequireSimulation(boolean flag)

This action sets whether if the object attached to this property holder will require its position to be moved.

#### Parameters

- boolean flag: True if will require its position to be move

### SaveKinematicState(number timeStep)

This action stores the angular, linear velocities of the 3D object before its angular and linear velocities are updated.

#### Parameters

- number timeStep: The amount of time to simulat

### SetAngularDamping(number angularDamping)

This action sets a number that will be used to decrease the angular velocity to ensure that our linear velocity calculation isn't too big.

#### Parameters

- number angularDamping: The angular dampin

### SetAngularVelocity(Libraries.Compute.Vector3 angularVelocity)

This action sets the angular velocity of the 3D object.

#### Parameters

- Libraries.Compute.Vector3: How fast the 3D object will rotat

### SetCollisionGroupFlag(boolean flag)

This action sets whether the object attached to this property holder will be inside a collision group.

#### Parameters

- boolean flag: Whether the object attached to this property holder will be inside a collision grou

### SetCollisionGroupIndex(integer index)

This action sets which collision group that this object will be in.

#### Parameters

- integer index: The collision group that this object will be i

### SetForce(Libraries.Compute.Vector3 force)

This action sets the force that will be applied to the object.

#### Parameters

- Libraries.Compute.Vector3: The force that will be applied to the objec

### SetFriction(number friction)

This action sets how smooth the surface of this object is. If the surface of this object is smooth, then you can pass in a number 0.0, if you want the surface of this object to be rough, then you can pass in a number 1.0.

#### Parameters

- number friction: The coefficient of frictio

### SetInterpolatedAngularVelocity(Libraries.Compute.Vector3 velocity)

This action stores an approximation of angular velocity of the 3D object.

#### Parameters

- Libraries.Compute.Vector3: an approximation of angular velocity of the 3D objec

### SetInterpolatedLinearVelocity(Libraries.Compute.Vector3 velocity)

This action stores an approximation of linear velocity of the 3D object.

#### Parameters

- Libraries.Compute.Vector3: The approximation of linear velocity of the 3D objec

### SetInverseInertiaLocal(Libraries.Compute.Vector3 inverseInertia)

This action sets the inverse mass moment of inertia of the 3D object relative to the local origin of the 3D object, where the components of the inverse mass moment of inertia is just the reciprocal of the local mass moment of inertia.

#### Parameters

- Libraries.Compute.Vector3: the inverse mass moment of inertia of the 3D object relative to the local origin of the 3D objec

### SetInverseMass(number inverseMass)

This action sets the reciprocal of the mass (1/mass) inside this property holder.

#### Parameters

- number inverseMass: The (1/mass) valu

### SetItem(Libraries.Interface.Item3D item)

This action attaches a 3D item, which includes the shape, friction, restitution, positions, and others of a 3D object as a part of the properties that this 3D item has. This action is used internally in the Item3D class when you enable physics on the item when a "PhysicsProperties3D" property holder will be created so that Item3D will be attached to that property holder and the property holder will be attached to the Item3D.

#### Parameters

- Libraries.Interface.Item3D: The Item3D to be store

### SetLinearDamping(number linearDamping)

This action sets a number that will be used to decrease the linear velocity to ensure that our linear velocity calculation isn't too big.

#### Parameters

- number linearDamping: the linear dampin

### SetLinearVelocity(Libraries.Compute.Vector3 linearVelocity)

This action sets the linear velocity of the 3D object.

#### Parameters

- Libraries.Compute.Vector3: the linear velocity of the 3D objec

### SetLinearVelocityX(number linearVelocityX)

This action sets the x component of the linear velocity of the 3D object.

#### Parameters

- number linearVelocityX: The x component of the linear velocity of the 3D objec

### SetLinearVelocityY(number linearVelocityY)

This action sets the y component of the linear velocity of the 3D object.

#### Parameters

- number linearVelocityY: The y component of the linear velocity of the 3D objec

### SetLinearVelocityZ(number linearVelocityZ)

This action sets the z component of the linear velocity of the 3D object.

#### Parameters

- number linearVelocityZ: The z component of the linear velocity of the 3D objec

### SetMass(number mass)

This action sets the mass of the this property holder, which will also set the density if a 3D item has been attached to this property holder.

#### Parameters

- number mass: The mass of the objec

### SetMassProperties(number mass, Libraries.Compute.Vector3 inertia)

This action updates the mass of the 3D object and the inertia of the 3D object relative to the local origin.

#### Parameters

- number mass: The mass of the 3D object.
- Libraries.Compute.Vector3: the inertia of the 3D object relative to the local origi

### SetResponsiveness(integer type)

This action sets how physics (linear velocity, angular velocity, force, torque) will affect the object.

#### Parameters

- integer type: The responsiveness of the objec

### SetRestitution(number restitution)

This action sets how much energy that this 3D object will loose after a collision. If you want the object to not loose any energy, then you can pass in 1.0. If you want the object to loose a lot of energy (meaning, they would probably move a lot slower after the collision), then you can pass in a 0.0. You can also use the values between 0 and 1.

#### Parameters

- number restitution: The coefficient of restitutio

### SetSleepTime(number time)

This action sets how much time that the 3D object attached to this property holder will remain in its current position.

#### Parameters

- number time: How much time that the 2D object attached to this property holder will remain in its current positio

### SetTorque(Libraries.Compute.Vector3 torque)

This action sets the torque that could potentially be applied to the center of mass of this object.

#### Parameters

- Libraries.Compute.Vector3: The torque that could potentially be applied to this object to rotate this objec

### Simulate(boolean flag)

This action will change the variables in this property holder based on whether simulation is required of the object that is attached to this property holder. If simulation is not required, then this means that the object's position will not change.

#### Parameters

- boolean flag: True if you want to simulate the objec

### UpdateInertia(Libraries.Compute.Matrix3 basis)

This action recalculates the mass moment of inertia relative to the world axis.

#### Parameters

- Libraries.Compute.Matrix3: The local axis of the 3D objec