5#include "MRPch/MRBindingMacros.h"
46 assert( maxGuideDistSq > 0 );
47 const auto d = pos - guidePos;
48 float distSq =
sqr( d );
49 if ( distSq <= maxGuideDistSq )
51 return guidePos + std::sqrt( maxGuideDistSq / distSq ) * d;
Definition MRCameraOrientationPlugin.h:8
constexpr T sqr(T x) noexcept
Definition MRMesh/MRMeshFwd.h:600
RelaxApproxType
Definition MRRelaxParams.h:36
V getLimitedPos(const V &pos, const V &guidePos, typename VectorTraits< V >::BaseType maxGuideDistSq)
Definition MRRelaxParams.h:44
Definition MRRelaxParams.h:12
MR_BIND_IGNORE int _padding
Definition MRRelaxParams.h:32
float force
speed of relaxing, typical values (0.0, 0.5]
Definition MRRelaxParams.h:20
const VertBitSet * region
region to relax
Definition MRRelaxParams.h:17
float maxInitialDist
maximum distance between a point and its position before relaxation, ignored if limitNearInitial = fa...
Definition MRRelaxParams.h:26
bool limitNearInitial
if true then maximal displacement of each point during denoising will be limited
Definition MRRelaxParams.h:23
int iterations
number of iterations
Definition MRRelaxParams.h:14
T BaseType
Definition MRMesh/MRVectorTraits.h:17