1 #ifndef NET_FORCE_ACCUMULATOR_H 2 #define NET_FORCE_ACCUMULATOR_H 6 #include <physics_entity.h> 7 #include <constant_force.h> 8 #include <gravity_force.h> 9 #include <linear_drag_force.h> 10 #include <unordered_map> 12 #include <spring_force.h> 17 std::vector<ConstantForceGenerator> m_constant_forces;
23 std::unordered_map<GLint, Spring> m_springs;
24 std::unordered_map<GLint,std::vector<GLint>> m_entity_spring_map;
70 const std::vector<std::shared_ptr<PhysicsEntity>> &entity_ptrs,
71 const std::shared_ptr<PhysicsEntity> entity_ptr,
72 Vector3Gf &force)
const;
82 const std::vector<std::shared_ptr<PhysicsEntity>> &entity_ptrs,
83 const std::shared_ptr<PhysicsEntity> entity_ptr,
84 Eigen::Matrix<GLfloat,3,3> &dFdx,
85 Eigen::Matrix<GLfloat,3,3> &dFdv)
const;
Computes a simple linear drag force on the provided entity.
Definition: linear_drag_force.h:12
void EnableDrag(bool enable)
Definition: net_force_accumulator.cpp:19
void ComputeNetForceJacobian(const std::vector< std::shared_ptr< PhysicsEntity >> &entity_ptrs, const std::shared_ptr< PhysicsEntity > entity_ptr, Eigen::Matrix< GLfloat, 3, 3 > &dFdx, Eigen::Matrix< GLfloat, 3, 3 > &dFdv) const
Definition: net_force_accumulator.cpp:91
Computes graviational force of attraction between 2 entities.
Definition: gravity_force.h:10
void AddSpring(Spring spring)
Definition: net_force_accumulator.cpp:29
data structure that represents a spring
Definition: spring.h:10
void EnableGravity(bool enable)
Definition: net_force_accumulator.cpp:14
void AddConstantForce(Vector3Gf a)
Definition: net_force_accumulator.cpp:9
void SetDragCoeff(GLfloat beta)
Definition: net_force_accumulator.cpp:24
void ComputeNetForce(const std::vector< std::shared_ptr< PhysicsEntity >> &entity_ptrs, const std::shared_ptr< PhysicsEntity > entity_ptr, Vector3Gf &force) const
Definition: net_force_accumulator.cpp:36
Computes the spring force resulting from 2 entities being connected by a spring.
Definition: spring_force.h:13
Definition: net_force_accumulator.h:14
NetForceAccumulator()
Definition: net_force_accumulator.cpp:4