Struct Quaternion
Represents the rotation of an object in the world.
Implements
Namespace: Anki.Vector.Types
Assembly: Anki.Vector.dll
Syntax
public struct Quaternion : IEquatable<Quaternion>
Constructors
| Improve this Doc View SourceQuaternion(Single)
Initializes a new instance of the Quaternion struct. This function converts an angle in the z axis (Euler angle z component) to a quaternion.
public Quaternion(float radiansZ)
Parameters
Type | Name | Description |
---|---|---|
Single | radiansZ | angle in the z axis in radians. |
Quaternion(Single, Single, Single, Single)
Initializes a new instance of the Quaternion struct.
public Quaternion(float q0, float q1, float q2, float q3)
Parameters
Type | Name | Description |
---|---|---|
Single | q0 | The The q0 (w) value of the quaternion. |
Single | q1 | The q1 (i) value of the quaternion.. |
Single | q2 | The q2 (j) value of the quaternion.. |
Single | q3 | The q3 (k) value of the quaternion.. |
Properties
| Improve this Doc View SourceAngleZ
An Angle instance representing the z Euler component of the object's rotation in radians
public float AngleZ { get; }
Property Type
Single |
Q0
Gets the q0 (w) value of the quaternion.
public float Q0 { get; }
Property Type
Single |
Q1
Gets the q1 (i) value of the quaternion.
public float Q1 { get; }
Property Type
Single |
Q2
Gets the q2 (j) value of the quaternion.
public float Q2 { get; }
Property Type
Single |
Q3
Gets the q3 (k) value of the quaternion.
public float Q3 { get; }
Property Type
Single |
Methods
| Improve this Doc View SourceEquals(Quaternion)
Indicates whether the current object is equal to another object of the same type.
public bool Equals(Quaternion other)
Parameters
Type | Name | Description |
---|---|---|
Quaternion | other | An object to compare with this object. |
Returns
Type | Description |
---|---|
Boolean | true if the current object is equal to the |
Equals(Object)
Determines whether the specified Object, is equal to this instance.
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
Object | obj | The Object to compare with this instance. |
Returns
Type | Description |
---|---|
Boolean |
|
Overrides
| Improve this Doc View SourceGetHashCode()
Returns a hash code for this instance.
public override int GetHashCode()
Returns
Type | Description |
---|---|
Int32 | A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. |
Overrides
| Improve this Doc View SourceToString()
Converts to string.
public override string ToString()
Returns
Type | Description |
---|---|
String | A String that represents this instance. |
Overrides
Operators
| Improve this Doc View SourceEquality(Quaternion, Quaternion)
Implements the operator ==.
public static bool operator ==(Quaternion lhs, Quaternion rhs)
Parameters
Type | Name | Description |
---|---|---|
Quaternion | lhs | The LHS. |
Quaternion | rhs | The RHS. |
Returns
Type | Description |
---|---|
Boolean | The result of the operator. |
Inequality(Quaternion, Quaternion)
Implements the operator !=.
public static bool operator !=(Quaternion lhs, Quaternion rhs)
Parameters
Type | Name | Description |
---|---|---|
Quaternion | lhs | The LHS. |
Quaternion | rhs | The RHS. |
Returns
Type | Description |
---|---|
Boolean | The result of the operator. |