Subclass implementation for any constraint which takes data of type TParameter.
More...
|
|
| ConstraintParametrized (const TConfig &config, const std::vector< TParameter > &constraintParameters, float compliance) |
| | Initializes this constraint with some initial compliance value and constraint parameters.
|
|
void | setConfig (const TConfig &config) |
| | Sets configuration for this constraint.
|
|
TConfig | getConfig () const |
| | Gets the current configuration of this constraint.
|
|
void | setParameter (BaseConstraint::ParticipantID participant, const TParameter ¶meter) |
| | 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.
|
|
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) |
|
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.
|
|
template<typename TConstraint, std::enable_if_t< std::is_base_of< ConstraintParametrized< typename TConstraint::Config, typename TConstraint::Parameter, TConstraint::NLagrange >, TConstraint >::value, bool > = true> |
| void | setParameter (ParticipantID participant, const typename TConstraint::Parameter ¶meter) |
| | Sets a parameter belonging to a particular constraint participant.
|
|
template<typename TConstraint, std::enable_if_t< std::is_base_of< ConstraintParametrized< typename TConstraint::Config, typename TConstraint::Parameter, TConstraint::NLagrange >, TConstraint >::value, bool > = true> |
| TConstraint::Parameter | getParameter (ParticipantID participant) const |
| | Gets a parameter associated with a particular constraint participant.
|
|
template<typename TConstraint, std::enable_if_t< std::is_base_of< ConstraintParametrized< typename TConstraint::Config, typename TConstraint::Parameter, TConstraint::NLagrange >, TConstraint >::value, bool > = true> |
| void | setConfig (const typename TConstraint::Config &config) |
| | Sets the configuration of a constraint.
|
|
template<typename TConstraint, std::enable_if_t< std::is_base_of< ConstraintParametrized< typename TConstraint::Config, typename TConstraint::Parameter, TConstraint::NLagrange >, TConstraint >::value, bool > = true> |
| TConstraint::Config | getConfig () const |
| | Gets the configuration of a constraint.
|
template<typename TConfig, typename TParameter, uint8_t LagrangeCount>
class ToyMaker::ConstraintParametrized< TConfig, TParameter, LagrangeCount >
Subclass implementation for any constraint which takes data of type TParameter.
- Template Parameters
-
| TConfig | The configuration data for the constraint as a whole |
| TParameter | A per-entity parameter specific to this constraint. |
| LagrangeCount | The number of Lagrange multipliers used by this constraint |
TODO: Why am I doing all this overcomplicated template nonsense here? Review and simplify.