Selection of libraries designed to be used with Emu projects. This was originally a Math library only, but has since been changed to hold all Emu libraries to enable consistency in changes to dependencies (such as EmuCore modifications).
FastVector was added as a spur of the moment change of priorities, due to a solid concept having been designed and wanting to be developed on instead of the very-boiler-plate Matrix functionalities in the MiscMath branch.
For the development of FastVector, it was decided best to branch off from the MiscMath branch to keep any TMP features that may have been added in case their functionality was needed.
Similarly, because there was such a significant difference between MatrixUpdate as a whole and the main dev branch in terms of TMP, the main branch would end up inevitably receiving a double merge of both Matrix and FastVector, so this is simply introducing the double merge.
The actual features
FastVector
A template Vector type which works with Vector templates in a similar relationship to DirectX::XMFLOATX and DirectX::XMVECTOR in the DirectX Math library. The base Vector template retains its adaptive nature when interacting the FastVector, but the FastVector's own interactions are somewhat more restrictive to minimise implicit performance costs and enable the explicit use of SIMD registers.
More information may be found in the FastVector pull request #48, which contains more detail than will be placed here.
Matrix - Miscellaneous Math
Provides miscellaneous mathematics functionalities for the Matrix type, and provides the same common interface for Matrix with similar semantics to Vector.
Provided is a list of included functionalities. Note that for every list entry, there is also a Range- and RangeNoCopy-suffixed variant, C-style function variants as well as the named member functions, and are const-qualified. If there is an exception to any of these, they will be stated explicitly.
Abs (Copy positive numbers, make negative numbers positive)
Ceil (Round toward positive infinity)
CeilConstexpr (Round toward positive infinity, evaluated in a constexpr-evaluable way if possible)
Clamp (Clamp elements between a minimum and maximum value)
ClampMax (Clamp elements to a maximum value)
ClampMin (Clamp elements to a minimum value)
Floor (Round toward negative infinity)
FloorConstexpr (Round toward negative infinity, evaluated in a constexpr-evaluable way if possible)
Lerp (Linearly interpolate elements toward a target b with a weighting of t)
Max (When given no arguments, retrieves the largest element in the Matrix. When given an argument, retrieves a Matrix composed the largest respective elements out of the two items. MaxRangeNoCopy is not provided for the zero-argument version. Supports reference output, and as a result is overloaded in a non-const context to support output of writable references)
Min (When given no arguments, retrieves the smallest element in the Matrix. When given an argument, retrieves a Matrix composed the smallest respective elements out of the two items. MinRangeNoCopy is not provided for the zero-argument version. Supports reference output, and as a result is overloaded in a non-const context to support output of writable references)
Trunc (Round toward zero)
TruncConstexpr (Round toward zero, evaluated in a constexpr-evaluable way if possible)
Regarding the merge of unrelated features
FastVector
was added as a spur of the moment change of priorities, due to a solid concept having been designed and wanting to be developed on instead of the very-boiler-plateMatrix
functionalities in the MiscMath branch.For the development of
FastVector
, it was decided best to branch off from the MiscMath branch to keep any TMP features that may have been added in case their functionality was needed.Similarly, because there was such a significant difference between
MatrixUpdate
as a whole and the main dev branch in terms ofTMP
, the main branch would end up inevitably receiving a double merge of bothMatrix
andFastVector
, so this is simply introducing the double merge.The actual features
FastVector
A template Vector type which works with
Vector
templates in a similar relationship toDirectX::XMFLOATX
andDirectX::XMVECTOR
in the DirectX Math library. The baseVector
template retains its adaptive nature when interacting theFastVector
, but theFastVector
's own interactions are somewhat more restrictive to minimise implicit performance costs and enable the explicit use of SIMD registers.More information may be found in the
FastVector
pull request #48, which contains more detail than will be placed here.Matrix
- Miscellaneous MathProvides miscellaneous mathematics functionalities for the
Matrix
type, and provides the same common interface forMatrix
with similar semantics toVector
.Provided is a list of included functionalities. Note that for every list entry, there is also a
Range
- andRangeNoCopy
-suffixed variant, C-style function variants as well as the named member functions, and areconst
-qualified. If there is an exception to any of these, they will be stated explicitly.Abs
(Copy positive numbers, make negative numbers positive)Ceil
(Round toward positive infinity)CeilConstexpr
(Round toward positive infinity, evaluated in aconstexpr
-evaluable way if possible)Clamp
(Clamp elements between a minimum and maximum value)ClampMax
(Clamp elements to a maximum value)ClampMin
(Clamp elements to a minimum value)Floor
(Round toward negative infinity)FloorConstexpr
(Round toward negative infinity, evaluated in aconstexpr
-evaluable way if possible)Lerp
(Linearly interpolate elements toward a targetb
with a weighting oft
)Max
(When given no arguments, retrieves the largest element in the Matrix. When given an argument, retrieves a Matrix composed the largest respective elements out of the two items.MaxRangeNoCopy
is not provided for the zero-argument version. Supports reference output, and as a result is overloaded in a non-const
context to support output of writable references)Min
(When given no arguments, retrieves the smallest element in the Matrix. When given an argument, retrieves a Matrix composed the smallest respective elements out of the two items.MinRangeNoCopy
is not provided for the zero-argument version. Supports reference output, and as a result is overloaded in a non-const
context to support output of writable references)Trunc
(Round toward zero)TruncConstexpr
(Round toward zero, evaluated in aconstexpr
-evaluable way if possible)