Engine
|
Computes the spring force resulting from 2 entities being connected by a spring. More...
#include <spring_force.h>
Public Member Functions | |
SpringForceGenerator () | |
void | AccumulateForce (const GLfloat k, const GLfloat l0, const std::shared_ptr< PhysicsEntity > entity1_ptr, const std::shared_ptr< PhysicsEntity > entity2_ptr, Vector3Gf &F) const |
void | AccumulatedFdx (const GLfloat k, const GLfloat l0, const std::shared_ptr< PhysicsEntity > entity1_ptr, const std::shared_ptr< PhysicsEntity > entity2_ptr, Eigen::Matrix< GLfloat, 3, 3 > &dF) const |
Computes the spring force resulting from 2 entities being connected by a spring.
SpringForceGenerator::SpringForceGenerator | ( | ) |
Constructs a SpringForceGenerator
void SpringForceGenerator::AccumulatedFdx | ( | const GLfloat | k, |
const GLfloat | l0, | ||
const std::shared_ptr< PhysicsEntity > | entity1_ptr, | ||
const std::shared_ptr< PhysicsEntity > | entity2_ptr, | ||
Eigen::Matrix< GLfloat, 3, 3 > & | dF | ||
) | const |
Adds the position jacobian
k | stiffness coefficent of spring |
l0 | rest length of spring |
entity1_ptr | entity on one end of the spring. The force will be computed such that it acts on this entity. |
entity2_ptr | entity on the other end of the spring. The negative of the computed force acts on this entity. |
dF | Matrix that will accumulate the derivative of force with respect to position |
void SpringForceGenerator::AccumulateForce | ( | const GLfloat | k, |
const GLfloat | l0, | ||
const std::shared_ptr< PhysicsEntity > | entity1_ptr, | ||
const std::shared_ptr< PhysicsEntity > | entity2_ptr, | ||
Vector3Gf & | F | ||
) | const |
Adds a spring force due to 2 entities being connected by a spring
k | stiffness coefficent of spring |
l0 | rest length of spring |
entity1_ptr | entity on one end of the spring. The force will be computed such that it acts on this entity. |
entity2_ptr | entity on the other end of the spring. The negative of the computed force acts on this entity. |
F | Force vector that will accumulate the constant force represented by this instance |