Engine
SpringForceGenerator Class Reference

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
 

Detailed Description

Computes the spring force resulting from 2 entities being connected by a spring.

Constructor & Destructor Documentation

SpringForceGenerator::SpringForceGenerator ( )

Constructs a SpringForceGenerator

Member Function Documentation

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

Parameters
kstiffness coefficent of spring
l0rest length of spring
entity1_ptrentity on one end of the spring. The force will be computed such that it acts on this entity.
entity2_ptrentity on the other end of the spring. The negative of the computed force acts on this entity.
dFMatrix 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

Parameters
kstiffness coefficent of spring
l0rest length of spring
entity1_ptrentity on one end of the spring. The force will be computed such that it acts on this entity.
entity2_ptrentity on the other end of the spring. The negative of the computed force acts on this entity.
FForce vector that will accumulate the constant force represented by this instance

The documentation for this class was generated from the following files: