-
-
Notifications
You must be signed in to change notification settings - Fork 444
[3.0] Generic Matrix Math #2528
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
otac0n
wants to merge
74
commits into
dotnet:develop/3.0
Choose a base branch
from
otac0n:feature/math-3.0
base: develop/3.0
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Feature/math 3.0
…or identity matrices.
…iplyAddEstimate.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR is a continuation of #2459 and supersedes it.
Status snapshot:
Vector structs:
TdefinesIRootFunctions<T>.+,-,*,/, and%operators defined between two vectors of the same type which returns a vector which has had each operation applied component-wise.+,-,*,/, and%operators defined between a vector and a scalar value that matches the generic type which returns a vector which has had each operation applied component-wise with the scalar value. Both vector first and scalar first should be implemented.-unary operator which returns the negated vector.+unary operator which returns the vector.Vector2D<T>toVector2D<float>)Matrix2Xn,Matrix3Xn, andMatrix4Xn) and return a vector containing the output (type should match the outer type e.g.Vector2D.Transform(Matrix4X4)returnsVector2D)VectorND<T> * MatrixNXMoperators where N is the same for both Vector and Matrix, but M is any numberMatrix2Xn,Matrix3Xn, andMatrix4Xn) and return a vector containing the output (type should match the outer type e.g.Vector2D.Transform(Matrix4X4)returnsVector2D)BitwiseAnd,BitwiseOr, andBitwiseXorstatic methods defined between two vectors which returns a vector which has had these operators applied on a component-wise basis.BitwiseAnd,BitwiseOr, andBitwiseXorstatic methods operators defined between a vectors and a scalar value that matches the generic type which returns a vector which has had these operators applied on a component-wise basis with the scalar.BitwiseNotstatic method defined which negates the bits of the vector components. (BitwiseComplement?)TimplementsIRootFunctions<T>The following static Vector properties which have the given value for all componentsVectorND<int>, where N matches the dimensionality of the vectorint digitsMidpointRounding modeint digits, MidpointRounding modeVectorND<int>, where N matches the dimensionality of the vectorVectorND<int>, where N matches the dimensionality of the vectorVectorND<int>, where N matches the dimensionality of the vectorVectorND<int>, where N matches the dimensionality of the vectorSystem.Runtime.Intrinsics.Vector64<TScalar>System.Runtime.Intrinsics.Vector128<TScalar>System.Runtime.Intrinsics.Vector256<TScalar>System.Runtime.Intrinsics.Vector512<TScalar>Matrix structs must fulfill the following requirements:
IEquatable<T>whereTis the same matrix classSeveral of these functions exist, but not for all types or not for both LH/RH versions.
A Quaternion struct:
Twhich is constrained byIBinaryFloatingPointIeee754<T>representing the scalar typeVector3D<T>and a Scalar, with the vector 3 mapping to X, Y, Z and the Scalar to the WVector4D<T>Vector3D<T>Axis property mapping to (X, Y, Z)+,-,*, and/between two Quaternions*withTmultiplying each component by the scalar value returning a new quaternion~Vector3D<T>and an angle and returns a Quaternion representing that rotationVector3D<T>and outputs a Quaternion representing that rotationGeometric Types:
Geometric Types details: