搜题
王老师:19139051760(拨打)
题目  更新时间:2023/4/3

写出连续环境中的视线追逐算法代码。

void DoLineofSightChase( ) { Vector u, v; bool left = false; bool right= false; u = VRotate2D(-Predator.fOrientation, (Prey.vPosition - Predator.vPosition)); u.Normalize(); if(u.x < -_TOL) left = true; else if(u.x > _TOL) right = true; Predator.SetThrusters(left,right); }
王老师:19139051760(拨打)