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

The result of rayTest to a heightmap at (0, 0) is always 0.035 #518

Open
chengruiz opened this issue Oct 30, 2023 · 0 comments
Open

The result of rayTest to a heightmap at (0, 0) is always 0.035 #518

chengruiz opened this issue Oct 30, 2023 · 0 comments

Comments

@chengruiz
Copy link

Hi Professor,
I accidentally found that the rayTest to a heightmap at (0, 0) is always 0.035 even if the heightmap is different. For example, add the following code to line 60 in examples/heightmap.cpp.

  Eigen::Vector3d start{0., 0., 100.};
  auto rays = world.rayTest(start, {0., 0., -1.}, 200, false);
  double ray_height = 0.;
  if (rays.size() > 0) {
    ray_height = rays[rays.size() - 1].getPosition()[2];
  }
  std::cout << hm->getHeight(start[0], start[1]) << " " << ray_height << std::endl;

It will output

0.441001 0.035

Interestingly, changing the seed of terrainProperties does not affect this result.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant