Quaternion 結構
定義
表示用來編碼三維實體旋轉的向量。Represents a vector that is used to encode three-dimensional physical rotations.
public value class Quaternion : IEquatable<System::Numerics::Quaternion>
public struct Quaternion : IEquatable<System.Numerics.Quaternion>
type Quaternion = struct
Public Structure Quaternion
Implements IEquatable(Of Quaternion)
- 繼承
- 實作
備註
@No__t-0 結構是用來以角度 theta 來有效率地將關於(x,y,z)向量的物件旋轉,其中:The Quaternion structure is used to efficiently rotate an object about the (x,y,z) vector by the angle theta, where:
w = cos(theta/2)
建構函式
Quaternion(Single, Single, Single, Single) |
從指定的元件建構四元數。Constructs a quaternion from the specified components. |
Quaternion(Vector3, Single) |
從指定的向量和旋轉部分建立四元數。Creates a quaternion from the specified vector and rotation parts. |
欄位
W |
四元數的旋轉元件。The rotation component of the quaternion. |
X |
四元數之向量元件的 X 值。The X value of the vector component of the quaternion. |
Y |
四元數之向量元件的 Y 值。The Y value of the vector component of the quaternion. |
Z |
四元數之向量元件的 Z 值。The Z value of the vector component of the quaternion. |
屬性
Identity |
取得表示沒有旋轉的四元數。Gets a quaternion that represents no rotation. |
IsIdentity |
取得值,這個值表示目前執行個體是否為單位四元數。Gets a value that indicates whether the current instance is the identity quaternion. |
方法
Add(Quaternion, Quaternion) |
將一個四元數的每個元素和第二個四元數的相對應元素相加。Adds each element in one quaternion with its corresponding element in a second quaternion. |
Concatenate(Quaternion, Quaternion) |
串連兩個四元數。Concatenates two quaternions. |
Conjugate(Quaternion) |
傳回指定四元數的共軛。Returns the conjugate of a specified quaternion. |
CreateFromAxisAngle(Vector3, Single) |
從單位向量和對此向量旋轉的角度建立四元數。Creates a quaternion from a unit vector and an angle to rotate around the vector. |
CreateFromRotationMatrix(Matrix4x4) |
從指定的旋轉矩陣建立四元數。Creates a quaternion from the specified rotation matrix. |
CreateFromYawPitchRoll(Single, Single, Single) |
依據指定的繞 Y 軸旋轉、繞 X 軸旋轉和滾動建立一個新四元數。Creates a new quaternion from the given yaw, pitch, and roll. |
Divide(Quaternion, Quaternion) |
將一個四元數除以第二個四元數。Divides one quaternion by a second quaternion. |
Dot(Quaternion, Quaternion) |
計算兩個四元數的內積。Calculates the dot product of two quaternions. |
Equals(Object) |
傳回值,這個值指出此執行個體和指定的物件是否相等。Returns a value that indicates whether this instance and a specified object are equal. |
Equals(Quaternion) |
傳回值,這個值指出此執行個體和另一個四元數是否相等。Returns a value that indicates whether this instance and another quaternion are equal. |
GetHashCode() |
傳回這個執行個體的雜湊碼。Returns the hash code for this instance. |
Inverse(Quaternion) |
傳回反四元數。Returns the inverse of a quaternion. |
Length() |
計算此四元數的長度。Calculates the length of the quaternion. |
LengthSquared() |
計算此四元數的長度平方。Calculates the squared length of the quaternion. |
Lerp(Quaternion, Quaternion, Single) |
根據指定第二個四元數之加權的值,執行兩個四元數之間的線性插補。Performs a linear interpolation between two quaternions based on a value that specifies the weighting of the second quaternion. |
Multiply(Quaternion, Quaternion) |
傳回將兩個四元數一起相乘所產生的四元數。Returns the quaternion that results from multiplying two quaternions together. |
Multiply(Quaternion, Single) |
傳回四元數,該四元數為依據純量因數縮放指定四元數之所有元件而產生。Returns the quaternion that results from scaling all the components of a specified quaternion by a scalar factor. |
Negate(Quaternion) |
將四元數的每個元件變換正負號。Reverses the sign of each component of the quaternion. |
Normalize(Quaternion) |
將指定的 Quaternion 之每個元件除以其長度。Divides each component of a specified Quaternion by its length. |
Slerp(Quaternion, Quaternion, Single) |
使用球面線性插補,在兩個四元數間進行插補。Interpolates between two quaternions, using spherical linear interpolation. |
Subtract(Quaternion, Quaternion) |
將第二個四元數中的每個元素減去第一個四元數中相對應的元素。Subtracts each element in a second quaternion from its corresponding element in a first quaternion. |
ToString() |
傳回表示這個四元數的字串。Returns a string that represents this quaternion. |
運算子
Addition(Quaternion, Quaternion) |
將一個四元數的每個元素和第二個四元數的相對應元素相加。Adds each element in one quaternion with its corresponding element in a second quaternion. |
Division(Quaternion, Quaternion) |
將一個四元數除以第二個四元數。Divides one quaternion by a second quaternion. |
Equality(Quaternion, Quaternion) |
傳回值,指出兩個四元數是否相等。Returns a value that indicates whether two quaternions are equal. |
Inequality(Quaternion, Quaternion) |
傳回值,指出兩個四元數是否不相等。Returns a value that indicates whether two quaternions are not equal. |
Multiply(Quaternion, Quaternion) |
傳回將兩個四元數一起相乘所產生的四元數。Returns the quaternion that results from multiplying two quaternions together. |
Multiply(Quaternion, Single) |
傳回四元數,該四元數為依據純量因數縮放指定四元數之所有元件而產生。Returns the quaternion that results from scaling all the components of a specified quaternion by a scalar factor. |
Subtraction(Quaternion, Quaternion) |
將第二個四元數中的每個元素減去第一個四元數中相對應的元素。Subtracts each element in a second quaternion from its corresponding element in a first quaternion. |
UnaryNegation(Quaternion) |
將四元數的每個元件變換正負號。Reverses the sign of each component of the quaternion. |