Bayley Wang
/
priustroller_3
temp repo
Fork of priustroller_2 by
Diff: meta/modulators.cpp
- Revision:
- 20:3a7eae543153
- Parent:
- 19:280c62c71cf8
- Child:
- 21:da41c08e51bc
--- a/meta/modulators.cpp Mon Mar 09 03:32:32 2015 +0000 +++ b/meta/modulators.cpp Mon Mar 09 03:36:59 2015 +0000 @@ -4,12 +4,11 @@ #include "fastmath.h" #include "transforms.h" -void SinusoidalModulator::Update(float valpha, float vbeta) { - float dtcA = 0.0f; - float dtcB = 0.0f; - float dtcC = 0.0f; - +void SinusoidalModulator::Update(float valpha, float vbeta) { //--hack to make duty cycles positive + float dtcA = valpha; + float dtcB = ((-valpha + sqrt(3.0f) * vbeta) / 2.0f); + float dtcC = ((-valpha - sqrt(3.0f) * vbeta) / 2.0f); _inverter->SetDtcA(dtcA * 0.5f + 0.5f); _inverter->SetDtcB(dtcB * 0.5f + 0.5f); _inverter->SetDtcC(dtcC * 0.5f + 0.5f);