Replies: 1 comment 1 reply
|
I think you're looking for |
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
In C#'s
System.Numerics.Vector3struct, there are two methods forVector3 * Matrix4x4:Vector3.Transform()Vector3.TransformNormal()The C# implementations:


The only difference is that the final addition with the translation component of the matrix is skipped for
TransformNormal(). For lots of operations with normals, this can be pretty nice, since it's "free performance" if you remember to use it lol. I'm not sure how much the library itself would make use of this though.You can of course throw normals into
Vector3.Transform()but you'd be missing out on the small optimization thatVector3.TransformNormal()exists to provide you. If you know you're definitely dealing with a normal vector (likeVec3::sAxisY()) thenVector3.TransformNormal()is the better choice.I apologize if Jolt already has this somewhere... I couldn't find it myself but I'd love to know if it exists.
If it doesn't exist, I understand that in Jolt this would be a bit cumbersome to do since it directly overloads the
*operator, but there could be a helper function for it (which is what I'm doing for myself).It's pretty simple to implement for anyone curious:
And Jolt's v5.6.0 operator for reference:
I'm curious to hear back if there is something like this already or if there is any pushback for adding it natively if there isn't something like it!
All reactions