www.pudn.com > Product_Submit2004.rar > SpeedRacer.cc, change:2004-10-12,size:1500b


#include "SpeedRacer.h" 
#include "../Common/Common.h" 
#include "../TOOLS/BasicTricks.h" 
#include "../Globals.h" 
 
// walks forwards and stuff. 
SpeedRacer::SpeedRacer() { 
  currentTrick = new BasicTricks::NullBody(); 
  headTrick = new BasicTricks::NullHead(); 
  configuration_.ParseFile("/ms/open-r/mw/data/spdrcr.cfg"); 
} 
SpeedRacer::~SpeedRacer() { 
  delete currentTrick; 
  delete headTrick; 
} 
 
void SpeedRacer::NewReadyModel() { 
  if (currentTrick->Continue() < 1) { 
    delete currentTrick; 
    currentTrick = new BasicTricks::NullBody(); 
    currentTrick->Start(); 
  } 
  utils.Head_MoveTo(10,0,0); 
} 
 
void SpeedRacer::NewPlayingModel() { 
  if (currentTrick->Continue() < 1) { 
    delete currentTrick; 
    currentTrick = new BasicTricks::Step(configuration_.GetAsInt("SR.WalkType"),configuration_.GetAsDouble("SR.FrontStrideLength"),configuration_.GetAsDouble("SR.BackStrideLength"),configuration_.GetAsDouble("SR.Turn"),configuration_.GetAsDouble("SR.Strafe"),configuration_.GetAsDouble("SR.StepFrequency")); 
//      configuration_.GetAsDouble("SR.FrontHeight"),configuration_.GetAsDouble("SR.FrontStrideHeight"),configuration_.GetAsDouble("SR.FrontForwardOffset"),configuration_.GetAsDouble("SR.FrontSideOffset"),configuration_.GetAsDouble("SR.BackHeight"),configuration_.GetAsDouble("BackStrideHeight"), configuration_.GetAsDouble("BackForwardOffset"),configuration_.GetAsDouble("BackSideOffset")); 
    currentTrick->Start(); 
  } 
  utils.Head_MoveTo(10,0,0); 
}