Skip to content
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

Enable selection buffer based ray query (ogre2) #510

Merged
merged 1 commit into from
Dec 10, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions ogre2/src/Ogre2RayQuery.cc
Original file line number Diff line number Diff line change
Expand Up @@ -95,11 +95,6 @@ RayQueryResult Ogre2RayQuery::ClosestPoint()
{
RayQueryResult result;

// ray query using selection buffer does not seem to work on some machines
// using cpu based ray-triangle intersection method
// \todo remove this line if selection buffer is working again
return this->ClosestPointByIntersection();

#ifdef __APPLE__
return this->ClosestPointByIntersection();
#else
Expand Down
10 changes: 10 additions & 0 deletions src/Utils_TEST.cc
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,16 @@ void UtilTest::ClickToScene(const std::string &_renderEngine)
root->AddChild(camera);
camera->Update();

// \todo(anyone)
// the centerClick var above is set to a screen pos of (width/2, height/2).
// This is off-by-1. The actual center pos should be at
// (width/2 - 1, height/2 - 1) so the result.X() and result.Y() is a bit off
// from the expected position. However, fixing the centerClick above caused
// the screenToPlane tests to fail so only modifying the pos here, and the
// cause of test failure need to be investigated.
if (_renderEngine == "ogre2")
centerClick = ignition::math::Vector2i(halfWidth-1, halfHeight-1);

// API without RayQueryResult and default max distance
result = screenToScene(centerClick, camera, rayQuery, rayResult);

Expand Down