diff options
author | Dániel Juhász <juhdanad@gmail.com> | 2018-08-16 20:10:08 +0200 |
---|---|---|
committer | SmallJoker <SmallJoker@users.noreply.github.com> | 2018-08-16 20:10:08 +0200 |
commit | 325bf680410e8012394e5f3ba5ba947c69034899 (patch) | |
tree | 66ed6c2b0c9d7a1c915006212ecde535699e16c4 /src/util/pointedthing.h | |
parent | 798724efeab2d71da4f041be99de86baa3d3cdd5 (diff) | |
download | minetest-325bf680410e8012394e5f3ba5ba947c69034899.tar.gz minetest-325bf680410e8012394e5f3ba5ba947c69034899.tar.bz2 minetest-325bf680410e8012394e5f3ba5ba947c69034899.zip |
Raycast: export exact pointing location (#6304)
* Return intersection point in node coordinates.
* Clarify 'intersection_point' documentation
Diffstat (limited to 'src/util/pointedthing.h')
-rw-r--r-- | src/util/pointedthing.h | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/util/pointedthing.h b/src/util/pointedthing.h index 4c4c04234..5b30ed031 100644 --- a/src/util/pointedthing.h +++ b/src/util/pointedthing.h @@ -64,7 +64,8 @@ struct PointedThing s16 object_id = -1; /*! * Only valid if type isn't POINTEDTHING_NONE. - * First intersection point of the ray and the nodebox. + * First intersection point of the ray and the nodebox in irrlicht + * coordinates. */ v3f intersection_point; /*! @@ -75,8 +76,13 @@ struct PointedThing */ v3s16 intersection_normal; /*! + * Only valid if type isn't POINTEDTHING_NONE. + * Indicates which selection box is selected, if there are more of them. + */ + u16 box_id = 0; + /*! * Square of the distance between the pointing - * ray's start point and the intersection point. + * ray's start point and the intersection point in irrlicht coordinates. */ f32 distanceSq = 0; @@ -85,7 +91,7 @@ struct PointedThing //! Constructor for POINTEDTHING_NODE PointedThing(const v3s16 &under, const v3s16 &above, const v3s16 &real_under, const v3f &point, const v3s16 &normal, - f32 distSq); + u16 box_id, f32 distSq); //! Constructor for POINTEDTHING_OBJECT PointedThing(s16 id, const v3f &point, const v3s16 &normal, f32 distSq); std::string dump() const; |