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(); }
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(); }
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); }
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"; }