搜题
问题   更新时间2023/4/3 12:59:00

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

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(拨打)