• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ LocationVector函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中LocationVector函数的典型用法代码示例。如果您正苦于以下问题:C++ LocationVector函数的具体用法?C++ LocationVector怎么用?C++ LocationVector使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了LocationVector函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: switch

void EyeOfTheStorm::DropFlag2(Player* plr, uint32 id)
{
	if(m_flagHolder != plr->GetLowGUID())
		return;

	switch(id)
	{
		case 4476:			// Blood Elf Tower
			m_dropFlag->SetPosition(LocationVector(2048.83f, 1393.65f, 1194.49f, 0.20944f));
			break;
		case 4514:			// Fel Reaver Tower
			m_dropFlag->SetPosition(LocationVector(2044.28f, 1729.68f, 1189.96f, -0.017453f));
			break;
		case 4518:			// Draenei Tower
			m_dropFlag->SetPosition(LocationVector(2286.56f, 1402.36f, 1197.11f, 3.72381f));
			break;
		case 4516:			// Mage Tower
			m_dropFlag->SetPosition(LocationVector(2284.48f, 1731.23f, 1189.99f, 2.89725f));
			break;
		default:
			m_dropFlag->SetPosition(plr->GetPosition());
			break;
	}

	plr->CastSpell(plr, 42792, true);

	m_dropFlag->SetUInt32Value(GAMEOBJECT_FLAGS, 1);
	m_dropFlag->PushToWorld(m_mapMgr);
	m_flagHolder = 0;
	sEventMgr.AddEvent(this, &EyeOfTheStorm::EventResetFlag, EVENT_EOTS_RESET_FLAG, 10000, 1, EVENT_FLAG_DO_NOT_EXECUTE_IN_WORLD_CONTEXT);
}
开发者ID:lev1976g,项目名称:NoxicCore,代码行数:31,代码来源:EyeOfTheStorm.cpp


示例2: uint32

void IsleOfConquest::BuildWorkshopVehicle(uint32 delay)
{
    sEventMgr.RemoveEvents(this, EVENT_IOC_BUILD_WORKSHOP_VEHICLE);

    if (delay != 0)
    {
        sEventMgr.AddEvent(this, &IsleOfConquest::BuildWorkshopVehicle, uint32(0), EVENT_IOC_BUILD_WORKSHOP_VEHICLE, delay, 1, 0);
        return;
    }

    ControlPointTypes state = controlpoint[IOC_CONTROL_POINT_WORKSHOP].state;

    switch (state)
    {
        case IOC_SPAWN_TYPE_ALLIANCE_CONTROLLED:
            workshopvehicle[TEAM_ALLIANCE].baselocation = LocationVector(773.72f, -884.15f, 16.727f, 1.553f);
            workshopvehicle[TEAM_ALLIANCE].c = SpawnCreature(34776, workshopvehicle[TEAM_ALLIANCE].baselocation, 1);
            break;

        case IOC_SPAWN_TYPE_HORDE_CONTROLLED:
            workshopvehicle[TEAM_HORDE].baselocation = LocationVector(773.72f, -884.15f, 16.727f, 1.553f);
            workshopvehicle[TEAM_HORDE].c = SpawnCreature(35069, workshopvehicle[TEAM_HORDE].baselocation, 2);
            break;
    }
}
开发者ID:Lbniese,项目名称:AscEmu,代码行数:25,代码来源:IsleOfConquest.cpp


示例3: LocationVector

LocationVector IsleOfConquest::GetStartingCoords(uint32 Team)
{
        if(Team)                // Horde
                return LocationVector(1264.06f, -736.73f, 48.91f, 3.07f);
        else                    // Alliance
                return LocationVector(303.22f, -857.02f, 48.91f, 5.99f);
}
开发者ID:Declipe,项目名称:AscEmu,代码行数:7,代码来源:IsleOfConquest.cpp


示例4: LocationVector

LocationVector RuinsOfLordaeron::GetStartingCoords( uint32 Team ){
	if(Team)
		return LocationVector(1277.105103f, 1743.956177f, 31.603209f);
	else
		return LocationVector(1295.322388f, 1585.953369f, 31.605387f);

}
开发者ID:Antares84,项目名称:arcemu,代码行数:7,代码来源:RuinsOfLordaeron.cpp


示例5: LocationVector

LocationVector WarsongGulch::GetStartingCoords(uint32 Team)
{
	if(Team)		// Horde
		return LocationVector(933.989685f, 1430.735840f, 345.537140f, 3.141593f);
	else			// Alliance
		return LocationVector(1519.530273f, 1481.868408f, 352.023743f, 3.141593f);
}
开发者ID:AegisEmu,项目名称:AegisEmu,代码行数:7,代码来源:WarsongGulch.cpp


示例6: LocationVector

