42 default: assert(
false);
49 return GetBasis(basis, x, y).normalized();
60 default: assert(
false);
66 double x,
double y)
const 74 return dn_norm_wrt_n.cwiseProduct(dv_wrt_dim);
82 bool basis_requested = deriv.empty();
84 for (
auto dim : {
X_,
Y_}) {
91 n(
Z) = basis_requested? 1.0 : 0.0;
101 bool basis_requested = deriv.empty();
103 tx(
X) = basis_requested? 1.0 : 0.0;
116 bool basis_requested = deriv.empty();
119 ty(
Y) = basis_requested? 1.0 : 0.0;
131 return 1/v.squaredNorm()*(v.norm() * Vector3d::Unit(idx) - v(idx)*v.normalized());
136 double x,
double y)
const
Vector3d GetBasis(Direction direction, double x, double y, const DimDerivs &dim_deriv={}) const
returns either the terrain normal/tangent or its derivative.
virtual double GetHeightDerivWrtY(double x, double y) const
virtual double GetHeightDerivWrtYY(double x, double y) const
Vector3d GetDerivativeOfNormalizedVectorWrtNonNormalizedIndex(const Vector3d &non_normalized, int index) const
Vector3d GetTangent1(double x, double y, const DimDerivs &={}) const
virtual double GetHeightDerivWrtYX(double x, double y) const
Vector3d GetNormalizedBasis(Direction direction, double x, double y) const
Returns either the vector normal or tangent to the terrain patch.
double GetSecondDerivativeOfHeightWrt(Dim2D dim1, Dim2D dim2, double x, double y) const
Vector3d GetDerivativeOfNormalizedBasisWrt(Direction direction, Dim2D dim, double x, double y) const
How the terrain normal/tangent vectors change when moving in x or y.
virtual double GetHeightDerivWrtX(double x, double y) const
virtual double GetHeightDerivWrtXX(double x, double y) const
virtual double GetHeightDerivWrtXY(double x, double y) const
std::vector< Dim2D > DimDerivs
dimensional derivatives
double GetDerivativeOfHeightWrt(Dim2D dim, double x, double y) const
How the height value changes at a 2D position in direction dim.
Vector3d GetTangent2(double x, double y, const DimDerivs &={}) const
Vector3d GetNormal(double x, double y, const DimDerivs &={}) const