3 namespace droid.Runtime.Utilities.Structs {
8 protected static readonly Matrix4x4 _FlipZ = Matrix4x4.Scale(
new Vector3(1, 1, -1));
11 public Vector3 Position {
get;
protected set; }
14 public Quaternion Orientation {
get;
protected set; }
17 public Matrix4x4 Matrix {
get;
protected set; }
20 public Matrix4x4 RightHandedMatrix {
get {
return _FlipZ * this.Matrix * _FlipZ; } }
25 this.Position = Vector3.zero;
26 this.Orientation = Quaternion.identity;
27 this.Matrix = Matrix4x4.identity;
31 public OutPose(Vector3 position, Quaternion orientation) { this.Set(position, orientation); }
34 public OutPose(Matrix4x4 matrix) { this.Set(matrix); }
36 protected void Set(Vector3 position, Quaternion orientation) {
37 this.Position = position;
38 this.Orientation = orientation;
39 this.Matrix = Matrix4x4.TRS(position, orientation, Vector3.one);
42 protected void Set(Matrix4x4 matrix) {
44 this.Position = matrix.GetColumn(3);
45 this.Orientation = Quaternion.LookRotation(matrix.GetColumn(2), matrix.GetColumn(1));
51 public new void Set(Vector3 position, Quaternion orientation) { base.Set(position, orientation); }
54 public new void Set(Matrix4x4 matrix) { base.Set(matrix); }
57 public void SetRightHanded(Matrix4x4 matrix) { this.Set(_FlipZ * matrix * _FlipZ); }
void Set(Vector3 position, Quaternion orientation)
OutPose(Matrix4x4 matrix)
Constructor that takes a Matrix4x4.
new void Set(Vector3 position, Quaternion orientation)
Sets the position and orientation from a Vector3 + Quaternion.
OutPose(Vector3 position, Quaternion orientation)
Constructor that takes a Vector3 and a Quaternion.
new void Set(Matrix4x4 matrix)
Sets the position and orientation from a Matrix4x4.
void SetRightHanded(Matrix4x4 matrix)
Sets the position and orientation from a right-handed Matrix4x4.
void Set(Matrix4x4 matrix)