📄 aicar.cpp
字号:
#include "StdAfx.h"
#include "../common/myd3d.h"
#include "mesh.h"
#include "car.h"
#include "obstacle.h"
#include "AIcar.h"
AICar::AICar()
{
/*_lView = 20.0f;*/
/*Car::SetSpeed(100.0f);*/
}
AICar::~AICar()
{
}
void AICar::AIMove(float units, float minR , float maxR)
{
//运动范围限制
float a = D3DXVec3Length( &GetPosition() );
if(a <= minR)
{
Move( -units );
GoLeft(0.2f);
SubSpeed(units);
}
if(a >= maxR)
{
Move( -units );
GoRight( 0.9f);
SubSpeed(units);
}
AddSpeed( 4.0f*units );
Move( units );
}
//D3DXVECTOR3 AICar::GetLookPos()
//{
// D3DXVECTOR3 look = Car::GetLook();
// D3DXVECTOR3 pos = Car::GetPosition();
// pos += look * _lView;
// return pos;
//}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -