Skip to content

Commit

Permalink
[FieldOfView] margin on hasIn
Browse files Browse the repository at this point in the history
  • Loading branch information
sarthou committed Aug 24, 2023
1 parent e41574b commit 2d8d207
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions include/overworld/BasicTypes/FieldOfView.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class FieldOfView
double getClipFar() const { return clip_far_; }

double getRatio() const { return width_ / height_; }
double getRatioOpenGl() const { return opengl_ratio_ }
double getRatioOpenGl() const { return opengl_ratio_; }
//double getRatioOpenGl() const { return 1.4227 * std::tan(width_ / height_ * 0.6105); }

/**
Expand All @@ -37,10 +37,10 @@ class FieldOfView
* @return true
* @return false
*/
inline bool hasIn(const Pose& pose) const
inline bool hasIn(const Pose& pose, double margin = 0.) const
{
return pose.getZ() <= clip_far_ && std::abs(pose.getOriginTilt()) <= height_ * TO_HALF_RAD &&
std::abs(pose.getOriginPan()) <= width_ * TO_HALF_RAD;
return pose.getZ() <= clip_far_ && std::abs(pose.getOriginTilt()) <= (height_ - margin*2) * TO_HALF_RAD &&
std::abs(pose.getOriginPan()) <= (width_ - margin*2) * TO_HALF_RAD;
}

std::string toString() const
Expand Down

0 comments on commit 2d8d207

Please sign in to comment.