18 template <
typename Real>
34 std::shared_ptr<ParametricCurve<2, Real>>
mCurve;
38 template <
typename Real>
51 Real GetTorsion(Real t)
const;
54 std::shared_ptr<ParametricCurve<3, Real>>
mCurve;
58 template <
typename Real>
65 template <
typename Real>
70 mCurve->Evaluate(t, 1, values);
74 normal =
Perp(tangent);
77 template <
typename Real>
81 mCurve->Evaluate(t, 2, values);
82 Real speedSqr =
Dot(values[1], values[1]);
83 if (speedSqr > (Real)0)
85 Real numer =
DotPerp(values[1], values[2]);
86 Real denom = pow(speedSqr, (Real)1.5);
98 template <
typename Real>
105 template <
typename Real>
110 mCurve->Evaluate(t, 2, values);
111 position = values[0];
112 Real VDotV =
Dot(values[1], values[1]);
113 Real VDotA =
Dot(values[1], values[2]);
114 normal = VDotV * values[2] - VDotA * values[1];
118 binormal =
Cross(tangent, normal);
121 template <
typename Real>
125 mCurve->Evaluate(t, 2, values);
126 Real speedSqr =
Dot(values[1], values[1]);
127 if (speedSqr > (Real)0)
130 Real denom = pow(speedSqr, (Real)1.5);
131 return numer / denom;
140 template <
typename Real>
144 mCurve->Evaluate(t, 3, values);
146 Real denom =
Dot(cross, cross);
149 Real numer =
Dot(cross, values[3]);
150 return numer / denom;
Real GetTorsion(Real t) const
GLenum GLsizei GLsizei GLint * values
std::shared_ptr< ParametricCurve< 3, Real > > mCurve
Real GetCurvature(Real t) const
Real DotPerp(Vector2< Real > const &v0, Vector2< Real > const &v1)
DualQuaternion< Real > Dot(DualQuaternion< Real > const &d0, DualQuaternion< Real > const &d1)
Real Normalize(GVector< Real > &v, bool robust=false)
FrenetFrame2(std::shared_ptr< ParametricCurve< 2, Real >> const &curve)
DualQuaternion< Real > Cross(DualQuaternion< Real > const &d0, DualQuaternion< Real > const &d1)
Vector2< Real > Perp(Vector2< Real > const &v)
DualQuaternion< Real > Length(DualQuaternion< Real > const &d, bool robust=false)
std::shared_ptr< ParametricCurve< 2, Real > > mCurve
void operator()(Real t, Vector2< Real > &position, Vector2< Real > &tangent, Vector2< Real > &normal) const
FrenetFrame3(std::shared_ptr< ParametricCurve< 3, Real >> const &curve)
void operator()(Real t, Vector3< Real > &position, Vector3< Real > &tangent, Vector3< Real > &normal, Vector3< Real > &binormal) const
Real GetCurvature(Real t) const