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 140 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 171 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 172 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 168 of file Solver.h.

◆ resolve()

void FxConstraint::resolve ( double dt)

◆ set_stiffness()

void FxConstraint::set_stiffness ( double k)
inline

Definition at line 157 of file Solver.h.

◆ setCompliance()

void FxConstraint::setCompliance ( double c)
inline

Definition at line 161 of file Solver.h.

◆ FxJoint

friend class FxJoint
friend

Definition at line 142 of file Solver.h.

Member Data Documentation

◆ carries_velocity

bool FxConstraint::carries_velocity = true
protected

Definition at line 150 of file Solver.h.

◆ compliance

double FxConstraint::compliance = 1e-7
protected

Definition at line 146 of file Solver.h.

◆ entity1

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

Definition at line 151 of file Solver.h.

◆ entity2

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

Definition at line 152 of file Solver.h.

◆ m_name

std::string FxConstraint::m_name
protected

Definition at line 145 of file Solver.h.


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