当前位置: 首页>>代码示例>>C++>>正文


C++ PathGenerator类代码示例

本文整理汇总了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();
}
开发者ID:Caydan,项目名称:DeathCore,代码行数:11,代码来源:MotionMaster.cpp

示例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();
}
开发者ID:alex1kiss,项目名称:LegacyCore_6.x.x,代码行数:12,代码来源:MotionMaster.cpp

示例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);
}
开发者ID:Jildor,项目名称:4.3.4-Core,代码行数:17,代码来源:MotionMaster.cpp

示例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";
	}
开发者ID:SpaghettiWestern,项目名称:SpaghettiWestern,代码行数:18,代码来源:PathGenerator_tests.cpp


注:本文中的PathGenerator类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。