跳至内容

Math

导航: 示例Cauldron杂项

Math

Sony VectorMath 库包装器。

函数

PolarToVector

Vec4 PolarToVector(float yaw, float pitch)

将极坐标旋转转换为向量表示。

返回:极坐标旋转的 Vec4 表示。

参数

  • yawfloat)– [in] 偏航角(以弧度为单位)。
  • pitchfloat)– [in] 俯仰角(以弧度为单位)。

返回: Vec4

来源: framework/cauldron/framework/inc/misc/math.h (第 85 行,第 10 列)

透视

const Mat4 Perspective(float fovyRadians, float aspect, float zNear, float zFar, bool invertedDepth)

构造一个具有反向深度参数的透视投影矩阵。

返回:Mat4 透视矩阵。

参数

  • fovyRadiansfloat)– [in] FOV(以弧度为单位)。
  • aspectfloat)– [in] 纵横比。
  • zNearfloat)– [in] 近平面。
  • zFarfloat)– [in] 远平面。
  • invertedDepthbool)– [in] 如果使用反向无限深度,则为 true。

返回: const Mat4

来源: framework/cauldron/framework/inc/misc/math.h (第 98 行,第 16 列)

正交

const Mat4 Orthographic(float left, float right, float bottom, float top, float zNear, float zFar, bool invertedDepth)

构造一个 z 范围在 [0, 1] 之间的正交投影矩阵。

返回:Mat4 正交矩阵。

参数

  • leftfloat)– [in] 左平面。
  • rightfloat)– [in] 右平面。
  • bottomfloat)– [in] 底部平面。
  • topfloat)– [in] 顶部平面。
  • zNearfloat)– [in] 近平面。
  • zFarfloat)– [in] 远平面。
  • invertedDepthbool)– [in] 如果使用反向无限深度,则为 true。

返回: const Mat4

来源: framework/cauldron/framework/inc/misc/math.h (第 113 行,第 16 列)

InverseMatrix

inline Mat4 InverseMatrix(const Mat4 &srcMatrix)

返回矩阵的逆。

返回:Mat4 逆矩阵。

参数

  • srcMatrixconst Mat4 &)– [in] 要求逆的矩阵。

返回: Mat4

属性: inline

来源: framework/cauldron/framework/inc/misc/math.h (第 122 行,第 17 列)

InverseMatrix

inline Mat3 InverseMatrix(const Mat3 &srcMatrix)

返回矩阵的逆。

返回 Mat3 逆矩阵。

参数

  • srcMatrixconst Mat3 &)– [in] 要求逆的矩阵。

返回: Mat3

属性: inline

来源: framework/cauldron/framework/inc/misc/math.h (第 134 行,第 17 列)

LookAtMatrix

inline Mat4 LookAtMatrix(Vec4 eye, Vec4 lookAt, Vec4 up)

构造一个位于“eye”并面向“lookAt”的矩阵。

返回:Mat4 矩阵。

参数

  • eyeVec4)– [in] 源(平移)。
  • lookAtVec4)– [in] 朝向(方向)。
  • upVec4)– [in] 用于正确定向矩阵的上向量。

返回: Mat4

属性: inline

来源: framework/cauldron/framework/inc/misc/math.h (第 148 行,第 17 列)

TransposeMatrix

inline Mat4 TransposeMatrix(const Mat4 &srcMatrix)

返回矩阵的转置。

返回:Mat4 转置矩阵。

参数

  • srcMatrixconst Mat4 &)– [in] 要转置的矩阵。

返回: Mat4

属性: inline

来源: framework/cauldron/framework/inc/misc/math.h (第 160 行,第 17 列)

MinPerElement

inline Vec4 MinPerElement(const Vec4 &vec1, const Vec4 &vec2)

返回一个由每个元素最小值组成的向量。

返回:Vec4 每个元素最小值的 4 分量向量。

参数

  • vec1const Vec4 &)– [in] 向量 1。
  • vec2const Vec4 &)– [in] 向量 2。

返回: Vec4

属性: inline

来源: framework/cauldron/framework/inc/misc/math.h (第 173 行,第 17 列)

MaxPerElement

inline Vec4 MaxPerElement(const Vec4 &vec1, const Vec4 &vec2)

返回一个由每个元素最大值组成的向量。

返回:Vec4 每个元素最大值的 4 分量向量。

参数

  • vec1const Vec4 &)– [in] 向量 1。
  • vec2const Vec4 &)– [in] 向量 2。

返回: Vec4

属性: inline

来源: framework/cauldron/framework/inc/misc/math.h (第 191 行,第 17 列)

类型定义

Mat3

using Mat3 = math::Matrix3

基于 VectorMath::Matrix3 的 3x3 矩阵的类型定义。

来源: framework/cauldron/framework/inc/misc/math.h (第 43 行,第 1 列)

Mat4

using Mat4 = math::Matrix4

基于 VectorMath::Matrix4 的 4x4 矩阵的类型定义。

来源: framework/cauldron/framework/inc/misc/math.h (第 48 行,第 1 列)

Point2

using Point2 = math::Point2

基于 VectorMath::Point2 的 2 分量点的类型定义。

来源: framework/cauldron/framework/inc/misc/math.h (第 53 行,第 1 列)

Point3

using Point3 = math::Point3

基于 VectorMath::Point3 的 3 分量点的类型定义。

来源: framework/cauldron/framework/inc/misc/math.h (第 58 行,第 1 列)

Vec2

using Vec2 = math::Vector2

基于 VectorMath::Vector2 的 2 分量向量的类型定义。

来源: framework/cauldron/framework/inc/misc/math.h (第 63 行,第 1 列)

Vec3

using Vec3 = math::Vector3

基于 VectorMath::Vector3 的 3 分量向量的类型定义。

来源: framework/cauldron/framework/inc/misc/math.h (第 68 行,第 1 列)

Vec4

using Vec4 = math::Vector4

基于 VectorMath::Vector4 的 4 分量向量的类型定义。

来源: framework/cauldron/framework/inc/misc/math.h (第 73 行,第 1 列)

© . This site is unofficial and not affiliated with AMD.