64 :
agx::Vec3(p), m_tension(t), m_stretch(stretch), m_curvature(curvature) {}
168 return m_points[index].getTension();
170 return m_points[index + 1].getTension();
172 return (1 - time) *
m_points[index].getTension() + time *
m_points[index + 1].getTension();
#define AGXSTREAM_DECLARE_SERIALIZABLE(T)
Use this in a Serializable class to add the required methods Important: Use full namespace in the dec...
#define AGXPHYSICS_EXPORT
Class for writing serialized data in binary format to a stream.
This class is an abstract base class for all classes that can be stored and retrieved from an Archive...
https://en.wikipedia.org/wiki/B-spline
void updateTangents() override
Compute tangents given current set of points.
Tangent getTangent(size_t index, agx::Real t) const override
virtual Point evaluate(size_t index, agx::Real t) const override
https://en.wikipedia.org/wiki/Centripetal_Catmull%E2%80%93Rom_spline
virtual Point evaluate(size_t index, agx::Real t) const override
virtual void updateTangents() override
Compute tangents given current set of points.
ParameterizedCatmullRomSplineRef m_catmull
virtual ~CPCatmullRomBSpline()
Tangent getTangent(size_t index, agx::Real t) const override
A Spline constructed of piecewise third-order polynomials which pass through a set of control points.
virtual ~CardinalSpline()
virtual Point evaluate(size_t index, agx::Real t) const override
Tangent getTangent(size_t index, agx::Real t) const override
void updateTangents() override
Compute tangents given current set of points.
A Spline constructed of piecewise third-order polynomials which pass through a set of control points.
virtual Point evaluate(size_t index, agx::Real t) const override
void updateTangents() override
Compute tangents given current set of points.
Tangent getTangent(size_t index, agx::Real t) const override
https://en.wikipedia.org/wiki/Hermite_spline
void updateTangents() override
Compute tangents given current set of points.
ParameterizedCatmullRomSplineRef m_catmull
virtual Point evaluate(size_t index, agx::Real t) const override
Tangent getTangent(size_t index, agx::Real t) const override
Special case of a cardinal spline.
void updateTangents() override
Compute tangents given current set of points.
ParameterizedCatmullRomSpline()
Used only for restoring purposes.
Tangent getTangent(size_t index, agx::Real t) const override
virtual ~ParameterizedCatmullRomSpline()
ParameterizedCatmullRomSpline(agx::Real alpha)
virtual Point evaluate(size_t index, agx::Real t) const override
Point class for storing 3D point, tension, stretch and curvature.
static AGXPHYSICS_EXPORT const agx::Real DEFAULT_CURVATURE
static AGXPHYSICS_EXPORT const double DEFAULT_TENSION
agx::Real getStretch() const
agx::Real getTension() const
Point(const agx::Vec3 &p=agx::Vec3(), agx::Real t=DEFAULT_TENSION, agx::Real stretch=DEFAULT_STRETCH, agx::Real curvature=DEFAULT_CURVATURE)
Create a spline point from a point p, tension t and stretch stretch.
agx::Real getCurvature() const
static AGXPHYSICS_EXPORT const agx::Real DEFAULT_STRETCH
void setTension(agx::Real tension)
Set the tension (N) in the point.
Tangent(const agx::Vec3 &v)
size_t getNumPoints() const
AGXSTREAM_DECLARE_ABSTRACT_SERIALIZABLE(agxUtil::Spline)
virtual Tangent getTangent(size_t, agx::Real) const
Spline()
Default constructor.
agx::Vector< Point > PointVector
void restore(agxStream::InputArchive &in) override
PointVector & getPoints()
virtual void clear()
Clears control points and tangents.
virtual void updateTangents()=0
All control points are added, computes the tangents.
agx::Vector< Tangent > TangentVector
virtual Point evaluate(size_t index, agx::Real t) const =0
Interpolate from point with index index a time t forward (0 <= t <= 1)
void add(const agx::Vec3 &point, agx::Real tension=Point::DEFAULT_TENSION, agx::Real stretch=Point::DEFAULT_STRETCH, agx::Real curvature=Point::DEFAULT_CURVATURE)
Add point to the control points given tension (1 max, 0 min) and stretch.
void store(agxStream::OutputArchive &out) const override
const PointVector & getPoints() const
virtual agx::Real getTension(size_t index, agx::Real time) const
Linear interpolate of tension from point at index.
Base class providing referencing counted objects.
The agxUtil namespace contain classes and methods for utility functionality.
agx::ref_ptr< NonUniformCardinalSpline > NonUniformCardinalSplineRef
agx::ref_ptr< CubicSpline > CubicSplineRef
agx::ref_ptr< Spline > SplineRef
agx::ref_ptr< BSpline > BSplineRef
agx::ref_ptr< HermiteSpline > HermiteSplineRef
agx::ref_ptr< CPCatmullRomBSpline > CPCatmullRomBSplineRef
agx::ref_ptr< CardinalSpline > CardinalSplineRef
agx::ref_ptr< ParameterizedCatmullRomSpline > ParameterizedCatmullRomSplineRef
The agx namespace contains the dynamics/math part of the AGX Dynamics API.
T1 clamp(T1 v, T2 minimum, T3 maximum)
AGXCORE_EXPORT const Real RealEpsilon
AGXPHYSICS_EXPORT agx::Bool equalsZero(const agx::AddedMassInteraction::Matrix6x6 &matrix, agx::Real eps=agx::RealEpsilon)
AGXPHYSICS_EXPORT agx::Bool equivalent(const agx::AddedMassInteraction::Matrix6x6 &lhs, const agx::AddedMassInteraction::Matrix6x6 &rhs, agx::Real eps=agx::RealEpsilon)