From 077627181ee2eac3c0dacc3d8dc49825837e474c Mon Sep 17 00:00:00 2001 From: Lars Müller <34514239+appgurueu@users.noreply.github.com> Date: Sun, 30 Oct 2022 16:53:14 +0100 Subject: Allow rotating entity selectionboxes (#12379) --- src/util/pointedthing.h | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src/util/pointedthing.h') diff --git a/src/util/pointedthing.h b/src/util/pointedthing.h index 68b183195..e4f2eb20c 100644 --- a/src/util/pointedthing.h +++ b/src/util/pointedthing.h @@ -74,7 +74,12 @@ struct PointedThing * This is perpendicular to the face the ray hits, * points outside of the box and it's length is 1. */ - v3s16 intersection_normal; + v3f intersection_normal; + /*! + * Only valid if type is POINTEDTHING_OBJECT. + * Raw normal vector of the intersection before applying rotation. + */ + v3f raw_intersection_normal; /*! * Only valid if type isn't POINTEDTHING_NONE. * Indicates which selection box is selected, if there are more of them. @@ -90,10 +95,10 @@ struct PointedThing PointedThing() = default; //! Constructor for POINTEDTHING_NODE PointedThing(const v3s16 &under, const v3s16 &above, - const v3s16 &real_under, const v3f &point, const v3s16 &normal, + const v3s16 &real_under, const v3f &point, const v3f &normal, u16 box_id, f32 distSq); //! Constructor for POINTEDTHING_OBJECT - PointedThing(u16 id, const v3f &point, const v3s16 &normal, f32 distSq); + PointedThing(u16 id, const v3f &point, const v3f &normal, const v3f &raw_normal, f32 distSq); std::string dump() const; void serialize(std::ostream &os) const; void deSerialize(std::istream &is); -- cgit v1.2.3