Skip to content

Commit

Permalink
Fixing Z check in WideAngleCamera::Project3d
Browse files Browse the repository at this point in the history
Signed-off-by: Sanjuksha Nirgude <sanjuksha@gmail.com>
  • Loading branch information
sanjuksha committed Nov 9, 2022
1 parent d86d435 commit e5d22e2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion gazebo/rendering/WideAngleCamera.cc
Original file line number Diff line number Diff line change
Expand Up @@ -773,7 +773,8 @@ ignition::math::Vector3d WideAngleCamera::Project3d(
pos.x /= pos.w;
pos.y /= pos.w;
// check if point is visible
if (std::fabs(pos.x) <= 1 && std::fabs(pos.y) <= 1 && pos.z > 0)
if (std::fabs(pos.x) <= 1 && std::fabs(pos.y) <= 1 &&
pos.z > -std::fabs(pos.w))
{
// determine dir vector to projected point from env camera
// work in y up, z forward, x right clip space
Expand Down

0 comments on commit e5d22e2

Please sign in to comment.