LocationVector CircleOfBlood::GetStartingCoords(uint32 Team)
{
    if (Team)
        return LocationVector(6292.032227f, 287.570343f, 5.003577f);
    else
        return LocationVector(6184.806641f, 236.643463f, 5.037095f);
}
开发者ID:master312,项目名称:AscEmu,代码行数:7,代码来源:CircleOfBlood.cpp


示例7: LocationVector

LocationVector DalaranSewers::GetStartingCoords(uint32 Team)
{
    if (Team)
        return LocationVector(1363.3609f, 817.3569f, 14.8128f);
    else
        return LocationVector(1219.5115f, 765.0264f, 14.8253f);
}
开发者ID:lev1976g,项目名称:AscEmu,代码行数:7,代码来源:DalaranSewers.cpp


示例8: LocationVector

LocationVector RingOfTrials::GetStartingCoords(uint32 Team)
{
    if (Team)
        return LocationVector(4027.004883f, 2976.964844f, 11.600499f);
    else
        return LocationVector(4085.861328f, 2866.750488f, 12.417445f);
}
开发者ID:AriDEV,项目名称:AscEmu,代码行数:7,代码来源:RingOfTrials.cpp


示例9: LocationVector

LocationVector ArathiBasin::GetStartingCoords(uint32 Team)
{
	if(Team)
		return LocationVector(684.75629f, 681.945007f, -12.915456f, 0.881211f);
	else
		return LocationVector(1314.932495f, 1311.246948f, -9.00952f, 3.802896f);
}
开发者ID:Carbinfibre,项目名称:Script-Land,代码行数:7,代码来源:ArathiBasin.cpp


示例10: LocationVector

LocationVector EyeOfTheStorm::GetStartingCoords(uint32 Team)
{
	return LocationVector(EOTSStartLocations[Team][0],
	                      EOTSStartLocations[Team][1],
	                      EOTSStartLocations[Team][2],
	                      EOTSStartLocations[Team][3]);
}
开发者ID:lev1976g,项目名称:NoxicCore,代码行数:7,代码来源:EyeOfTheStorm.cpp


示例11: RedSystemMessage

bool ChatHandler::HandleTriggerCommand(const char* args, WorldSession* m_session)
{
	if(!args)
	{
		RedSystemMessage(m_session, "No information was provided.");
		return true;
	}
	int32 instance_id;
	uint32 trigger_id;
	int valcount = sscanf(args, "%u %d", (unsigned int*)&trigger_id, (int*)&instance_id);
	if(valcount < 1)
		return false;
	if(valcount == 1)
		instance_id = 0;

	AreaTriggerEntry* entry = dbcAreaTrigger.LookupEntryForced(trigger_id);
	if(trigger_id == 0 || entry == NULL)
	{
		RedSystemMessage(m_session, "Could not find trigger %s", args);
		return true;
	}

	m_session->GetPlayer()->SafeTeleport(entry->mapid, instance_id, LocationVector(entry->x, entry->y,
	                                     entry->z, entry->o));

	BlueSystemMessage(m_session, "Teleported to trigger %u on [%u][%.2f][%.2f][%.2f]", entry->id,
	                  entry->mapid, entry->x, entry->y, entry->z);
	return true;
}
开发者ID:dberga,项目名称:arcbliz,代码行数:29,代码来源:Level1.cpp


示例12: LocationVector

LocationVector StrandOfTheAncients::GetStartingCoords(uint32 Team)
{
	uint32 sTeam = ( Team == Attackers ? 1 : 0 );
	return LocationVector( SOTAStartLocations[sTeam][0], 
		SOTAStartLocations[sTeam][1],
		SOTAStartLocations[sTeam][2] );
}
开发者ID:Bootz,项目名称:arcticdev,代码行数:7,代码来源:StrandOfTheAncients.cpp


示例13: GnomishTransporter

bool GnomishTransporter(uint32 i, Spell *pSpell)
{
	if(!pSpell->p_caster) return true;

	pSpell->p_caster->EventAttackStop();
	pSpell->p_caster->SafeTeleport(1, 0, LocationVector(-7169.41f, -3838.63f, 8.72f));
	return true;
}
开发者ID:Bootz,项目名称:arcticdev,代码行数:8,代码来源:ItemSpells.cpp


示例14: uint32

