本文整理汇总了C++中LoadPath函数的典型用法代码示例。如果您正苦于以下问题:C++ LoadPath函数的具体用法?C++ LoadPath怎么用?C++ LoadPath使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了LoadPath函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: LoadPath
void WaypointMovementGenerator<Creature>::InitializeWaypointPath(Creature& u, int32 id, WaypointPathOrigin wpSource, uint32 initialDelay, uint32 overwriteEntry)
{
LoadPath(u, id, wpSource, overwriteEntry);
i_nextMoveTime.Reset(initialDelay);
// Start moving if possible
StartMove(u);
}
开发者ID:mangostwo,项目名称:server,代码行数:7,代码来源:WaypointMovementGenerator.cpp
示例2: StopPath
void SmartAI::StartPath(bool run, uint32 path, bool repeat, Unit* /*invoker*/)
{
if (me->isInCombat())// no wp movement in combat
{
sLog->outError("SmartAI::StartPath: Creature entry %u wanted to start waypoint movement while in combat, ignoring.", me->GetEntry());
return;
}
if (HasEscortState(SMART_ESCORT_ESCORTING))
StopPath();
if (path)
if (!LoadPath(path))
return;
if (!mWayPoints || mWayPoints->empty())
return;
AddEscortState(SMART_ESCORT_ESCORTING);
mCanRepeatPath = repeat;
SetRun(run);
WayPoint* wp = GetNextWayPoint();
if (wp)
{
me->GetPosition(&mLastOOCPos);
me->GetMotionMaster()->MovePoint(wp->id, wp->x, wp->y, wp->z);
GetScript()->ProcessEventsFor(SMART_EVENT_WAYPOINT_START, NULL, wp->id, GetScript()->GetPathId());
}
}
开发者ID:AdrElecTro,项目名称:TrinityCore,代码行数:28,代码来源:SmartAI.cpp
示例3: LoadPath
void WaypointMovementGenerator<Creature>::Reset(Creature &creature)
{
i_path = NULL;
LoadPath(creature);
SetStoppedByPlayer(false);
i_nextMoveTime.Reset(0);
creature.addUnitState(UNIT_STAT_ROAMING|UNIT_STAT_ROAMING_MOVE);
}
开发者ID:AwkwardDev,项目名称:MangosFX,代码行数:8,代码来源:WaypointMovementGenerator.cpp
示例4: atunnel_InitTunnel
/*=================== Tunnel Initialization ================================*/
struct tunnel_state *
atunnel_InitTunnel(void)
{
struct tunnel_state *st = (struct tunnel_state *) calloc (1, sizeof(*st));
LoadPath(st);
st->current_texture = NRAND(MAX_TEXTURE);
return st;
}
开发者ID:MaddTheSane,项目名称:xscreensaver,代码行数:9,代码来源:tunnel_draw.c
示例5: LoadPath
void WaypointMovementGenerator<Creature>::Initialize(Creature& creature)
{
creature.addUnitState(UNIT_STAT_ROAMING);
creature.clearUnitState(UNIT_STAT_WAYPOINT_PAUSED);
LoadPath(creature);
StartMoveNow(creature);
}
开发者ID:SakhWoW,项目名称:blizzlikecore,代码行数:9,代码来源:WaypointMovementGenerator.cpp
示例6: LoadPath
void
FlightPathMovementGenerator::Initialize(Player &player)
{
player.getHostilRefManager().setOnlineOfflineState(false);
player.addUnitState(UNIT_STAT_IN_FLIGHT);
LoadPath(player);
i_currentNode = 0;
Traveller<Player> traveller(player);
// do not send movement, it was sent already
i_destinationHolder.SetDestination(traveller, i_path[i_currentNode].x, i_path[i_currentNode].y, i_path[i_currentNode].z, false);
}
开发者ID:Artea,项目名称:mangos-svn,代码行数:11,代码来源:WaypointMovementGenerator.cpp
示例7: LoadPath
void WaypointMovementGenerator<Creature>::DoInitialize(Creature* owner)
{
if (!owner)
return;
if (!owner->isAlive())
return;
LoadPath(owner);
owner->AddUnitState(UNIT_STATE_ROAMING | UNIT_STATE_ROAMING_MOVE);
}
开发者ID:concept45,项目名称:Core,代码行数:11,代码来源:WaypointMovementGenerator.cpp
示例8: LoadPath
void FlightPathMovementGenerator::Initialize(Player &player)
{
player.getHostilRefManager().setOnlineOfflineState(false);
player.addUnitState(UNIT_STAT_IN_FLIGHT);
player.SetFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_DISABLE_MOVE | UNIT_FLAG_TAXI_FLIGHT);
LoadPath(player);
Traveller<Player> traveller(player);
// do not send movement, it was sent already
i_destinationHolder.SetDestination(traveller, i_path[i_currentNode].x, i_path[i_currentNode].y, i_path[i_currentNode].z, false);
player.SendMonsterMoveByPath(GetPath(),GetCurrentNode(),GetPathAtMapEnd(),MOVEMENTFLAG_WALK_MODE|MOVEMENTFLAG_ONTRANSPORT);
}
开发者ID:spiritos,项目名称:mangos,代码行数:12,代码来源:WaypointMovementGenerator.cpp
示例9: LoadPath
void FlightPathMovementGenerator::Initialize(Player &player)
{
// Random handlers used for quests etc. - best would be to add FlightPathMovementGenerator::Initialize to sub-script class (Feanor)
if( player.m_taxi.GetTaxiDestination() == 158 || player.m_taxi.GetTaxiDestination() == 243 )
player.SetDisplayId(16587);
player.getHostileRefManager().setOnlineOfflineState(false);
player.addUnitState(UNIT_STAT_IN_FLIGHT);
player.SetFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_DISABLE_MOVE | UNIT_FLAG_TAXI_FLIGHT);
LoadPath(player);
Traveller<Player> traveller(player);
// do not send movement, it was sent already
i_destinationHolder.SetDestination(traveller, i_path[i_currentNode].x, i_path[i_currentNode].y, i_path[i_currentNode].z, false);
player.SendMonsterMoveByPath(GetPath(),GetCurrentNode(),GetPathAtMapEnd(), SplineFlags(SPLINEFLAG_WALKMODE|SPLINEFLAG_FLYING));
}
开发者ID:Lirok,项目名称:mangos,代码行数:16,代码来源:WaypointMovementGenerator.cpp
示例10: LoadPath
void PathBehavior::DoStepPostEvents(RuntimeScene & scene)
{
if(!isPathLoaded)
{
LoadPath(scene);
Reset();
}
if(futureSegment != -1)
{
EnterSegment(futureSegment);
futureSegment = -1;
}
if(futurePosition != -1)
{
timeOnSegment = futurePosition * totalSegmentTime;
futurePosition = -1;
}
}
开发者ID:sanyaade-teachings,项目名称:GD,代码行数:18,代码来源:PathBehavior.cpp
示例11: LoadPath
/**
* Called at each frame before events :
* Position the object on the path
*/
void PathBehavior::DoStepPreEvents(RuntimeScene & scene)
{
if(!isPathLoaded)
{
LoadPath(scene);
Reset();
}
// add to the current time along the path
timeOnSegment += static_cast<double>(scene.GetTimeManager().GetElapsedTime())
/ 1000000.0 * speed;
// if I reached the end of this segment, move to a new segment
if (timeOnSegment >= totalSegmentTime && currentSegment < path.size())
EnterSegment(currentSegment + 1);
//Position object on the segment
sf::Vector2f newPos;
if ( !path.empty() && currentSegment < path.size()-1 )
newPos = offset + path[currentSegment] + (path[currentSegment + 1] - path[currentSegment]) * (timeOnSegment / totalSegmentTime);
else
{
if ( stopAtEnd && !path.empty()) newPos = path.back() + offset;
else if (reverseAtEnd)
{
std::reverse(path.begin(), path.end());
EnterSegment(0);
if (!path.empty()) newPos = path.front() + offset;
}
else
{
EnterSegment(0);
if (!path.empty()) newPos = path.front() + offset;
}
}
object->SetX(newPos.x);
object->SetY(newPos.y);
return;
}
开发者ID:mateerladnam,项目名称:GD,代码行数:45,代码来源:PathBehavior.cpp
示例12: TC_LOG_ERROR
void SmartAI::StartPath(bool run/* = false*/, uint32 pathId/* = 0*/, bool repeat/* = false*/, Unit* invoker/* = nullptr*/, uint32 nodeId/* = 1*/)
{
if (me->IsInCombat()) // no wp movement in combat
{
TC_LOG_ERROR("misc", "SmartAI::StartPath: Creature entry %u wanted to start waypoint movement (%u) while in combat, ignoring.", me->GetEntry(), pathId);
return;
}
if (HasEscortState(SMART_ESCORT_ESCORTING))
StopPath();
SetRun(run);
if (pathId)
{
if (!LoadPath(pathId))
return;
}
if (_path.nodes.empty())
return;
_currentWaypointNode = nodeId;
_waypointPathEnded = false;
_repeatWaypointPath = repeat;
// Do not use AddEscortState, removing everything from previous
_escortState = SMART_ESCORT_ESCORTING;
if (invoker && invoker->GetTypeId() == TYPEID_PLAYER)
{
_escortNPCFlags = me->GetUInt32Value(UNIT_NPC_FLAGS);
me->SetFlag(UNIT_NPC_FLAGS, 0);
}
GetScript()->ProcessEventsFor(SMART_EVENT_WAYPOINT_START, nullptr, _currentWaypointNode, GetScript()->GetPathId());
me->GetMotionMaster()->MovePath(_path, _repeatWaypointPath);
}
开发者ID:lasyan3,项目名称:TrinityCore,代码行数:40,代码来源:SmartAI.cpp
示例13: StopPath
void SmartAI::StartPath(bool run, uint32 path, bool repeat, Unit* invoker)
{
if (me->IsInCombat())// no wp movement in combat
{
sLog->outError("SmartAI::StartPath: Creature entry %u wanted to start waypoint movement while in combat, ignoring.", me->GetEntry());
return;
}
if (HasEscortState(SMART_ESCORT_ESCORTING))
StopPath();
if (path)
{
if (!LoadPath(path))
return;
}
if (!mWayPoints || mWayPoints->empty())
return;
if (WayPoint* wp = GetNextWayPoint())
{
AddEscortState(SMART_ESCORT_ESCORTING);
mCanRepeatPath = repeat;
SetRun(run);
if (invoker && invoker->GetTypeId() == TYPEID_PLAYER)
{
mEscortNPCFlags = me->GetUInt32Value(UNIT_NPC_FLAGS);
me->SetUInt32Value(UNIT_NPC_FLAGS, 0);
}
Movement::PointsArray pathPoints;
GenerateWayPointArray(&pathPoints);
me->GetMotionMaster()->MoveSplinePath(&pathPoints);
GetScript()->ProcessEventsFor(SMART_EVENT_WAYPOINT_START, NULL, wp->id, GetScript()->GetPathId());
}
}
开发者ID:Matt-One,项目名称:azerothcore-wotlk,代码行数:39,代码来源:SmartAI.cpp
示例14: LoadPath
void FlightPathMovementGenerator::Initialize(Player &player)
{
player.getHostileRefManager().setOnlineOfflineState(false);
player.addUnitState(UNIT_STAT_IN_FLIGHT);
player.SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE | UNIT_FLAG_TAXI_FLIGHT);
LoadPath(player);
Traveller<Player> traveller(player);
// do not send movement, it was sent already
i_destinationHolder.SetDestination(traveller, i_path[i_currentNode].x, i_path[i_currentNode].y, i_path[i_currentNode].z, false);
player.SendMonsterMoveByPath(GetPath(), GetCurrentNode(), GetPathAtMapEnd());
// Storage to preload flightmaster grid at end of flight. For multi-stop flights, this will
// be reinitialized for each flightmaster at the end of each spline (or stop) in the flight.
uint32 nodeCount = i_mapIds.size(); // Get the number of nodes in the path. i_path and i_mapIds are the
// same size when loaded in ObjectMgr::GetTaxiPathNodes, called from LoadPath()
m_endMapId = i_mapIds[nodeCount -1]; // Get the map ID from the last node
m_preloadTargetNode = nodeCount - 3; // 2 nodes before the final node, we pre-load the grid
m_endGridX = i_path[nodeCount -1].x; // Get the X position from the last node
m_endGridY = i_path[nodeCount -1].y; // Get tye Y position from the last node
}
开发者ID:ShadowCore,项目名称:ShadowCore,代码行数:23,代码来源:WaypointMovementGenerator.cpp
示例15: TC_LOG_ERROR
void SmartAI::StartPath(bool run, uint32 path, bool repeat, Unit* invoker)
{
if (me->IsInCombat())// no wp movement in combat
{
TC_LOG_ERROR("misc", "SmartAI::StartPath: Creature entry %u wanted to start waypoint movement while in combat, ignoring.", me->GetEntry());
return;
}
if (HasEscortState(SMART_ESCORT_ESCORTING))
StopPath();
SetRun(run);
if (path)
if (!LoadPath(path))
return;
if (_path.nodes.empty())
return;
mCurrentWPID = 1;
m_Ended = false;
// Do not use AddEscortState, removing everything from previous cycle
mEscortState = SMART_ESCORT_ESCORTING;
mCanRepeatPath = repeat;
if (invoker && invoker->GetTypeId() == TYPEID_PLAYER)
{
mEscortNPCFlags = me->GetUInt32Value(UNIT_NPC_FLAGS);
me->SetFlag(UNIT_NPC_FLAGS, 0);
}
GetScript()->ProcessEventsFor(SMART_EVENT_WAYPOINT_START, nullptr, mCurrentWPID, GetScript()->GetPathId());
me->GetMotionMaster()->MovePath(_path, mCanRepeatPath);
}
开发者ID:Carbenium,项目名称:TrinityCore,代码行数:37,代码来源:SmartAI.cpp
示例16: LoadPath
bool CConfigIni::LoadSystem(const CString& systemName, CConfigIni::structSystem& system)
{
//路径
LoadPath(systemName, l_szIniItem_PathData, system.m_szPathData);
LoadPath(systemName, l_szIniItem_PathTask, system.m_szPathTask);
LoadPath(systemName, l_szIniItem_PathSample, system.m_szPathSample);
LoadPath(systemName, l_szIniItem_PathCompound, system.m_szPathCompound);
LoadPath(systemName, l_szIniItem_PathMethod, system.m_szPathMethod);
LoadPath(systemName, l_szIniItem_PathCrystalReport, system.m_szPathCrystalReport);
LoadPath(systemName, l_szIniItem_PathLog, system.m_szPathLog);
//参数
LoadString(systemName, l_szIniItem_DefaultMethod, system.m_szDefaultMethod);
LoadString(systemName, l_szIniItem_Inject, system.m_szInject);
// LoadString(systemName, _T("SCParam"), system.m_szSCParam);
// LoadString(systemName, _T("SysSettings"), system.m_szSysSettings);
LoadString(systemName, l_szIniItem_Instrument, system.m_szInstrument);
//硬件
LoadInt(systemName, l_szIniItem_RGACOM, system.m_iRGACOM);
LoadInt(systemName, l_szIniItem_ValveCOM, system.m_iValveCOM);
LoadInt(systemName, l_szIniItem_PumpCOM, system.m_iPumpCOM);
LoadInt(systemName, l_szIniItem_NextSampleID, system.m_iNextSampleID);
LoadString(systemName, l_szIniItem_WindowName, system.m_szWindowName);
LoadString(systemName, l_szIniItem_ProgramName, system.m_szProgramName);
LoadString(systemName, l_szIniItem_MessageName, system.m_szMessageName);
LoadString(systemName, l_szIniItem_SignalName, system.m_szSignalName);
LoadString(systemName, l_szIniItem_XSLFolder, system.m_szXSLFolder);
if(system.m_szXSLFolder.GetLength())
{
TCHAR c = system.m_szXSLFolder.GetAt(system.m_szXSLFolder.GetLength() - 1);
if(c == '/' || c == '\\') system.m_szXSLFolder.Delete(system.m_szXSLFolder.GetLength() - 1);
}
LoadString(systemName, l_szIniItem_LastTask, system.m_szLastTask);
LoadInt(systemName, l_szIniItem_ShowAutoSampler, system.m_bShowAutoSampler);
return true;
}
开发者ID:Wanghuaichen,项目名称:SignalProcess,代码行数:39,代码来源:Base_AnalysisTemplate.cpp
示例17: main
void main(int argc, char **argv)
{
// init glut
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH | GLUT_MULTISAMPLE);
// create the window
glutCreateWindow("PQP Demo - Falling");
// set OpenGL graphics state -- material props, perspective, etc.
init_viewer_window();
// set the callbacks
glutDisplayFunc(cb_display);
glutMouseFunc(cb_mouse);
glutMotionFunc(cb_motion);
glutKeyboardFunc(cb_keyboard);
glutIdleFunc(cb_idle);
// create models
FILE *fp;
int ntris, i;
double a,b,c;
PQP_REAL p1[3],p2[3],p3[3];
// model 1
torus1_drawn = new Model("torus1.tris");
torus1_tested = new PQP_Model();
fp = fopen("torus1.tris","r");
fscanf(fp,"%d",&ntris);
torus1_tested->BeginModel();
for (i = 0; i < ntris; i++)
{
fscanf(fp,"%lf %lf %lf",&a,&b,&c);
p1[0] = (PQP_REAL)a;
p1[1] = (PQP_REAL)b;
p1[2] = (PQP_REAL)c;
fscanf(fp,"%lf %lf %lf",&a,&b,&c);
p2[0] = (PQP_REAL)a;
p2[1] = (PQP_REAL)b;
p2[2] = (PQP_REAL)c;
fscanf(fp,"%lf %lf %lf",&a,&b,&c);
p3[0] = (PQP_REAL)a;
p3[1] = (PQP_REAL)b;
p3[2] = (PQP_REAL)c;
torus1_tested->AddTri(p1,p2,p3,i);
}
torus1_tested->EndModel();
fclose(fp);
// model 2
torus2_drawn = new Model("torus2.tris");
torus2_tested = new PQP_Model();
fp = fopen("torus2.tris","r");
fscanf(fp,"%d",&ntris);
torus2_tested->BeginModel();
for (i = 0; i < ntris; i++)
{
fscanf(fp,"%lf %lf %lf",&a,&b,&c);
p1[0] = (PQP_REAL)a;
p1[1] = (PQP_REAL)b;
p1[2] = (PQP_REAL)c;
fscanf(fp,"%lf %lf %lf",&a,&b,&c);
p2[0] = (PQP_REAL)a;
p2[1] = (PQP_REAL)b;
p2[2] = (PQP_REAL)c;
fscanf(fp,"%lf %lf %lf",&a,&b,&c);
p3[0] = (PQP_REAL)a;
p3[1] = (PQP_REAL)b;
p3[2] = (PQP_REAL)c;
torus2_tested->AddTri(p1,p2,p3,i);
}
torus2_tested->EndModel();
fclose(fp);
// load paths
LoadPath(R1,T1,"torus1.path");
LoadPath(R2,T2,"torus2.path");
// print instructions
LOG4CXX_INFO(KrisLibrary::logger(),"PQP Demo - Falling:\n"
"Press:\n"
"0 - no proximity query, just animation\n"
//.........这里部分代码省略.........
开发者ID:krishauser,项目名称:KrisLibrary,代码行数:101,代码来源:main.cpp
示例18: LoadPath
void WaypointMovementGenerator<Creature>::DoInitialize(Creature* creature)
{
LoadPath(creature);
creature->AddUnitState(UNIT_STATE_ROAMING|UNIT_STATE_ROAMING_MOVE);
}
开发者ID:Helias,项目名称:azerothcore-wotlk,代码行数:5,代码来源:WaypointMovementGenerator.cpp
示例19: LoadPath
void WaypointMovementGenerator<Creature>::DoInitialize(Creature* creature)
{
LoadPath(creature);
}
开发者ID:090809,项目名称:TrinityCore,代码行数:4,代码来源:WaypointMovementGenerator.cpp
示例20: ReadPortType
void
Profile::GetDeviceConfig(const ProfileMap &map, unsigned n,
DeviceConfig &config)
{
char buffer[64];
bool have_port_type = ReadPortType(map, n, config.port_type);
MakeDeviceSettingName(buffer, "Port", n, "BluetoothMAC");
map.Get(buffer, config.bluetooth_mac);
MakeDeviceSettingName(buffer, "Port", n, "IOIOUartID");
map.Get(buffer, config.ioio_uart_id);
MakeDeviceSettingName(buffer, "Port", n, "IPAddress");
if (!map.Get(buffer, config.ip_address))
config.ip_address.clear();
MakeDeviceSettingName(buffer, "Port", n, "TCPPort");
if (!map.Get(buffer, config.tcp_port))
config.tcp_port = 4353;
config.path.clear();
if ((!have_port_type ||
config.port_type == DeviceConfig::PortType::SERIAL) &&
!LoadPath(map, config, n) && LoadPortIndex(map, config, n))
config.port_type = DeviceConfig::PortType::SERIAL;
MakeDeviceSettingName(buffer, "Port", n, "BaudRate");
if (!map.Get(buffer, config.baud_rate)) {
/* XCSoar before 6.2 used to store a "speed index", not the real
baud rate - try to import the old settings */
static constexpr unsigned speed_index_table[] = {
1200,
2400,
4800,
9600,
19200,
38400,
57600,
115200
};
MakeDeviceSettingName(buffer, "Speed", n, "Index");
unsigned speed_index;
if (map.Get(buffer, speed_index) &&
speed_index < ARRAY_SIZE(speed_index_table))
config.baud_rate = speed_index_table[speed_index];
}
MakeDeviceSettingName(buffer, "Port", n, "BulkBaudRate");
if (!map.Get(buffer, config.bulk_baud_rate))
config.bulk_baud_rate = 0;
strcpy(buffer, "DeviceA");
buffer[strlen(buffer) - 1] += n;
map.Get(buffer, config.driver_name);
MakeDeviceSettingName(buffer, "Port", n, "Enabled");
map.Get(buffer, config.enabled);
MakeDeviceSettingName(buffer, "Port", n, "SyncFromDevice");
map.Get(buffer, config.sync_from_device);
MakeDeviceSettingName(buffer, "Port", n, "SyncToDevice");
map.Get(buffer, config.sync_to_device);
MakeDeviceSettingName(buffer, "Port", n, "K6Bt");
map.Get(buffer, config.k6bt);
MakeDeviceSettingName(buffer, "Port", n, "I2C_Bus");
map.Get(buffer, config.i2c_bus);
MakeDeviceSettingName(buffer, "Port", n, "I2C_Addr");
map.Get(buffer, config.i2c_addr);
MakeDeviceSettingName(buffer, "Port", n, "PressureUse");
map.GetEnum(buffer, config.press_use);
MakeDeviceSettingName(buffer, "Port", n, "SensorOffset");
map.Get(buffer, config.sensor_offset);
MakeDeviceSettingName(buffer, "Port", n, "SensorFactor");
map.Get(buffer, config.sensor_factor);
MakeDeviceSettingName(buffer, "Port", n, "UseSecondDevice");
map.Get(buffer, config.use_second_device);
MakeDeviceSettingName(buffer, "Port", n, "SecondDevice");
map.Get(buffer, config.driver2_name);
}
开发者ID:kwtskran,项目名称:XCSoar,代码行数:92,代码来源:DeviceConfig.cpp
注:本文中的LoadPath函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论