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)
继承
Quaternion
实现

注解

Quaternion 结构用于有效地使用 angle (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

获取一个指示当前实例是否为 Identity 四元数的值。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 轴旋转和绕 Z 轴旋转创建新四元数。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.

适用于