dl
类 | 命名空间 | 类型定义 | 函数
dl_matrix.h 文件参考

矩阵(列存储) 更多...

#include <array>
#include "dl_type.h"
#include "dl_math.h"
#include "dl_string.h"

浏览源代码.

类

class  dl::Matrix< T, M, N >
 

命名空间

namespace  dl
 
namespace  dl::Mat
 

类型定义

using dl::Matrix4 = Matrix< Float, 4, 4 >
 

函数

template<typename T , size_t M, size_t N>
bool dl::operator== (const Matrix< T, M, N > &a, const Matrix< T, M, N > &b)
 判断相等 更多...
 
template<typename T , size_t M, size_t N, size_t P>
Matrix< T, M, N > dl::operator* (const Matrix< T, M, P > &a, const Matrix< T, P, N > &b)
 矩阵乘法 更多...
 
template<typename T , size_t M, size_t N>
std::array< T, M > dl::operator* (const Matrix< T, M, N > &a, const std::array< T, N > &v)
 矩阵 乘 向量 更多...
 
Matrix4 dl::Mat::CreateIdentity ()
 创建平移矩阵 更多...
 
Matrix4 dl::Mat::CreateTranslation (const Position3 &t)
 创建平移矩阵 更多...
 
void dl::Mat::ApplyTranslation (Matrix4 &m, const Position3 &t)
 平移矩阵 更多...
 
Matrix4 dl::Mat::CreateRotation (const Position3 &axis, Float angle)
 创建旋转矩阵 更多...
 
Matrix4 dl::Mat::CreateRotation (const Position4 &q)
 创建旋转矩阵(四元数) 更多...
 
Matrix4 dl::Mat::CreateScaling (const Position3 &s)
 创建缩放矩阵 更多...
 
Matrix4 dl::Mat::CreateLookTo (const Position3 &eye, const Position3 &dir, const Position3 &up)
 创建LookTo矩阵 更多...
 
Matrix4 dl::Mat::CreatePerspective (Float fovy, Float aspect, Float z_near, Float z_far)
 创建透视投影矩阵 [0, 1] 更多...
 
Matrix4 dl::Mat::CreateOrthogonal (Float left, Float top, Float right, Float bottom, Float z_near, Float z_far)
 创建正交投影矩阵 [0, 1] 更多...
 
Matrix4 dl::Mat::GetInverse (const Matrix4 &m)
 获得逆矩阵 更多...
 
void dl::Mat::Test ()
 验证正确性 更多...
 

详细描述

矩阵(列存储)

版本
1.0
作者
lveyou
日期
22-10-17
注解
使用列优先存储(一列一列的内存分布,主要是可以直接传给glsl)
数学定义:m X n矩阵是由,m行、n列组成的矩阵,对应ij
右边矩阵先变换
  • - - - n(j,x) |11 12 13 14 |21 22 23 24 |31 32 33 34 |41 42 43 44 m(i,y)

在文件 dl_matrix.h 中定义.