## Libraries.Game.Physics.PhysicsProperties3D Documentation

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

Inherits from: Libraries.Language.Object

### Variables Table

VariablesDescription
integer NON_RESPONSIVEstatic object
integer UNMOVABLEstatic object
integer RESPONSIVEobject governed by kinematics (meaning, the object is affected by linear velocity and angular velocity settings)

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

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

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

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

#### Parameters

• boolean flag: True if this object can rotate.

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

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

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

### Equals(Libraries.Language.Object object)

This action determines if two objects are equal based on their hash code values.

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

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

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

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

### GetAngularVelocity()

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

#### Return

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

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

### GetCollisionGroupIndex()

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

#### Return

integer: the collision group that this object will be in.

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

### GetFriction()

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

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

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

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

#### Return

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

### GetInverseInertiaWorld()

This action returns the inertia tensor in global coordinates.

#### Return

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

### GetInverseMass()

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

#### Return

number: the (1/mass) value.

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

#### Return

number: linear damping.

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

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

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

#### Return

Libraries.Compute.Vector3: the linear velocity.

### GetMass()

This action returns the mass of the object.

#### Return

number: the mass of the object.

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

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

### GetRestitution()

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

#### Return

number: the coefficient of restitution.

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

### GetTorque()

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

#### Return

Libraries.Compute.Vector3: torque.

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

#### Parameters

• number seconds: The amount of time in the future.

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

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

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

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

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

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

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

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

#### Parameters

• boolean flag: 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.

#### Parameters

• integer index: The 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. 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 friction.

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

#### Parameters

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