Add function for check whether transformation contain reflection

Extend RayCast hit by square distance
Use distance to distiguish closest place on surface when move origin
Move origin after job (only on success)
This commit is contained in:
Filip Sykala - NTB T15p 2023-01-03 13:24:01 +01:00
parent b899d51aba
commit 550ef48fe1
5 changed files with 105 additions and 79 deletions

View file

@ -67,8 +67,9 @@ public:
{
using Key = TrKey;
Key tr_key;
Hit(Key tr_key, Vec3f position, Vec3f normal)
: SurfacePoint(position, normal), tr_key(tr_key)
double squared_distance;
Hit(const Key& tr_key, const SurfacePoint& surface_point, double squared_distance)
: SurfacePoint(surface_point), tr_key(tr_key), squared_distance(squared_distance)
{}
};