ToyMaker Game Engine 0.0.2
ToyMaker is a game engine developed and maintained by Zoheb Shujauddin.
Loading...
Searching...
No Matches
ToyMaker::ParametrizedConstraint< TParameter, LagrangeCount > Class Template Reference

Subclass implementation for any constraint which takes data of type TParameter. More...

#include <types.hpp>

Inheritance diagram for ToyMaker::ParametrizedConstraint< TParameter, LagrangeCount >:
ToyMaker::Constraint< LagrangeCount > ToyMaker::BaseConstraint

Public Member Functions

void setParameter (BaseConstraint::ParticipantID participant, const TParameter &parameter)
 Adds a parameter for this constraint.
TParameter getParameter (BaseConstraint::ParticipantID participant) const
 Gets parameter belonging to a particular constraint participant.
void removeParameter (BaseConstraint::ParticipantID participant)
 Removes a parameter belonging to a particular constraint participant.
const std::unordered_map< BaseConstraint::ParticipantID, TParameter > & getParameters () const
 Returns all parameters known to this constraint.
Public Member Functions inherited from ToyMaker::Constraint< LagrangeCount >
void applyLagrangeDelta (float delta, uint8_t index)
 Adds a delta to a lagrange value located at index.
const std::array< float, LagrangeCount > & getLagrange () const
 Gets the current Lagrange multiplier values for this constraint.
const std::array< float, LagrangeCount > & getLagrangeDelta () const
 Gets the latest lagrange delta applied to a constraint.
void resetLagrange () override
 Sets all lagrange multipliers to 0 in preparation for the next physics update.
template<uint8_t ... indices>
void resetLagrange (std::integer_sequence< uint8_t, indices... > sequence)
Public Member Functions inherited from ToyMaker::BaseConstraint
float getCompliance () const
 Gets the current compliance value for this constraint.
virtual void applyConstraintPosition (const ParticipantTable &states, float substepSeconds)
 Applies positional constraint to current set of bounds and physics states.
virtual void applyConstraintVelocity (const ParticipantTable &states, float substepSeconds)
 Applies velocity-based constraint to current set of bounds and physics states.
void setCompliance (float newCompliance)
 Sets the compliance value for this constraint.

Protected Member Functions

 ParametrizedConstraint (float compliance)
 Initializes this constraint with some initial compliance value.
Protected Member Functions inherited from ToyMaker::Constraint< LagrangeCount >
 Constraint (float compliance)
 Initializes this constraint with some initial compliance value.
Protected Member Functions inherited from ToyMaker::BaseConstraint
 BaseConstraint (float compliance)
 Initializes this constraint.

Private Attributes

std::unordered_map< BaseConstraint::ParticipantID, TParameter > mParameters {}
 A set of parameters associated with each entity.

Additional Inherited Members

Public Types inherited from ToyMaker::BaseConstraint
using ParticipantID = std::size_t
using ParticipantTable

Detailed Description

template<typename TParameter, uint8_t LagrangeCount>
class ToyMaker::ParametrizedConstraint< TParameter, LagrangeCount >

Subclass implementation for any constraint which takes data of type TParameter.

Template Parameters
TParameterA parameter specific to this constraint.
LagrangeCountThe number of Lagrange multipliers used by this constraint

Member Data Documentation

◆ mParameters

template<typename TParameter, uint8_t LagrangeCount>
std::unordered_map<BaseConstraint::ParticipantID, TParameter> ToyMaker::ParametrizedConstraint< TParameter, LagrangeCount >::mParameters {}
private

A set of parameters associated with each entity.

These parameters store values that augment the values known by the engine – i.e., physics state and object bounds – but are specific to the constraint itself


The documentation for this class was generated from the following file:
  • ToyMaker_Main/include/toymaker/engine/physics/types.hpp