本文整理汇总了C++中PathGenerator类的典型用法代码示例。如果您正苦于以下问题:C++ PathGenerator类的具体用法?C++ PathGenerator怎么用?C++ PathGenerator使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了PathGenerator类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: MoveCharge
void MotionMaster::MoveCharge(PathGenerator path, float speed, uint32 id)
{
Vector3 dest = path.GetActualEndPosition();
MoveCharge(dest.x, dest.y, dest.z, speed, id);
Movement::MoveSplineInit init(_owner);
init.MovebyPath(path.GetPath());
init.SetVelocity(speed);
init.Launch();
}
示例2: MoveCharge
void MotionMaster::MoveCharge(PathGenerator const& path, float speed /*= SPEED_CHARGE*/)
{
G3D::Vector3 dest = path.GetActualEndPosition();
MoveCharge(dest.x, dest.y, dest.z, speed, EVENT_CHARGE_PREPATH);
// Charge movement is not started when using EVENT_CHARGE_PREPATH
Movement::MoveSplineInit init(_owner);
init.MovebyPath(path.GetPath());
init.SetVelocity(speed);
init.Launch();
}
示例3: MoveCharge
void MotionMaster::MoveCharge(PathGenerator const& path)
{
Vector3 dest = path.GetActualEndPosition();
MoveCharge(dest.x, dest.y, dest.z, SPEED_CHARGE, EVENT_CHARGE_PREPATH);
// Charge movement is not started when using EVENT_CHARGE_PREPATH
int32 timerToDestination = 0;
Movement::MoveSplineInit init(_owner);
init.MovebyPath(path.GetPath());
init.SetVelocity(SPEED_CHARGE);
timerToDestination = init.Launch();
if (_owner->ToPlayer())
_owner->ToPlayer()->SetJumpTimerDestination(timerToDestination + 100);
}
示例4: check_findpath
void check_findpath(PathGenerator& testgen, Coordinate3D<int> start, Coordinate3D<int> end, unsigned int expected_length){
bool pathfound = testgen.findPath(start, end);
CHECK(pathfound == true);
if(pathfound){
std::vector<Coordinate3D<int>> test_path = testgen.getPath();
CHECK(test_path.size() == expected_length);
CHECK(test_path[0] == end);
CHECK(test_path[expected_length-1] == start);
}
// std::cerr << "path: ";
// for(unsigned int i = 0; i < expected_length; i++){
// Util::printErrCoordinate(test_path[i]);
// std::cerr << " ";
// }
// std::cerr << "\n";
}