Beispiel #1
0
 void StartSpringDumper()
 {
     _accelFunc    = AccelFuncSpringDumper;
     _positionFunc = PositionFuncSpringDumper;
     _energyFunc   = EnergyFuncSpring;
     ResetStates();
 }
Beispiel #2
0
    void StartSpringDumper()
    {
        var position = new Vector2(300f, 0f);
        var velocity = Vector2.zero;

        _accelFunc    = AccelFuncSpringDumper;
        _positionFunc = PositionFuncSpringDumper;
        _energyFunc   = EnergyFuncSpring;
        _eulerState.Set(position, velocity, Time.fixedDeltaTime, _accelFunc);
        _semiImplicitEulerState.Set(position, velocity, Time.fixedDeltaTime, _accelFunc);
        _verletState.Set(position, velocity, Time.fixedDeltaTime, _accelFunc);
    }