2 instantiations of Quaternion
Microsoft.Gen.Logging.Generated.Tests (1)
LogPropertiesTests.cs (1)
105
P15 = new
Quaternion
(1, 2, 3, 4),
Microsoft.Maui.Essentials (1)
OrientationSensor\OrientationSensor.shared.cs (1)
139
Orientation = new
Quaternion
(x, y, z, w);
128 references to Quaternion
Microsoft.Gen.Logging.Generated.Tests (1)
test\Generators\Microsoft.Gen.Logging\TestClasses\LogPropertiesSpecialTypesExtensions.cs (1)
32
public
Quaternion
P15 { get; set; }
Microsoft.Maui.Essentials (2)
OrientationSensor\OrientationSensor.shared.cs (2)
142
/// Gets the current orientation that represents a <see cref="
Quaternion
"/>.
144
public
Quaternion
Orientation { get; }
netstandard (1)
netstandard.cs (1)
1336
[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Numerics.
Quaternion
))]
System.Numerics (1)
System.Numerics.cs (1)
9
[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Numerics.
Quaternion
))]
System.Numerics.Vectors (1)
artifacts\obj\System.Numerics.Vectors\Debug\net10.0\System.Numerics.Vectors.Forwards.cs (1)
6
[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Numerics.
Quaternion
))]
System.Private.CoreLib (122)
src\libraries\System.Private.CoreLib\src\System\Numerics\Matrix4x4.cs (3)
622
public static Matrix4x4 CreateFromQuaternion(
Quaternion
quaternion)
967
public static bool Decompose(Matrix4x4 matrix, out Vector3 scale, out
Quaternion
rotation, out Vector3 translation)
1022
public static Matrix4x4 Transform(Matrix4x4 value,
Quaternion
rotation)
src\libraries\System.Private.CoreLib\src\System\Numerics\Matrix4x4.Impl.cs (9)
300
Quaternion
q =
Quaternion
.CreateFromAxisAngle(axis, angle);
305
public static Impl CreateFromQuaternion(in
Quaternion
quaternion)
346
Quaternion
q =
Quaternion
.CreateFromYawPitchRoll(yaw, pitch, roll);
950
public static unsafe bool Decompose(in Impl matrix, out Vector3 scale, out
Quaternion
rotation, out Vector3 translation)
1122
rotation =
Quaternion
.Identity;
1128
rotation =
Quaternion
.CreateFromRotationMatrix(matTemp.AsM4x4());
1491
public static Impl Transform(in Impl value, in
Quaternion
rotation)
src\libraries\System.Private.CoreLib\src\System\Numerics\Plane.cs (1)
158
public static Plane Transform(Plane plane,
Quaternion
rotation) => Vector4.Transform(plane.AsVector4(), rotation).AsPlane();
src\libraries\System.Private.CoreLib\src\System\Numerics\Quaternion.cs (84)
11
/// <remarks>The <see cref="
Quaternion
" /> structure is used to efficiently rotate an object about the (x,y,z) vector by the angle theta, where:
14
public struct Quaternion : IEquatable<
Quaternion
>
30
/// <summary>Initializes a <see cref="
Quaternion
" /> from the specified components.</summary>
41
/// <summary>Initializes a <see cref="
Quaternion
" /> from the specified vector and rotation parts.</summary>
52
public static
Quaternion
Zero
60
public static
Quaternion
Identity
92
/// <remarks>The <see cref="op_Addition" /> method defines the operation of the addition operator for <see cref="
Quaternion
" /> objects.</remarks>
95
public static
Quaternion
operator +(
Quaternion
value1,
Quaternion
value2) => (value1.AsVector128() + value2.AsVector128()).AsQuaternion();
101
/// <remarks>The <see cref="op_Division" /> method defines the division operation for <see cref="
Quaternion
" /> objects.</remarks>
102
public static
Quaternion
operator /(
Quaternion
value1,
Quaternion
value2) => value1 * Inverse(value2);
109
/// The <see cref="op_Equality" /> method defines the operation of the equality operator for <see cref="
Quaternion
" /> objects.</remarks>
112
public static bool operator ==(
Quaternion
value1,
Quaternion
value2) => value1.AsVector128() == value2.AsVector128();
119
public static bool operator !=(
Quaternion
value1,
Quaternion
value2) => !(value1 == value2);
125
/// <remarks>The <see cref="
Quaternion
.op_Multiply" /> method defines the operation of the multiplication operator for <see cref="
Quaternion
" /> objects.</remarks>
127
public static
Quaternion
operator *(
Quaternion
value1,
Quaternion
value2)
146
/// <remarks>The <see cref="
Quaternion
.op_Multiply" /> method defines the operation of the multiplication operator for <see cref="
Quaternion
" /> objects.</remarks>
149
public static
Quaternion
operator *(
Quaternion
value1, float value2) => (value1.AsVector128() * value2).AsQuaternion();
155
/// <remarks>The <see cref="op_Subtraction" /> method defines the operation of the subtraction operator for <see cref="
Quaternion
" /> objects.</remarks>
158
public static
Quaternion
operator -(
Quaternion
value1,
Quaternion
value2) => (value1.AsVector128() - value2.AsVector128()).AsQuaternion();
163
/// <remarks>The <see cref="op_UnaryNegation" /> method defines the operation of the unary negation operator for <see cref="
Quaternion
" /> objects.</remarks>
166
public static
Quaternion
operator -(
Quaternion
value) => (-value.AsVector128()).AsQuaternion();
173
public static
Quaternion
Add(
Quaternion
value1,
Quaternion
value2) => value1 + value2;
179
public static
Quaternion
Concatenate(
Quaternion
value1,
Quaternion
value2) => value2 * value1;
186
public static
Quaternion
Conjugate(
Quaternion
value)
194
/// <summary>Creates a <see cref="
Quaternion
" /> from the specified components.</summary>
199
/// <returns>A <see cref="
Quaternion
" /> created from the specified components.</returns>>
201
public static
Quaternion
Create(float x, float y, float z, float w) => Vector128.Create(x, y, z, w).AsQuaternion();
203
/// <summary>Creates a <see cref="
Quaternion
" /> from the specified vector and rotation parts.</summary>
206
/// <returns>A <see cref="
Quaternion
" /> created from the specified vector and rotation parts.</returns>
208
public static
Quaternion
Create(Vector3 vectorPart, float scalarPart) => Vector4.Create(vectorPart, scalarPart).AsQuaternion();
214
/// <remarks><paramref name="axis" /> vector must be normalized before calling this method or the resulting <see cref="
Quaternion
" /> will be incorrect.</remarks>
216
public static
Quaternion
CreateFromAxisAngle(Vector3 axis, float angle)
228
public static
Quaternion
CreateFromRotationMatrix(Matrix4x4 matrix)
232
Quaternion
q = default;
282
public static
Quaternion
CreateFromYawPitchRoll(float yaw, float pitch, float roll)
290
Quaternion
result;
304
public static
Quaternion
Divide(
Quaternion
value1,
Quaternion
value2) => value1 / value2;
312
public static float Dot(
Quaternion
quaternion1,
Quaternion
quaternion2) => Vector128.Dot(quaternion1.AsVector128(), quaternion2.AsVector128());
319
public static
Quaternion
Inverse(
Quaternion
value)
342
public static
Quaternion
Lerp(
Quaternion
quaternion1,
Quaternion
quaternion2, float amount)
360
public static
Quaternion
Multiply(
Quaternion
value1,
Quaternion
value2) => value1 * value2;
367
public static
Quaternion
Multiply(
Quaternion
value1, float value2) => value1 * value2;
373
public static
Quaternion
Negate(
Quaternion
value) => -value;
375
/// <summary>Divides each component of a specified <see cref="
Quaternion
" /> by its length.</summary>
380
public static
Quaternion
Normalize(
Quaternion
value) => (value.AsVector128() / value.Length()).AsQuaternion();
387
public static
Quaternion
Slerp(
Quaternion
quaternion1,
Quaternion
quaternion2, float amount)
425
public static
Quaternion
Subtract(
Quaternion
value1,
Quaternion
value2) => value1 - value2;
430
/// <remarks>The current instance and <paramref name="obj" /> are equal if <paramref name="obj" /> is a <see cref="
Quaternion
" /> object and the corresponding components of each matrix are equal.</remarks>
431
public override readonly bool Equals([NotNullWhen(true)] object? obj) => (obj is
Quaternion
other) && Equals(other);
438
public readonly bool Equals(
Quaternion
other) => this.AsVector128().Equals(other.AsVector128());
src\libraries\System.Private.CoreLib\src\System\Numerics\Quaternion.Extensions.cs (4)
10
/// <summary>Reinterprets a <see cref="
Quaternion
" /> as a new <see cref="Vector4" />.</summary>
12
/// <returns><paramref name="value" /> reinterpreted as a new <see cref="
Quaternion
" />.</returns>
14
public static Vector4 AsVector4(this
Quaternion
value) => Unsafe.BitCast<
Quaternion
, Vector4>(value);
src\libraries\System.Private.CoreLib\src\System\Numerics\Vector2.cs (1)
924
public static Vector2 Transform(Vector2 value,
Quaternion
rotation) => Vector4.Transform(value, rotation).AsVector2();
src\libraries\System.Private.CoreLib\src\System\Numerics\Vector3.cs (1)
946
public static Vector3 Transform(Vector3 value,
Quaternion
rotation) => Vector4.Transform(value, rotation).AsVector3();
src\libraries\System.Private.CoreLib\src\System\Numerics\Vector4.cs (8)
985
public static Vector4 Transform(Vector2 value,
Quaternion
rotation) => Transform(Create(value, 0.0f, 1.0f), rotation);
1008
public static Vector4 Transform(Vector3 value,
Quaternion
rotation) => Transform(Create(value, 1.0f), rotation);
1032
public static Vector4 Transform(Vector4 value,
Quaternion
rotation)
1037
Quaternion
conjuagate =
Quaternion
.Conjugate(rotation);
1038
Quaternion
temp =
Quaternion
.Concatenate(conjuagate, value.AsQuaternion());
1039
return
Quaternion
.Concatenate(temp, rotation).AsVector4();
src\libraries\System.Private.CoreLib\src\System\Numerics\Vector4.Extensions.cs (4)
17
/// <summary>Reinterprets a <see cref="Vector4" /> as a new <see cref="
Quaternion
" />.</summary>
19
/// <returns><paramref name="value" /> reinterpreted as a new <see cref="
Quaternion
" />.</returns>
20
public static
Quaternion
AsQuaternion(this Vector4 value) => Unsafe.BitCast<Vector4,
Quaternion
>(value);
src\libraries\System.Private.CoreLib\src\System\Runtime\Intrinsics\Vector128.Numerics.cs (7)
58
/// <summary>Reinterprets a <see langword="Vector128<Single>" /> as a new <see cref="
Quaternion
" />.</summary>
60
/// <returns><paramref name="value" /> reinterpreted as a new <see cref="
Quaternion
" />.</returns>
62
public static
Quaternion
AsQuaternion(this Vector128<float> value) => Unsafe.BitCast<Vector128<float>,
Quaternion
>(value);
70
/// <summary>Reinterprets a <see cref="
Quaternion
" /> as a new <see langword="Vector128<Single>" />.</summary>
74
public static Vector128<float> AsVector128(this
Quaternion
value) => Unsafe.BitCast<
Quaternion
, Vector128<float>>(value);