Add a new implementation for cone/ray intersect to simplify code and fix issue with current implementation (#3902)
* 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>
This commit is contained in:
@@ -609,6 +609,21 @@ namespace UnitTest
|
||||
EXPECT_EQ(hits, 0);
|
||||
}
|
||||
|
||||
// replicates a scenario in the Editor using a cone and a pick ray which should have failed but passed
|
||||
// note: To replicate this, select an entity so the default translation manipulator appears, move very close to the
|
||||
// entity, hover the mouse over one of the manipulator linear manipulator arrows (cone part) and move the mouse away
|
||||
// notice the manipulator will remain highlighted as a successful intersection is still reported
|
||||
TEST(MATH_IntersectRayConeTestEditor, DISABLED_RayConeEditorScenarioTest)
|
||||
{
|
||||
auto rayOrigin = Vector3(0.0f, -0.808944702f, 0.0f);
|
||||
auto rayDir = Vector3(0.301363617f, 0.939044654f, 0.165454566f);
|
||||
float t1 = 0.0f;
|
||||
float t2 = 0.0f;
|
||||
int hits = Intersect::IntersectRayCone(
|
||||
rayOrigin, rayDir, AZ::Vector3(0.0f, 0.0f, 0.161788940f), AZ::Vector3(0.0f, 0.0f, -1.0f), 0.0453009047, 0.0113252262, t1, t2);
|
||||
EXPECT_EQ(hits, 0);
|
||||
}
|
||||
|
||||
class MATH_IntersectRayQuadTest
|
||||
: public AllocatorsFixture
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user