Skip to content

Commit

Permalink
Eigen is probably bad at this.
Browse files Browse the repository at this point in the history
  • Loading branch information
nistath committed Oct 29, 2019
1 parent 03394d6 commit 9cef922
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion fast_raycast/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ build:
@mkdir -p $(APP_DIR)
@mkdir -p $(OBJ_DIR)

debug: CXXFLAGS += -DDEBUG -g -Og
debug: CXXFLAGS += -DEIGEN_NO_DEBUG -DDEBUG -g -Og
debug: all

release: CXXFLAGS += -O3 -ffast-math
Expand Down
11 changes: 6 additions & 5 deletions fast_raycast/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -160,11 +160,12 @@ class Cone {
auto sol = ((-c1 - dis) / c2).min((-c1 + dis) / c2);

if (heightLimit) {
auto hit_height = (L.transpose() * direction_).array() +
(sol * (U.transpose() * direction_).array());
Coeffs sol2 = sol;
Coeffs hit_height = (L.transpose() * direction_).array() +
(sol2 * (U.transpose() * direction_).array());

solutions =
((0 <= hit_height) && (hit_height <= height_)).select(sol, nan());
((0 <= hit_height) && (hit_height <= height_)).select(sol2, nan());
} else {
solutions = sol;
}
Expand All @@ -189,8 +190,8 @@ int main() {
constexpr el_t VFOV = M_PI / 6;
constexpr el_t VBIAS = -M_PI / 2;

constexpr int NRings = 20;
constexpr int NPoints = 20;
constexpr int NRings = 20000;
constexpr int NPoints = 2000;
constexpr int NRays = NPoints * NRings;
Rays<Dynamic> rays = Rays<NRays>::Zero();
rays.origins().col(2) = decltype(rays.origins().col(2))::Ones(NRays, 1);
Expand Down

0 comments on commit 9cef922

Please sign in to comment.