Engine
NetForceAccumulator Class Reference

Public Member Functions

 NetForceAccumulator ()
 
void AddConstantForce (Vector3Gf a)
 
void EnableGravity (bool enable)
 
void EnableDrag (bool enable)
 
void SetDragCoeff (GLfloat beta)
 
void AddSpring (Spring spring)
 
void ComputeNetForce (const std::vector< std::shared_ptr< PhysicsEntity >> &entity_ptrs, const std::shared_ptr< PhysicsEntity > entity_ptr, Vector3Gf &force) const
 
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
 

Constructor & Destructor Documentation

NetForceAccumulator::NetForceAccumulator ( )

Constructs a NetForceAccumulator

Member Function Documentation

void NetForceAccumulator::AddConstantForce ( Vector3Gf  a)

Adds a new constant force to the simuluation

Parameters
aacceleration vector of the new constant force
void NetForceAccumulator::AddSpring ( Spring  spring)

Adds a spring to the force simulation

Parameters
springspring to be added
void NetForceAccumulator::ComputeNetForce ( const std::vector< std::shared_ptr< PhysicsEntity >> &  entity_ptrs,
const std::shared_ptr< PhysicsEntity entity_ptr,
Vector3Gf &  force 
) const

Computes the net force acting on an entity in the sumulation via accumulation

Parameters
entity_ptrslist of all entities in the simulation
entity_ptrentity whom the net force is acting on
forcevector that will be modified to contain the net force acting on the supplied entity
void NetForceAccumulator::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

Computes the net force jacobian for the supplied entity

Parameters
entity_ptrslist of all entities in the simulation
entity_ptrentity whom the net force is acting on
dFdxmatrix that will be modified to contain the net force jacobian with respect to position
dFdvmatrix that will be modified to contain the net force jacobian with respect to velocity
void NetForceAccumulator::EnableDrag ( bool  enable)

Enables/Disables velocity based drag

Parameters
enabletrue to turn on drag, false to turn off
void NetForceAccumulator::EnableGravity ( bool  enable)

Enables/Disables universial gravitation between entities

Parameters
enabletrue to turn on gravtational attraction, false to turn off
void NetForceAccumulator::SetDragCoeff ( GLfloat  beta)

Set the drag coefficent. Large values mean stronger drag

Parameters
betadrag coefficent

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