Fx2D
A C++20 2D rigid-body physics engine
Loading...
Searching...
No Matches
FxConstraint Class Referenceabstract

Base type for solver constraints. More...

#include <Solver.h>

+ Inheritance diagram for FxConstraint:

Public Member Functions

void set_stiffness (double k)
 
void setCompliance (double c)
 
virtual void evaluate (float &C, FxVec2f &g1, FxVec2f &g2, float &gth1, float &gth2, bool &active) const =0
 
void resolve (double dt)
 
const std::string & get_name () const
 
const std::shared_ptr< FxEntity > & get_entity1 () const
 
const std::shared_ptr< FxEntity > & get_entity2 () const
 
std::string get_entity1_name () const
 
std::string get_entity2_name () const
 
virtual ~FxConstraint ()=default
 

Protected Attributes

std::string m_name
 
double compliance = 1e-7
 
bool carries_velocity = true
 
std::shared_ptr< FxEntity > entity1
 
std::shared_ptr< FxEntity > entity2
 

Friends

class FxJoint
 

Detailed Description

Base type for solver constraints.

Definition at line 124 of file Solver.h.

Constructor & Destructor Documentation

◆ ~FxConstraint()

virtual FxConstraint::~FxConstraint ( )
virtualdefault

Member Function Documentation

◆ evaluate()

virtual void FxConstraint::evaluate ( float &  C,
FxVec2f &  g1,
FxVec2f &  g2,
float &  gth1,
float &  gth2,
bool &  active 
) const
pure virtual

◆ get_entity1()

const std::shared_ptr< FxEntity > & FxConstraint::get_entity1 ( ) const
inline

Definition at line 155 of file Solver.h.

◆ get_entity1_name()

std::string FxConstraint::get_entity1_name ( ) const

◆ get_entity2()

const std::shared_ptr< FxEntity > & FxConstraint::get_entity2 ( ) const
inline

Definition at line 156 of file Solver.h.

◆ get_entity2_name()

std::string FxConstraint::get_entity2_name ( ) const

◆ get_name()

const std::string & FxConstraint::get_name ( ) const
inline

Definition at line 152 of file Solver.h.

◆ resolve()

void FxConstraint::resolve ( double  dt)

◆ set_stiffness()

void FxConstraint::set_stiffness ( double  k)
inline

Definition at line 141 of file Solver.h.

◆ setCompliance()

void FxConstraint::setCompliance ( double  c)
inline

Definition at line 145 of file Solver.h.

Friends And Related Symbol Documentation

◆ FxJoint

friend class FxJoint
friend

Definition at line 126 of file Solver.h.

Member Data Documentation

◆ carries_velocity

bool FxConstraint::carries_velocity = true
protected

Definition at line 134 of file Solver.h.

◆ compliance

double FxConstraint::compliance = 1e-7
protected

Definition at line 130 of file Solver.h.

◆ entity1

std::shared_ptr<FxEntity> FxConstraint::entity1
protected

Definition at line 135 of file Solver.h.

◆ entity2

std::shared_ptr<FxEntity> FxConstraint::entity2
protected

Definition at line 136 of file Solver.h.

◆ m_name

std::string FxConstraint::m_name
protected

Definition at line 129 of file Solver.h.


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