diff options
| author | assiduous <assiduous@diligentgraphics.com> | 2020-02-08 05:00:19 +0000 |
|---|---|---|
| committer | assiduous <assiduous@diligentgraphics.com> | 2020-02-08 05:00:19 +0000 |
| commit | 1edcafe9bd41bdde86869d4e1c0212c78ce123b7 (patch) | |
| tree | 90d3effee6a54cd591e05f2d1c0d922b5339cffb /Common/interface | |
| parent | Fixed TraceLineThroughGrid function: properly handle degenrate lines and avoi... (diff) | |
| download | DiligentCore-1edcafe9bd41bdde86869d4e1c0212c78ce123b7.tar.gz DiligentCore-1edcafe9bd41bdde86869d4e1c0212c78ce123b7.zip | |
Updated TraceLineThroughGrid test plus some minor comments clean-up
Diffstat (limited to 'Common/interface')
| -rw-r--r-- | Common/interface/AdvancedMath.hpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/Common/interface/AdvancedMath.hpp b/Common/interface/AdvancedMath.hpp index 921f96e5..32032426 100644 --- a/Common/interface/AdvancedMath.hpp +++ b/Common/interface/AdvancedMath.hpp @@ -562,14 +562,17 @@ inline float IntersectRayTriangle(const float3& V0, /// \tparam TCallback - Type of the callback function. /// \param f2Start - Line start point. -/// \param f2Start - Line end point. +/// \param f2End - Line end point. /// \param i2GridSize - Grid dimensions. -/// \param Callback - Callback function that will be caleed with the argument of type int2 +/// \param Callback - Callback function that will be caled with the argument of type int2 /// for every cell visited. The function should return true to continue -/// tracing and false otherwise. +/// tracing and false to stop it. /// /// \remarks The algorithm clips the line against the grid boundaries [0 .. i2GridSize.x] x [0 .. i2GridSize.y] /// +/// When one of the end points falls exactly on a vertical cell boundary, cell to the right is enumerated. +/// When one of the end points falls exactly on a horizontal cell boundary, cell above is enumerated. +/// /// For example, for the line below on a 2x2 grid, the algorithm will trace the following cells: (0,0), (0,1), (1,1) /// /// End |
