lighttransport / nanort

NanoRT, single header only modern ray tracing kernel.
MIT License
1.07k stars 89 forks source link

Documentation Return type of Traverse #59

Closed cadop closed 4 years ago

cadop commented 4 years ago

In the readme/documentation, the code example says that the accel.Traverse() returns the nearest hit point. However, it is a bool, so I don't think it can actually return a point.

// Returns nearest hit point(if exists)
BVHTraceOptions trace_options; // optional
bool hit = accel.Traverse(ray, triangle_intersecter, trace_options);

Is there a different method that does return the hitpoint?

syoyo commented 4 years ago

https://github.com/lighttransport/nanort/blob/8f8ce2286624df355d59f4e418c8ce3fa22fc577/nanort.h#L736

Documentation for Traverse is described here.

syoyo commented 4 years ago

There was some inconsistencies in README.md and the source code, so modified it in this commit: https://github.com/lighttransport/nanort/commit/65d776edaffe8dee0eb3b31d9c646459c4a52fa9