bool ChatHandler::HandleRecallPortPlayerCommand(const char* args, WorldSession * m_session)
{
	char location[255];
	char player[255];
	if(sscanf(args, "%s %s", player, location) != 2)
		return false;

	Player * plr = objmgr.GetPlayer(player, false);
	if(!plr) return false;

	QueryResult *result = WorldDatabase.Query( "SELECT * FROM recall ORDER BY name" );
	if(!result)
		return false;

	do
	{
		Field *fields = result->Fetch();
		const char * locname = fields[1].GetString();
		uint32 locmap = fields[2].GetUInt32();
		float x = fields[3].GetFloat();
		float y = fields[4].GetFloat();
		float z = fields[5].GetFloat();
		float o = fields[6].GetFloat();

		if (strnicmp((char*)location,locname,strlen(args))==0)
		{	//Added Orientation and a rank/invis check for a "ported to" message. --Hemi
			sGMLog.writefromsession( m_session, "ported %s to %s ( Map: %u, X: %f, Y: %f, Z: %f, O: %f )", plr->GetName(), locname, locmap, x, y, z, o );
			if(plr->GetSession() && (plr->GetSession()->CanUseCommand('a') || !m_session->GetPlayer()->m_isGmInvisible))
				plr->GetSession()->SystemMessage("%s teleported you to location %s!", m_session->GetPlayer()->GetName(), locname);

			if(plr->GetInstanceID() != m_session->GetPlayer()->GetInstanceID())
				sEventMgr.AddEvent(plr, &Player::EventSafeTeleport, locmap, uint32(0), LocationVector(x, y, z, o), EVENT_PLAYER_TELEPORT, 1, 1,EVENT_FLAG_DO_NOT_EXECUTE_IN_WORLD_CONTEXT);
			else
				plr->SafeTeleport(locmap, 0, LocationVector(x, y, z, o));
			delete result;
			return true;
		}
	}
	while (result->NextRow());

	delete result;
	return false;
}
开发者ID:Naqvamp,项目名称:Sandbox,代码行数:43,代码来源:RecallCommands.cpp


示例15: SimCommand

//*NOTE: HORRIBLE bug in GCC 3.x Linux causes a call to cin.seekg() to irreversably corrupt the input stream!
//So I've changed all the cins to use C-style stdin.
bool SimCommand(string &sCommand)
{
	if(fLeftOvers)
	{
		fseek(stdin, 0, SEEK_END);
		fLeftOvers = false;
	}

	cout << "sim> ";
	fflush(NULL);

	//Temporary string storage
	char sTempBuff[MAX_LINE+2];
	char sMessageBuffer[64];
	bool fRetVal = true;

	sTempBuff[MAX_LINE+1] = 1;
	//get a line from the assembly file
	fgets(sTempBuff, MAX_LINE+1, stdin);
	//*NOTE: MSVC's STL version of get() sets the failbit if it gets no characters.
	if(!sTempBuff[0])
		clearerr(stdin);
	fseek(stdin, 0, SEEK_END);

	if(ferror(stdin))
	{
		SimCallBack(Fatal, "Error reading command.");
		clearerr(stdin);
		return false;
	}
	if(feof(stdin))
		clearerr(stdin);
	
	//Check to see if the line was too long
	if(!sTempBuff[MAX_LINE+1])
	{
		sTempBuff[MAX_LINE] = 0;
		sprintf(sMessageBuffer, "Line exceeds %u characters. Excess ignored.", MAX_LINE);
		SimCallBack(Warning, sMessageBuffer);
	}

	//Return the input
	string sTemp = sTempBuff;
	sTemp = sTemp.substr(0, sTemp.find_first_of("\x0A\x0D\x04\xFF"));

	//Check to see if we should run the translator on it
	if(Flags.fOldLC3)
	{
		sCommand = "";
		if(!AsmConvertLC3Line(sTemp, sCommand, LocationVector(), SimMessageCallBack))
			return false;
	}

	return true;
}
开发者ID:bjackson,项目名称:LC3Tools,代码行数:57,代码来源:SimUI.cpp


示例16: uint32

bool ChatHandler::HandleRecallPortPlayerCommand(const char* args, WorldSession * m_session)
{
	char location[255];
	char player[255];
	if(sscanf(args, "%s %s", player, location) != 2)
		return false;

	Player * plr = objmgr.GetPlayer(player, false);
	if(!plr) return false;

	QueryResult *result = WorldDatabase.Query( "SELECT * FROM recall ORDER BY name" );
	if(!result)
		return false;

	do
	{
		Field *fields = result->Fetch();
		const char * locname = fields[1].GetString();
		uint32 locmap = fields[2].GetUInt32();
		float x = fields[3].GetFloat();
		float y = fields[4].GetFloat();
		float z = fields[5].GetFloat();

		if (strnicmp((char*)location,locname,strlen(args))==0)
		{
			sGMLog.writefromsession( m_session, "ported %s to %s ( map: %u, x: %f, y: %f, z: %f )", plr->GetName(), locname, locmap, x, y, z );
			if(plr->GetInstanceID() != m_session->GetPlayer()->GetInstanceID())
				sEventMgr.AddEvent(plr, &Player::EventSafeTeleport, locmap, uint32(0), LocationVector(x, y, z), EVENT_PLAYER_TELEPORT, 1, 1,EVENT_FLAG_DO_NOT_EXECUTE_IN_WORLD_CONTEXT);
			else
				plr->SafeTeleport(locmap, 0, LocationVector(x, y, z));
			delete result;
			return true;
		}

	}while (result->NextRow());

	delete result;
	return false;
}
开发者ID:Chero,项目名称:abcwow,代码行数:39,代码来源:RecallCommands.cpp


