// L============================================================================= // L This software is distributed under the MIT license. // L Copyright 2021 Péter Kardos // L============================================================================= #pragma once namespace mathter { //------------------------------------------------------------------------------ // Enums //------------------------------------------------------------------------------ /// Determines if you want to left- or right-multiply your matrices with vectors. /// /// This flag affects the generated transformation matrices. If you want to write M2*M1*v in your code, /// then choose PRECEDE_VECTOR, if you want v*M1*M2, choose FOLLOW_VECTOR. Matrices generated by Transform, Scale, /// Rotation and similar functions will match your order of multiplication. (I.e. bottom row is translation if you /// choose FOLLOW_VECTOR). /// You can still use M*v and v*M in your code. /// enum class eMatrixOrder { PRECEDE_VECTOR, FOLLOW_VECTOR, }; /// Determines the memory layout of matrices. /// /// For ROW_MAJOR layout, the matrix's first row comes first in memory, followed immediately by /// the second row's elements. For COLUMN_MAJOR matrices, the memory region begins with the first column. /// This does not affect arithmetic or matrix generator function in any way. Your arithmetic will work /// the same way if you change this. /// Please note that changing this flag may affect performance of arithmetic operations. Profile your /// code to determine optimal settings. Performance may depend on multiple factors. /// enum class eMatrixLayout { ROW_MAJOR, COLUMN_MAJOR, }; //------------------------------------------------------------------------------ // Constants //------------------------------------------------------------------------------ /// Specify this as Vector or Matrix dimension template parameter to set size at runtime. /// PLEASE NOTE THAT DYNAMICALLY SIZED VECTORS AND MATRICES ARE NOT SUPPORTED YET. constexpr int DYNAMIC = -1; //------------------------------------------------------------------------------ // Classes //------------------------------------------------------------------------------ template struct VectorData; template class Vector; template class Swizzle; template class Matrix; template class SubmatrixHelper; template class Quaternion; } // namespace mathter