20 #if (defined(__cplusplus) && !defined(SWIG)) || (defined(SWIG) && !defined(SWIGJAVA))
67 :
agx::
Vec3(p), m_tension(t), m_stretch(stretch), m_curvature(curvature) {}
70 inline agx::Real getTension()
const {
return m_tension; }
73 inline void setTension(
agx::Real tension) { m_tension = tension; }
76 inline agx::Real getStretch()
const {
return m_stretch; }
79 inline agx::Real getCurvature()
const {
return m_curvature; }
108 virtual Point evaluate(
size_t index,
agx::Real t )
const = 0;
113 inline size_t getNumPoints()
const {
return m_points.size(); }
118 inline PointVector& getPoints() {
return m_points; }
124 inline const PointVector& getPoints()
const {
return m_points; }
130 virtual Tangent getTangent(
size_t ,
agx::Real )
const {
return Tangent(); }
141 virtual void updateTangents() = 0;
146 virtual void clear();
157 PointVector m_points;
158 TangentVector m_tangents;
166 if (index + 1 == m_points.size())
167 return m_points.back().getTension();
171 return m_points[index].getTension();
173 return m_points[index + 1].getTension();
175 return (1 - time) * m_points[index].getTension() + time * m_points[index + 1].getTension();
193 virtual Point evaluate(
size_t index,
agx::Real t )
const override;
198 void updateTangents()
override;
200 Tangent getTangent(
size_t index,
agx::Real t)
const override;
206 virtual ~CubicSpline() {}
226 virtual Point evaluate(
size_t index,
agx::Real t )
const override;
231 void updateTangents()
override;
233 Tangent getTangent(
size_t index,
agx::Real t)
const override;
239 virtual ~CardinalSpline() {}
251 NonUniformCardinalSpline();
256 virtual Point evaluate(
size_t index,
agx::Real t)
const override;
261 void updateTangents()
override;
263 Tangent getTangent(
size_t index,
agx::Real t)
const override;
269 virtual ~NonUniformCardinalSpline() {}
281 ParameterizedCatmullRomSpline(
agx::Real alpha);
286 virtual Point evaluate(
size_t index,
agx::Real t)
const override;
291 void updateTangents()
override;
293 Tangent getTangent(
size_t index,
agx::Real t)
const override;
299 virtual ~ParameterizedCatmullRomSpline() {}
302 ParameterizedCatmullRomSpline();
321 virtual Point evaluate(
size_t index,
agx::Real t)
const override;
326 void updateTangents()
override;
328 Tangent getTangent(
size_t index,
agx::Real t)
const override;
334 virtual ~BSpline() {}
345 CPCatmullRomBSpline();
350 virtual Point evaluate(
size_t index,
agx::Real t)
const override;
355 virtual void updateTangents()
override;
357 Tangent getTangent(
size_t index,
agx::Real t)
const override;
363 virtual ~CPCatmullRomBSpline() {}
364 ParameterizedCatmullRomSplineRef m_catmull;
365 BSplineRef m_bspline;
381 virtual Point evaluate(
size_t index,
agx::Real t)
const override;
386 void updateTangents()
override;
388 Tangent getTangent(
size_t index,
agx::Real t)
const override;
394 virtual ~HermiteSpline() {}
395 ParameterizedCatmullRomSplineRef m_catmull;
396 BSplineRef m_bspline;
#define AGXSTREAM_DECLARE_ABSTRACT_SERIALIZABLE(T)
Use this in a pure abstract Serializable class to add the required methods Important: Use full namesp...
#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...
Base class providing referencing counted objects.
Smart pointer for handling referenced counted objects.
InputRef< T > in(const char *name, T &obj)
Create an object with a name and a reference to the object that should be restored (usually a pointer...
OutputRef< Serializable > out(const char *name, const Serializable *obj)
Return an object that contain the name and the object that should be serialized to an archive.
AGXTERRAIN_EXPORT void clear()
The agxUtil namespace contain classes and methods for utility functionality.
The agx namespace contains the dynamics/math part of the AGX Dynamics API.
Vec3T< Real > Vec3
The object holding 3 dimensional vectors and providing basic arithmetic.
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)