* Tests produce errors that need to be disabled in debug
Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>
* PR suggestion
Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>
* Added new helper functions to get the shortest equivalent of the rotation. In case the w component of the quaternion is negative the rotation is > 180° and taking the longer path. The quaternion will be inverted in that case to take the shortest path of rotation.
* Added unit test.
* Renamed the angle parameter of the CreateRotationX/Y/Z() functions into angleInRadians.
Signed-off-by: Benjamin Jillich <jillich@amazon.com>
Direct conversion helpers for quaternion to the scaled axis-angle representation and back without the need to convert them first to the axis-angle format and manually scale (or normalize on the way back). This also avoids having to deal with the special case of an identity representation which is 0,0,0 in the scaled axis-angle format while our convention for axis-angle is 0,1,0 for the axis and 0 for the angle.
Added unit tests that check the conversion round-trips from quaternion -> (scaled) axis-angle -> quaternion as well as comparing the scaled axis-angle representations from the direct helper functions as well as the axis-angle while manually scaling/normalizing.
Signed-off-by: Benjamin Jillich <jillich@amazon.com>
* update return type for viewport screen functions
Signed-off-by: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com>
* add tests for AZ::Matrix3x4::CreateFromMatrix4x4 and add TransformPoint to Matrix3x4
Signed-off-by: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com>
* update NDC -> Ndc
Signed-off-by: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com>
* updates following review feedback
Signed-off-by: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com>
* updates and improvements following PR feedback
Signed-off-by: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com>
* add forward declaration of Matrix3x4 type
Signed-off-by: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com>
* update where forward declarations are defined for Matrix3x4
Signed-off-by: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com>
* add a new implementation for cone/ray intersect to simplify and fix existing issue
Signed-off-by: hultonha <hultonha@amazon.co.uk>
* move new ray/cone intersection function to AzToolsFramework - repond to PR comments
Signed-off-by: hultonha <hultonha@amazon.co.uk>
* updates following PR feedback
Signed-off-by: hultonha <hultonha@amazon.co.uk>
* add additional comment to give more context to the intersection function
Signed-off-by: hultonha <hultonha@amazon.co.uk>
* update google test expect usage
Signed-off-by: hultonha <hultonha@amazon.co.uk>
* Modernization + small fix.
Modernize ( `bool`/`override`/other) code in AzCore, AzFramework, AzQtComponents, AzToolsFramework, etc.
Replaced a `bind` or two, use `using` in a few places as well.
Fix nullptr comparison of AZStd::function.
Signed-off-by: nemerle <96597+nemerle@users.noreply.github.com>
* Apply review-based changes
Signed-off-by: nemerle <96597+nemerle@users.noreply.github.com>
* [GHI 2178] Fixed missing vegetation info
The entity debug drawing culling system was removing it due to the level entity not having an AABB. Since this component can draw infinitely far, it just needed a max AABB.
With the culling fixed, it made another culling problem evident - a bug in the font code where it wasn't culling 3D text rendered behind the camera. Now it is.
Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com>
* Fix problem with debug rendering not immediately showing up.
When using FloatMax for the AABB, it causes math overflows with the initial camera frustrum. Changing to max/2.0f is sufficient to avoid the overflows.
Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com>
* Fixed normals on mesh raycasts.
The normals needed to be normalized after transformation, and didn't need the non-uniform scale applied to them, since they're normals.
Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com>
* Fixed the bug that prevented max-size AABBs from working with ShapeIntersection::Overlap.
Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com>
* Final update copyright headers to reference license files at the repo root
Signed-off-by: spham <spham@amazon.com>
* Fix copyright validator unit tests to support the stale O3DE header scenario
Signed-off-by: spham <spham@amazon.com>
- Add operators +, -, * and / too all matrix classes
- Add RetrieveScaleSq and GetReciprocalScaled to all matrix classes
- Add unit tests to all matrix classes
- Fix a bug that causes release configuration not to compile.
- Added operator+(Matrix3x4), operator*(float), RetrieveScaleSq and GetReciprocalScaled to Matrix3x4. Used by Cloth CPU Linear Skinning. These operation will be performant as they use SIMD.
- Modified so there are no virtual functions calls at vertex level.
- Caching indices to simplify the loop when applying skinning.
- Caching static variables Matrix3x4 zero and DualQuaternion zero to avoid creating it for every vertex.
- Removing branching to skip joints when the weight is zero, these cases are rarely and this improves performance by removing branching from loops at vertex level.
- Changing skinning influences so it's a continuous block of memory.
- Caching the vector size() if a variable instead of directly using it in a for loop.