Jolt Physics
A multi core friendly Game Physics Engine
Loading...
Searching...
No Matches
SpringPart Class Reference

Class used in other constraint parts to calculate the required bias factor in the lagrange multiplier for creating springs. More...

#include <SpringPart.h>

Public Member Functions

void CalculateSpringProperties (float inDeltaTime, float inInvEffectiveMass, float inBias, float inC, float inFrequency, float inDamping, float &outEffectiveMass)
 
bool IsActive () const
 Returns if this spring is active. More...
 
float GetBias (float inTotalLambda) const
 Get total bias b, including supplied bias and bias for spring: lambda = J v + b. More...
 

Detailed Description

Class used in other constraint parts to calculate the required bias factor in the lagrange multiplier for creating springs.

Member Function Documentation

◆ CalculateSpringProperties()

void SpringPart::CalculateSpringProperties ( float  inDeltaTime,
float  inInvEffectiveMass,
float  inBias,
float  inC,
float  inFrequency,
float  inDamping,
float &  outEffectiveMass 
)
inline

Calculate spring properties

Parameters
inDeltaTimeTime step
inInvEffectiveMassInverse effective mass K
inBiasBias term (b) for the constraint impulse: lambda = J v + b
inCValue of the constraint equation (C). Set to zero if you don't want to drive the constraint to zero with a spring.
inFrequencyOscillation frequency (Hz). Set to zero if you don't want to drive the constraint to zero with a spring.
inDampingDamping factor (0 = no damping, 1 = critical damping). Set to zero if you don't want to drive the constraint to zero with a spring.
outEffectiveMassOn return, this contains the new effective mass K^-1

◆ GetBias()

float SpringPart::GetBias ( float  inTotalLambda) const
inline

Get total bias b, including supplied bias and bias for spring: lambda = J v + b.

◆ IsActive()

bool SpringPart::IsActive ( ) const
inline

Returns if this spring is active.


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