htrdr

Solving radiative transfer in heterogeneous media
git clone git://git.meso-star.fr/htrdr.git
Log | Files | Refs | README | LICENSE

commit 9e449d549dc533e3b3c98750aa63be174fbc39c7
parent 589086529706de83a64f713ab82b3cb69ba63772
Author: Vincent Forest <vincent.forest@meso-star.com>
Date:   Thu, 22 Apr 2021 11:52:04 +0200

Add the htrdr_geometry_get_hit_position function

Retrieve the position of a submitted hit.

Diffstat:
Msrc/core/htrdr_geometry.c | 15+++++++++++++++
Msrc/core/htrdr_geometry.h | 5+++++
2 files changed, 20 insertions(+), 0 deletions(-)

diff --git a/src/core/htrdr_geometry.c b/src/core/htrdr_geometry.c @@ -648,6 +648,21 @@ htrdr_geometry_get_interface *out_interface = *interf; } +void +htrdr_geometry_get_hit_position + (const struct htrdr_geometry* geom, + const struct s3d_hit* hit, + double position[3]) +{ + struct s3d_attrib attr; + ASSERT(geom && hit && position && !S3D_HIT_NONE(hit)); + + S3D(primitive_get_attrib(&hit->prim, S3D_POSITION, hit->uv, &attr)); + position[0] = attr.value[0]; + position[1] = attr.value[1]; + position[2] = attr.value[2]; +} + res_T htrdr_geometry_trace_ray (struct htrdr_geometry* geom, diff --git a/src/core/htrdr_geometry.h b/src/core/htrdr_geometry.h @@ -73,6 +73,11 @@ htrdr_geometry_get_interface const struct s3d_hit* hit, struct htrdr_interface* interface); +HTRDR_CORE_API void +htrdr_geometry_get_hit_position + (const struct htrdr_geometry* geom, + const struct s3d_hit* hit, + double position[3]); HTRDR_CORE_API res_T htrdr_geometry_trace_ray