1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-07-22 17:18:39 +00:00

Optimize code patterns around raycasting

This commit is contained in:
sfan5 2024-04-24 22:08:12 +02:00
parent e10adf83d5
commit 9c3c286aab
4 changed files with 77 additions and 84 deletions

View file

@ -23,31 +23,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "exceptions.h"
#include <sstream>
PointedThing::PointedThing(const v3s16 &under, const v3s16 &above,
const v3s16 &real_under, const v3f &point, const v3f &normal,
u16 box_id, f32 distSq, PointabilityType pointab):
type(POINTEDTHING_NODE),
node_undersurface(under),
node_abovesurface(above),
node_real_undersurface(real_under),
intersection_point(point),
intersection_normal(normal),
box_id(box_id),
distanceSq(distSq),
pointability(pointab)
{}
PointedThing::PointedThing(u16 id, const v3f &point, const v3f &normal,
const v3f &raw_normal, f32 distSq, PointabilityType pointab) :
type(POINTEDTHING_OBJECT),
object_id(id),
intersection_point(point),
intersection_normal(normal),
raw_intersection_normal(raw_normal),
distanceSq(distSq),
pointability(pointab)
{}
std::string PointedThing::dump() const
{
std::ostringstream os(std::ios::binary);
@ -131,8 +106,3 @@ bool PointedThing::operator==(const PointedThing &pt2) const
}
return true;
}
bool PointedThing::operator!=(const PointedThing &pt2) const
{
return !(*this == pt2);
}