diff options
Diffstat (limited to 'source/gameengine/GameLogic/SCA_RandomSensor.cpp')
-rw-r--r-- | source/gameengine/GameLogic/SCA_RandomSensor.cpp | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/source/gameengine/GameLogic/SCA_RandomSensor.cpp b/source/gameengine/GameLogic/SCA_RandomSensor.cpp index 99e25042582..c23722d2d3c 100644 --- a/source/gameengine/GameLogic/SCA_RandomSensor.cpp +++ b/source/gameengine/GameLogic/SCA_RandomSensor.cpp @@ -48,8 +48,8 @@ /* ------------------------------------------------------------------------- */ SCA_RandomSensor::SCA_RandomSensor(SCA_EventManager* eventmgr, - SCA_IObject* gameobj, - int startseed) + SCA_IObject* gameobj, + int startseed) : SCA_ISensor(gameobj,eventmgr) { m_basegenerator = new SCA_RandomNumberGenerator(startseed); @@ -65,10 +65,10 @@ SCA_RandomSensor::~SCA_RandomSensor() void SCA_RandomSensor::Init() { - m_iteration = 0; + m_iteration = 0; m_interval = 0; m_lastdraw = false; - m_currentDraw = m_basegenerator->Draw(); + m_currentDraw = m_basegenerator->Draw(); } @@ -97,19 +97,19 @@ bool SCA_RandomSensor::IsPositiveTrigger() bool SCA_RandomSensor::Evaluate() { - /* Random generator is the generator from Line 25 of Table 1 in */ - /* [KNUTH 1981, The Art of Computer Programming Vol. 2 */ - /* (2nd Ed.), pp102] */ - /* It's a very simple max. length sequence generator. We can */ - /* draw 32 bool values before having to generate the next */ - /* sequence value. There are some theorems that will tell you */ - /* this is a reasonable way of generating bools. Check Knuth. */ - /* Furthermore, we only draw each <delay>-eth frame. */ + /* Random generator is the generator from Line 25 of Table 1 in */ + /* [KNUTH 1981, The Art of Computer Programming Vol. 2 */ + /* (2nd Ed.), pp102] */ + /* It's a very simple max. length sequence generator. We can */ + /* draw 32 bool values before having to generate the next */ + /* sequence value. There are some theorems that will tell you */ + /* this is a reasonable way of generating bools. Check Knuth. */ + /* Furthermore, we only draw each <delay>-eth frame. */ bool evaluateResult = false; if (++m_interval > m_pulse_frequency) { - bool drawResult = false; + bool drawResult = false; m_interval = 0; if (m_iteration > 31) { m_currentDraw = m_basegenerator->Draw(); @@ -122,8 +122,8 @@ bool SCA_RandomSensor::Evaluate() evaluateResult = drawResult != m_lastdraw; m_lastdraw = drawResult; } - - /* now pass this result to some controller */ + + /* now pass this result to some controller */ return evaluateResult; } |