15 template <
int N,
typename Real>
30 inline Real
const&
GetLength(
int i)
const;
53 template <
int N,
typename Real>
58 template <
int N,
typename Real>
69 template <
int N,
typename Real>
inline 75 template <
int N,
typename Real>
inline 81 template <
int N,
typename Real>
inline 87 template <
int N,
typename Real>
inline 93 template <
int N,
typename Real>
inline 99 template <
int N,
typename Real>
106 template <
int N,
typename Real>
126 diff = position[iM1] - position[i];
128 force =
mConstant[iM1] * ((Real)1 - ratio) * diff;
129 acceleration += this->
mInvMass[i] * force;
135 diff = position[iP1] - position[i];
137 force =
mConstant[i] * ((Real)1 - ratio) * diff;
138 acceleration += this->
mInvMass[i] * force;
virtual Vector< N, Real > ExternalAcceleration(int i, Real time, std::vector< Vector< N, Real >> const &position, std::vector< Vector< N, Real >> const &velocity)
virtual ~MassSpringCurve()
int GetNumSprings() const
MassSpringCurve(int numParticles, Real step)
Real const & GetLength(int i) const
void SetLength(int i, Real length)
GLuint GLsizei GLsizei * length
DualQuaternion< Real > Length(DualQuaternion< Real > const &d, bool robust=false)
virtual Vector< N, Real > Acceleration(int i, Real time, std::vector< Vector< N, Real >> const &position, std::vector< Vector< N, Real >> const &velocity)
std::vector< Real > mLength
std::vector< Real > mInvMass
Real const & GetConstant(int i) const
std::vector< Real > mConstant
void SetConstant(int i, Real constant)