## Libraries.Game.Collision.PhysicsPosition3D Documentation

This class stores coordinate systems in 3D space, where the coordinate system represent the position of the 3D item and the tilt of the 3D item with respect to your screen. NOTE: this class can be seen as the class that stores a 4x4 transformation matrix.

*Inherits from: *Libraries.Language.Object

## Summary

### Actions Summary Table

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

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

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

GetBasis() | This action gets the tilt of the 3D object (the rotational part of the transformation matrix). |

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

GetMatrix(Libraries.Compute.Matrix4 matrix) | This action returns a 4x4 transformation matrix representation of this PhysicsPosition3D. |

GetOrigin() | This action gets the position of the 3D object (the 3D object's local origin with respect to the global coordinates). |

GetRotation() | This action returns a quaternion (another holder of the position and tilt information) that represents the current PhysicsPosition3D. |

Inverse(Libraries.Game.Collision.PhysicsPosition3D transform) | This action stores the inverse of the transformation matrix passed in. |

Inverse() | This action calculates the inverse of the transformation matrix stored inside this PhysicsPosition3D. |

InverseTransform(Libraries.Compute.Vector3 in, Libraries.Compute.Vector3 out) | This action multiplies "Vector3 in" with the inverse of the current PhysicsPosition3D and store the result in "Vector3 out. |

Multiply(Libraries.Game.Collision.PhysicsPosition3D transform) | This action changes the current PhysicsPosition3D with respect to the current PhysicsPosition3D using the "PhysicsPosition3D transform" passed in. |

Multiply(Libraries.Game.Collision.PhysicsPosition3D transform1, Libraries.Game.Collision.PhysicsPosition3D transform2) | This action multiplies two transformation matrices together and store the result in the current PhysicsPosition3D. |

Output() | the position of the 3D object's origin with respect to the origin of the global coordinat |

Set(Libraries.Compute.Matrix4 matrix) | This action sets the position of a 3D object using a matrix that contains both the tilt of the object and the position of the 3D object's center with respect to the world center. |

Set(Libraries.Compute.Matrix3 matrix) | This action sets the tilt of the 3D object and reset the position of the 3D object (the 3D object's local origin) to the global coordinate's origin. |

Set(Libraries.Game.Collision.PhysicsPosition3D transform) | This action sets the location and the tilt of the 3D object using another PhysicsPosition3D. |

Set(Libraries.Compute.Matrix3 basis, Libraries.Compute.Vector3 origin) | This action sets the tilt of the 3D object using "Matrix3 basis" and sets the location of the 3D object using "Vector3 origin. |

SetRotation(Libraries.Compute.Quaternion quaternion) | This action sets the current PhysicsPosition3D using a quaternion that is passed in. |

SetToIdentity() | This action sets the tilt of the 3D object to be 0 and make the position of the 3D object described by this PhysicsPosition3D to align with the global origin. |

Transform(Libraries.Compute.Vector3 vector) | This action turns a point/vector (Vector3 vector) that is described relative to the 3D object and change it so that the point/vector is described in the global coordinates. |

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

**Example Code**

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

#### Parameters

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

#### Return

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

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

#### Parameters

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

#### Return

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

### GetBasis()

This action gets the tilt of the 3D object (the rotational part of the transformation matrix).

#### Return

Libraries.Compute.Matrix3: the tilt of the 3D object.

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

### GetMatrix(Libraries.Compute.Matrix4 matrix)

This action returns a 4x4 transformation matrix representation of this PhysicsPosition3D.

#### Parameters

- Libraries.Compute.Matrix4: A 4x4 transformation matrix representation of this PhysicsPosition3D.

#### Return

Libraries.Compute.Matrix4: a 4x4 transformation matrix representation of this PhysicsPosition3D.

### GetOrigin()

This action gets the position of the 3D object (the 3D object's local origin with respect to the global coordinates).

#### Return

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

### GetRotation()

This action returns a quaternion (another holder of the position and tilt information) that represents the current PhysicsPosition3D.

#### Return

Libraries.Compute.Quaternion: The current position and tilt of the 3D object represented in the form of a quaternion.

### Inverse(Libraries.Game.Collision.PhysicsPosition3D transform)

This action stores the inverse of the transformation matrix passed in.

#### Parameters

- Libraries.Game.Collision.PhysicsPosition3D: The transformation matrix that you want to find the inverse for.

### Inverse()

This action calculates the inverse of the transformation matrix stored inside this PhysicsPosition3D.

### InverseTransform(Libraries.Compute.Vector3 in, Libraries.Compute.Vector3 out)

This action multiplies "Vector3 in" with the inverse of the current PhysicsPosition3D and store the result in "Vector3 out." Mathematically: out = [currT]^(-1) * in

#### Parameters

- Libraries.Compute.Vector3: A point described in global coordinates.
- Libraries.Compute.Vector3: The same point described relative to the 3D object.

### Multiply(Libraries.Game.Collision.PhysicsPosition3D transform)

This action changes the current PhysicsPosition3D with respect to the current PhysicsPosition3D using the "PhysicsPosition3D transform" passed in. A mathematical representation is: [currT] = [currT][passedInT].

#### Parameters

- Libraries.Game.Collision.PhysicsPosition3D: The transformation matrix that you want to multiply by.

### Multiply(Libraries.Game.Collision.PhysicsPosition3D transform1, Libraries.Game.Collision.PhysicsPosition3D transform2)

This action multiplies two transformation matrices together and store the result in the current PhysicsPosition3D. Mathematically: [currT] = [T_1][T_2].

#### Parameters

- Libraries.Game.Collision.PhysicsPosition3D: The first transformation matrix.
- Libraries.Game.Collision.PhysicsPosition3D: The second transformation matrix.

### Output()

the position of the 3D object's origin with respect to the origin of the global coordinat

### Set(Libraries.Compute.Matrix4 matrix)

This action sets the position of a 3D object using a matrix that contains both the tilt of the object and the position of the 3D object's center with respect to the world center.

#### Parameters

- Libraries.Compute.Matrix4: The tilt of the object and the position of the 3D object.

### Set(Libraries.Compute.Matrix3 matrix)

This action sets the tilt of the 3D object and reset the position of the 3D object (the 3D object's local origin) to the global coordinate's origin. If you don't want the origin of the 3D object to be reset, please use the action "Set(Matrix3 basis, Vector3 origin)."

#### Parameters

- Libraries.Compute.Matrix3: The tilt of the 3D object.

### Set(Libraries.Game.Collision.PhysicsPosition3D transform)

This action sets the location and the tilt of the 3D object using another PhysicsPosition3D.

#### Parameters

### Set(Libraries.Compute.Matrix3 basis, Libraries.Compute.Vector3 origin)

This action sets the tilt of the 3D object using "Matrix3 basis" and sets the location of the 3D object using "Vector3 origin."

#### Parameters

- Libraries.Compute.Matrix3: The tilt of the 3D object.
- Libraries.Compute.Vector3: The center of the 3D object.

### SetRotation(Libraries.Compute.Quaternion quaternion)

This action sets the current PhysicsPosition3D using a quaternion that is passed in.

#### Parameters

- Libraries.Compute.Quaternion: The current position and tilt of the 3D object.

### SetToIdentity()

This action sets the tilt of the 3D object to be 0 and make the position of the 3D object described by this PhysicsPosition3D to align with the global origin.

### Transform(Libraries.Compute.Vector3 vector)

This action turns a point/vector (Vector3 vector) that is described relative to the 3D object and change it so that the point/vector is described in the global coordinates.

#### Parameters

- Libraries.Compute.Vector3: The vector to be transformed.