示例17: LocationVector

	inline LocationVector VMapManager::convertPositionToMangosRep(Vector3 & src) const
	{
		float pos[3];
		pos[0] = src.z;
		pos[1] = src.x;
		pos[2] = src.y;
		double full = 64.0*533.33333333;
		double mid = full/2.0;
		pos[0] = -((mid+pos[0])-full);
		pos[1] = -((mid+pos[1])-full);

		return LocationVector(pos[0], pos[1], pos[2]);
	}
开发者ID:AegisEmu,项目名称:AegisEmu,代码行数:13,代码来源:VMapManager.cpp


示例18: switch

LocationVector Arena::GetStartingCoords(uint32 Team)
{
	// 559, 562, 572
	/*
	A start
	H start
	Repop
	572 1295.322388 1585.953369 31.605387
	572 1277.105103 1743.956177 31.603209
	572 1286.112061 1668.334961 39.289127

	562 6184.806641 236.643463 5.037095
	562 6292.032227 287.570343 5.003577
	562 6241.171875 261.067322 0.891833

	559 4085.861328 2866.750488 12.417445
	559 4027.004883 2976.964844 11.600499
	559 4057.042725 2918.686523 13.051933
	*/
	switch(m_mapMgr->GetMapId())
	{
		/* loraedeon */
	case 572:
		{
			if(Team)
				return LocationVector(1277.105103f, 1743.956177f, 31.603209f);
			else
				return LocationVector(1295.322388f, 1585.953369f, 31.605387f);
		}break;

		/* blades edge arena */
	case 562:
		{
			if(Team)
				return LocationVector(6292.032227f, 287.570343f, 5.003577f);
			else
				return LocationVector(6184.806641f, 236.643463f, 5.037095f);
		}break;

		/* nagrand arena */
	case 559:
		{
			if(Team)
				return LocationVector(4027.004883f, 2976.964844f, 11.600499f);
			else
				return LocationVector(4085.861328f, 2866.750488f, 12.417445f);
		}break;
	}

	return LocationVector(0,0,0,0);
}
开发者ID:pfchrono,项目名称:rs-ascent,代码行数:51,代码来源:Arenas.cpp


示例19: LocationVector

bool ChatHandler::HandleRecallGoCommand(const char* args, WorldSession *m_session)
{
	if( args == NULL )
		return false;

	if( !*args )
		return false;

	if( m_session == NULL )
		return false;

	QueryResult *result = WorldDatabase.Query( "SELECT * FROM recall ORDER BY name" );

	if( result == NULL)
		return false;

	do
	{
		Field* fields = result->Fetch();
		const char* locname = fields[1].GetString();
		uint32 locmap = fields[2].GetUInt32();
		float x = fields[3].GetFloat();
		float y = fields[4].GetFloat();
		float z = fields[5].GetFloat();

		if( strnicmp( const_cast< char* >( args ), locname, strlen( args ) ) == 0 )
		{
			if( m_session->GetPlayer() != NULL )
			{
				m_session->GetPlayer()->SafeTeleportDelayed( locmap, 0, LocationVector(x, y, z) );
				delete result;
				result = NULL;
				return true;
			}
			else
			{
				delete result;
				result = NULL;
				return false;
			}
		}

	}while (result->NextRow());

	delete result;
	result = NULL;
	return false;
}
开发者ID:AtVirus,项目名称:Descent-core,代码行数:48,代码来源:RecallCommands.cpp


示例20: getSelectedChar

bool ChatHandler::HandleStartCommand(const char* /*args*/, WorldSession* m_session)
{
    Player* pPlayer = getSelectedChar(m_session, false);
    if (!pPlayer)
        return false;

    uint8 raceid = pPlayer->getRace();
    uint8 classid = pPlayer->getClass();

    // find the first matching one
    PlayerCreateInfo* info = objmgr.GetPlayerCreateInfo(raceid, classid);
    if (!info)
    {
        RedSystemMessage(m_session, "Internal error: Could not find create info for race %u and class %u.", raceid, classid);
        return false;
    }

    GreenSystemMessage(m_session, "Teleporting %s to starting location.", pPlayer->GetName());

    if (pPlayer->SafeTeleport(info->mapId, 0, LocationVector(info->positionX, info->positionY, info->positionZ)))
        return true;
    return false;
}
开发者ID:lev1976g,项目名称:easywow,代码行数:23,代码来源:Level0.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ Lock函数代码示例发布时间:2022-05-30
下一篇:
C++ Location函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap