Beispiel #1
0
void BurnThread::SurfaceFire(void)
{// does surface fire calculations of spread rate and intensity
     CrownState=0;
	LoadGlobalFEData(fe);
     if(ld.fuel<=0)
          return;
	fros=spreadrate(ld.slope, m_windspd, ld.fuel);
	if(fros>0.0)				    	// if rate of spread is >0
	{	GetAccelConst();              // get acceleration constants
		VecSurf();		 	    	// vector wind with slope
          CalculateFireOrientation(pFlamMap->GetOffsetFromMax());
		NormalizeDirectionWithLocalSlope();
		ellipse(vecros, ivecspeed);  	// compute elliptical dimensions
		grow(vecdir);  		    	// compute time derivatives xt and yt for perimeter point
		AccelSurf1();                 // compute new equilibrium ROS and Avg. ROS in remaining timestep
		SlopeCorrect(1);
		SubTimeStep=timerem;
		limgrow();   			    	// limits HORIZONTAL growth to mindist
		AccelSurf2();			    	// calcl ros & fli for SubTimeStep Kw/m from BTU/ft/s*/
          CrownState=1;
	//	if(SSpotOK && cover==99)
	//	{    cf.FlameLength=0;		// may want to set other crown parameters to 0 here
	//		SpotFire(3);	   	 	// spotting from  winddriven surface fires
	//	}
	}
	else
	{    timerem=0;
		RosT=0;
		fli=0;
		FliFinal=0;
	}
}
Vector4 RPhysics::CalculateInputForce() {

    const float accel = 1.25*GetAccelConst();
    Vector4 ret(0,0,0);
    if(m_pedalState==PRESSED||m_boostLeft>0) {
        Vector4 inputDir = GetTurnDir();
        ret = inputDir*accel;
        float angle = fabs(Angle3(m_player->GetAhead(),m_velocity));
        if(angle*0==0)
            ret*=(1+angle);
        //ret*=2;
        //cerr<<"A:"<<angle<<endl;
    } else if(m_brakeState==PRESSED) {
        Vector4 ahead = m_player->GetAhead();
        ret = -ahead*BRAKE_CONSTANT;
    }
    return ret;
}