From d04d6750a21215758a68a2bc0384689d54382fd6 Mon Sep 17 00:00:00 2001 From: "Michael Cook (mackal)" Date: Wed, 15 Mar 2017 13:22:45 -0400 Subject: [PATCH 01/28] Allow base damage of 0 (ex slam) min damage done to 1 --- common/skills.cpp | 27 +++++++++++++++++++++++++++ common/skills.h | 1 + zone/attack.cpp | 18 ++++++++++-------- zone/bot.cpp | 6 +++--- zone/special_attacks.cpp | 10 +++++----- 5 files changed, 46 insertions(+), 16 deletions(-) diff --git a/common/skills.cpp b/common/skills.cpp index 6cb063e2e..947861163 100644 --- a/common/skills.cpp +++ b/common/skills.cpp @@ -148,6 +148,33 @@ int32 EQEmu::skills::GetBaseDamage(SkillType skill) } } +bool EQEmu::skills::IsMeleeDmg(SkillType skill) +{ + switch (skill) { + case Skill1HBlunt: + case Skill1HSlashing: + case Skill2HBlunt: + case Skill2HSlashing: + case SkillBackstab: + case SkillBash: + case SkillDragonPunch: + case SkillEagleStrike: + case SkillFlyingKick: + case SkillHandtoHand: + case SkillKick: + case Skill1HPiercing: + case SkillRiposte: + case SkillRoundKick: + case SkillThrowing: + case SkillTigerClaw: + case SkillFrenzy: + case Skill2HPiercing: + return true; + default: + return false; + } +} + const std::map& EQEmu::skills::GetSkillTypeMap() { /* VS2013 code diff --git a/common/skills.h b/common/skills.h index 572b8c59f..43a31ed15 100644 --- a/common/skills.h +++ b/common/skills.h @@ -167,6 +167,7 @@ namespace EQEmu bool IsBardInstrumentSkill(SkillType skill); bool IsCastingSkill(SkillType skill); int32 GetBaseDamage(SkillType skill); + bool IsMeleeDmg(SkillType skill); extern const std::map& GetSkillTypeMap(); diff --git a/zone/attack.cpp b/zone/attack.cpp index 38e8bed34..6740b5c29 100644 --- a/zone/attack.cpp +++ b/zone/attack.cpp @@ -866,11 +866,9 @@ void Mob::MeleeMitigation(Mob *attacker, DamageHitInfo &hit, ExtraAttackOptions auto roll = RollD20(hit.offense, mitigation); - // +0.5 for rounding - hit.damage_done = static_cast(roll * static_cast(hit.base_damage) + 0.5); + // +0.5 for rounding, min to 1 dmg + hit.damage_done = std::max(static_cast(roll * static_cast(hit.base_damage) + 0.5), 1); - if (hit.damage_done < 0) - hit.damage_done = 0; Log.Out(Logs::Detail, Logs::Attack, "mitigation %d vs offense %d. base %d rolled %f damage %d", mitigation, hit.offense, hit.base_damage, roll, hit.damage_done); } @@ -1207,7 +1205,7 @@ void Mob::DoAttack(Mob *other, DamageHitInfo &hit, ExtraAttackOptions *opts) if (strike_through && zone->random.Roll(strike_through)) { Message_StringID(MT_StrikeThrough, STRIKETHROUGH_STRING); // You strike through your opponents defenses! - hit.damage_done = 0; // set to zero, we will check this to continue + hit.damage_done = 1; // set to one, we will check this to continue } // I'm pretty sure you can riposte a riposte if (hit.damage_done == DMG_RIPOSTED) { @@ -1218,7 +1216,7 @@ void Mob::DoAttack(Mob *other, DamageHitInfo &hit, ExtraAttackOptions *opts) Log.Out(Logs::Detail, Logs::Combat, "Avoided/strikethrough damage with code %d", hit.damage_done); } - if (hit.damage_done == 0) { + if (hit.damage_done >= 0) { if (other->CheckHitChance(this, hit)) { other->MeleeMitigation(this, hit, opts); if (hit.damage_done > 0) { @@ -1297,7 +1295,7 @@ bool Client::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, b Log.Out(Logs::Detail, Logs::Combat, "Attacking with %s in slot %d using skill %d", weapon?weapon->GetItem()->Name:"Fist", Hand, my_hit.skill); // Now figure out damage - my_hit.damage_done = 0; + my_hit.damage_done = 1; my_hit.min_damage = 0; uint8 mylevel = GetLevel() ? GetLevel() : 1; uint32 hate = 0; @@ -1784,7 +1782,7 @@ bool NPC::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, bool DamageHitInfo my_hit; my_hit.skill = EQEmu::skills::SkillHandtoHand; my_hit.hand = Hand; - my_hit.damage_done = 0; + my_hit.damage_done = 1; if (Hand == EQEmu::inventory::slotPrimary) { my_hit.skill = static_cast(GetPrimSkill()); OffHandAtk(false); @@ -4465,6 +4463,10 @@ void Mob::ApplyDamageTable(DamageHitInfo &hit) if (hit.offense < 115) return; + // things that come out to 1 dmg seem to skip this (ex non-bash slam classes) + if (hit.damage_done < 2) + return; + auto &damage_table = GetDamageTable(); if (zone->random.Roll(damage_table.chance)) diff --git a/zone/bot.cpp b/zone/bot.cpp index bdb8cd627..6ce4210b3 100644 --- a/zone/bot.cpp +++ b/zone/bot.cpp @@ -3919,9 +3919,9 @@ bool Bot::Attack(Mob* other, int Hand, bool FromRiposte, bool IsStrikethrough, b DamageHitInfo my_hit; AttackAnimation(my_hit.skill, Hand, weapon); Log.Out(Logs::Detail, Logs::Combat, "Attacking with %s in slot %d using skill %d", weapon?weapon->GetItem()->Name:"Fist", Hand, my_hit.skill); - + // Now figure out damage - my_hit.damage_done = 0; + my_hit.damage_done = 1; my_hit.min_damage = 0; uint8 mylevel = GetLevel() ? GetLevel() : 1; uint32 hate = 0; @@ -5046,7 +5046,7 @@ void Bot::DoSpecialAttackDamage(Mob *who, EQEmu::skills::SkillType skill, int32 DamageHitInfo my_hit; my_hit.base_damage = max_damage; my_hit.min_damage = min_damage; - my_hit.damage_done = 0; + my_hit.damage_done = 1; my_hit.skill = skill; my_hit.offense = offense(my_hit.skill); diff --git a/zone/special_attacks.cpp b/zone/special_attacks.cpp index d65d5ad35..fa91fdf73 100644 --- a/zone/special_attacks.cpp +++ b/zone/special_attacks.cpp @@ -142,7 +142,7 @@ void Mob::DoSpecialAttackDamage(Mob *who, EQEmu::skills::SkillType skill, int32 return; DamageHitInfo my_hit; - my_hit.damage_done = 0; + my_hit.damage_done = 1; // min 1 dmg my_hit.base_damage = base_damage; my_hit.min_damage = min_damage; my_hit.skill = skill; @@ -847,7 +847,7 @@ void Mob::DoArcheryAttackDmg(Mob *other, const EQEmu::ItemInstance *RangeWeapon, DamageHitInfo my_hit; my_hit.base_damage = MaxDmg; my_hit.min_damage = 0; - my_hit.damage_done = 0; + my_hit.damage_done = 1; my_hit.skill = EQEmu::skills::SkillArchery; my_hit.offense = offense(my_hit.skill); @@ -1179,7 +1179,7 @@ void NPC::DoRangedAttackDmg(Mob* other, bool Launch, int16 damage_mod, int16 cha DamageHitInfo my_hit; my_hit.base_damage = MaxDmg; my_hit.min_damage = MinDmg; - my_hit.damage_done = 0; + my_hit.damage_done = 1; my_hit.skill = skill; my_hit.offense = offense(my_hit.skill); @@ -1360,7 +1360,7 @@ void Mob::DoThrowingAttackDmg(Mob *other, const EQEmu::ItemInstance *RangeWeapon DamageHitInfo my_hit; my_hit.base_damage = WDmg; my_hit.min_damage = 0; - my_hit.damage_done = 0; + my_hit.damage_done = 1; my_hit.skill = EQEmu::skills::SkillThrowing; my_hit.offense = offense(my_hit.skill); @@ -2117,7 +2117,7 @@ void Mob::DoMeleeSkillAttackDmg(Mob *other, uint16 weapon_damage, EQEmu::skills: DamageHitInfo my_hit; my_hit.base_damage = weapon_damage; my_hit.min_damage = 0; - my_hit.damage_done = 0; + my_hit.damage_done = 1; my_hit.skill = skillinuse; my_hit.offense = offense(my_hit.skill); From 23bc535e23c336931335df2554a04abd6d06fe35 Mon Sep 17 00:00:00 2001 From: "Michael Cook (mackal)" Date: Wed, 15 Mar 2017 15:07:28 -0400 Subject: [PATCH 02/28] Tweaks to most likely wrong PVP damage reduction --- zone/attack.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/zone/attack.cpp b/zone/attack.cpp index 6740b5c29..b0c056b30 100644 --- a/zone/attack.cpp +++ b/zone/attack.cpp @@ -1435,13 +1435,15 @@ void Client::Damage(Mob* other, int32 damage, uint16 spell_id, EQEmu::skills::Sk // cut all PVP spell damage to 2/3 // Blasting ourselfs is considered PvP //Don't do PvP mitigation if the caster is damaging himself + //should this be applied to all damage? comments sound like some is for spell DMG + //patch notes on PVP reductions only mention archery/throwing ... not normal dmg if(other && other->IsClient() && (other != this) && damage > 0) { int PvPMitigation = 100; - if (attack_skill == EQEmu::skills::SkillArchery) + if (attack_skill == EQEmu::skills::SkillArchery || attack_skill == EQEmu::skills::SkillThrowing) PvPMitigation = 80; else PvPMitigation = 67; - damage = (damage * PvPMitigation) / 100; + damage = std::max((damage * PvPMitigation) / 100, 1); } if(!ClientFinishedLoading()) @@ -3197,7 +3199,7 @@ void Mob::CommonDamage(Mob* attacker, int &damage, const uint16 spell_id, const if (!ignore_invul && (GetInvul() || DivineAura())) { Log.Out(Logs::Detail, Logs::Combat, "Avoiding %d damage due to invulnerability.", damage); - damage = -5; + damage = DMG_INVULNERABLE; } if( spell_id != SPELL_UNKNOWN || attacker == nullptr ) From e7785d56930ff584331d1d4b26c779060fea3cff Mon Sep 17 00:00:00 2001 From: "Michael Cook (mackal)" Date: Wed, 15 Mar 2017 15:25:42 -0400 Subject: [PATCH 03/28] Bash dmg should return 0 with no item (slam) --- zone/special_attacks.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/zone/special_attacks.cpp b/zone/special_attacks.cpp index fa91fdf73..a5cae5700 100644 --- a/zone/special_attacks.cpp +++ b/zone/special_attacks.cpp @@ -94,6 +94,8 @@ int Mob::GetBaseSkillDamage(EQEmu::skills::SkillType skill, Mob *target) } if (inst) ac_bonus = inst->GetItemArmorClass(true) / 25.0f; + else + return 0; // return 0 in cases where we don't have an item if (ac_bonus > skill_bonus) ac_bonus = skill_bonus; return static_cast(ac_bonus + skill_bonus); From fbb13ec4169fb37b55c23576b44c375efd2e52ba Mon Sep 17 00:00:00 2001 From: "Michael Cook (mackal)" Date: Thu, 16 Mar 2017 12:52:58 -0400 Subject: [PATCH 04/28] bug found by clang 4 --- zone/command.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zone/command.cpp b/zone/command.cpp index 307b4e949..dfe6b10e7 100644 --- a/zone/command.cpp +++ b/zone/command.cpp @@ -10686,7 +10686,7 @@ void command_logs(Client *c, const Seperator *sep){ /* We use a general 'is_category_enabled' now, let's update when we update any output settings This is used in hot places of code to check if its enabled in any way before triggering logs */ - if (sep->arg[4] > 0){ + if (atoi(sep->arg[4] > 0){ Log.log_settings[atoi(sep->arg[3])].is_category_enabled = 1; } else{ From 153e587ceaf1e6e759a3c3766548b4bfdb38e9b3 Mon Sep 17 00:00:00 2001 From: "Michael Cook (mackal)" Date: Thu, 16 Mar 2017 12:56:21 -0400 Subject: [PATCH 05/28] Not sure how that happened --- zone/command.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zone/command.cpp b/zone/command.cpp index dfe6b10e7..2a22bc82c 100644 --- a/zone/command.cpp +++ b/zone/command.cpp @@ -10686,7 +10686,7 @@ void command_logs(Client *c, const Seperator *sep){ /* We use a general 'is_category_enabled' now, let's update when we update any output settings This is used in hot places of code to check if its enabled in any way before triggering logs */ - if (atoi(sep->arg[4] > 0){ + if (atoi(sep->arg[4]) > 0){ Log.log_settings[atoi(sep->arg[3])].is_category_enabled = 1; } else{ From 94d8db4691dff22970d80da19d8dad2f248e33dd Mon Sep 17 00:00:00 2001 From: "Michael Cook (mackal)" Date: Thu, 16 Mar 2017 14:10:36 -0400 Subject: [PATCH 06/28] clang-tidy said this was a use-after-free Also, what is this code doing? --- zone/entity.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/zone/entity.cpp b/zone/entity.cpp index 2bc1b99ed..4a6c2c20a 100644 --- a/zone/entity.cpp +++ b/zone/entity.cpp @@ -2439,6 +2439,7 @@ void EntityList::UpdateWho(bool iSendFullUpdate) memcpy(pack->pBuffer, tmp, pack->size); pack->size = sizeof(ServerClientListKeepAlive_Struct) + (tmpNumUpdates * 4); safe_delete_array(tmp); + sclka = (ServerClientListKeepAlive_Struct*) pack->pBuffer; } sclka->wid[sclka->numupdates] = it->second->GetWID(); sclka->numupdates++; From fa1edee790344938a1294a2f24de02d05b039511 Mon Sep 17 00:00:00 2001 From: Uleat Date: Fri, 17 Mar 2017 20:37:48 -0400 Subject: [PATCH 07/28] Added clamp for EQEmuLogSys::LogSettings database values load --- common/database.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/common/database.cpp b/common/database.cpp index b06540cbd..3c4754495 100644 --- a/common/database.cpp +++ b/common/database.cpp @@ -2056,6 +2056,8 @@ uint32 Database::GetGuildIDByCharID(uint32 character_id) void Database::LoadLogSettings(EQEmuLogSys::LogSettings* log_settings) { + // log_settings previously initialized to '0' by EQEmuLogSys::LoadLogSettingsDefaults() + std::string query = "SELECT " "log_category_id, " @@ -2073,6 +2075,9 @@ void Database::LoadLogSettings(EQEmuLogSys::LogSettings* log_settings) for (auto row = results.begin(); row != results.end(); ++row) { log_category = atoi(row[0]); + if (log_category <= Logs::None || log_category >= Logs::MaxCategoryID) + continue; + log_settings[log_category].log_to_console = atoi(row[2]); log_settings[log_category].log_to_file = atoi(row[3]); log_settings[log_category].log_to_gmsay = atoi(row[4]); From 16845c204c98e057ab07e4486e500544c4edb4a1 Mon Sep 17 00:00:00 2001 From: "Michael Cook (mackal)" Date: Sat, 18 Mar 2017 00:34:49 -0400 Subject: [PATCH 08/28] Fix leak in Group::SendHPPacketsTo --- zone/groups.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/zone/groups.cpp b/zone/groups.cpp index af505d3f2..85876bacc 100644 --- a/zone/groups.cpp +++ b/zone/groups.cpp @@ -397,6 +397,8 @@ void Group::SendHPPacketsTo(Mob *member) if(members[i] && members[i] != member) { members[i]->CreateHPPacket(&hpapp); + safe_delete_array(hpapp.pBuffer); + happ.size = 0; member->CastToClient()->QueuePacket(&hpapp, false); if (member->CastToClient()->ClientVersion() >= EQEmu::versions::ClientVersion::SoD) { From 3173c961fa880ba800fb796bf5a175ff2e4dd312 Mon Sep 17 00:00:00 2001 From: "Michael Cook (mackal)" Date: Sat, 18 Mar 2017 00:51:54 -0400 Subject: [PATCH 09/28] Fix typo --- zone/groups.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zone/groups.cpp b/zone/groups.cpp index 85876bacc..b2c916e63 100644 --- a/zone/groups.cpp +++ b/zone/groups.cpp @@ -398,7 +398,7 @@ void Group::SendHPPacketsTo(Mob *member) { members[i]->CreateHPPacket(&hpapp); safe_delete_array(hpapp.pBuffer); - happ.size = 0; + hpapp.size = 0; member->CastToClient()->QueuePacket(&hpapp, false); if (member->CastToClient()->ClientVersion() >= EQEmu::versions::ClientVersion::SoD) { From 13f49fe569b58365ec5ce516bfe8bc8b4f27e591 Mon Sep 17 00:00:00 2001 From: "Michael Cook (mackal)" Date: Sat, 18 Mar 2017 00:54:03 -0400 Subject: [PATCH 10/28] Fix uninit group value --- zone/groups.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/zone/groups.cpp b/zone/groups.cpp index b2c916e63..dd1e54690 100644 --- a/zone/groups.cpp +++ b/zone/groups.cpp @@ -47,6 +47,7 @@ Group::Group(uint32 gid) AssistTargetID = 0; TankTargetID = 0; PullerTargetID = 0; + disbandcheck = false; memset(&LeaderAbilities, 0, sizeof(GroupLeadershipAA_Struct)); uint32 i; @@ -79,6 +80,7 @@ Group::Group(Mob* leader) AssistTargetID = 0; TankTargetID = 0; PullerTargetID = 0; + disbandcheck = false; memset(&LeaderAbilities, 0, sizeof(GroupLeadershipAA_Struct)); mentoree = nullptr; uint32 i; From 1ae66ce955409d47ecdf048721252315e86ac3f9 Mon Sep 17 00:00:00 2001 From: "Michael Cook (mackal)" Date: Sat, 18 Mar 2017 00:59:13 -0400 Subject: [PATCH 11/28] Fix uninit jump in Client::Process --- zone/client.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/zone/client.cpp b/zone/client.cpp index bf455a51f..beaa0970c 100644 --- a/zone/client.cpp +++ b/zone/client.cpp @@ -159,7 +159,8 @@ Client::Client(EQStreamInterface* ieqs) m_ZoneSummonLocation(-2.0f,-2.0f,-2.0f), m_AutoAttackPosition(0.0f, 0.0f, 0.0f, 0.0f), m_AutoAttackTargetLocation(0.0f, 0.0f, 0.0f), - last_region_type(RegionTypeUnsupported) + last_region_type(RegionTypeUnsupported), + m_dirtyautohaters(false) { for(int cf=0; cf < _FilterCount; cf++) ClientFilters[cf] = FilterShow; From 304d41e230181b89d75db49a84211a8ed8a2eb6e Mon Sep 17 00:00:00 2001 From: "Michael Cook (mackal)" Date: Sat, 18 Mar 2017 01:09:48 -0400 Subject: [PATCH 12/28] Fix fix memory leak fix --- zone/groups.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zone/groups.cpp b/zone/groups.cpp index dd1e54690..331303e8b 100644 --- a/zone/groups.cpp +++ b/zone/groups.cpp @@ -399,9 +399,9 @@ void Group::SendHPPacketsTo(Mob *member) if(members[i] && members[i] != member) { members[i]->CreateHPPacket(&hpapp); + member->CastToClient()->QueuePacket(&hpapp, false); safe_delete_array(hpapp.pBuffer); hpapp.size = 0; - member->CastToClient()->QueuePacket(&hpapp, false); if (member->CastToClient()->ClientVersion() >= EQEmu::versions::ClientVersion::SoD) { outapp.SetOpcode(OP_MobManaUpdate); From 11e227756d3afbd44772ded4951a0db2f6f2fdac Mon Sep 17 00:00:00 2001 From: "Michael Cook (mackal)" Date: Sat, 18 Mar 2017 01:15:08 -0400 Subject: [PATCH 13/28] Fix memory leak in raids --- zone/raids.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/zone/raids.cpp b/zone/raids.cpp index 46dd4424e..070698e43 100644 --- a/zone/raids.cpp +++ b/zone/raids.cpp @@ -1555,6 +1555,8 @@ void Raid::SendHPPacketsTo(Client *c) { members[x].member->CreateHPPacket(&hpapp); c->QueuePacket(&hpapp, false); + safe_delete_array(hpapp.pBuffer); + hpapp.size = 0; if (c->ClientVersion() >= EQEmu::versions::ClientVersion::SoD) { outapp.SetOpcode(OP_MobManaUpdate); From bafb199d24d9278af088263a62487c352f63a371 Mon Sep 17 00:00:00 2001 From: "Michael Cook (mackal)" Date: Sat, 18 Mar 2017 01:30:59 -0400 Subject: [PATCH 14/28] Fix encounters leaking? I didn't actually test this ... --- zone/entity.cpp | 14 +++++++++++++- zone/entity.h | 1 + 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/zone/entity.cpp b/zone/entity.cpp index 4a6c2c20a..18d55d695 100644 --- a/zone/entity.cpp +++ b/zone/entity.cpp @@ -2224,7 +2224,8 @@ void EntityList::RemoveAllObjects() } } -void EntityList::RemoveAllTraps(){ +void EntityList::RemoveAllTraps() +{ auto it = trap_list.begin(); while (it != trap_list.end()) { safe_delete(it->second); @@ -2233,6 +2234,16 @@ void EntityList::RemoveAllTraps(){ } } +void EntityList::RemoveAllEncounters() +{ + auto it = encounter_list.begin(); + while (it != encounter_list.end()) { + safe_delete(it->second); + free_ids.push(it->first); + it = encounter_list.erase(it); + } +} + bool EntityList::RemoveMob(uint16 delete_id) { if (delete_id == 0) @@ -2410,6 +2421,7 @@ void EntityList::Clear() entity_list.RemoveAllDoors(); entity_list.RemoveAllObjects(); entity_list.RemoveAllRaids(); + entity_list.RemoveAllEncounters(); entity_list.RemoveAllLocalities(); } diff --git a/zone/entity.h b/zone/entity.h index 1ea9a4c03..0ee029940 100644 --- a/zone/entity.h +++ b/zone/entity.h @@ -292,6 +292,7 @@ public: void RemoveAllObjects(); void RemoveAllLocalities(); void RemoveAllRaids(); + void RemoveAllEncounters(); void DestroyTempPets(Mob *owner); int16 CountTempPets(Mob *owner); void AddTempPetsToHateList(Mob *owner, Mob* other, bool bFrenzy = false); From f64e1644b10ee96e4b5c9b17acbb20a065b4d1ec Mon Sep 17 00:00:00 2001 From: "Michael Cook (mackal)" Date: Sat, 18 Mar 2017 14:11:30 -0400 Subject: [PATCH 15/28] Take 2 at fixing encounters --- zone/entity.cpp | 1 - zone/lua_parser.cpp | 3 +++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/zone/entity.cpp b/zone/entity.cpp index 18d55d695..5f20dffc7 100644 --- a/zone/entity.cpp +++ b/zone/entity.cpp @@ -2421,7 +2421,6 @@ void EntityList::Clear() entity_list.RemoveAllDoors(); entity_list.RemoveAllObjects(); entity_list.RemoveAllRaids(); - entity_list.RemoveAllEncounters(); entity_list.RemoveAllLocalities(); } diff --git a/zone/lua_parser.cpp b/zone/lua_parser.cpp index d28c592a4..bf384c703 100644 --- a/zone/lua_parser.cpp +++ b/zone/lua_parser.cpp @@ -800,6 +800,9 @@ void LuaParser::ReloadQuests() { encounter.second->Depop(); } lua_encounters.clear(); + // so the Depop function above depends on the Process being called again so ... + // And there is situations where it wouldn't be :P + entity_list.EncounterProcess(); if(L) { lua_close(L); From d882c5fbf6cca1e5c8fb7167d980ecd3cbaf2a3d Mon Sep 17 00:00:00 2001 From: Uleat Date: Sat, 18 Mar 2017 16:11:07 -0400 Subject: [PATCH 16/28] Fix for glitchy mercenary unsuspend button behavior (report any abnormalities) --- zone/client.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zone/client.cpp b/zone/client.cpp index beaa0970c..23a7213a3 100644 --- a/zone/client.cpp +++ b/zone/client.cpp @@ -625,7 +625,7 @@ bool Client::Save(uint8 iCommitNow) { GetMercInfo().MercTimerRemaining = GetMercTimer()->GetRemainingTime(); } - if (!(GetMerc() && !dead)) { + if (dead || (!GetMerc() && !GetMercInfo().IsSuspended)) { memset(&m_mercinfo, 0, sizeof(struct MercInfo)); } From 9510e8fbe1936f3728641acce396ffd46de198c0 Mon Sep 17 00:00:00 2001 From: "Michael Cook (mackal)" Date: Sat, 18 Mar 2017 16:59:46 -0400 Subject: [PATCH 17/28] This should resolve leaks and shutdown lua issues --- zone/lua_parser.cpp | 4 ++++ zone/net.cpp | 1 + 2 files changed, 5 insertions(+) diff --git a/zone/lua_parser.cpp b/zone/lua_parser.cpp index bf384c703..92f0adbea 100644 --- a/zone/lua_parser.cpp +++ b/zone/lua_parser.cpp @@ -228,6 +228,10 @@ LuaParser::LuaParser() { } LuaParser::~LuaParser() { + // valgrind didn't like when we didn't clean these up :P + lua_encounters.clear(); + lua_encounter_events_registered.clear(); + lua_encounters_loaded.clear(); if(L) { lua_close(L); } diff --git a/zone/net.cpp b/zone/net.cpp index 935dace7d..2746595cf 100644 --- a/zone/net.cpp +++ b/zone/net.cpp @@ -560,6 +560,7 @@ int main(int argc, char** argv) { } entity_list.Clear(); + entity_list.RemoveAllEncounters(); // gotta do it manually or rewrite lots of shit :P parse->ClearInterfaces(); From 0ac70c545915b7ef4c0b3fd1f3f9dd8740fcf674 Mon Sep 17 00:00:00 2001 From: "Michael Cook (mackal)" Date: Mon, 20 Mar 2017 19:45:26 -0400 Subject: [PATCH 18/28] SE_Taunt is a flat chance not a bonus to taunt chance --- zone/mob.h | 2 +- zone/special_attacks.cpp | 105 ++++++++++++++++++++------------------- zone/spell_effects.cpp | 2 +- 3 files changed, 56 insertions(+), 53 deletions(-) diff --git a/zone/mob.h b/zone/mob.h index 42672f046..81ef7d14a 100644 --- a/zone/mob.h +++ b/zone/mob.h @@ -843,7 +843,7 @@ public: void StartEnrage(); void ProcessEnrage(); bool IsEnraged(); - void Taunt(NPC* who, bool always_succeed, float chance_bonus=0, bool FromSpell=false, int32 bonus_hate=0); + void Taunt(NPC *who, bool always_succeed, int chance_bonus = 0, bool FromSpell = false, int32 bonus_hate = 0); virtual void AI_Init(); virtual void AI_Start(uint32 iMoveDelay = 0); diff --git a/zone/special_attacks.cpp b/zone/special_attacks.cpp index a5cae5700..b982e3e30 100644 --- a/zone/special_attacks.cpp +++ b/zone/special_attacks.cpp @@ -1868,18 +1868,18 @@ void Client::DoClassAttacks(Mob *ca_target, uint16 skill, bool IsRiposte) } } -void Mob::Taunt(NPC* who, bool always_succeed, float chance_bonus, bool FromSpell, int32 bonus_hate) { - +void Mob::Taunt(NPC *who, bool always_succeed, int chance_bonus, bool FromSpell, int32 bonus_hate) +{ if (who == nullptr) return; - if(DivineAura()) + if (DivineAura()) return; - if(!FromSpell && !CombatRange(who)) + if (!FromSpell && !CombatRange(who)) return; - if(!always_succeed && IsClient()) + if (!always_succeed && IsClient()) CastToClient()->CheckIncreaseSkill(EQEmu::skills::SkillTaunt, who, 10); Mob *hate_top = who->GetHateMost(); @@ -1887,69 +1887,73 @@ void Mob::Taunt(NPC* who, bool always_succeed, float chance_bonus, bool FromSpel int level_difference = GetLevel() - who->GetLevel(); bool Success = false; - //Support for how taunt worked pre 2000 on LIVE - Can not taunt NPC over your level. - if ((RuleB(Combat,TauntOverLevel) == false) && (level_difference < 0) || who->GetSpecialAbility(IMMUNE_TAUNT)){ - Message_StringID(MT_SpellFailure,FAILED_TAUNT); + // Support for how taunt worked pre 2000 on LIVE - Can not taunt NPC over your level. + if ((RuleB(Combat, TauntOverLevel) == false) && (level_difference < 0) || + who->GetSpecialAbility(IMMUNE_TAUNT)) { + Message_StringID(MT_SpellFailure, FAILED_TAUNT); return; } - //All values used based on live parses after taunt was updated in 2006. - if ((hate_top && hate_top->GetHPRatio() >= 20) || hate_top == nullptr) { + // All values used based on live parses after taunt was updated in 2006. + if ((hate_top && hate_top->GetHPRatio() >= 20) || hate_top == nullptr || chance_bonus) { + // SE_Taunt this is flat chance + if (chance_bonus) { + Success = zone->random.Roll(chance_bonus); + } else { + int32 newhate = 0; + float tauntchance = 50.0f; - int32 newhate = 0; - float tauntchance = 50.0f; - - if(always_succeed) - tauntchance = 101.0f; - - else { - - if (level_difference < 0){ - tauntchance += static_cast(level_difference)*3.0f; - if (tauntchance < 20) - tauntchance = 20.0f; - } + if (always_succeed) + tauntchance = 101.0f; else { - tauntchance += static_cast(level_difference)*5.0f; - if (tauntchance > 65) - tauntchance = 65.0f; + + if (level_difference < 0) { + tauntchance += static_cast(level_difference) * 3.0f; + if (tauntchance < 20) + tauntchance = 20.0f; + } + + else { + tauntchance += static_cast(level_difference) * 5.0f; + if (tauntchance > 65) + tauntchance = 65.0f; + } } + + // TauntSkillFalloff rate is not based on any real data. Default of 33% gives a reasonable + // result. + if (IsClient() && !always_succeed) + tauntchance -= (RuleR(Combat, TauntSkillFalloff) * + (CastToClient()->MaxSkill(EQEmu::skills::SkillTaunt) - + GetSkill(EQEmu::skills::SkillTaunt))); + + if (tauntchance < 1) + tauntchance = 1.0f; + + tauntchance /= 100.0f; + + Success = tauntchance > zone->random.Real(0, 1); } - //TauntSkillFalloff rate is not based on any real data. Default of 33% gives a reasonable result. - if (IsClient() && !always_succeed) - tauntchance -= (RuleR(Combat, TauntSkillFalloff) * (CastToClient()->MaxSkill(EQEmu::skills::SkillTaunt) - GetSkill(EQEmu::skills::SkillTaunt))); - - //From SE_Taunt (Does a taunt with a chance modifier) - if (chance_bonus) - tauntchance += tauntchance*chance_bonus/100.0f; - - if (tauntchance < 1) - tauntchance = 1.0f; - - tauntchance /= 100.0f; - - if (tauntchance > zone->random.Real(0, 1)) { - if (hate_top && hate_top != this){ + if (Success) { + if (hate_top && hate_top != this) { newhate = (who->GetNPCHate(hate_top) - who->GetNPCHate(this)) + 1 + bonus_hate; who->CastToNPC()->AddToHateList(this, newhate); Success = true; + } else { + who->CastToNPC()->AddToHateList(this, 12); } - else - who->CastToNPC()->AddToHateList(this,12); if (who->CanTalk()) - who->Say_StringID(SUCCESSFUL_TAUNT,GetCleanName()); - } - else{ - Message_StringID(MT_SpellFailure,FAILED_TAUNT); + who->Say_StringID(SUCCESSFUL_TAUNT, GetCleanName()); + } else { + Message_StringID(MT_SpellFailure, FAILED_TAUNT); } + } else { + Message_StringID(MT_SpellFailure, FAILED_TAUNT); } - else - Message_StringID(MT_SpellFailure,FAILED_TAUNT); - if (HasSkillProcs()) TrySkillProc(who, EQEmu::skills::SkillTaunt, TauntReuseTime * 1000); @@ -1957,7 +1961,6 @@ void Mob::Taunt(NPC* who, bool always_succeed, float chance_bonus, bool FromSpel TrySkillProc(who, EQEmu::skills::SkillTaunt, TauntReuseTime * 1000, true); } - void Mob::InstillDoubt(Mob *who) { //make sure we can use this skill /*int skill = GetSkill(INTIMIDATION);*/ //unused diff --git a/zone/spell_effects.cpp b/zone/spell_effects.cpp index 132e6bcdb..40d85123f 100644 --- a/zone/spell_effects.cpp +++ b/zone/spell_effects.cpp @@ -2676,7 +2676,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove case SE_Taunt: { if (caster && IsNPC()){ - caster->Taunt(this->CastToNPC(), false, static_cast(spell.base[i]), true, spell.base2[i]); + caster->Taunt(this->CastToNPC(), false, spell.base[i], true, spell.base2[i]); } break; } From 1e1de3a48af1aef020e7f09a2d0f3072ea986a59 Mon Sep 17 00:00:00 2001 From: "Michael Cook (mackal)" Date: Mon, 20 Mar 2017 19:49:35 -0400 Subject: [PATCH 19/28] Fix error --- zone/special_attacks.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/zone/special_attacks.cpp b/zone/special_attacks.cpp index b982e3e30..074d707a8 100644 --- a/zone/special_attacks.cpp +++ b/zone/special_attacks.cpp @@ -1900,7 +1900,6 @@ void Mob::Taunt(NPC *who, bool always_succeed, int chance_bonus, bool FromSpell, if (chance_bonus) { Success = zone->random.Roll(chance_bonus); } else { - int32 newhate = 0; float tauntchance = 50.0f; if (always_succeed) @@ -1938,7 +1937,7 @@ void Mob::Taunt(NPC *who, bool always_succeed, int chance_bonus, bool FromSpell, if (Success) { if (hate_top && hate_top != this) { - newhate = (who->GetNPCHate(hate_top) - who->GetNPCHate(this)) + 1 + bonus_hate; + int newhate = (who->GetNPCHate(hate_top) - who->GetNPCHate(this)) + 1 + bonus_hate; who->CastToNPC()->AddToHateList(this, newhate); Success = true; } else { From e8a8647424169d8c8bc9e6be8969c53d80213173 Mon Sep 17 00:00:00 2001 From: Uleat Date: Wed, 22 Mar 2017 03:45:50 -0400 Subject: [PATCH 20/28] Fix for bots db update 9015 not triggering where update 9011 has not applied --- common/version.h | 2 +- utils/sql/git/bots/bots_db_update_manifest.txt | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/common/version.h b/common/version.h index 60d594dea..e000d4fc6 100644 --- a/common/version.h +++ b/common/version.h @@ -32,7 +32,7 @@ #define CURRENT_BINARY_DATABASE_VERSION 9107 #ifdef BOTS - #define CURRENT_BINARY_BOTS_DATABASE_VERSION 9015 + #define CURRENT_BINARY_BOTS_DATABASE_VERSION 9016 #else #define CURRENT_BINARY_BOTS_DATABASE_VERSION 0 // must be 0 #endif diff --git a/utils/sql/git/bots/bots_db_update_manifest.txt b/utils/sql/git/bots/bots_db_update_manifest.txt index c9a8999e1..a699be478 100644 --- a/utils/sql/git/bots/bots_db_update_manifest.txt +++ b/utils/sql/git/bots/bots_db_update_manifest.txt @@ -14,6 +14,7 @@ 9013|2017_02_26_bots_spells_id_update_for_saved_bots.sql|SELECT * FROM `bot_data` WHERE `spells_id` >= '701' AND `spells_id` <= '712'|not_empty| 9014|2017_02_26_bots_spells_id_update_for_bot_spells_entries.sql|SELECT * FROM `bot_spells_entries` WHERE `npc_spells_id` >= '701' AND `npc_spells_id` <= '712'|not_empty| 9015|2017_02_26_bots_spell_casting_chances_update.sql|SHOW COLUMNS FROM `bot_spell_casting_chances` LIKE 'value'|not_empty| +9016|2017_02_26_bots_spell_casting_chances_update.sql|SHOW TABLES LIKE 'bot_spell_casting_chances'|empty| # Upgrade conditions: # This won't be needed after this system is implemented, but it is used database that are not From 8bdefa17b5977c2382c2b4f8bebbd6817c11ced4 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Wed, 22 Mar 2017 13:39:12 -0500 Subject: [PATCH 21/28] Fix README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e1753680b..057937a0c 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ * Hundreds of Quests/events created and maintained by Project EQ ## Server Installs -||Windows|Linux| +| |Windows|Linux| |:---:|:---:|:---:| |**Install Count**|![Windows Install Count](http://analytics.akkadius.com/?install_count&windows_count)|![Linux Install Count](http://analytics.akkadius.com/?install_count&linux_count)| ### > Windows From f77f996c3fec60b998977a11d0d18de5845557d1 Mon Sep 17 00:00:00 2001 From: Uleat Date: Thu, 23 Mar 2017 04:35:36 -0400 Subject: [PATCH 22/28] Pass through zone code to fix uninitialized pointer declarations --- zone/aggro.cpp | 8 +++---- zone/attack.cpp | 2 +- zone/bot.cpp | 52 ++++++++++++++++++++--------------------- zone/client.cpp | 20 ++++++++-------- zone/client_mods.cpp | 4 ++-- zone/client_packet.cpp | 32 ++++++++++++------------- zone/client_process.cpp | 4 ++-- zone/corpse.cpp | 16 ++++++------- zone/effects.cpp | 8 +++---- zone/merc.cpp | 12 +++++----- zone/mob.cpp | 12 +++++----- zone/pets.cpp | 2 +- zone/spell_effects.cpp | 16 ++++++------- zone/spells.cpp | 30 ++++++++++++------------ zone/zone.cpp | 6 ++--- zone/zoning.cpp | 4 ++-- 16 files changed, 114 insertions(+), 114 deletions(-) diff --git a/zone/aggro.cpp b/zone/aggro.cpp index cc537662a..bf74f4b4d 100644 --- a/zone/aggro.cpp +++ b/zone/aggro.cpp @@ -550,8 +550,8 @@ faster, but I'm doing it this way to make it readable and easy to modify bool Mob::IsAttackAllowed(Mob *target, bool isSpellAttack) { - Mob *mob1, *mob2, *tempmob; - Client *c1, *c2, *becomenpc; + Mob *mob1 = nullptr, *mob2 = nullptr, *tempmob = nullptr; + Client *c1 = nullptr, *c2 = nullptr, *becomenpc = nullptr; // NPC *npc1, *npc2; int reverse; @@ -767,8 +767,8 @@ type', in which case, the answer is yes. // also goes for their pets bool Mob::IsBeneficialAllowed(Mob *target) { - Mob *mob1, *mob2, *tempmob; - Client *c1, *c2; + Mob *mob1 = nullptr, *mob2 = nullptr, *tempmob = nullptr; + Client *c1 = nullptr, *c2 = nullptr; int reverse; if(!target) diff --git a/zone/attack.cpp b/zone/attack.cpp index b0c056b30..5cd5aebae 100644 --- a/zone/attack.cpp +++ b/zone/attack.cpp @@ -1268,7 +1268,7 @@ bool Client::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, b if (GetFeigned()) return false; // Rogean: How can you attack while feigned? Moved up from Aggro Code. - EQEmu::ItemInstance* weapon; + EQEmu::ItemInstance* weapon = nullptr; if (Hand == EQEmu::inventory::slotSecondary){ // Kaiyodo - Pick weapon from the attacking hand weapon = GetInv().GetItem(EQEmu::inventory::slotSecondary); OffHandAtk(true); diff --git a/zone/bot.cpp b/zone/bot.cpp index 6ce4210b3..00bb96bfc 100644 --- a/zone/bot.cpp +++ b/zone/bot.cpp @@ -1896,12 +1896,12 @@ void Bot::BotRangedAttack(Mob* other) { } EQEmu::ItemInstance* rangedItem = GetBotItem(EQEmu::inventory::slotRange); - const EQEmu::ItemData* RangeWeapon = 0; + const EQEmu::ItemData* RangeWeapon = nullptr; if(rangedItem) RangeWeapon = rangedItem->GetItem(); EQEmu::ItemInstance* ammoItem = GetBotItem(EQEmu::inventory::slotAmmo); - const EQEmu::ItemData* Ammo = 0; + const EQEmu::ItemData* Ammo = nullptr; if(ammoItem) Ammo = ammoItem->GetItem(); @@ -2008,7 +2008,7 @@ void Bot::ApplySpecialAttackMod(EQEmu::skills::SkillType skill, int32 &dmg, int3 if (item_slot >= EQEmu::legacy::EQUIPMENT_BEGIN){ const EQEmu::ItemInstance* inst = GetBotItem(item_slot); - const EQEmu::ItemData* botweapon = 0; + const EQEmu::ItemData* botweapon = nullptr; if(inst) botweapon = inst->GetItem(); @@ -2456,7 +2456,7 @@ void Bot::AI_Process() { //now off hand if(GetTarget() && attack_dw_timer.Check() && CanThisClassDualWield()) { const EQEmu::ItemInstance* instweapon = GetBotItem(EQEmu::inventory::slotSecondary); - const EQEmu::ItemData* weapon = 0; + const EQEmu::ItemData* weapon = nullptr; //can only dual wield without a weapon if you're a monk if(instweapon || (botClass == MONK)) { if(instweapon) @@ -2928,8 +2928,8 @@ void Bot::FillSpawnStruct(NewSpawn_Struct* ns, Mob* ForWho) { ns->spawn.light = m_Light.Type[EQEmu::lightsource::LightActive]; ns->spawn.helm = helmtexture; //(GetShowHelm() ? helmtexture : 0); //0xFF; ns->spawn.equip_chest2 = texture; //0xFF; - const EQEmu::ItemData* item = 0; - const EQEmu::ItemInstance* inst = 0; + const EQEmu::ItemData* item = nullptr; + const EQEmu::ItemInstance* inst = nullptr; uint32 spawnedbotid = 0; spawnedbotid = this->GetBotID(); for (int i = EQEmu::textures::textureBegin; i < EQEmu::textures::weaponPrimary; i++) { @@ -4357,9 +4357,9 @@ int32 Bot::GetBotFocusEffect(BotfocusType bottype, uint16 spell_id) { //Check if item focus effect exists for the client. if (itembonuses.FocusEffects[bottype]) { - const EQEmu::ItemData* TempItem = 0; - const EQEmu::ItemData* UsedItem = 0; - const EQEmu::ItemInstance* TempInst = 0; + const EQEmu::ItemData* TempItem = nullptr; + const EQEmu::ItemData* UsedItem = nullptr; + const EQEmu::ItemInstance* TempInst = nullptr; uint16 UsedFocusID = 0; int32 Total = 0; int32 focus_max = 0; @@ -5031,7 +5031,7 @@ void Bot::DoSpecialAttackDamage(Mob *who, EQEmu::skills::SkillType skill, int32 if (skill == EQEmu::skills::SkillBash) { const EQEmu::ItemInstance* inst = GetBotItem(EQEmu::inventory::slotSecondary); - const EQEmu::ItemData* botweapon = 0; + const EQEmu::ItemData* botweapon = nullptr; if(inst) botweapon = inst->GetItem(); @@ -5372,7 +5372,7 @@ FACTION_VALUE Bot::GetReverseFactionCon(Mob* iOther) { } Mob* Bot::GetOwnerOrSelf() { - Mob* Result = 0; + Mob* Result = nullptr; if(this->GetBotOwner()) Result = GetBotOwner(); else @@ -5382,7 +5382,7 @@ Mob* Bot::GetOwnerOrSelf() { } Mob* Bot::GetOwner() { - Mob* Result = 0; + Mob* Result = nullptr; Result = GetBotOwner(); if(!Result) this->SetBotOwner(0); @@ -5438,8 +5438,8 @@ bool Bot::IsBotAttackAllowed(Mob* attacker, Mob* target, bool& hasRuleDefined) { void Bot::EquipBot(std::string* errorMessage) { GetBotItems(m_inv, errorMessage); - const EQEmu::ItemInstance* inst = 0; - const EQEmu::ItemData* item = 0; + const EQEmu::ItemInstance* inst = nullptr; + const EQEmu::ItemData* item = nullptr; for (int i = EQEmu::legacy::EQUIPMENT_BEGIN; i <= EQEmu::legacy::EQUIPMENT_END; ++i) { inst = GetBotItem(i); if(inst) { @@ -7235,7 +7235,7 @@ bool Bot::CanHeal() { } Bot* Bot::GetBotByBotClientOwnerAndBotName(Client* c, std::string botName) { - Bot* Result = 0; + Bot* Result = nullptr; if(c) { std::list BotList = entity_list.GetBotsByBotOwnerCharacterID(c->CharacterID()); if(!BotList.empty()) { @@ -7275,7 +7275,7 @@ void Bot::ProcessBotGroupInvite(Client* c, std::string botName) { // Processes a group disband request from a Client for a Bot. void Bot::ProcessBotGroupDisband(Client* c, std::string botName) { if(c) { - Bot* tempBot = 0; + Bot* tempBot = nullptr; if(botName.empty()) tempBot = GetFirstBotInGroup(c->GetGroup()); @@ -7318,7 +7318,7 @@ void Bot::ProcessClientZoneChange(Client* botOwner) { // Finds and returns the first Bot object found in specified group Bot* Bot::GetFirstBotInGroup(Group* group) { - Bot* Result = 0; + Bot* Result = nullptr; if(group) { for(int Counter = 0; Counter < MAX_GROUP_MEMBERS; Counter++) { @@ -7344,8 +7344,8 @@ void Bot::ProcessBotInspectionRequest(Bot* inspectedBot, Client* client) { insr->TargetID = inspectedBot->GetNPCTypeID(); insr->playerid = inspectedBot->GetID(); - const EQEmu::ItemData* item = 0; - const EQEmu::ItemInstance* inst = 0; + const EQEmu::ItemData* item = nullptr; + const EQEmu::ItemInstance* inst = nullptr; // Modded to display power source items (will only show up on SoF+ client inspect windows though.) // I don't think bots are currently coded to use them..but, you'll have to use '#bot inventory list' @@ -7396,7 +7396,7 @@ void Bot::ProcessBotInspectionRequest(Bot* inspectedBot, Client* client) { void Bot::CalcItemBonuses(StatBonuses* newbon) { - const EQEmu::ItemData* itemtmp = 0; + const EQEmu::ItemData* itemtmp = nullptr; for (int i = EQEmu::legacy::EQUIPMENT_BEGIN; i <= (EQEmu::legacy::EQUIPMENT_END + 1); ++i) { const EQEmu::ItemInstance* item = GetBotItem((i == 22 ? 9999 : i)); @@ -7989,7 +7989,7 @@ bool EntityList::Bot_AICheckCloseBeneficialSpells(Bot* caster, uint8 iChance, fl Mob* EntityList::GetMobByBotID(uint32 botID) { - Mob* Result = 0; + Mob* Result = nullptr; if(botID > 0) { auto it = mob_list.begin(); for (auto it = mob_list.begin(); it != mob_list.end(); ++it) { @@ -8006,7 +8006,7 @@ Mob* EntityList::GetMobByBotID(uint32 botID) { } Bot* EntityList::GetBotByBotID(uint32 botID) { - Bot* Result = 0; + Bot* Result = nullptr; if(botID > 0) { for(std::list::iterator botListItr = bot_list.begin(); botListItr != bot_list.end(); ++botListItr) { Bot* tempBot = *botListItr; @@ -8020,7 +8020,7 @@ Bot* EntityList::GetBotByBotID(uint32 botID) { } Bot* EntityList::GetBotByBotName(std::string botName) { - Bot* Result = 0; + Bot* Result = nullptr; if(!botName.empty()) { for(std::list::iterator botListItr = bot_list.begin(); botListItr != bot_list.end(); ++botListItr) { Bot* tempBot = *botListItr; @@ -8197,7 +8197,7 @@ void EntityList::ShowSpawnWindow(Client* client, int Distance, bool NamedOnly) { uint8 Bot::GetNumberNeedingHealedInGroup(uint8 hpr, bool includePets) { uint8 needHealed = 0; - Group *g; + Group *g = nullptr; if(this->HasGroup()) { g = this->GetGroup(); if(g) { @@ -8237,8 +8237,8 @@ int Bot::GetRawACNoShield(int &shield_ac) { } uint32 Bot::CalcCurrentWeight() { - const EQEmu::ItemData* TempItem = 0; - EQEmu::ItemInstance* inst; + const EQEmu::ItemData* TempItem = nullptr; + EQEmu::ItemInstance* inst = nullptr; uint32 Total = 0; for (int i = EQEmu::legacy::EQUIPMENT_BEGIN; i <= EQEmu::legacy::EQUIPMENT_END; ++i) { inst = GetBotItem(i); diff --git a/zone/client.cpp b/zone/client.cpp index 23a7213a3..fa683a267 100644 --- a/zone/client.cpp +++ b/zone/client.cpp @@ -717,7 +717,7 @@ bool Client::AddPacket(EQApplicationPacket** pApp, bool bAckreq) { c->ack_req = bAckreq; c->app = *pApp; - *pApp = 0; + *pApp = nullptr; clientpackets.Append(c); return true; @@ -726,7 +726,7 @@ bool Client::AddPacket(EQApplicationPacket** pApp, bool bAckreq) { bool Client::SendAllPackets() { LinkedListIterator iterator(clientpackets); - CLIENTPACKET* cp = 0; + CLIENTPACKET* cp = nullptr; iterator.Reset(); while(iterator.MoreElements()) { cp = iterator.GetData(); @@ -772,7 +772,7 @@ void Client::FastQueuePacket(EQApplicationPacket** app, bool ack_req, CLIENT_CON eqs->FastQueuePacket((EQApplicationPacket **)app, ack_req); else if (app && (*app)) delete *app; - *app = 0; + *app = nullptr; } return; } @@ -2038,7 +2038,7 @@ void Client::ReadBook(BookRequest_Struct *book) { read_from_slot = book->invslot -1; } - const EQEmu::ItemInstance *inst = 0; + const EQEmu::ItemInstance *inst = nullptr; if (read_from_slot <= EQEmu::legacy::SLOT_PERSONAL_BAGS_END) { @@ -4046,7 +4046,7 @@ bool Client::KeyRingCheck(uint32 item_id) void Client::KeyRingList() { Message(4,"Keys on Keyring:"); - const EQEmu::ItemData *item = 0; + const EQEmu::ItemData *item = nullptr; for (auto iter = keyring.begin(); iter != keyring.end(); ++iter) { if ((item = database.GetItem(*iter))!=nullptr) { Message(4,item->Name); @@ -4659,7 +4659,7 @@ void Client::SendRespawnBinds() uint32 PacketLength = 17 + (26 * num_options); //Header size + per-option invariant size std::list::iterator itr; - RespawnOption* opt; + RespawnOption* opt = nullptr; //Find string size for each option for (itr = respawn_options.begin(); itr != respawn_options.end(); ++itr) @@ -8385,7 +8385,7 @@ bool Client::RemoveRespawnOption(std::string option_name) if (IsHoveringForRespawn() || respawn_options.empty()) { return false; } bool had = false; - RespawnOption* opt; + RespawnOption* opt = nullptr; std::list::iterator itr; for (itr = respawn_options.begin(); itr != respawn_options.end(); ++itr) { @@ -8432,7 +8432,7 @@ bool Client::RemoveRespawnOption(uint8 position) void Client::SetHunger(int32 in_hunger) { - EQApplicationPacket *outapp; + EQApplicationPacket *outapp = nullptr; outapp = new EQApplicationPacket(OP_Stamina, sizeof(Stamina_Struct)); Stamina_Struct* sta = (Stamina_Struct*)outapp->pBuffer; sta->food = in_hunger; @@ -8446,7 +8446,7 @@ void Client::SetHunger(int32 in_hunger) void Client::SetThirst(int32 in_thirst) { - EQApplicationPacket *outapp; + EQApplicationPacket *outapp = nullptr; outapp = new EQApplicationPacket(OP_Stamina, sizeof(Stamina_Struct)); Stamina_Struct* sta = (Stamina_Struct*)outapp->pBuffer; sta->food = m_pp.hunger_level > 6000 ? 6000 : m_pp.hunger_level; @@ -8460,7 +8460,7 @@ void Client::SetThirst(int32 in_thirst) void Client::SetConsumption(int32 in_hunger, int32 in_thirst) { - EQApplicationPacket *outapp; + EQApplicationPacket *outapp = nullptr; outapp = new EQApplicationPacket(OP_Stamina, sizeof(Stamina_Struct)); Stamina_Struct* sta = (Stamina_Struct*)outapp->pBuffer; sta->food = in_hunger; diff --git a/zone/client_mods.cpp b/zone/client_mods.cpp index 3d3a1d529..e97aa026c 100644 --- a/zone/client_mods.cpp +++ b/zone/client_mods.cpp @@ -1211,8 +1211,8 @@ int32 Client::CalcManaRegenCap() uint32 Client::CalcCurrentWeight() { - const EQEmu::ItemData* TempItem = 0; - EQEmu::ItemInstance* ins; + const EQEmu::ItemData* TempItem = nullptr; + EQEmu::ItemInstance* ins = nullptr; uint32 Total = 0; int x; for (x = EQEmu::legacy::EQUIPMENT_BEGIN; x <= EQEmu::inventory::slotCursor; x++) { // include cursor or not? diff --git a/zone/client_packet.cpp b/zone/client_packet.cpp index 4b3817e9a..1616ac687 100644 --- a/zone/client_packet.cpp +++ b/zone/client_packet.cpp @@ -1074,7 +1074,7 @@ void Client::Handle_Connect_OP_ReqNewZone(const EQApplicationPacket *app) { conn_state = NewZoneRequested; - EQApplicationPacket* outapp; + EQApplicationPacket* outapp = nullptr; ///////////////////////////////////// // New Zone Packet @@ -1240,12 +1240,12 @@ void Client::Handle_Connect_OP_ZoneEntry(const EQApplicationPacket *app) } uint32 pplen = 0; - EQApplicationPacket* outapp = 0; - MYSQL_RES* result = 0; + EQApplicationPacket* outapp = nullptr; + MYSQL_RES* result = nullptr; bool loaditems = 0; uint32 i; std::string query; - unsigned long* lengths; + unsigned long* lengths = nullptr; uint32 cid = CharacterID(); character_id = cid; /* Global character_id reference */ @@ -2062,7 +2062,7 @@ void Client::Handle_OP_AdventureMerchantRequest(const EQApplicationPacket *app) merchantid = tmp->CastToNPC()->MerchantType; tmp->CastToNPC()->FaceTarget(this->CastToMob()); - const EQEmu::ItemData *item = 0; + const EQEmu::ItemData *item = nullptr; std::list merlist = zone->merchanttable[merchantid]; std::list::const_iterator itr; for (itr = merlist.begin(); itr != merlist.end() && count<255; ++itr){ @@ -4867,7 +4867,7 @@ void Client::Handle_OP_Consume(const EQApplicationPacket *app) { if (m_pp.hunger_level > 6000) { - EQApplicationPacket *outapp; + EQApplicationPacket *outapp = nullptr; outapp = new EQApplicationPacket(OP_Stamina, sizeof(Stamina_Struct)); Stamina_Struct* sta = (Stamina_Struct*)outapp->pBuffer; sta->food = m_pp.hunger_level > 6000 ? 6000 : m_pp.hunger_level; @@ -4882,7 +4882,7 @@ void Client::Handle_OP_Consume(const EQApplicationPacket *app) { if (m_pp.thirst_level > 6000) { - EQApplicationPacket *outapp; + EQApplicationPacket *outapp = nullptr; outapp = new EQApplicationPacket(OP_Stamina, sizeof(Stamina_Struct)); Stamina_Struct* sta = (Stamina_Struct*)outapp->pBuffer; sta->food = m_pp.hunger_level > 6000 ? 6000 : m_pp.hunger_level; @@ -4915,7 +4915,7 @@ void Client::Handle_OP_Consume(const EQApplicationPacket *app) m_pp.hunger_level = 50000; if (m_pp.thirst_level > 50000) m_pp.thirst_level = 50000; - EQApplicationPacket *outapp; + EQApplicationPacket *outapp = nullptr; outapp = new EQApplicationPacket(OP_Stamina, sizeof(Stamina_Struct)); Stamina_Struct* sta = (Stamina_Struct*)outapp->pBuffer; sta->food = m_pp.hunger_level > 6000 ? 6000 : m_pp.hunger_level; @@ -5903,7 +5903,7 @@ void Client::Handle_OP_GMEmoteZone(const EQApplicationPacket *app) return; } GMEmoteZone_Struct* gmez = (GMEmoteZone_Struct*)app->pBuffer; - char* newmessage = 0; + char* newmessage = nullptr; if (strstr(gmez->text, "^") == 0) entity_list.Message(0, 15, gmez->text); else{ @@ -8259,7 +8259,7 @@ void Client::Handle_OP_ItemName(const EQApplicationPacket *app) return; } ItemNamePacket_Struct *p = (ItemNamePacket_Struct*)app->pBuffer; - const EQEmu::ItemData *item = 0; + const EQEmu::ItemData *item = nullptr; if ((item = database.GetItem(p->item_id)) != nullptr) { auto outapp = new EQApplicationPacket(OP_ItemName, sizeof(ItemNamePacket_Struct)); p = (ItemNamePacket_Struct*)outapp->pBuffer; @@ -8466,7 +8466,7 @@ void Client::Handle_OP_ItemVerifyRequest(const EQApplicationPacket *app) target_id = request->target; - EQApplicationPacket *outapp; + EQApplicationPacket *outapp = nullptr; outapp = new EQApplicationPacket(OP_ItemVerifyReply, sizeof(ItemVerifyReply_Struct)); ItemVerifyReply_Struct* reply = (ItemVerifyReply_Struct*)outapp->pBuffer; reply->slot = slot_id; @@ -8540,8 +8540,8 @@ void Client::Handle_OP_ItemVerifyRequest(const EQApplicationPacket *app) int r; bool tryaug = false; - EQEmu::ItemInstance* clickaug = 0; - EQEmu::ItemData* augitem = 0; + EQEmu::ItemInstance* clickaug = nullptr; + EQEmu::ItemData* augitem = nullptr; for (r = EQEmu::inventory::socketBegin; r < EQEmu::inventory::SocketCount; r++) { const EQEmu::ItemInstance* aug_i = inst->GetAugment(r); @@ -8670,7 +8670,7 @@ void Client::Handle_OP_ItemVerifyRequest(const EQApplicationPacket *app) if (m_pp.thirst_level > 6000) m_pp.thirst_level = 6000; - EQApplicationPacket *outapp2; + EQApplicationPacket *outapp2 = nullptr; outapp2 = new EQApplicationPacket(OP_Stamina, sizeof(Stamina_Struct)); Stamina_Struct* sta = (Stamina_Struct*)outapp2->pBuffer; sta->food = m_pp.hunger_level; @@ -9195,7 +9195,7 @@ void Client::Handle_OP_LootItem(const EQApplicationPacket *app) return; } - EQApplicationPacket* outapp = 0; + EQApplicationPacket* outapp = nullptr; Entity* entity = entity_list.GetID(*((uint16*)app->pBuffer)); if (entity == 0) { Message(13, "Error: OP_LootItem: Corpse not found (ent = 0)"); @@ -12022,7 +12022,7 @@ void Client::Handle_OP_SetStartCity(const EQApplicationPacket *app) else zoneid = atoi(row[0]); - char* name; + char* name = nullptr; database.GetZoneLongName(database.GetZoneName(zoneid), &name); Message(15, "%d - %s", zoneid, name); } diff --git a/zone/client_process.cpp b/zone/client_process.cpp index 2bfa8a055..57ed6283c 100644 --- a/zone/client_process.cpp +++ b/zone/client_process.cpp @@ -210,7 +210,7 @@ bool Client::Process() { if (bardsong_timer.Check() && bardsong != 0) { //NOTE: this is kinda a heavy-handed check to make sure the mob still exists before //doing the next pulse on them... - Mob *song_target; + Mob *song_target = nullptr; if(bardsong_target_id == GetID()) { song_target = this; } else { @@ -838,7 +838,7 @@ void Client::BulkSendMerchantInventory(int merchant_id, int npcid) { if (m_ClientVersionBit & EQEmu::versions::bit_RoFAndLater) { // RoF+ can send 200 items numItemSlots = 200; } - const EQEmu::ItemData *item; + const EQEmu::ItemData *item = nullptr; std::list merlist = zone->merchanttable[merchant_id]; std::list::const_iterator itr; Mob* merch = entity_list.GetMobByNpcTypeID(npcid); diff --git a/zone/corpse.cpp b/zone/corpse.cpp index a1cc8c69d..1bfc4ef10 100644 --- a/zone/corpse.cpp +++ b/zone/corpse.cpp @@ -82,7 +82,7 @@ Corpse* Corpse::LoadCharacterCorpseEntity(uint32 in_dbid, uint32 in_charid, std: /* Load Items */ ItemList itemlist; - ServerLootItem_Struct* tmp = 0; + ServerLootItem_Struct* tmp = nullptr; for (unsigned int i = 0; i < pcs->itemcount; i++) { tmp = new ServerLootItem_Struct; memcpy(tmp, &pcs->items[i], sizeof(player_lootitem::ServerLootItem_Struct)); @@ -267,7 +267,7 @@ Corpse::Corpse(Client* client, int32 in_rezexp) : Mob ( int i; PlayerProfile_Struct *pp = &client->GetPP(); - EQEmu::ItemInstance *item; + EQEmu::ItemInstance *item = nullptr; /* Check if Zone has Graveyard First */ if(!zone->HasGraveyard()) { @@ -671,7 +671,7 @@ void Corpse::AddItem(uint32 itemnum, uint16 charges, int16 slot, uint32 aug1, ui } ServerLootItem_Struct* Corpse::GetItem(uint16 lootslot, ServerLootItem_Struct** bag_item_data) { - ServerLootItem_Struct *sitem = 0, *sitem2; + ServerLootItem_Struct *sitem = nullptr, *sitem2 = nullptr; ItemList::iterator cur,end; cur = itemlist.begin(); @@ -993,7 +993,7 @@ void Corpse::MakeLootRequestPackets(Client* client, const EQApplicationPacket* a } int i = 0; - const EQEmu::ItemData* item = 0; + const EQEmu::ItemData* item = nullptr; ItemList::iterator cur,end; cur = itemlist.begin(); end = itemlist.end(); @@ -1116,9 +1116,9 @@ void Corpse::LootItem(Client *client, const EQApplicationPacket *app) return; } - const EQEmu::ItemData *item = 0; - EQEmu::ItemInstance *inst = 0; - ServerLootItem_Struct *item_data = nullptr, *bag_item_data[10]; + const EQEmu::ItemData *item = nullptr; + EQEmu::ItemInstance *inst = nullptr; + ServerLootItem_Struct *item_data = nullptr, *bag_item_data[10] = {}; memset(bag_item_data, 0, sizeof(bag_item_data)); if (GetPlayerKillItem() > 1) { @@ -1437,7 +1437,7 @@ uint32 Corpse::GetEquipment(uint8 material_slot) const { } uint32 Corpse::GetEquipmentColor(uint8 material_slot) const { - const EQEmu::ItemData *item; + const EQEmu::ItemData *item = nullptr; if (material_slot > EQEmu::textures::LastTexture) { return 0; diff --git a/zone/effects.cpp b/zone/effects.cpp index 400bae1fa..202ca6237 100644 --- a/zone/effects.cpp +++ b/zone/effects.cpp @@ -747,7 +747,7 @@ void EntityList::AETaunt(Client* taunter, float range, int32 bonus_hate) // NPC spells will only affect other NPCs with compatible faction void EntityList::AESpell(Mob *caster, Mob *center, uint16 spell_id, bool affect_caster, int16 resist_adjust) { - Mob *curmob; + Mob *curmob = nullptr; float dist = caster->GetAOERange(spell_id); float dist2 = dist * dist; @@ -847,7 +847,7 @@ void EntityList::AESpell(Mob *caster, Mob *center, uint16 spell_id, bool affect_ void EntityList::MassGroupBuff(Mob *caster, Mob *center, uint16 spell_id, bool affect_caster) { - Mob *curmob; + Mob *curmob = nullptr; float dist = caster->GetAOERange(spell_id); float dist2 = dist * dist; @@ -888,7 +888,7 @@ void EntityList::MassGroupBuff(Mob *caster, Mob *center, uint16 spell_id, bool a // NPC spells will only affect other NPCs with compatible faction void EntityList::AEBardPulse(Mob *caster, Mob *center, uint16 spell_id, bool affect_caster) { - Mob *curmob; + Mob *curmob = nullptr; float dist = caster->GetAOERange(spell_id); float dist2 = dist * dist; @@ -940,7 +940,7 @@ void EntityList::AEBardPulse(Mob *caster, Mob *center, uint16 spell_id, bool aff //NPCs handle it differently in Mob::Rampage void EntityList::AEAttack(Mob *attacker, float dist, int Hand, int count, bool IsFromSpell) { //Dook- Will need tweaking, currently no pets or players or horses - Mob *curmob; + Mob *curmob = nullptr; float dist2 = dist * dist; diff --git a/zone/merc.cpp b/zone/merc.cpp index 5f8ea59ea..6a1957d45 100644 --- a/zone/merc.cpp +++ b/zone/merc.cpp @@ -2183,7 +2183,7 @@ bool Merc::AICastSpell(int8 iChance, uint32 iSpellTypes) { } if(castedSpell) { - char* gmsg = 0; + char* gmsg = nullptr; if(tar != this) { //we don't need spam of bots healing themselves @@ -2606,8 +2606,8 @@ int16 Merc::GetFocusEffect(focusType type, uint16 spell_id) { //Check if item focus effect exists for the client. if (itembonuses.FocusEffects[type]){ - const EQEmu::ItemData* TempItem = 0; - const EQEmu::ItemData* UsedItem = 0; + const EQEmu::ItemData* TempItem = nullptr; + const EQEmu::ItemData* UsedItem = nullptr; uint16 UsedFocusID = 0; int16 Total = 0; int16 focus_max = 0; @@ -4556,7 +4556,7 @@ void Merc::SetTarget(Mob* mob) { } Mob* Merc::GetOwnerOrSelf() { - Mob* Result = 0; + Mob* Result = nullptr; if(this->GetMercOwner()) Result = GetMercOwner(); @@ -4591,7 +4591,7 @@ bool Merc::Death(Mob* killerMob, int32 damage, uint16 spell, EQEmu::skills::Skil } Client* Merc::GetMercOwner() { - Client* mercOwner = 0; + Client* mercOwner = nullptr; if(GetOwner()) { @@ -4605,7 +4605,7 @@ Client* Merc::GetMercOwner() { } Mob* Merc::GetOwner() { - Mob* Result = 0; + Mob* Result = nullptr; Result = entity_list.GetMob(GetOwnerID()); diff --git a/zone/mob.cpp b/zone/mob.cpp index e7b248dd5..9bde2cc0e 100644 --- a/zone/mob.cpp +++ b/zone/mob.cpp @@ -1292,7 +1292,7 @@ void Mob::CreateHPPacket(EQApplicationPacket* app) void Mob::SendHPUpdate(bool skip_self) { EQApplicationPacket hp_app; - Group *group; + Group *group = nullptr; // destructor will free the pBuffer CreateHPPacket(&hp_app); @@ -2787,7 +2787,7 @@ void Mob::SendArmorAppearance(Client *one_client) { if (!IsClient()) { - const EQEmu::ItemData *item; + const EQEmu::ItemData *item = nullptr; for (int i = 0; i < 7; ++i) { item = database.GetItem(GetEquipment(i)); @@ -2905,7 +2905,7 @@ int32 Mob::GetEquipmentMaterial(uint8 material_slot) const { uint32 equipmaterial = 0; int32 ornamentationAugtype = RuleI(Character, OrnamentationAugmentType); - const EQEmu::ItemData *item; + const EQEmu::ItemData *item = nullptr; item = database.GetItem(GetEquipment(material_slot)); if (item != 0) @@ -2958,7 +2958,7 @@ int32 Mob::GetHerosForgeModel(uint8 material_slot) const if (material_slot >= 0 && material_slot < EQEmu::textures::weaponPrimary) { uint32 ornamentationAugtype = RuleI(Character, OrnamentationAugmentType); - const EQEmu::ItemData *item; + const EQEmu::ItemData *item = nullptr; item = database.GetItem(GetEquipment(material_slot)); int16 invslot = EQEmu::InventoryProfile::CalcSlotFromMaterial(material_slot); @@ -3012,7 +3012,7 @@ int32 Mob::GetHerosForgeModel(uint8 material_slot) const uint32 Mob::GetEquipmentColor(uint8 material_slot) const { - const EQEmu::ItemData *item; + const EQEmu::ItemData *item = nullptr; if (armor_tint.Slot[material_slot].Color) { @@ -3028,7 +3028,7 @@ uint32 Mob::GetEquipmentColor(uint8 material_slot) const uint32 Mob::IsEliteMaterialItem(uint8 material_slot) const { - const EQEmu::ItemData *item; + const EQEmu::ItemData *item = nullptr; item = database.GetItem(GetEquipment(material_slot)); if(item != 0) diff --git a/zone/pets.cpp b/zone/pets.cpp index b9ccafe38..a73f6b54d 100644 --- a/zone/pets.cpp +++ b/zone/pets.cpp @@ -425,7 +425,7 @@ void Mob::MakePoweredPet(uint16 spell_id, const char* pettype, int16 petpower, // like the special back items some focused pets may receive. uint32 petinv[EQEmu::legacy::EQUIPMENT_SIZE]; memset(petinv, 0, sizeof(petinv)); - const EQEmu::ItemData *item = 0; + const EQEmu::ItemData *item = nullptr; if (database.GetBasePetItems(record.equipmentset, petinv)) { for (int i = 0; i < EQEmu::legacy::EQUIPMENT_SIZE; i++) diff --git a/zone/spell_effects.cpp b/zone/spell_effects.cpp index 40d85123f..b6a3d835d 100644 --- a/zone/spell_effects.cpp +++ b/zone/spell_effects.cpp @@ -438,7 +438,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove { float x, y, z, heading; - const char *target_zone; + const char *target_zone = nullptr; x = static_cast(spell.base[1]); y = static_cast(spell.base[0]); @@ -510,7 +510,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove case SE_Teleport2: { float x, y, z, heading; - const char *target_zone; + const char *target_zone = nullptr; x = static_cast(spell.base[1]); y = static_cast(spell.base[0]); @@ -1723,7 +1723,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove #endif // can only summon corpses of clients if(!IsNPC()) { - Client* TargetClient = 0; + Client* TargetClient = nullptr; if(this->GetTarget()) TargetClient = this->GetTarget()->CastToClient(); else @@ -5177,7 +5177,7 @@ uint16 Client::GetSympatheticFocusEffect(focusType type, uint16 spell_id) { //item focus if (itembonuses.FocusEffects[type]){ - const EQEmu::ItemData* TempItem = 0; + const EQEmu::ItemData* TempItem = nullptr; for (int x = EQEmu::legacy::EQUIPMENT_BEGIN; x <= EQEmu::legacy::EQUIPMENT_END; x++) { @@ -5306,8 +5306,8 @@ int16 Client::GetFocusEffect(focusType type, uint16 spell_id) //Check if item focus effect exists for the client. if (itembonuses.FocusEffects[type]){ - const EQEmu::ItemData* TempItem = 0; - const EQEmu::ItemData* UsedItem = 0; + const EQEmu::ItemData* TempItem = nullptr; + const EQEmu::ItemData* UsedItem = nullptr; uint16 UsedFocusID = 0; int16 Total = 0; int16 focus_max = 0; @@ -5578,8 +5578,8 @@ int16 NPC::GetFocusEffect(focusType type, uint16 spell_id) { if (RuleB(Spells, NPC_UseFocusFromItems) && itembonuses.FocusEffects[type]){ - const EQEmu::ItemData* TempItem = 0; - const EQEmu::ItemData* UsedItem = 0; + const EQEmu::ItemData* TempItem = nullptr; + const EQEmu::ItemData* UsedItem = nullptr; uint16 UsedFocusID = 0; int16 Total = 0; int16 focus_max = 0; diff --git a/zone/spells.cpp b/zone/spells.cpp index af09c14a3..e3ec41f30 100644 --- a/zone/spells.cpp +++ b/zone/spells.cpp @@ -826,7 +826,7 @@ void Mob::InterruptSpell(uint16 spellid) // color not used right now void Mob::InterruptSpell(uint16 message, uint16 color, uint16 spellid) { - EQApplicationPacket *outapp; + EQApplicationPacket *outapp = nullptr; uint16 message_other; bool bard_song_mode = false; //has the bard song gone to auto repeat mode if (spellid == SPELL_UNKNOWN) { @@ -1267,7 +1267,7 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, CastingSlot slo { bool fromaug = false; const EQEmu::ItemInstance* inst = CastToClient()->GetInv()[inventory_slot]; - EQEmu::ItemData* augitem = 0; + EQEmu::ItemData* augitem = nullptr; uint32 recastdelay = 0; uint32 recasttype = 0; @@ -3428,7 +3428,7 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob *spelltar, bool reflect, bool use_r } } - EQApplicationPacket *action_packet, *message_packet; + EQApplicationPacket *action_packet = nullptr, *message_packet = nullptr; float spell_effectiveness; if(!IsValidSpell(spell_id)) @@ -3621,19 +3621,19 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob *spelltar, bool reflect, bool use_r spelltar != this) { - Client* pClient = 0; - Raid* pRaid = 0; - Group* pBasicGroup = 0; + Client* pClient = nullptr; + Raid* pRaid = nullptr; + Group* pBasicGroup = nullptr; uint32 nGroup = 0; //raid group - Client* pClientTarget = 0; - Raid* pRaidTarget = 0; - Group* pBasicGroupTarget = 0; + Client* pClientTarget = nullptr; + Raid* pRaidTarget = nullptr; + Group* pBasicGroupTarget = nullptr; uint32 nGroupTarget = 0; //raid group - Client* pClientTargetPet = 0; - Raid* pRaidTargetPet = 0; - Group* pBasicGroupTargetPet = 0; + Client* pClientTargetPet = nullptr; + Raid* pRaidTargetPet = nullptr; + Group* pBasicGroupTargetPet = nullptr; uint32 nGroupTargetPet = 0; //raid group const uint32 cnWTF = 0xFFFFFFFF + 1; //this should be zero unless on 64bit? forced uint64? @@ -4936,7 +4936,7 @@ void Mob::Mesmerize() void Client::MakeBuffFadePacket(uint16 spell_id, int slot_id, bool send_message) { - EQApplicationPacket* outapp; + EQApplicationPacket* outapp = nullptr; outapp = new EQApplicationPacket(OP_Buff, sizeof(SpellBuffPacket_Struct)); SpellBuffPacket_Struct* sbf = (SpellBuffPacket_Struct*) outapp->pBuffer; @@ -5416,7 +5416,7 @@ void Mob::_StopSong() //be used for other things as well void Client::SendBuffDurationPacket(Buffs_Struct &buff, int slot) { - EQApplicationPacket* outapp; + EQApplicationPacket* outapp = nullptr; outapp = new EQApplicationPacket(OP_Buff, sizeof(SpellBuffPacket_Struct)); SpellBuffPacket_Struct* sbf = (SpellBuffPacket_Struct*) outapp->pBuffer; @@ -5452,7 +5452,7 @@ void Client::SendBuffNumHitPacket(Buffs_Struct &buff, int slot) // UF+ use this packet if (ClientVersion() < EQEmu::versions::ClientVersion::UF) return; - EQApplicationPacket *outapp; + EQApplicationPacket *outapp = nullptr; outapp = new EQApplicationPacket(OP_BuffCreate, sizeof(BuffIcon_Struct) + sizeof(BuffIconEntry_Struct)); BuffIcon_Struct *bi = (BuffIcon_Struct *)outapp->pBuffer; bi->entity_id = GetID(); diff --git a/zone/zone.cpp b/zone/zone.cpp index ab0a9b6e4..599e5e802 100644 --- a/zone/zone.cpp +++ b/zone/zone.cpp @@ -290,7 +290,7 @@ bool Zone::LoadGroundSpawns() { Log.Out(Logs::General, Logs::Status, "Loading Ground Spawns from DB..."); database.LoadGroundSpawns(zoneid, GetInstanceVersion(), &groundspawn); uint32 ix=0; - char* name=0; + char* name = nullptr; uint32 gsnumber=0; for(gsindex=0;gsindex<50;gsindex++){ if(groundspawn.spawn[gsindex].item>0 && groundspawn.spawn[gsindex].item iterator(zone_point_list); - ZonePoint* closest_zp = 0; + ZonePoint* closest_zp = nullptr; float closest_dist = FLT_MAX; float max_distance2 = max_distance * max_distance; iterator.Reset(); @@ -1625,7 +1625,7 @@ ZonePoint* Zone::GetClosestZonePoint(const glm::vec3& location, const char* to_n ZonePoint* Zone::GetClosestZonePointWithoutZone(float x, float y, float z, Client* client, float max_distance) { LinkedListIterator iterator(zone_point_list); - ZonePoint* closest_zp = 0; + ZonePoint* closest_zp = nullptr; float closest_dist = FLT_MAX; float max_distance2 = max_distance*max_distance; iterator.Reset(); diff --git a/zone/zoning.cpp b/zone/zoning.cpp index 30dc4d81f..677dd3d18 100644 --- a/zone/zoning.cpp +++ b/zone/zoning.cpp @@ -297,7 +297,7 @@ void Client::SendZoneCancel(ZoneChange_Struct *zc) { //effectively zone them right back to where they were //unless we find a better way to stop the zoning process. SetPortExemption(true); - EQApplicationPacket *outapp; + EQApplicationPacket *outapp = nullptr; outapp = new EQApplicationPacket(OP_ZoneChange, sizeof(ZoneChange_Struct)); ZoneChange_Struct *zc2 = (ZoneChange_Struct*)outapp->pBuffer; strcpy(zc2->char_name, zc->char_name); @@ -316,7 +316,7 @@ void Client::SendZoneError(ZoneChange_Struct *zc, int8 err) SetPortExemption(true); - EQApplicationPacket *outapp; + EQApplicationPacket *outapp = nullptr; outapp = new EQApplicationPacket(OP_ZoneChange, sizeof(ZoneChange_Struct)); ZoneChange_Struct *zc2 = (ZoneChange_Struct*)outapp->pBuffer; strcpy(zc2->char_name, zc->char_name); From 9e417955949df27afb476e95cfb0e7bbc831a207 Mon Sep 17 00:00:00 2001 From: Uleat Date: Sat, 25 Mar 2017 15:44:38 -0400 Subject: [PATCH 23/28] Test fix for heal rotations crashing server surrounding player zoning --- zone/heal_rotation.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/zone/heal_rotation.cpp b/zone/heal_rotation.cpp index 6981cc0c1..96703818f 100644 --- a/zone/heal_rotation.cpp +++ b/zone/heal_rotation.cpp @@ -646,7 +646,10 @@ void HealRotation::bias_targets() // attempt to clear invalid target pool entries m_target_pool.remove(nullptr); - m_target_pool.remove_if([](Mob* l) { return (!IsHealRotationTargetMobType(l)); }); + m_target_pool.remove_if([](Mob* l) { + try { return (!IsHealRotationTargetMobType(l)); } + catch (...) { return true; } + }); uint32 sort_type = 0; // debug From 719098a97ce43225a0d9a3bd51b1358690efb3f6 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Sat, 25 Mar 2017 23:32:49 -0500 Subject: [PATCH 24/28] [Performance] Reduced CPU footprint in non-combat zones doing constant checks for combat related activities --- changelog.txt | 3 ++ zone/client_process.cpp | 2 +- zone/mob_ai.cpp | 107 ++++++++++++++++++++++------------------ 3 files changed, 62 insertions(+), 50 deletions(-) diff --git a/changelog.txt b/changelog.txt index 9514c812c..ea457ed67 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,5 +1,8 @@ EQEMu Changelog (Started on Sept 24, 2003 15:50) ------------------------------------------------------- +== 03/25/2017 == +Akkadius: Reduced CPU footprint in non-combat zones doing constant checks for combat related activities + == 03/12/2017 == Akkadius: - Implemented range rules for packets and other functions diff --git a/zone/client_process.cpp b/zone/client_process.cpp index 57ed6283c..b2a010542 100644 --- a/zone/client_process.cpp +++ b/zone/client_process.cpp @@ -616,7 +616,7 @@ bool Client::Process() { //At this point, we are still connected, everything important has taken //place, now check to see if anybody wants to aggro us. // only if client is not feigned - if(ret && !GetFeigned() && scanarea_timer.Check()) { + if(zone->CanDoCombat() && ret && !GetFeigned() && scanarea_timer.Check()) { entity_list.CheckClientAggro(this); } #endif diff --git a/zone/mob_ai.cpp b/zone/mob_ai.cpp index f6e6fa019..d0298ac55 100644 --- a/zone/mob_ai.cpp +++ b/zone/mob_ai.cpp @@ -726,6 +726,7 @@ void Client::AI_SpellCast() void Client::AI_Process() { + if (!IsAIControlled()) return; @@ -956,6 +957,10 @@ void Mob::AI_Process() { bool engaged = IsEngaged(); bool doranged = false; + if (!zone->CanDoCombat()) { + engaged = false; + } + // Begin: Additions for Wiz Fear Code // if(RuleB(Combat, EnableFearPathing)){ @@ -1016,13 +1021,14 @@ void Mob::AI_Process() { SetTarget(hate_list.GetClosestEntOnHateList(this)); else { - if(AI_target_check_timer->Check()) + if (AI_target_check_timer->Check()) { if (IsFocused()) { if (!target) { SetTarget(hate_list.GetEntWithMostHateOnList(this)); } - } else { + } + else { if (!ImprovedTaunt()) SetTarget(hate_list.GetEntWithMostHateOnList(this)); } @@ -1042,28 +1048,29 @@ void Mob::AI_Process() { #ifdef BOTS if (IsPet() && GetOwner() && GetOwner()->IsBot() && target == GetOwner()) { - // this blocks all pet attacks against owner..bot pet test (copied above check) - RemoveFromHateList(this); - return; + // this blocks all pet attacks against owner..bot pet test (copied above check) + RemoveFromHateList(this); + return; } #endif //BOTS - if(DivineAura()) + if (DivineAura()) return; - auto npcSpawnPoint = CastToNPC()->GetSpawnPoint(); - if(GetSpecialAbility(TETHER)) { + auto npcSpawnPoint = CastToNPC()->GetSpawnPoint(); + if (GetSpecialAbility(TETHER)) { float tether_range = static_cast(GetSpecialAbilityParam(TETHER, 0)); tether_range = tether_range > 0.0f ? tether_range * tether_range : pAggroRange * pAggroRange; - if(DistanceSquaredNoZ(m_Position, npcSpawnPoint) > tether_range) { + if (DistanceSquaredNoZ(m_Position, npcSpawnPoint) > tether_range) { GMMove(npcSpawnPoint.x, npcSpawnPoint.y, npcSpawnPoint.z, npcSpawnPoint.w); } - } else if(GetSpecialAbility(LEASH)) { + } + else if (GetSpecialAbility(LEASH)) { float leash_range = static_cast(GetSpecialAbilityParam(LEASH, 0)); leash_range = leash_range > 0.0f ? leash_range * leash_range : pAggroRange * pAggroRange; - if(DistanceSquaredNoZ(m_Position, npcSpawnPoint) > leash_range) { + if (DistanceSquaredNoZ(m_Position, npcSpawnPoint) > leash_range) { GMMove(npcSpawnPoint.x, npcSpawnPoint.y, npcSpawnPoint.z, npcSpawnPoint.w); SetHP(GetMaxHP()); BuffFadeAll(); @@ -1080,16 +1087,16 @@ void Mob::AI_Process() { { if (AI_movement_timer->Check()) { - if(CalculateHeadingToTarget(GetTarget()->GetX(), GetTarget()->GetY()) != m_Position.w) + if (CalculateHeadingToTarget(GetTarget()->GetX(), GetTarget()->GetY()) != m_Position.w) { SetHeading(CalculateHeadingToTarget(GetTarget()->GetX(), GetTarget()->GetY())); SendPosition(); } SetCurrentSpeed(0); } - if(IsMoving()) + if (IsMoving()) { - if(CalculateHeadingToTarget(GetTarget()->GetX(), GetTarget()->GetY()) != m_Position.w) + if (CalculateHeadingToTarget(GetTarget()->GetX(), GetTarget()->GetY()) != m_Position.w) { SetHeading(CalculateHeadingToTarget(GetTarget()->GetX(), GetTarget()->GetY())); SendPosition(); @@ -1098,13 +1105,13 @@ void Mob::AI_Process() { } //casting checked above... - if(target && !IsStunned() && !IsMezzed() && GetAppearance() != eaDead && !IsMeleeDisabled()) { + if (target && !IsStunned() && !IsMezzed() && GetAppearance() != eaDead && !IsMeleeDisabled()) { //we should check to see if they die mid-attacks, previous //crap of checking target for null was not gunna cut it //try main hand first - if(attack_timer.Check()) { + if (attack_timer.Check()) { DoMainHandAttackRounds(target); TriggerDefensiveProcs(target, EQEmu::inventory::slotPrimary, false); @@ -1150,17 +1157,17 @@ void Mob::AI_Process() { if (owner) { int16 flurry_chance = owner->aabonuses.PetFlurry + - owner->spellbonuses.PetFlurry + owner->itembonuses.PetFlurry; + owner->spellbonuses.PetFlurry + owner->itembonuses.PetFlurry; if (flurry_chance && zone->random.Roll(flurry_chance)) Flurry(nullptr); } } - if ((IsPet() || IsTempPet()) && IsPetOwnerClient()){ - if (spellbonuses.PC_Pet_Rampage[0] || itembonuses.PC_Pet_Rampage[0] || aabonuses.PC_Pet_Rampage[0]){ + if ((IsPet() || IsTempPet()) && IsPetOwnerClient()) { + if (spellbonuses.PC_Pet_Rampage[0] || itembonuses.PC_Pet_Rampage[0] || aabonuses.PC_Pet_Rampage[0]) { int chance = spellbonuses.PC_Pet_Rampage[0] + itembonuses.PC_Pet_Rampage[0] + aabonuses.PC_Pet_Rampage[0]; - if(zone->random.Roll(chance)) { + if (zone->random.Roll(chance)) { Rampage(nullptr); } } @@ -1170,30 +1177,30 @@ void Mob::AI_Process() { { int rampage_chance = GetSpecialAbilityParam(SPECATK_RAMPAGE, 0); rampage_chance = rampage_chance > 0 ? rampage_chance : 20; - if(zone->random.Roll(rampage_chance)) { + if (zone->random.Roll(rampage_chance)) { ExtraAttackOptions opts; int cur = GetSpecialAbilityParam(SPECATK_RAMPAGE, 3); - if(cur > 0) { + if (cur > 0) { opts.damage_flat = cur; } cur = GetSpecialAbilityParam(SPECATK_RAMPAGE, 4); - if(cur > 0) { + if (cur > 0) { opts.armor_pen_percent = cur / 100.0f; } cur = GetSpecialAbilityParam(SPECATK_RAMPAGE, 5); - if(cur > 0) { + if (cur > 0) { opts.armor_pen_flat = cur; } cur = GetSpecialAbilityParam(SPECATK_RAMPAGE, 6); - if(cur > 0) { + if (cur > 0) { opts.crit_percent = cur / 100.0f; } cur = GetSpecialAbilityParam(SPECATK_RAMPAGE, 7); - if(cur > 0) { + if (cur > 0) { opts.crit_flat = cur; } Rampage(&opts); @@ -1205,30 +1212,30 @@ void Mob::AI_Process() { { int rampage_chance = GetSpecialAbilityParam(SPECATK_AREA_RAMPAGE, 0); rampage_chance = rampage_chance > 0 ? rampage_chance : 20; - if(zone->random.Roll(rampage_chance)) { + if (zone->random.Roll(rampage_chance)) { ExtraAttackOptions opts; int cur = GetSpecialAbilityParam(SPECATK_AREA_RAMPAGE, 3); - if(cur > 0) { + if (cur > 0) { opts.damage_flat = cur; } cur = GetSpecialAbilityParam(SPECATK_AREA_RAMPAGE, 4); - if(cur > 0) { + if (cur > 0) { opts.armor_pen_percent = cur / 100.0f; } cur = GetSpecialAbilityParam(SPECATK_AREA_RAMPAGE, 5); - if(cur > 0) { + if (cur > 0) { opts.armor_pen_flat = cur; } cur = GetSpecialAbilityParam(SPECATK_AREA_RAMPAGE, 6); - if(cur > 0) { + if (cur > 0) { opts.crit_percent = cur / 100.0f; } cur = GetSpecialAbilityParam(SPECATK_AREA_RAMPAGE, 7); - if(cur > 0) { + if (cur > 0) { opts.crit_flat = cur; } @@ -1243,7 +1250,7 @@ void Mob::AI_Process() { DoOffHandAttackRounds(target); //now special attacks (kick, etc) - if(IsNPC()) + if (IsNPC()) CastToNPC()->DoClassAttacks(target); } @@ -1252,18 +1259,19 @@ void Mob::AI_Process() { else { //we cannot reach our target... //underwater stuff only works with water maps in the zone! - if(IsNPC() && CastToNPC()->IsUnderwaterOnly() && zone->HasWaterMap()) { - auto targetPosition = glm::vec3(target->GetX(), target->GetY(), target->GetZ()); - if(!zone->watermap->InLiquid(targetPosition)) { + if (IsNPC() && CastToNPC()->IsUnderwaterOnly() && zone->HasWaterMap()) { + auto targetPosition = glm::vec3(target->GetX(), target->GetY(), target->GetZ()); + if (!zone->watermap->InLiquid(targetPosition)) { Mob *tar = hate_list.GetEntWithMostHateOnList(this); - if(tar == target) { + if (tar == target) { WipeHateList(); Heal(); BuffFadeAll(); AI_walking_timer->Start(100); pLastFightingDelayMoving = Timer::GetCurrentTime(); return; - } else if(tar != nullptr) { + } + else if (tar != nullptr) { SetTarget(tar); return; } @@ -1274,35 +1282,35 @@ void Mob::AI_Process() { if (!HateSummon()) { //could not summon them, check ranged... - if(GetSpecialAbility(SPECATK_RANGED_ATK)) + if (GetSpecialAbility(SPECATK_RANGED_ATK)) doranged = true; // Now pursue // TODO: Check here for another person on hate list with close hate value - if(AI_PursueCastCheck()){ + if (AI_PursueCastCheck()) { //we did something, so do not process movement. } else if (AI_movement_timer->Check()) { - if(!IsRooted()) { + if (!IsRooted()) { Log.Out(Logs::Detail, Logs::AI, "Pursuing %s while engaged.", target->GetName()); - if(!RuleB(Pathing, Aggro) || !zone->pathing) + if (!RuleB(Pathing, Aggro) || !zone->pathing) CalculateNewPosition2(target->GetX(), target->GetY(), target->GetZ(), GetRunspeed()); else { bool WaypointChanged, NodeReached; glm::vec3 Goal = UpdatePath(target->GetX(), target->GetY(), target->GetZ(), - GetRunspeed(), WaypointChanged, NodeReached); + GetRunspeed(), WaypointChanged, NodeReached); - if(WaypointChanged) + if (WaypointChanged) tar_ndx = 20; CalculateNewPosition2(Goal.x, Goal.y, Goal.z, GetRunspeed()); } } - else if(IsMoving()) { + else if (IsMoving()) { SetHeading(CalculateHeadingToTarget(target->GetX(), target->GetY())); SetCurrentSpeed(0); @@ -1311,11 +1319,12 @@ void Mob::AI_Process() { } } } - else - { + else { + if (m_PlayerState & static_cast(PlayerState::Aggressive)) SendRemovePlayerState(PlayerState::Aggressive); - if(AI_feign_remember_timer->Check()) { + + if(!zone->CanDoCombat() && AI_feign_remember_timer->Check()) { // 6/14/06 // Improved Feign Death Memory // check to see if any of our previous feigned targets have gotten up. @@ -1340,7 +1349,7 @@ void Mob::AI_Process() { { //we processed a spell action, so do nothing else. } - else if (AI_scan_area_timer->Check()) + else if (!zone->CanDoCombat() && AI_scan_area_timer->Check()) { /* * This is where NPCs look around to see if they want to attack anybody. From aa25946dc2d6aefb8978fa7990d8d104e1e8d97c Mon Sep 17 00:00:00 2001 From: Akkadius Date: Sun, 26 Mar 2017 00:03:51 -0500 Subject: [PATCH 25/28] [Performance] Reduced CPU footprint in cases where a client is checking for aggro excessively every 750 millseconds. This has been adjusted to 6 seconds per new rule RULE_INT(Aggro, ClientAggroCheckInterval) - When zones have many players, with many NPC's, this adds up quickly --- changelog.txt | 3 +++ common/features.h | 2 +- common/ruletypes.h | 1 + zone/client.cpp | 4 ++-- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/changelog.txt b/changelog.txt index ea457ed67..b2c71a440 100644 --- a/changelog.txt +++ b/changelog.txt @@ -2,6 +2,9 @@ EQEMu Changelog (Started on Sept 24, 2003 15:50) ------------------------------------------------------- == 03/25/2017 == Akkadius: Reduced CPU footprint in non-combat zones doing constant checks for combat related activities +Akkadius: Reduced CPU footprint in cases where a client is checking for aggro excessively every 750 millseconds. This has + been adjusted to 6 seconds per new rule RULE_INT(Aggro, ClientAggroCheckInterval) + - When zones have many players, with many NPC's, this adds up quickly == 03/12/2017 == Akkadius: diff --git a/common/features.h b/common/features.h index 4140014d8..863004666 100644 --- a/common/features.h +++ b/common/features.h @@ -157,7 +157,7 @@ enum { //timer settings, all in milliseconds AIscanarea_delay = 6000, AIfeignremember_delay = 500, AItarget_check_duration = 500, - AIClientScanarea_delay = 750, //used in REVERSE_AGGRO + // AIClientScanarea_delay = 750, //used in REVERSE_AGGRO AIassistcheck_delay = 3000, //now often a fighting NPC will yell for help AI_check_signal_timer_delay = 500, // How often EVENT_SIGNAL checks are processed ClientProximity_interval = 150, diff --git a/common/ruletypes.h b/common/ruletypes.h index 0bac4d6df..a6653da8e 100644 --- a/common/ruletypes.h +++ b/common/ruletypes.h @@ -536,6 +536,7 @@ RULE_INT(Aggro, MaxScalingProcAggro, 400) // Set to -1 for no limit. Maxmimum am RULE_INT(Aggro, IntAggroThreshold, 75) // Int <= this will aggro regardless of level difference. RULE_BOOL(Aggro, AllowTickPulling, false) // tick pulling is an exploit in an NPC's call for help fixed sometime in 2006 on live RULE_BOOL(Aggro, UseLevelAggro, true) // Level 18+ and Undead will aggro regardless of level difference. (this will disabled Rule:IntAggroThreshold if set to true) +RULE_INT(Aggro, ClientAggroCheckInterval, 6) // Interval in which clients actually check for aggro - in seconds RULE_CATEGORY_END() RULE_CATEGORY(TaskSystem) diff --git a/zone/client.cpp b/zone/client.cpp index fa683a267..2170d8ba9 100644 --- a/zone/client.cpp +++ b/zone/client.cpp @@ -133,9 +133,9 @@ Client::Client(EQStreamInterface* ieqs) fishing_timer(8000), endupkeep_timer(1000), forget_timer(0), - autosave_timer(RuleI(Character, AutosaveIntervalS)*1000), + autosave_timer(RuleI(Character, AutosaveIntervalS) * 1000), #ifdef REVERSE_AGGRO - scanarea_timer(AIClientScanarea_delay), + scanarea_timer(RuleI(Aggro, ClientAggroCheckInterval) * 1000), #endif tribute_timer(Tribute_duration), proximity_timer(ClientProximity_interval), From 7309c11630443c8a5a2d6d38578b79b7e5df40e7 Mon Sep 17 00:00:00 2001 From: Uleat Date: Sun, 26 Mar 2017 13:41:14 -0400 Subject: [PATCH 26/28] Updated glm library to 0.9.8.4 (from 0.9.6.1) --- common/glm/copying.txt | 37 +- common/glm/glm/CMakeLists.txt | 43 +- common/glm/glm/common.hpp | 29 - common/glm/glm/detail/_features.hpp | 33 +- common/glm/glm/detail/_fixes.hpp | 29 - common/glm/glm/detail/_noise.hpp | 29 - common/glm/glm/detail/_swizzle.hpp | 1094 ++++++++--------- common/glm/glm/detail/_swizzle_func.hpp | 29 - common/glm/glm/detail/_vectorize.hpp | 29 - common/glm/glm/detail/dummy.cpp | 57 +- common/glm/glm/detail/func_common.hpp | 29 - common/glm/glm/detail/func_common.inl | 675 +++++----- common/glm/glm/detail/func_exponential.hpp | 29 - common/glm/glm/detail/func_exponential.inl | 57 +- common/glm/glm/detail/func_geometric.hpp | 39 +- common/glm/glm/detail/func_geometric.inl | 180 ++- common/glm/glm/detail/func_integer.hpp | 29 - common/glm/glm/detail/func_integer.inl | 105 +- common/glm/glm/detail/func_matrix.hpp | 43 +- common/glm/glm/detail/func_matrix.inl | 231 ++-- common/glm/glm/detail/func_noise.hpp | 93 -- common/glm/glm/detail/func_noise.inl | 388 ------ common/glm/glm/detail/func_packing.hpp | 45 +- common/glm/glm/detail/func_packing.inl | 206 ++-- common/glm/glm/detail/func_trigonometric.hpp | 33 +- common/glm/glm/detail/func_trigonometric.inl | 58 +- .../glm/glm/detail/func_vector_relational.hpp | 29 - .../glm/glm/detail/func_vector_relational.inl | 62 +- common/glm/glm/detail/glm.cpp | 29 - common/glm/glm/detail/intrinsic_common.hpp | 87 -- common/glm/glm/detail/intrinsic_common.inl | 313 ----- .../glm/glm/detail/intrinsic_exponential.hpp | 77 -- .../glm/glm/detail/intrinsic_exponential.inl | 27 - common/glm/glm/detail/intrinsic_geometric.hpp | 74 -- common/glm/glm/detail/intrinsic_geometric.inl | 147 --- common/glm/glm/detail/intrinsic_integer.hpp | 48 - common/glm/glm/detail/intrinsic_integer.inl | 139 --- common/glm/glm/detail/intrinsic_matrix.hpp | 67 - common/glm/glm/detail/intrinsic_matrix.inl | 1070 ---------------- .../glm/detail/intrinsic_trigonometric.hpp | 46 - .../glm/detail/intrinsic_trigonometric.inl | 27 - .../detail/intrinsic_vector_relational.hpp | 46 - .../detail/intrinsic_vector_relational.inl | 366 ------ common/glm/glm/detail/precision.hpp | 85 +- common/glm/glm/detail/setup.hpp | 1060 ++++++++-------- common/glm/glm/detail/type_float.hpp | 29 - common/glm/glm/detail/type_gentype.hpp | 29 - common/glm/glm/detail/type_gentype.inl | 29 - common/glm/glm/detail/type_half.hpp | 29 - common/glm/glm/detail/type_half.inl | 41 +- common/glm/glm/detail/type_int.hpp | 80 +- common/glm/glm/detail/type_mat.hpp | 32 +- common/glm/glm/detail/type_mat.inl | 29 - common/glm/glm/detail/type_mat2x2.hpp | 173 +-- common/glm/glm/detail/type_mat2x2.inl | 267 ++-- common/glm/glm/detail/type_mat2x3.hpp | 212 ++-- common/glm/glm/detail/type_mat2x3.inl | 217 ++-- common/glm/glm/detail/type_mat2x4.hpp | 221 ++-- common/glm/glm/detail/type_mat2x4.inl | 211 ++-- common/glm/glm/detail/type_mat3x2.hpp | 224 ++-- common/glm/glm/detail/type_mat3x2.inl | 241 ++-- common/glm/glm/detail/type_mat3x3.hpp | 240 ++-- common/glm/glm/detail/type_mat3x3.inl | 291 ++--- common/glm/glm/detail/type_mat3x4.hpp | 163 +-- common/glm/glm/detail/type_mat3x4.inl | 250 ++-- common/glm/glm/detail/type_mat4x2.hpp | 182 ++- common/glm/glm/detail/type_mat4x2.inl | 281 ++--- common/glm/glm/detail/type_mat4x3.hpp | 117 +- common/glm/glm/detail/type_mat4x3.inl | 248 ++-- common/glm/glm/detail/type_mat4x4.hpp | 125 +- common/glm/glm/detail/type_mat4x4.inl | 316 ++--- common/glm/glm/detail/type_vec.hpp | 180 ++- common/glm/glm/detail/type_vec.inl | 29 - common/glm/glm/detail/type_vec1.hpp | 359 +++--- common/glm/glm/detail/type_vec1.inl | 350 +++--- common/glm/glm/detail/type_vec2.hpp | 298 +++-- common/glm/glm/detail/type_vec2.inl | 418 +++---- common/glm/glm/detail/type_vec3.hpp | 331 +++-- common/glm/glm/detail/type_vec3.inl | 648 +++++----- common/glm/glm/detail/type_vec4.hpp | 365 +++--- common/glm/glm/detail/type_vec4.inl | 1044 +++++++--------- common/glm/glm/detail/type_vec4_avx.inl | 41 - common/glm/glm/detail/type_vec4_avx2.inl | 41 - common/glm/glm/detail/type_vec4_sse2.inl | 120 -- common/glm/glm/exponential.hpp | 29 - common/glm/glm/ext.hpp | 49 +- common/glm/glm/fwd.hpp | 69 +- common/glm/glm/geometric.hpp | 29 - common/glm/glm/glm.hpp | 67 +- common/glm/glm/gtc/bitfield.hpp | 31 +- common/glm/glm/gtc/bitfield.inl | 151 +-- common/glm/glm/gtc/constants.hpp | 89 +- common/glm/glm/gtc/constants.inl | 87 +- common/glm/glm/gtc/epsilon.hpp | 31 +- common/glm/glm/gtc/epsilon.inl | 29 - common/glm/glm/gtc/integer.hpp | 61 +- common/glm/glm/gtc/integer.inl | 81 +- common/glm/glm/gtc/matrix_access.hpp | 35 +- common/glm/glm/gtc/matrix_access.inl | 41 +- common/glm/glm/gtc/matrix_integer.hpp | 33 +- common/glm/glm/gtc/matrix_inverse.hpp | 35 +- common/glm/glm/gtc/matrix_inverse.inl | 54 +- common/glm/glm/gtc/matrix_transform.hpp | 281 ++++- common/glm/glm/gtc/matrix_transform.inl | 477 ++++--- common/glm/glm/gtc/noise.hpp | 33 +- common/glm/glm/gtc/noise.inl | 31 +- common/glm/glm/gtc/packing.hpp | 167 ++- common/glm/glm/gtc/packing.inl | 533 ++++++-- common/glm/glm/gtc/quaternion.hpp | 214 ++-- common/glm/glm/gtc/quaternion.inl | 324 ++--- common/glm/glm/gtc/random.hpp | 44 +- common/glm/glm/gtc/random.inl | 51 +- common/glm/glm/gtc/reciprocal.hpp | 139 +-- common/glm/glm/gtc/reciprocal.inl | 29 - common/glm/glm/gtc/round.hpp | 35 +- common/glm/glm/gtc/round.inl | 50 +- common/glm/glm/gtc/type_precision.hpp | 39 +- common/glm/glm/gtc/type_precision.inl | 29 - common/glm/glm/gtc/type_ptr.hpp | 39 +- common/glm/glm/gtc/type_ptr.inl | 29 - common/glm/glm/gtc/ulp.hpp | 33 +- common/glm/glm/gtc/ulp.inl | 41 +- common/glm/glm/gtc/vec1.hpp | 31 +- common/glm/glm/gtc/vec1.inl | 29 - common/glm/glm/gtx/associated_min_max.hpp | 31 +- common/glm/glm/gtx/associated_min_max.inl | 61 +- common/glm/glm/gtx/bit.hpp | 35 +- common/glm/glm/gtx/bit.inl | 44 +- common/glm/glm/gtx/closest_point.hpp | 33 +- common/glm/glm/gtx/closest_point.inl | 29 - common/glm/glm/gtx/color_space.hpp | 35 +- common/glm/glm/gtx/color_space.inl | 51 +- common/glm/glm/gtx/color_space_YCoCg.hpp | 33 +- common/glm/glm/gtx/color_space_YCoCg.inl | 119 +- common/glm/glm/gtx/common.hpp | 43 +- common/glm/glm/gtx/common.inl | 70 +- common/glm/glm/gtx/compatibility.hpp | 40 +- common/glm/glm/gtx/compatibility.inl | 42 +- common/glm/glm/gtx/component_wise.hpp | 57 +- common/glm/glm/gtx/component_wise.inl | 150 ++- common/glm/glm/gtx/dual_quaternion.hpp | 232 ++-- common/glm/glm/gtx/dual_quaternion.inl | 190 ++- common/glm/glm/gtx/euler_angles.hpp | 53 +- common/glm/glm/gtx/euler_angles.inl | 85 +- common/glm/glm/gtx/extend.hpp | 35 +- common/glm/glm/gtx/extend.inl | 29 - common/glm/glm/gtx/extented_min_max.hpp | 162 --- common/glm/glm/gtx/extented_min_max.inl | 169 --- common/glm/glm/gtx/fast_exponential.hpp | 35 +- common/glm/glm/gtx/fast_exponential.inl | 31 +- common/glm/glm/gtx/fast_square_root.hpp | 35 +- common/glm/glm/gtx/fast_square_root.inl | 35 +- common/glm/glm/gtx/fast_trigonometry.hpp | 35 +- common/glm/glm/gtx/fast_trigonometry.inl | 45 +- common/glm/glm/gtx/gradient_paint.hpp | 33 +- common/glm/glm/gtx/gradient_paint.inl | 29 - .../glm/glm/gtx/handed_coordinate_space.hpp | 35 +- .../glm/glm/gtx/handed_coordinate_space.inl | 29 - common/glm/glm/gtx/integer.hpp | 35 +- common/glm/glm/gtx/integer.inl | 29 - common/glm/glm/gtx/intersect.hpp | 41 +- common/glm/glm/gtx/intersect.inl | 55 +- common/glm/glm/gtx/io.hpp | 71 +- common/glm/glm/gtx/io.inl | 623 ++++------ common/glm/glm/gtx/log_base.hpp | 47 +- common/glm/glm/gtx/log_base.inl | 29 - common/glm/glm/gtx/matrix_cross_product.hpp | 35 +- common/glm/glm/gtx/matrix_cross_product.inl | 29 - common/glm/glm/gtx/matrix_decompose.hpp | 40 +- common/glm/glm/gtx/matrix_decompose.inl | 100 +- common/glm/glm/gtx/matrix_interpolation.hpp | 34 +- common/glm/glm/gtx/matrix_interpolation.inl | 29 - common/glm/glm/gtx/matrix_major_storage.hpp | 35 +- common/glm/glm/gtx/matrix_major_storage.inl | 29 - common/glm/glm/gtx/matrix_operation.hpp | 35 +- common/glm/glm/gtx/matrix_operation.inl | 29 - common/glm/glm/gtx/matrix_query.hpp | 35 +- common/glm/glm/gtx/matrix_query.inl | 67 +- common/glm/glm/gtx/matrix_transform_2d.hpp | 34 +- common/glm/glm/gtx/matrix_transform_2d.inl | 28 - common/glm/glm/gtx/mixed_product.hpp | 35 +- common/glm/glm/gtx/mixed_product.inl | 29 - common/glm/glm/gtx/multiple.hpp | 106 -- common/glm/glm/gtx/multiple.inl | 64 - common/glm/glm/gtx/norm.hpp | 66 +- common/glm/glm/gtx/norm.inl | 116 +- common/glm/glm/gtx/normal.hpp | 35 +- common/glm/glm/gtx/normal.inl | 29 - common/glm/glm/gtx/normalize_dot.hpp | 35 +- common/glm/glm/gtx/normalize_dot.inl | 29 - common/glm/glm/gtx/number_precision.hpp | 35 +- common/glm/glm/gtx/number_precision.inl | 29 - common/glm/glm/gtx/optimum_pow.hpp | 35 +- common/glm/glm/gtx/optimum_pow.inl | 29 - common/glm/glm/gtx/orthonormalize.hpp | 35 +- common/glm/glm/gtx/orthonormalize.inl | 29 - common/glm/glm/gtx/perpendicular.hpp | 35 +- common/glm/glm/gtx/perpendicular.inl | 29 - common/glm/glm/gtx/polar_coordinates.hpp | 35 +- common/glm/glm/gtx/polar_coordinates.inl | 31 +- common/glm/glm/gtx/projection.hpp | 35 +- common/glm/glm/gtx/projection.inl | 29 - common/glm/glm/gtx/quaternion.hpp | 37 +- common/glm/glm/gtx/quaternion.inl | 145 +-- common/glm/glm/gtx/range.hpp | 101 +- common/glm/glm/gtx/raw_data.hpp | 35 +- common/glm/glm/gtx/raw_data.inl | 29 - common/glm/glm/gtx/rotate_normalized_axis.hpp | 37 +- common/glm/glm/gtx/rotate_normalized_axis.inl | 29 - common/glm/glm/gtx/rotate_vector.hpp | 35 +- common/glm/glm/gtx/rotate_vector.inl | 29 - common/glm/glm/gtx/scalar_multiplication.hpp | 33 +- common/glm/glm/gtx/scalar_relational.hpp | 35 +- common/glm/glm/gtx/scalar_relational.inl | 29 - common/glm/glm/gtx/simd_mat4.hpp | 49 +- common/glm/glm/gtx/simd_mat4.inl | 77 +- common/glm/glm/gtx/simd_quat.hpp | 148 +-- common/glm/glm/gtx/simd_quat.inl | 77 +- common/glm/glm/gtx/simd_vec4.hpp | 132 +- common/glm/glm/gtx/simd_vec4.inl | 58 +- common/glm/glm/gtx/spline.hpp | 35 +- common/glm/glm/gtx/spline.inl | 29 - common/glm/glm/gtx/std_based_type.hpp | 33 +- common/glm/glm/gtx/std_based_type.inl | 29 - common/glm/glm/gtx/string_cast.hpp | 37 +- common/glm/glm/gtx/string_cast.inl | 87 +- common/glm/glm/gtx/transform.hpp | 35 +- common/glm/glm/gtx/transform.inl | 48 +- common/glm/glm/gtx/transform2.hpp | 33 +- common/glm/glm/gtx/transform2.inl | 139 +-- common/glm/glm/gtx/type_aligned.hpp | 41 +- common/glm/glm/gtx/type_aligned.inl | 29 - common/glm/glm/gtx/vector_angle.hpp | 41 +- common/glm/glm/gtx/vector_angle.inl | 29 - common/glm/glm/gtx/vector_query.hpp | 33 +- common/glm/glm/gtx/vector_query.inl | 29 - common/glm/glm/gtx/wrap.hpp | 53 +- common/glm/glm/gtx/wrap.inl | 183 +-- common/glm/glm/integer.hpp | 29 - common/glm/glm/mat2x2.hpp | 29 - common/glm/glm/mat2x3.hpp | 29 - common/glm/glm/mat2x4.hpp | 29 - common/glm/glm/mat3x2.hpp | 29 - common/glm/glm/mat3x3.hpp | 29 - common/glm/glm/mat3x4.hpp | 29 - common/glm/glm/mat4x2.hpp | 29 - common/glm/glm/mat4x3.hpp | 31 +- common/glm/glm/mat4x4.hpp | 29 - common/glm/glm/matrix.hpp | 29 - common/glm/glm/packing.hpp | 29 - common/glm/glm/trigonometric.hpp | 29 - common/glm/glm/vec2.hpp | 29 - common/glm/glm/vec3.hpp | 29 - common/glm/glm/vec4.hpp | 29 - common/glm/glm/vector_relational.hpp | 29 - common/glm/readme.txt | 701 ----------- 256 files changed, 8824 insertions(+), 18647 deletions(-) delete mode 100644 common/glm/glm/detail/func_noise.hpp delete mode 100644 common/glm/glm/detail/func_noise.inl delete mode 100644 common/glm/glm/detail/intrinsic_common.hpp delete mode 100644 common/glm/glm/detail/intrinsic_common.inl delete mode 100644 common/glm/glm/detail/intrinsic_exponential.hpp delete mode 100644 common/glm/glm/detail/intrinsic_exponential.inl delete mode 100644 common/glm/glm/detail/intrinsic_geometric.hpp delete mode 100644 common/glm/glm/detail/intrinsic_geometric.inl delete mode 100644 common/glm/glm/detail/intrinsic_integer.hpp delete mode 100644 common/glm/glm/detail/intrinsic_integer.inl delete mode 100644 common/glm/glm/detail/intrinsic_matrix.hpp delete mode 100644 common/glm/glm/detail/intrinsic_matrix.inl delete mode 100644 common/glm/glm/detail/intrinsic_trigonometric.hpp delete mode 100644 common/glm/glm/detail/intrinsic_trigonometric.inl delete mode 100644 common/glm/glm/detail/intrinsic_vector_relational.hpp delete mode 100644 common/glm/glm/detail/intrinsic_vector_relational.inl delete mode 100644 common/glm/glm/detail/type_vec4_avx.inl delete mode 100644 common/glm/glm/detail/type_vec4_avx2.inl delete mode 100644 common/glm/glm/detail/type_vec4_sse2.inl delete mode 100644 common/glm/glm/gtx/extented_min_max.hpp delete mode 100644 common/glm/glm/gtx/extented_min_max.inl delete mode 100644 common/glm/glm/gtx/multiple.hpp delete mode 100644 common/glm/glm/gtx/multiple.inl delete mode 100644 common/glm/readme.txt diff --git a/common/glm/copying.txt b/common/glm/copying.txt index efd93bab9..7c20b4a67 100644 --- a/common/glm/copying.txt +++ b/common/glm/copying.txt @@ -1,6 +1,39 @@ -The MIT License +================================================================================ +OpenGL Mathematics (GLM) +-------------------------------------------------------------------------------- +GLM can be distributed and/or modified under the terms of either +a) The Happy Bunny License, or b) the MIT License. -Copyright (c) 2005 - 2013 G-Truc Creation +================================================================================ +The Happy Bunny License (Modified MIT License) +-------------------------------------------------------------------------------- +Copyright (c) 2005 - 2016 G-Truc Creation + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +Restrictions: By making use of the Software for military purposes, you choose +to make a Bunny unhappy. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +================================================================================ +The MIT License +-------------------------------------------------------------------------------- +Copyright (c) 2005 - 2016 G-Truc Creation Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/common/glm/glm/CMakeLists.txt b/common/glm/glm/CMakeLists.txt index 9dbe11cab..d60a88771 100644 --- a/common/glm/glm/CMakeLists.txt +++ b/common/glm/glm/CMakeLists.txt @@ -1,9 +1,9 @@ -set(NAME glm_dummy) - file(GLOB ROOT_SOURCE *.cpp) file(GLOB ROOT_INLINE *.inl) file(GLOB ROOT_HEADER *.hpp) file(GLOB ROOT_TEXT ../*.txt) +file(GLOB ROOT_MD ../*.md) +file(GLOB ROOT_NAT ../util/glm.natvis) file(GLOB_RECURSE CORE_SOURCE ./detail/*.cpp) file(GLOB_RECURSE CORE_INLINE ./detail/*.inl) @@ -17,7 +17,11 @@ file(GLOB_RECURSE GTX_SOURCE ./gtx/*.cpp) file(GLOB_RECURSE GTX_INLINE ./gtx/*.inl) file(GLOB_RECURSE GTX_HEADER ./gtx/*.hpp) -source_group("Text Files" FILES ${ROOT_TEXT}) +file(GLOB_RECURSE SIMD_SOURCE ./simd/*.cpp) +file(GLOB_RECURSE SIMD_INLINE ./simd/*.inl) +file(GLOB_RECURSE SIMD_HEADER ./simd/*.h) + +source_group("Text Files" FILES ${ROOT_TEXT} ${ROOT_MD}) source_group("Core Files" FILES ${CORE_SOURCE}) source_group("Core Files" FILES ${CORE_INLINE}) source_group("Core Files" FILES ${CORE_HEADER}) @@ -27,16 +31,37 @@ source_group("GTC Files" FILES ${GTC_HEADER}) source_group("GTX Files" FILES ${GTX_SOURCE}) source_group("GTX Files" FILES ${GTX_INLINE}) source_group("GTX Files" FILES ${GTX_HEADER}) +source_group("SIMD Files" FILES ${SIMD_SOURCE}) +source_group("SIMD Files" FILES ${SIMD_INLINE}) +source_group("SIMD Files" FILES ${SIMD_HEADER}) include_directories(${CMAKE_CURRENT_SOURCE_DIR}/..) -if(GLM_TEST_ENABLE) - add_executable(${NAME} ${ROOT_TEXT} +if(GLM_STATIC_LIBRARY_ENABLE OR GLM_DYNAMIC_LIBRARY_ENABLE) + if(GLM_STATIC_LIBRARY_ENABLE) + add_library(glm_static STATIC ${ROOT_TEXT} ${ROOT_MD} ${ROOT_NAT} + ${ROOT_SOURCE} ${ROOT_INLINE} ${ROOT_HEADER} + ${CORE_SOURCE} ${CORE_INLINE} ${CORE_HEADER} + ${GTC_SOURCE} ${GTC_INLINE} ${GTC_HEADER} + ${GTX_SOURCE} ${GTX_INLINE} ${GTX_HEADER} + ${SIMD_SOURCE} ${SIMD_INLINE} ${SIMD_HEADER}) + endif(GLM_STATIC_LIBRARY_ENABLE) + + if(GLM_DYNAMIC_LIBRARY_ENABLE) + add_library(glm_shared SHARED ${ROOT_TEXT} ${ROOT_MD} ${ROOT_NAT} + ${ROOT_SOURCE} ${ROOT_INLINE} ${ROOT_HEADER} + ${CORE_SOURCE} ${CORE_INLINE} ${CORE_HEADER} + ${GTC_SOURCE} ${GTC_INLINE} ${GTC_HEADER} + ${GTX_SOURCE} ${GTX_INLINE} ${GTX_HEADER} + ${SIMD_SOURCE} ${SIMD_INLINE} ${SIMD_HEADER}) + endif(GLM_DYNAMIC_LIBRARY_ENABLE) + +else(GLM_STATIC_LIBRARY_ENABLE OR GLM_DYNAMIC_LIBRARY_ENABLE) + add_executable(glm_dummy ${ROOT_TEXT} ${ROOT_MD} ${ROOT_NAT} ${ROOT_SOURCE} ${ROOT_INLINE} ${ROOT_HEADER} ${CORE_SOURCE} ${CORE_INLINE} ${CORE_HEADER} ${GTC_SOURCE} ${GTC_INLINE} ${GTC_HEADER} - ${GTX_SOURCE} ${GTX_INLINE} ${GTX_HEADER}) -endif(GLM_TEST_ENABLE) + ${GTX_SOURCE} ${GTX_INLINE} ${GTX_HEADER} + ${SIMD_SOURCE} ${SIMD_INLINE} ${SIMD_HEADER}) -#add_library(glm STATIC glm.cpp) -#add_library(glm_shared SHARED glm.cpp) +endif(GLM_STATIC_LIBRARY_ENABLE OR GLM_DYNAMIC_LIBRARY_ENABLE) diff --git a/common/glm/glm/common.hpp b/common/glm/glm/common.hpp index 8f1c3171e..f57e800ee 100644 --- a/common/glm/glm/common.hpp +++ b/common/glm/glm/common.hpp @@ -1,34 +1,5 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// /// @ref core /// @file glm/common.hpp -/// @date 2013-12-24 / 2013-12-24 -/// @author Christophe Riccio -/////////////////////////////////////////////////////////////////////////////////// #pragma once diff --git a/common/glm/glm/detail/_features.hpp b/common/glm/glm/detail/_features.hpp index 51eda577c..97dd63303 100644 --- a/common/glm/glm/detail/_features.hpp +++ b/common/glm/glm/detail/_features.hpp @@ -1,34 +1,5 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// /// @ref core /// @file glm/detail/_features.hpp -/// @date 2013-02-20 / 2013-02-20 -/// @author Christophe Riccio -/////////////////////////////////////////////////////////////////////////////////// #pragma once @@ -284,7 +255,7 @@ # define GLM_CXX11_STATIC_ASSERT # endif -#elif(GLM_COMPILER & (GLM_COMPILER_APPLE_CLANG | GLM_COMPILER_LLVM)) +#elif(GLM_COMPILER & GLM_COMPILER_CLANG) # if(__has_feature(cxx_exceptions)) # define GLM_CXX98_EXCEPTIONS # endif @@ -425,4 +396,4 @@ # define GLM_CXX11_VARIADIC_TEMPLATES # endif -#endif//(GLM_COMPILER & (GLM_COMPILER_APPLE_CLANG | GLM_COMPILER_LLVM)) +#endif//(GLM_COMPILER & GLM_COMPILER_CLANG) diff --git a/common/glm/glm/detail/_fixes.hpp b/common/glm/glm/detail/_fixes.hpp index 6185dcbb7..c957562b4 100644 --- a/common/glm/glm/detail/_fixes.hpp +++ b/common/glm/glm/detail/_fixes.hpp @@ -1,34 +1,5 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// /// @ref core /// @file glm/detail/_fixes.hpp -/// @date 2011-02-21 / 2011-11-22 -/// @author Christophe Riccio -/////////////////////////////////////////////////////////////////////////////////// #include diff --git a/common/glm/glm/detail/_noise.hpp b/common/glm/glm/detail/_noise.hpp index 94c835d54..89403f4a7 100644 --- a/common/glm/glm/detail/_noise.hpp +++ b/common/glm/glm/detail/_noise.hpp @@ -1,34 +1,5 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// /// @ref core /// @file glm/detail/_noise.hpp -/// @date 2013-12-24 / 2013-12-24 -/// @author Christophe Riccio -/////////////////////////////////////////////////////////////////////////////////// #pragma once diff --git a/common/glm/glm/detail/_swizzle.hpp b/common/glm/glm/detail/_swizzle.hpp index 3edf6cb23..8e134d90e 100644 --- a/common/glm/glm/detail/_swizzle.hpp +++ b/common/glm/glm/detail/_swizzle.hpp @@ -1,34 +1,5 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// /// @ref core /// @file glm/detail/_swizzle.hpp -/// @date 2006-04-20 / 2011-02-16 -/// @author Christophe Riccio -/////////////////////////////////////////////////////////////////////////////////// #pragma once @@ -39,11 +10,9 @@ namespace detail template struct _swizzle_base0 { - typedef T value_type; - protected: - GLM_FUNC_QUALIFIER value_type& elem (size_t i) { return (reinterpret_cast(_buffer))[i]; } - GLM_FUNC_QUALIFIER const value_type& elem (size_t i) const { return (reinterpret_cast(_buffer))[i]; } + GLM_FUNC_QUALIFIER T& elem(size_t i){ return (reinterpret_cast(_buffer))[i]; } + GLM_FUNC_QUALIFIER T const& elem(size_t i) const{ return (reinterpret_cast(_buffer))[i]; } // Use an opaque buffer to *ensure* the compiler doesn't call a constructor. // The size 1 buffer is assumed to aligned to the actual members so that the @@ -51,27 +20,27 @@ namespace detail char _buffer[1]; }; - template + template class vecType, int E0, int E1, int E2, int E3, bool Aligned> struct _swizzle_base1 : public _swizzle_base0 { }; - template - struct _swizzle_base1 : public _swizzle_base0 + template class vecType, int E0, int E1, bool Aligned> + struct _swizzle_base1<2, T, P, vecType, E0,E1,-1,-2, Aligned> : public _swizzle_base0 { - GLM_FUNC_QUALIFIER V operator ()() const { return V(this->elem(E0), this->elem(E1)); } + GLM_FUNC_QUALIFIER vecType operator ()() const { return vecType(this->elem(E0), this->elem(E1)); } }; - template - struct _swizzle_base1 : public _swizzle_base0 + template class vecType, int E0, int E1, int E2, bool Aligned> + struct _swizzle_base1<3, T, P, vecType, E0,E1,E2,-1, Aligned> : public _swizzle_base0 { - GLM_FUNC_QUALIFIER V operator ()() const { return V(this->elem(E0), this->elem(E1), this->elem(E2)); } + GLM_FUNC_QUALIFIER vecType operator ()() const { return vecType(this->elem(E0), this->elem(E1), this->elem(E2)); } }; - template - struct _swizzle_base1 : public _swizzle_base0 + template class vecType, int E0, int E1, int E2, int E3, bool Aligned> + struct _swizzle_base1<4, T, P, vecType, E0,E1,E2,E3, Aligned> : public _swizzle_base0 { - GLM_FUNC_QUALIFIER V operator ()() const { return V(this->elem(E0), this->elem(E1), this->elem(E2), this->elem(E3)); } + GLM_FUNC_QUALIFIER vecType operator ()() const { return vecType(this->elem(E0), this->elem(E1), this->elem(E2), this->elem(E3)); } }; // Internal class for implementing swizzle operators @@ -86,79 +55,76 @@ namespace detail DUPLICATE_ELEMENTS = 1 if there is a repeated element, 0 otherwise (used to specialize swizzles containing duplicate elements so that they cannot be used as r-values). */ - template - struct _swizzle_base2 : public _swizzle_base1 + template class vecType, int E0, int E1, int E2, int E3, int DUPLICATE_ELEMENTS> + struct _swizzle_base2 : public _swizzle_base1::value> { - typedef VecType vec_type; - typedef ValueType value_type; - - GLM_FUNC_QUALIFIER _swizzle_base2& operator= (const ValueType& t) + GLM_FUNC_QUALIFIER _swizzle_base2& operator= (const T& t) { for (int i = 0; i < N; ++i) (*this)[i] = t; return *this; } - GLM_FUNC_QUALIFIER _swizzle_base2& operator= (const VecType& that) + GLM_FUNC_QUALIFIER _swizzle_base2& operator= (vecType const& that) { struct op { - GLM_FUNC_QUALIFIER void operator() (value_type& e, value_type& t) { e = t; } + GLM_FUNC_QUALIFIER void operator() (T& e, T& t) { e = t; } }; _apply_op(that, op()); return *this; } - GLM_FUNC_QUALIFIER void operator -= (const VecType& that) + GLM_FUNC_QUALIFIER void operator -= (vecType const& that) { struct op { - GLM_FUNC_QUALIFIER void operator() (value_type& e, value_type& t) { e -= t; } + GLM_FUNC_QUALIFIER void operator() (T& e, T& t) { e -= t; } }; _apply_op(that, op()); } - GLM_FUNC_QUALIFIER void operator += (const VecType& that) + GLM_FUNC_QUALIFIER void operator += (vecType const& that) { struct op { - GLM_FUNC_QUALIFIER void operator() (value_type& e, value_type& t) { e += t; } + GLM_FUNC_QUALIFIER void operator() (T& e, T& t) { e += t; } }; _apply_op(that, op()); } - GLM_FUNC_QUALIFIER void operator *= (const VecType& that) + GLM_FUNC_QUALIFIER void operator *= (vecType const& that) { struct op { - GLM_FUNC_QUALIFIER void operator() (value_type& e, value_type& t) { e *= t; } + GLM_FUNC_QUALIFIER void operator() (T& e, T& t) { e *= t; } }; _apply_op(that, op()); } - GLM_FUNC_QUALIFIER void operator /= (const VecType& that) + GLM_FUNC_QUALIFIER void operator /= (vecType const& that) { struct op { - GLM_FUNC_QUALIFIER void operator() (value_type& e, value_type& t) { e /= t; } + GLM_FUNC_QUALIFIER void operator() (T& e, T& t) { e /= t; } }; _apply_op(that, op()); } - GLM_FUNC_QUALIFIER value_type& operator[] (size_t i) + GLM_FUNC_QUALIFIER T& operator[](size_t i) { const int offset_dst[4] = { E0, E1, E2, E3 }; return this->elem(offset_dst[i]); } - GLM_FUNC_QUALIFIER value_type operator[] (size_t i) const + GLM_FUNC_QUALIFIER T operator[](size_t i) const { const int offset_dst[4] = { E0, E1, E2, E3 }; return this->elem(offset_dst[i]); } protected: - template - GLM_FUNC_QUALIFIER void _apply_op(const VecType& that, T op) + template + GLM_FUNC_QUALIFIER void _apply_op(vecType const& that, U op) { // Make a copy of the data in this == &that. // The copier should optimize out the copy in cases where the function is // properly inlined and the copy is not necessary. - ValueType t[N]; + T t[N]; for (int i = 0; i < N; ++i) t[i] = that[i]; for (int i = 0; i < N; ++i) @@ -167,56 +133,54 @@ namespace detail }; // Specialization for swizzles containing duplicate elements. These cannot be modified. - template - struct _swizzle_base2 : public _swizzle_base1 + template class vecType, int E0, int E1, int E2, int E3> + struct _swizzle_base2 : public _swizzle_base1::value> { - typedef VecType vec_type; - typedef ValueType value_type; - struct Stub {}; + GLM_FUNC_QUALIFIER _swizzle_base2& operator= (Stub const &) { return *this; } - GLM_FUNC_QUALIFIER value_type operator[] (size_t i) const + GLM_FUNC_QUALIFIER T operator[] (size_t i) const { const int offset_dst[4] = { E0, E1, E2, E3 }; return this->elem(offset_dst[i]); } }; - template - struct _swizzle : public _swizzle_base2 + template class vecType, int E0, int E1, int E2, int E3> + struct _swizzle : public _swizzle_base2 { - typedef _swizzle_base2 base_type; + typedef _swizzle_base2 base_type; using base_type::operator=; - GLM_FUNC_QUALIFIER operator VecType () const { return (*this)(); } + GLM_FUNC_QUALIFIER operator vecType () const { return (*this)(); } }; // // To prevent the C++ syntax from getting entirely overwhelming, define some alias macros // -#define _GLM_SWIZZLE_TEMPLATE1 template -#define _GLM_SWIZZLE_TEMPLATE2 template -#define _GLM_SWIZZLE_TYPE1 _swizzle -#define _GLM_SWIZZLE_TYPE2 _swizzle +#define _GLM_SWIZZLE_TEMPLATE1 template class vecType, int E0, int E1, int E2, int E3> +#define _GLM_SWIZZLE_TEMPLATE2 template class vecType, int E0, int E1, int E2, int E3, int F0, int F1, int F2, int F3> +#define _GLM_SWIZZLE_TYPE1 _swizzle +#define _GLM_SWIZZLE_TYPE2 _swizzle // // Wrapper for a binary operator (e.g. u.yy + v.zy) // #define _GLM_SWIZZLE_VECTOR_BINARY_OPERATOR_IMPLEMENTATION(OPERAND) \ _GLM_SWIZZLE_TEMPLATE2 \ - GLM_FUNC_QUALIFIER V operator OPERAND ( const _GLM_SWIZZLE_TYPE1& a, const _GLM_SWIZZLE_TYPE2& b) \ + GLM_FUNC_QUALIFIER vecType operator OPERAND ( const _GLM_SWIZZLE_TYPE1& a, const _GLM_SWIZZLE_TYPE2& b) \ { \ return a() OPERAND b(); \ } \ _GLM_SWIZZLE_TEMPLATE1 \ - GLM_FUNC_QUALIFIER V operator OPERAND ( const _GLM_SWIZZLE_TYPE1& a, const V& b) \ + GLM_FUNC_QUALIFIER vecType operator OPERAND ( const _GLM_SWIZZLE_TYPE1& a, const vecType& b) \ { \ return a() OPERAND b; \ } \ _GLM_SWIZZLE_TEMPLATE1 \ - GLM_FUNC_QUALIFIER V operator OPERAND ( const V& a, const _GLM_SWIZZLE_TYPE1& b) \ + GLM_FUNC_QUALIFIER vecType operator OPERAND ( const vecType& a, const _GLM_SWIZZLE_TYPE1& b) \ { \ return a OPERAND b(); \ } @@ -226,12 +190,12 @@ namespace detail // #define _GLM_SWIZZLE_SCALAR_BINARY_OPERATOR_IMPLEMENTATION(OPERAND) \ _GLM_SWIZZLE_TEMPLATE1 \ - GLM_FUNC_QUALIFIER V operator OPERAND ( const _GLM_SWIZZLE_TYPE1& a, const T& b) \ + GLM_FUNC_QUALIFIER vecType operator OPERAND ( const _GLM_SWIZZLE_TYPE1& a, const T& b) \ { \ return a() OPERAND b; \ } \ _GLM_SWIZZLE_TEMPLATE1 \ - GLM_FUNC_QUALIFIER V operator OPERAND ( const T& a, const _GLM_SWIZZLE_TYPE1& b) \ + GLM_FUNC_QUALIFIER vecType operator OPERAND ( const T& a, const _GLM_SWIZZLE_TYPE1& b) \ { \ return a OPERAND b(); \ } @@ -334,500 +298,500 @@ namespace glm } #define _GLM_SWIZZLE2_2_MEMBERS(T, P, V, E0,E1) \ - struct { detail::_swizzle<2, T, P, V, 0,0,-1,-2> E0 ## E0; }; \ - struct { detail::_swizzle<2, T, P, V, 0,1,-1,-2> E0 ## E1; }; \ - struct { detail::_swizzle<2, T, P, V, 1,0,-1,-2> E1 ## E0; }; \ - struct { detail::_swizzle<2, T, P, V, 1,1,-1,-2> E1 ## E1; }; + struct { detail::_swizzle<2, T, P, V, 0,0,-1,-2> E0 ## E0; }; \ + struct { detail::_swizzle<2, T, P, V, 0,1,-1,-2> E0 ## E1; }; \ + struct { detail::_swizzle<2, T, P, V, 1,0,-1,-2> E1 ## E0; }; \ + struct { detail::_swizzle<2, T, P, V, 1,1,-1,-2> E1 ## E1; }; #define _GLM_SWIZZLE2_3_MEMBERS(T, P, V, E0,E1) \ - struct { detail::_swizzle<3,T, P, V, 0,0,0,-1> E0 ## E0 ## E0; }; \ - struct { detail::_swizzle<3,T, P, V, 0,0,1,-1> E0 ## E0 ## E1; }; \ - struct { detail::_swizzle<3,T, P, V, 0,1,0,-1> E0 ## E1 ## E0; }; \ - struct { detail::_swizzle<3,T, P, V, 0,1,1,-1> E0 ## E1 ## E1; }; \ - struct { detail::_swizzle<3,T, P, V, 1,0,0,-1> E1 ## E0 ## E0; }; \ - struct { detail::_swizzle<3,T, P, V, 1,0,1,-1> E1 ## E0 ## E1; }; \ - struct { detail::_swizzle<3,T, P, V, 1,1,0,-1> E1 ## E1 ## E0; }; \ - struct { detail::_swizzle<3,T, P, V, 1,1,1,-1> E1 ## E1 ## E1; }; + struct { detail::_swizzle<3,T, P, V, 0,0,0,-1> E0 ## E0 ## E0; }; \ + struct { detail::_swizzle<3,T, P, V, 0,0,1,-1> E0 ## E0 ## E1; }; \ + struct { detail::_swizzle<3,T, P, V, 0,1,0,-1> E0 ## E1 ## E0; }; \ + struct { detail::_swizzle<3,T, P, V, 0,1,1,-1> E0 ## E1 ## E1; }; \ + struct { detail::_swizzle<3,T, P, V, 1,0,0,-1> E1 ## E0 ## E0; }; \ + struct { detail::_swizzle<3,T, P, V, 1,0,1,-1> E1 ## E0 ## E1; }; \ + struct { detail::_swizzle<3,T, P, V, 1,1,0,-1> E1 ## E1 ## E0; }; \ + struct { detail::_swizzle<3,T, P, V, 1,1,1,-1> E1 ## E1 ## E1; }; #define _GLM_SWIZZLE2_4_MEMBERS(T, P, V, E0,E1) \ - struct { detail::_swizzle<4,T, P, V, 0,0,0,0> E0 ## E0 ## E0 ## E0; }; \ - struct { detail::_swizzle<4,T, P, V, 0,0,0,1> E0 ## E0 ## E0 ## E1; }; \ - struct { detail::_swizzle<4,T, P, V, 0,0,1,0> E0 ## E0 ## E1 ## E0; }; \ - struct { detail::_swizzle<4,T, P, V, 0,0,1,1> E0 ## E0 ## E1 ## E1; }; \ - struct { detail::_swizzle<4,T, P, V, 0,1,0,0> E0 ## E1 ## E0 ## E0; }; \ - struct { detail::_swizzle<4,T, P, V, 0,1,0,1> E0 ## E1 ## E0 ## E1; }; \ - struct { detail::_swizzle<4,T, P, V, 0,1,1,0> E0 ## E1 ## E1 ## E0; }; \ - struct { detail::_swizzle<4,T, P, V, 0,1,1,1> E0 ## E1 ## E1 ## E1; }; \ - struct { detail::_swizzle<4,T, P, V, 1,0,0,0> E1 ## E0 ## E0 ## E0; }; \ - struct { detail::_swizzle<4,T, P, V, 1,0,0,1> E1 ## E0 ## E0 ## E1; }; \ - struct { detail::_swizzle<4,T, P, V, 1,0,1,0> E1 ## E0 ## E1 ## E0; }; \ - struct { detail::_swizzle<4,T, P, V, 1,0,1,1> E1 ## E0 ## E1 ## E1; }; \ - struct { detail::_swizzle<4,T, P, V, 1,1,0,0> E1 ## E1 ## E0 ## E0; }; \ - struct { detail::_swizzle<4,T, P, V, 1,1,0,1> E1 ## E1 ## E0 ## E1; }; \ - struct { detail::_swizzle<4,T, P, V, 1,1,1,0> E1 ## E1 ## E1 ## E0; }; \ - struct { detail::_swizzle<4,T, P, V, 1,1,1,1> E1 ## E1 ## E1 ## E1; }; + struct { detail::_swizzle<4,T, P, V, 0,0,0,0> E0 ## E0 ## E0 ## E0; }; \ + struct { detail::_swizzle<4,T, P, V, 0,0,0,1> E0 ## E0 ## E0 ## E1; }; \ + struct { detail::_swizzle<4,T, P, V, 0,0,1,0> E0 ## E0 ## E1 ## E0; }; \ + struct { detail::_swizzle<4,T, P, V, 0,0,1,1> E0 ## E0 ## E1 ## E1; }; \ + struct { detail::_swizzle<4,T, P, V, 0,1,0,0> E0 ## E1 ## E0 ## E0; }; \ + struct { detail::_swizzle<4,T, P, V, 0,1,0,1> E0 ## E1 ## E0 ## E1; }; \ + struct { detail::_swizzle<4,T, P, V, 0,1,1,0> E0 ## E1 ## E1 ## E0; }; \ + struct { detail::_swizzle<4,T, P, V, 0,1,1,1> E0 ## E1 ## E1 ## E1; }; \ + struct { detail::_swizzle<4,T, P, V, 1,0,0,0> E1 ## E0 ## E0 ## E0; }; \ + struct { detail::_swizzle<4,T, P, V, 1,0,0,1> E1 ## E0 ## E0 ## E1; }; \ + struct { detail::_swizzle<4,T, P, V, 1,0,1,0> E1 ## E0 ## E1 ## E0; }; \ + struct { detail::_swizzle<4,T, P, V, 1,0,1,1> E1 ## E0 ## E1 ## E1; }; \ + struct { detail::_swizzle<4,T, P, V, 1,1,0,0> E1 ## E1 ## E0 ## E0; }; \ + struct { detail::_swizzle<4,T, P, V, 1,1,0,1> E1 ## E1 ## E0 ## E1; }; \ + struct { detail::_swizzle<4,T, P, V, 1,1,1,0> E1 ## E1 ## E1 ## E0; }; \ + struct { detail::_swizzle<4,T, P, V, 1,1,1,1> E1 ## E1 ## E1 ## E1; }; #define _GLM_SWIZZLE3_2_MEMBERS(T, P, V, E0,E1,E2) \ - struct { detail::_swizzle<2,T, P, V, 0,0,-1,-2> E0 ## E0; }; \ - struct { detail::_swizzle<2,T, P, V, 0,1,-1,-2> E0 ## E1; }; \ - struct { detail::_swizzle<2,T, P, V, 0,2,-1,-2> E0 ## E2; }; \ - struct { detail::_swizzle<2,T, P, V, 1,0,-1,-2> E1 ## E0; }; \ - struct { detail::_swizzle<2,T, P, V, 1,1,-1,-2> E1 ## E1; }; \ - struct { detail::_swizzle<2,T, P, V, 1,2,-1,-2> E1 ## E2; }; \ - struct { detail::_swizzle<2,T, P, V, 2,0,-1,-2> E2 ## E0; }; \ - struct { detail::_swizzle<2,T, P, V, 2,1,-1,-2> E2 ## E1; }; \ - struct { detail::_swizzle<2,T, P, V, 2,2,-1,-2> E2 ## E2; }; + struct { detail::_swizzle<2,T, P, V, 0,0,-1,-2> E0 ## E0; }; \ + struct { detail::_swizzle<2,T, P, V, 0,1,-1,-2> E0 ## E1; }; \ + struct { detail::_swizzle<2,T, P, V, 0,2,-1,-2> E0 ## E2; }; \ + struct { detail::_swizzle<2,T, P, V, 1,0,-1,-2> E1 ## E0; }; \ + struct { detail::_swizzle<2,T, P, V, 1,1,-1,-2> E1 ## E1; }; \ + struct { detail::_swizzle<2,T, P, V, 1,2,-1,-2> E1 ## E2; }; \ + struct { detail::_swizzle<2,T, P, V, 2,0,-1,-2> E2 ## E0; }; \ + struct { detail::_swizzle<2,T, P, V, 2,1,-1,-2> E2 ## E1; }; \ + struct { detail::_swizzle<2,T, P, V, 2,2,-1,-2> E2 ## E2; }; #define _GLM_SWIZZLE3_3_MEMBERS(T, P, V ,E0,E1,E2) \ - struct { detail::_swizzle<3,T,P, V, 0,0,0,-1> E0 ## E0 ## E0; }; \ - struct { detail::_swizzle<3,T,P, V, 0,0,1,-1> E0 ## E0 ## E1; }; \ - struct { detail::_swizzle<3,T,P, V, 0,0,2,-1> E0 ## E0 ## E2; }; \ - struct { detail::_swizzle<3,T,P, V, 0,1,0,-1> E0 ## E1 ## E0; }; \ - struct { detail::_swizzle<3,T,P, V, 0,1,1,-1> E0 ## E1 ## E1; }; \ - struct { detail::_swizzle<3,T,P, V, 0,1,2,-1> E0 ## E1 ## E2; }; \ - struct { detail::_swizzle<3,T,P, V, 0,2,0,-1> E0 ## E2 ## E0; }; \ - struct { detail::_swizzle<3,T,P, V, 0,2,1,-1> E0 ## E2 ## E1; }; \ - struct { detail::_swizzle<3,T,P, V, 0,2,2,-1> E0 ## E2 ## E2; }; \ - struct { detail::_swizzle<3,T,P, V, 1,0,0,-1> E1 ## E0 ## E0; }; \ - struct { detail::_swizzle<3,T,P, V, 1,0,1,-1> E1 ## E0 ## E1; }; \ - struct { detail::_swizzle<3,T,P, V, 1,0,2,-1> E1 ## E0 ## E2; }; \ - struct { detail::_swizzle<3,T,P, V, 1,1,0,-1> E1 ## E1 ## E0; }; \ - struct { detail::_swizzle<3,T,P, V, 1,1,1,-1> E1 ## E1 ## E1; }; \ - struct { detail::_swizzle<3,T,P, V, 1,1,2,-1> E1 ## E1 ## E2; }; \ - struct { detail::_swizzle<3,T,P, V, 1,2,0,-1> E1 ## E2 ## E0; }; \ - struct { detail::_swizzle<3,T,P, V, 1,2,1,-1> E1 ## E2 ## E1; }; \ - struct { detail::_swizzle<3,T,P, V, 1,2,2,-1> E1 ## E2 ## E2; }; \ - struct { detail::_swizzle<3,T,P, V, 2,0,0,-1> E2 ## E0 ## E0; }; \ - struct { detail::_swizzle<3,T,P, V, 2,0,1,-1> E2 ## E0 ## E1; }; \ - struct { detail::_swizzle<3,T,P, V, 2,0,2,-1> E2 ## E0 ## E2; }; \ - struct { detail::_swizzle<3,T,P, V, 2,1,0,-1> E2 ## E1 ## E0; }; \ - struct { detail::_swizzle<3,T,P, V, 2,1,1,-1> E2 ## E1 ## E1; }; \ - struct { detail::_swizzle<3,T,P, V, 2,1,2,-1> E2 ## E1 ## E2; }; \ - struct { detail::_swizzle<3,T,P, V, 2,2,0,-1> E2 ## E2 ## E0; }; \ - struct { detail::_swizzle<3,T,P, V, 2,2,1,-1> E2 ## E2 ## E1; }; \ - struct { detail::_swizzle<3,T,P, V, 2,2,2,-1> E2 ## E2 ## E2; }; + struct { detail::_swizzle<3, T, P, V, 0,0,0,-1> E0 ## E0 ## E0; }; \ + struct { detail::_swizzle<3, T, P, V, 0,0,1,-1> E0 ## E0 ## E1; }; \ + struct { detail::_swizzle<3, T, P, V, 0,0,2,-1> E0 ## E0 ## E2; }; \ + struct { detail::_swizzle<3, T, P, V, 0,1,0,-1> E0 ## E1 ## E0; }; \ + struct { detail::_swizzle<3, T, P, V, 0,1,1,-1> E0 ## E1 ## E1; }; \ + struct { detail::_swizzle<3, T, P, V, 0,1,2,-1> E0 ## E1 ## E2; }; \ + struct { detail::_swizzle<3, T, P, V, 0,2,0,-1> E0 ## E2 ## E0; }; \ + struct { detail::_swizzle<3, T, P, V, 0,2,1,-1> E0 ## E2 ## E1; }; \ + struct { detail::_swizzle<3, T, P, V, 0,2,2,-1> E0 ## E2 ## E2; }; \ + struct { detail::_swizzle<3, T, P, V, 1,0,0,-1> E1 ## E0 ## E0; }; \ + struct { detail::_swizzle<3, T, P, V, 1,0,1,-1> E1 ## E0 ## E1; }; \ + struct { detail::_swizzle<3, T, P, V, 1,0,2,-1> E1 ## E0 ## E2; }; \ + struct { detail::_swizzle<3, T, P, V, 1,1,0,-1> E1 ## E1 ## E0; }; \ + struct { detail::_swizzle<3, T, P, V, 1,1,1,-1> E1 ## E1 ## E1; }; \ + struct { detail::_swizzle<3, T, P, V, 1,1,2,-1> E1 ## E1 ## E2; }; \ + struct { detail::_swizzle<3, T, P, V, 1,2,0,-1> E1 ## E2 ## E0; }; \ + struct { detail::_swizzle<3, T, P, V, 1,2,1,-1> E1 ## E2 ## E1; }; \ + struct { detail::_swizzle<3, T, P, V, 1,2,2,-1> E1 ## E2 ## E2; }; \ + struct { detail::_swizzle<3, T, P, V, 2,0,0,-1> E2 ## E0 ## E0; }; \ + struct { detail::_swizzle<3, T, P, V, 2,0,1,-1> E2 ## E0 ## E1; }; \ + struct { detail::_swizzle<3, T, P, V, 2,0,2,-1> E2 ## E0 ## E2; }; \ + struct { detail::_swizzle<3, T, P, V, 2,1,0,-1> E2 ## E1 ## E0; }; \ + struct { detail::_swizzle<3, T, P, V, 2,1,1,-1> E2 ## E1 ## E1; }; \ + struct { detail::_swizzle<3, T, P, V, 2,1,2,-1> E2 ## E1 ## E2; }; \ + struct { detail::_swizzle<3, T, P, V, 2,2,0,-1> E2 ## E2 ## E0; }; \ + struct { detail::_swizzle<3, T, P, V, 2,2,1,-1> E2 ## E2 ## E1; }; \ + struct { detail::_swizzle<3, T, P, V, 2,2,2,-1> E2 ## E2 ## E2; }; #define _GLM_SWIZZLE3_4_MEMBERS(T, P, V, E0,E1,E2) \ - struct { detail::_swizzle<4,T, P, V, 0,0,0,0> E0 ## E0 ## E0 ## E0; }; \ - struct { detail::_swizzle<4,T, P, V, 0,0,0,1> E0 ## E0 ## E0 ## E1; }; \ - struct { detail::_swizzle<4,T, P, V, 0,0,0,2> E0 ## E0 ## E0 ## E2; }; \ - struct { detail::_swizzle<4,T, P, V, 0,0,1,0> E0 ## E0 ## E1 ## E0; }; \ - struct { detail::_swizzle<4,T, P, V, 0,0,1,1> E0 ## E0 ## E1 ## E1; }; \ - struct { detail::_swizzle<4,T, P, V, 0,0,1,2> E0 ## E0 ## E1 ## E2; }; \ - struct { detail::_swizzle<4,T, P, V, 0,0,2,0> E0 ## E0 ## E2 ## E0; }; \ - struct { detail::_swizzle<4,T, P, V, 0,0,2,1> E0 ## E0 ## E2 ## E1; }; \ - struct { detail::_swizzle<4,T, P, V, 0,0,2,2> E0 ## E0 ## E2 ## E2; }; \ - struct { detail::_swizzle<4,T, P, V, 0,1,0,0> E0 ## E1 ## E0 ## E0; }; \ - struct { detail::_swizzle<4,T, P, V, 0,1,0,1> E0 ## E1 ## E0 ## E1; }; \ - struct { detail::_swizzle<4,T, P, V, 0,1,0,2> E0 ## E1 ## E0 ## E2; }; \ - struct { detail::_swizzle<4,T, P, V, 0,1,1,0> E0 ## E1 ## E1 ## E0; }; \ - struct { detail::_swizzle<4,T, P, V, 0,1,1,1> E0 ## E1 ## E1 ## E1; }; \ - struct { detail::_swizzle<4,T, P, V, 0,1,1,2> E0 ## E1 ## E1 ## E2; }; \ - struct { detail::_swizzle<4,T, P, V, 0,1,2,0> E0 ## E1 ## E2 ## E0; }; \ - struct { detail::_swizzle<4,T, P, V, 0,1,2,1> E0 ## E1 ## E2 ## E1; }; \ - struct { detail::_swizzle<4,T, P, V, 0,1,2,2> E0 ## E1 ## E2 ## E2; }; \ - struct { detail::_swizzle<4,T, P, V, 0,2,0,0> E0 ## E2 ## E0 ## E0; }; \ - struct { detail::_swizzle<4,T, P, V, 0,2,0,1> E0 ## E2 ## E0 ## E1; }; \ - struct { detail::_swizzle<4,T, P, V, 0,2,0,2> E0 ## E2 ## E0 ## E2; }; \ - struct { detail::_swizzle<4,T, P, V, 0,2,1,0> E0 ## E2 ## E1 ## E0; }; \ - struct { detail::_swizzle<4,T, P, V, 0,2,1,1> E0 ## E2 ## E1 ## E1; }; \ - struct { detail::_swizzle<4,T, P, V, 0,2,1,2> E0 ## E2 ## E1 ## E2; }; \ - struct { detail::_swizzle<4,T, P, V, 0,2,2,0> E0 ## E2 ## E2 ## E0; }; \ - struct { detail::_swizzle<4,T, P, V, 0,2,2,1> E0 ## E2 ## E2 ## E1; }; \ - struct { detail::_swizzle<4,T, P, V, 0,2,2,2> E0 ## E2 ## E2 ## E2; }; \ - struct { detail::_swizzle<4,T, P, V, 1,0,0,0> E1 ## E0 ## E0 ## E0; }; \ - struct { detail::_swizzle<4,T, P, V, 1,0,0,1> E1 ## E0 ## E0 ## E1; }; \ - struct { detail::_swizzle<4,T, P, V, 1,0,0,2> E1 ## E0 ## E0 ## E2; }; \ - struct { detail::_swizzle<4,T, P, V, 1,0,1,0> E1 ## E0 ## E1 ## E0; }; \ - struct { detail::_swizzle<4,T, P, V, 1,0,1,1> E1 ## E0 ## E1 ## E1; }; \ - struct { detail::_swizzle<4,T, P, V, 1,0,1,2> E1 ## E0 ## E1 ## E2; }; \ - struct { detail::_swizzle<4,T, P, V, 1,0,2,0> E1 ## E0 ## E2 ## E0; }; \ - struct { detail::_swizzle<4,T, P, V, 1,0,2,1> E1 ## E0 ## E2 ## E1; }; \ - struct { detail::_swizzle<4,T, P, V, 1,0,2,2> E1 ## E0 ## E2 ## E2; }; \ - struct { detail::_swizzle<4,T, P, V, 1,1,0,0> E1 ## E1 ## E0 ## E0; }; \ - struct { detail::_swizzle<4,T, P, V, 1,1,0,1> E1 ## E1 ## E0 ## E1; }; \ - struct { detail::_swizzle<4,T, P, V, 1,1,0,2> E1 ## E1 ## E0 ## E2; }; \ - struct { detail::_swizzle<4,T, P, V, 1,1,1,0> E1 ## E1 ## E1 ## E0; }; \ - struct { detail::_swizzle<4,T, P, V, 1,1,1,1> E1 ## E1 ## E1 ## E1; }; \ - struct { detail::_swizzle<4,T, P, V, 1,1,1,2> E1 ## E1 ## E1 ## E2; }; \ - struct { detail::_swizzle<4,T, P, V, 1,1,2,0> E1 ## E1 ## E2 ## E0; }; \ - struct { detail::_swizzle<4,T, P, V, 1,1,2,1> E1 ## E1 ## E2 ## E1; }; \ - struct { detail::_swizzle<4,T, P, V, 1,1,2,2> E1 ## E1 ## E2 ## E2; }; \ - struct { detail::_swizzle<4,T, P, V, 1,2,0,0> E1 ## E2 ## E0 ## E0; }; \ - struct { detail::_swizzle<4,T, P, V, 1,2,0,1> E1 ## E2 ## E0 ## E1; }; \ - struct { detail::_swizzle<4,T, P, V, 1,2,0,2> E1 ## E2 ## E0 ## E2; }; \ - struct { detail::_swizzle<4,T, P, V, 1,2,1,0> E1 ## E2 ## E1 ## E0; }; \ - struct { detail::_swizzle<4,T, P, V, 1,2,1,1> E1 ## E2 ## E1 ## E1; }; \ - struct { detail::_swizzle<4,T, P, V, 1,2,1,2> E1 ## E2 ## E1 ## E2; }; \ - struct { detail::_swizzle<4,T, P, V, 1,2,2,0> E1 ## E2 ## E2 ## E0; }; \ - struct { detail::_swizzle<4,T, P, V, 1,2,2,1> E1 ## E2 ## E2 ## E1; }; \ - struct { detail::_swizzle<4,T, P, V, 1,2,2,2> E1 ## E2 ## E2 ## E2; }; \ - struct { detail::_swizzle<4,T, P, V, 2,0,0,0> E2 ## E0 ## E0 ## E0; }; \ - struct { detail::_swizzle<4,T, P, V, 2,0,0,1> E2 ## E0 ## E0 ## E1; }; \ - struct { detail::_swizzle<4,T, P, V, 2,0,0,2> E2 ## E0 ## E0 ## E2; }; \ - struct { detail::_swizzle<4,T, P, V, 2,0,1,0> E2 ## E0 ## E1 ## E0; }; \ - struct { detail::_swizzle<4,T, P, V, 2,0,1,1> E2 ## E0 ## E1 ## E1; }; \ - struct { detail::_swizzle<4,T, P, V, 2,0,1,2> E2 ## E0 ## E1 ## E2; }; \ - struct { detail::_swizzle<4,T, P, V, 2,0,2,0> E2 ## E0 ## E2 ## E0; }; \ - struct { detail::_swizzle<4,T, P, V, 2,0,2,1> E2 ## E0 ## E2 ## E1; }; \ - struct { detail::_swizzle<4,T, P, V, 2,0,2,2> E2 ## E0 ## E2 ## E2; }; \ - struct { detail::_swizzle<4,T, P, V, 2,1,0,0> E2 ## E1 ## E0 ## E0; }; \ - struct { detail::_swizzle<4,T, P, V, 2,1,0,1> E2 ## E1 ## E0 ## E1; }; \ - struct { detail::_swizzle<4,T, P, V, 2,1,0,2> E2 ## E1 ## E0 ## E2; }; \ - struct { detail::_swizzle<4,T, P, V, 2,1,1,0> E2 ## E1 ## E1 ## E0; }; \ - struct { detail::_swizzle<4,T, P, V, 2,1,1,1> E2 ## E1 ## E1 ## E1; }; \ - struct { detail::_swizzle<4,T, P, V, 2,1,1,2> E2 ## E1 ## E1 ## E2; }; \ - struct { detail::_swizzle<4,T, P, V, 2,1,2,0> E2 ## E1 ## E2 ## E0; }; \ - struct { detail::_swizzle<4,T, P, V, 2,1,2,1> E2 ## E1 ## E2 ## E1; }; \ - struct { detail::_swizzle<4,T, P, V, 2,1,2,2> E2 ## E1 ## E2 ## E2; }; \ - struct { detail::_swizzle<4,T, P, V, 2,2,0,0> E2 ## E2 ## E0 ## E0; }; \ - struct { detail::_swizzle<4,T, P, V, 2,2,0,1> E2 ## E2 ## E0 ## E1; }; \ - struct { detail::_swizzle<4,T, P, V, 2,2,0,2> E2 ## E2 ## E0 ## E2; }; \ - struct { detail::_swizzle<4,T, P, V, 2,2,1,0> E2 ## E2 ## E1 ## E0; }; \ - struct { detail::_swizzle<4,T, P, V, 2,2,1,1> E2 ## E2 ## E1 ## E1; }; \ - struct { detail::_swizzle<4,T, P, V, 2,2,1,2> E2 ## E2 ## E1 ## E2; }; \ - struct { detail::_swizzle<4,T, P, V, 2,2,2,0> E2 ## E2 ## E2 ## E0; }; \ - struct { detail::_swizzle<4,T, P, V, 2,2,2,1> E2 ## E2 ## E2 ## E1; }; \ - struct { detail::_swizzle<4,T, P, V, 2,2,2,2> E2 ## E2 ## E2 ## E2; }; + struct { detail::_swizzle<4,T, P, V, 0,0,0,0> E0 ## E0 ## E0 ## E0; }; \ + struct { detail::_swizzle<4,T, P, V, 0,0,0,1> E0 ## E0 ## E0 ## E1; }; \ + struct { detail::_swizzle<4,T, P, V, 0,0,0,2> E0 ## E0 ## E0 ## E2; }; \ + struct { detail::_swizzle<4,T, P, V, 0,0,1,0> E0 ## E0 ## E1 ## E0; }; \ + struct { detail::_swizzle<4,T, P, V, 0,0,1,1> E0 ## E0 ## E1 ## E1; }; \ + struct { detail::_swizzle<4,T, P, V, 0,0,1,2> E0 ## E0 ## E1 ## E2; }; \ + struct { detail::_swizzle<4,T, P, V, 0,0,2,0> E0 ## E0 ## E2 ## E0; }; \ + struct { detail::_swizzle<4,T, P, V, 0,0,2,1> E0 ## E0 ## E2 ## E1; }; \ + struct { detail::_swizzle<4,T, P, V, 0,0,2,2> E0 ## E0 ## E2 ## E2; }; \ + struct { detail::_swizzle<4,T, P, V, 0,1,0,0> E0 ## E1 ## E0 ## E0; }; \ + struct { detail::_swizzle<4,T, P, V, 0,1,0,1> E0 ## E1 ## E0 ## E1; }; \ + struct { detail::_swizzle<4,T, P, V, 0,1,0,2> E0 ## E1 ## E0 ## E2; }; \ + struct { detail::_swizzle<4,T, P, V, 0,1,1,0> E0 ## E1 ## E1 ## E0; }; \ + struct { detail::_swizzle<4,T, P, V, 0,1,1,1> E0 ## E1 ## E1 ## E1; }; \ + struct { detail::_swizzle<4,T, P, V, 0,1,1,2> E0 ## E1 ## E1 ## E2; }; \ + struct { detail::_swizzle<4,T, P, V, 0,1,2,0> E0 ## E1 ## E2 ## E0; }; \ + struct { detail::_swizzle<4,T, P, V, 0,1,2,1> E0 ## E1 ## E2 ## E1; }; \ + struct { detail::_swizzle<4,T, P, V, 0,1,2,2> E0 ## E1 ## E2 ## E2; }; \ + struct { detail::_swizzle<4,T, P, V, 0,2,0,0> E0 ## E2 ## E0 ## E0; }; \ + struct { detail::_swizzle<4,T, P, V, 0,2,0,1> E0 ## E2 ## E0 ## E1; }; \ + struct { detail::_swizzle<4,T, P, V, 0,2,0,2> E0 ## E2 ## E0 ## E2; }; \ + struct { detail::_swizzle<4,T, P, V, 0,2,1,0> E0 ## E2 ## E1 ## E0; }; \ + struct { detail::_swizzle<4,T, P, V, 0,2,1,1> E0 ## E2 ## E1 ## E1; }; \ + struct { detail::_swizzle<4,T, P, V, 0,2,1,2> E0 ## E2 ## E1 ## E2; }; \ + struct { detail::_swizzle<4,T, P, V, 0,2,2,0> E0 ## E2 ## E2 ## E0; }; \ + struct { detail::_swizzle<4,T, P, V, 0,2,2,1> E0 ## E2 ## E2 ## E1; }; \ + struct { detail::_swizzle<4,T, P, V, 0,2,2,2> E0 ## E2 ## E2 ## E2; }; \ + struct { detail::_swizzle<4,T, P, V, 1,0,0,0> E1 ## E0 ## E0 ## E0; }; \ + struct { detail::_swizzle<4,T, P, V, 1,0,0,1> E1 ## E0 ## E0 ## E1; }; \ + struct { detail::_swizzle<4,T, P, V, 1,0,0,2> E1 ## E0 ## E0 ## E2; }; \ + struct { detail::_swizzle<4,T, P, V, 1,0,1,0> E1 ## E0 ## E1 ## E0; }; \ + struct { detail::_swizzle<4,T, P, V, 1,0,1,1> E1 ## E0 ## E1 ## E1; }; \ + struct { detail::_swizzle<4,T, P, V, 1,0,1,2> E1 ## E0 ## E1 ## E2; }; \ + struct { detail::_swizzle<4,T, P, V, 1,0,2,0> E1 ## E0 ## E2 ## E0; }; \ + struct { detail::_swizzle<4,T, P, V, 1,0,2,1> E1 ## E0 ## E2 ## E1; }; \ + struct { detail::_swizzle<4,T, P, V, 1,0,2,2> E1 ## E0 ## E2 ## E2; }; \ + struct { detail::_swizzle<4,T, P, V, 1,1,0,0> E1 ## E1 ## E0 ## E0; }; \ + struct { detail::_swizzle<4,T, P, V, 1,1,0,1> E1 ## E1 ## E0 ## E1; }; \ + struct { detail::_swizzle<4,T, P, V, 1,1,0,2> E1 ## E1 ## E0 ## E2; }; \ + struct { detail::_swizzle<4,T, P, V, 1,1,1,0> E1 ## E1 ## E1 ## E0; }; \ + struct { detail::_swizzle<4,T, P, V, 1,1,1,1> E1 ## E1 ## E1 ## E1; }; \ + struct { detail::_swizzle<4,T, P, V, 1,1,1,2> E1 ## E1 ## E1 ## E2; }; \ + struct { detail::_swizzle<4,T, P, V, 1,1,2,0> E1 ## E1 ## E2 ## E0; }; \ + struct { detail::_swizzle<4,T, P, V, 1,1,2,1> E1 ## E1 ## E2 ## E1; }; \ + struct { detail::_swizzle<4,T, P, V, 1,1,2,2> E1 ## E1 ## E2 ## E2; }; \ + struct { detail::_swizzle<4,T, P, V, 1,2,0,0> E1 ## E2 ## E0 ## E0; }; \ + struct { detail::_swizzle<4,T, P, V, 1,2,0,1> E1 ## E2 ## E0 ## E1; }; \ + struct { detail::_swizzle<4,T, P, V, 1,2,0,2> E1 ## E2 ## E0 ## E2; }; \ + struct { detail::_swizzle<4,T, P, V, 1,2,1,0> E1 ## E2 ## E1 ## E0; }; \ + struct { detail::_swizzle<4,T, P, V, 1,2,1,1> E1 ## E2 ## E1 ## E1; }; \ + struct { detail::_swizzle<4,T, P, V, 1,2,1,2> E1 ## E2 ## E1 ## E2; }; \ + struct { detail::_swizzle<4,T, P, V, 1,2,2,0> E1 ## E2 ## E2 ## E0; }; \ + struct { detail::_swizzle<4,T, P, V, 1,2,2,1> E1 ## E2 ## E2 ## E1; }; \ + struct { detail::_swizzle<4,T, P, V, 1,2,2,2> E1 ## E2 ## E2 ## E2; }; \ + struct { detail::_swizzle<4,T, P, V, 2,0,0,0> E2 ## E0 ## E0 ## E0; }; \ + struct { detail::_swizzle<4,T, P, V, 2,0,0,1> E2 ## E0 ## E0 ## E1; }; \ + struct { detail::_swizzle<4,T, P, V, 2,0,0,2> E2 ## E0 ## E0 ## E2; }; \ + struct { detail::_swizzle<4,T, P, V, 2,0,1,0> E2 ## E0 ## E1 ## E0; }; \ + struct { detail::_swizzle<4,T, P, V, 2,0,1,1> E2 ## E0 ## E1 ## E1; }; \ + struct { detail::_swizzle<4,T, P, V, 2,0,1,2> E2 ## E0 ## E1 ## E2; }; \ + struct { detail::_swizzle<4,T, P, V, 2,0,2,0> E2 ## E0 ## E2 ## E0; }; \ + struct { detail::_swizzle<4,T, P, V, 2,0,2,1> E2 ## E0 ## E2 ## E1; }; \ + struct { detail::_swizzle<4,T, P, V, 2,0,2,2> E2 ## E0 ## E2 ## E2; }; \ + struct { detail::_swizzle<4,T, P, V, 2,1,0,0> E2 ## E1 ## E0 ## E0; }; \ + struct { detail::_swizzle<4,T, P, V, 2,1,0,1> E2 ## E1 ## E0 ## E1; }; \ + struct { detail::_swizzle<4,T, P, V, 2,1,0,2> E2 ## E1 ## E0 ## E2; }; \ + struct { detail::_swizzle<4,T, P, V, 2,1,1,0> E2 ## E1 ## E1 ## E0; }; \ + struct { detail::_swizzle<4,T, P, V, 2,1,1,1> E2 ## E1 ## E1 ## E1; }; \ + struct { detail::_swizzle<4,T, P, V, 2,1,1,2> E2 ## E1 ## E1 ## E2; }; \ + struct { detail::_swizzle<4,T, P, V, 2,1,2,0> E2 ## E1 ## E2 ## E0; }; \ + struct { detail::_swizzle<4,T, P, V, 2,1,2,1> E2 ## E1 ## E2 ## E1; }; \ + struct { detail::_swizzle<4,T, P, V, 2,1,2,2> E2 ## E1 ## E2 ## E2; }; \ + struct { detail::_swizzle<4,T, P, V, 2,2,0,0> E2 ## E2 ## E0 ## E0; }; \ + struct { detail::_swizzle<4,T, P, V, 2,2,0,1> E2 ## E2 ## E0 ## E1; }; \ + struct { detail::_swizzle<4,T, P, V, 2,2,0,2> E2 ## E2 ## E0 ## E2; }; \ + struct { detail::_swizzle<4,T, P, V, 2,2,1,0> E2 ## E2 ## E1 ## E0; }; \ + struct { detail::_swizzle<4,T, P, V, 2,2,1,1> E2 ## E2 ## E1 ## E1; }; \ + struct { detail::_swizzle<4,T, P, V, 2,2,1,2> E2 ## E2 ## E1 ## E2; }; \ + struct { detail::_swizzle<4,T, P, V, 2,2,2,0> E2 ## E2 ## E2 ## E0; }; \ + struct { detail::_swizzle<4,T, P, V, 2,2,2,1> E2 ## E2 ## E2 ## E1; }; \ + struct { detail::_swizzle<4,T, P, V, 2,2,2,2> E2 ## E2 ## E2 ## E2; }; #define _GLM_SWIZZLE4_2_MEMBERS(T, P, V, E0,E1,E2,E3) \ - struct { detail::_swizzle<2,T, P, V, 0,0,-1,-2> E0 ## E0; }; \ - struct { detail::_swizzle<2,T, P, V, 0,1,-1,-2> E0 ## E1; }; \ - struct { detail::_swizzle<2,T, P, V, 0,2,-1,-2> E0 ## E2; }; \ - struct { detail::_swizzle<2,T, P, V, 0,3,-1,-2> E0 ## E3; }; \ - struct { detail::_swizzle<2,T, P, V, 1,0,-1,-2> E1 ## E0; }; \ - struct { detail::_swizzle<2,T, P, V, 1,1,-1,-2> E1 ## E1; }; \ - struct { detail::_swizzle<2,T, P, V, 1,2,-1,-2> E1 ## E2; }; \ - struct { detail::_swizzle<2,T, P, V, 1,3,-1,-2> E1 ## E3; }; \ - struct { detail::_swizzle<2,T, P, V, 2,0,-1,-2> E2 ## E0; }; \ - struct { detail::_swizzle<2,T, P, V, 2,1,-1,-2> E2 ## E1; }; \ - struct { detail::_swizzle<2,T, P, V, 2,2,-1,-2> E2 ## E2; }; \ - struct { detail::_swizzle<2,T, P, V, 2,3,-1,-2> E2 ## E3; }; \ - struct { detail::_swizzle<2,T, P, V, 3,0,-1,-2> E3 ## E0; }; \ - struct { detail::_swizzle<2,T, P, V, 3,1,-1,-2> E3 ## E1; }; \ - struct { detail::_swizzle<2,T, P, V, 3,2,-1,-2> E3 ## E2; }; \ - struct { detail::_swizzle<2,T, P, V, 3,3,-1,-2> E3 ## E3; }; + struct { detail::_swizzle<2,T, P, V, 0,0,-1,-2> E0 ## E0; }; \ + struct { detail::_swizzle<2,T, P, V, 0,1,-1,-2> E0 ## E1; }; \ + struct { detail::_swizzle<2,T, P, V, 0,2,-1,-2> E0 ## E2; }; \ + struct { detail::_swizzle<2,T, P, V, 0,3,-1,-2> E0 ## E3; }; \ + struct { detail::_swizzle<2,T, P, V, 1,0,-1,-2> E1 ## E0; }; \ + struct { detail::_swizzle<2,T, P, V, 1,1,-1,-2> E1 ## E1; }; \ + struct { detail::_swizzle<2,T, P, V, 1,2,-1,-2> E1 ## E2; }; \ + struct { detail::_swizzle<2,T, P, V, 1,3,-1,-2> E1 ## E3; }; \ + struct { detail::_swizzle<2,T, P, V, 2,0,-1,-2> E2 ## E0; }; \ + struct { detail::_swizzle<2,T, P, V, 2,1,-1,-2> E2 ## E1; }; \ + struct { detail::_swizzle<2,T, P, V, 2,2,-1,-2> E2 ## E2; }; \ + struct { detail::_swizzle<2,T, P, V, 2,3,-1,-2> E2 ## E3; }; \ + struct { detail::_swizzle<2,T, P, V, 3,0,-1,-2> E3 ## E0; }; \ + struct { detail::_swizzle<2,T, P, V, 3,1,-1,-2> E3 ## E1; }; \ + struct { detail::_swizzle<2,T, P, V, 3,2,-1,-2> E3 ## E2; }; \ + struct { detail::_swizzle<2,T, P, V, 3,3,-1,-2> E3 ## E3; }; -#define _GLM_SWIZZLE4_3_MEMBERS(T,P, V, E0,E1,E2,E3) \ - struct { detail::_swizzle<3,T,P, V, 0,0,0,-1> E0 ## E0 ## E0; }; \ - struct { detail::_swizzle<3,T,P, V, 0,0,1,-1> E0 ## E0 ## E1; }; \ - struct { detail::_swizzle<3,T,P, V, 0,0,2,-1> E0 ## E0 ## E2; }; \ - struct { detail::_swizzle<3,T,P, V, 0,0,3,-1> E0 ## E0 ## E3; }; \ - struct { detail::_swizzle<3,T,P, V, 0,1,0,-1> E0 ## E1 ## E0; }; \ - struct { detail::_swizzle<3,T,P, V, 0,1,1,-1> E0 ## E1 ## E1; }; \ - struct { detail::_swizzle<3,T,P, V, 0,1,2,-1> E0 ## E1 ## E2; }; \ - struct { detail::_swizzle<3,T,P, V, 0,1,3,-1> E0 ## E1 ## E3; }; \ - struct { detail::_swizzle<3,T,P, V, 0,2,0,-1> E0 ## E2 ## E0; }; \ - struct { detail::_swizzle<3,T,P, V, 0,2,1,-1> E0 ## E2 ## E1; }; \ - struct { detail::_swizzle<3,T,P, V, 0,2,2,-1> E0 ## E2 ## E2; }; \ - struct { detail::_swizzle<3,T,P, V, 0,2,3,-1> E0 ## E2 ## E3; }; \ - struct { detail::_swizzle<3,T,P, V, 0,3,0,-1> E0 ## E3 ## E0; }; \ - struct { detail::_swizzle<3,T,P, V, 0,3,1,-1> E0 ## E3 ## E1; }; \ - struct { detail::_swizzle<3,T,P, V, 0,3,2,-1> E0 ## E3 ## E2; }; \ - struct { detail::_swizzle<3,T,P, V, 0,3,3,-1> E0 ## E3 ## E3; }; \ - struct { detail::_swizzle<3,T,P, V, 1,0,0,-1> E1 ## E0 ## E0; }; \ - struct { detail::_swizzle<3,T,P, V, 1,0,1,-1> E1 ## E0 ## E1; }; \ - struct { detail::_swizzle<3,T,P, V, 1,0,2,-1> E1 ## E0 ## E2; }; \ - struct { detail::_swizzle<3,T,P, V, 1,0,3,-1> E1 ## E0 ## E3; }; \ - struct { detail::_swizzle<3,T,P, V, 1,1,0,-1> E1 ## E1 ## E0; }; \ - struct { detail::_swizzle<3,T,P, V, 1,1,1,-1> E1 ## E1 ## E1; }; \ - struct { detail::_swizzle<3,T,P, V, 1,1,2,-1> E1 ## E1 ## E2; }; \ - struct { detail::_swizzle<3,T,P, V, 1,1,3,-1> E1 ## E1 ## E3; }; \ - struct { detail::_swizzle<3,T,P, V, 1,2,0,-1> E1 ## E2 ## E0; }; \ - struct { detail::_swizzle<3,T,P, V, 1,2,1,-1> E1 ## E2 ## E1; }; \ - struct { detail::_swizzle<3,T,P, V, 1,2,2,-1> E1 ## E2 ## E2; }; \ - struct { detail::_swizzle<3,T,P, V, 1,2,3,-1> E1 ## E2 ## E3; }; \ - struct { detail::_swizzle<3,T,P, V, 1,3,0,-1> E1 ## E3 ## E0; }; \ - struct { detail::_swizzle<3,T,P, V, 1,3,1,-1> E1 ## E3 ## E1; }; \ - struct { detail::_swizzle<3,T,P, V, 1,3,2,-1> E1 ## E3 ## E2; }; \ - struct { detail::_swizzle<3,T,P, V, 1,3,3,-1> E1 ## E3 ## E3; }; \ - struct { detail::_swizzle<3,T,P, V, 2,0,0,-1> E2 ## E0 ## E0; }; \ - struct { detail::_swizzle<3,T,P, V, 2,0,1,-1> E2 ## E0 ## E1; }; \ - struct { detail::_swizzle<3,T,P, V, 2,0,2,-1> E2 ## E0 ## E2; }; \ - struct { detail::_swizzle<3,T,P, V, 2,0,3,-1> E2 ## E0 ## E3; }; \ - struct { detail::_swizzle<3,T,P, V, 2,1,0,-1> E2 ## E1 ## E0; }; \ - struct { detail::_swizzle<3,T,P, V, 2,1,1,-1> E2 ## E1 ## E1; }; \ - struct { detail::_swizzle<3,T,P, V, 2,1,2,-1> E2 ## E1 ## E2; }; \ - struct { detail::_swizzle<3,T,P, V, 2,1,3,-1> E2 ## E1 ## E3; }; \ - struct { detail::_swizzle<3,T,P, V, 2,2,0,-1> E2 ## E2 ## E0; }; \ - struct { detail::_swizzle<3,T,P, V, 2,2,1,-1> E2 ## E2 ## E1; }; \ - struct { detail::_swizzle<3,T,P, V, 2,2,2,-1> E2 ## E2 ## E2; }; \ - struct { detail::_swizzle<3,T,P, V, 2,2,3,-1> E2 ## E2 ## E3; }; \ - struct { detail::_swizzle<3,T,P, V, 2,3,0,-1> E2 ## E3 ## E0; }; \ - struct { detail::_swizzle<3,T,P, V, 2,3,1,-1> E2 ## E3 ## E1; }; \ - struct { detail::_swizzle<3,T,P, V, 2,3,2,-1> E2 ## E3 ## E2; }; \ - struct { detail::_swizzle<3,T,P, V, 2,3,3,-1> E2 ## E3 ## E3; }; \ - struct { detail::_swizzle<3,T,P, V, 3,0,0,-1> E3 ## E0 ## E0; }; \ - struct { detail::_swizzle<3,T,P, V, 3,0,1,-1> E3 ## E0 ## E1; }; \ - struct { detail::_swizzle<3,T,P, V, 3,0,2,-1> E3 ## E0 ## E2; }; \ - struct { detail::_swizzle<3,T,P, V, 3,0,3,-1> E3 ## E0 ## E3; }; \ - struct { detail::_swizzle<3,T,P, V, 3,1,0,-1> E3 ## E1 ## E0; }; \ - struct { detail::_swizzle<3,T,P, V, 3,1,1,-1> E3 ## E1 ## E1; }; \ - struct { detail::_swizzle<3,T,P, V, 3,1,2,-1> E3 ## E1 ## E2; }; \ - struct { detail::_swizzle<3,T,P, V, 3,1,3,-1> E3 ## E1 ## E3; }; \ - struct { detail::_swizzle<3,T,P, V, 3,2,0,-1> E3 ## E2 ## E0; }; \ - struct { detail::_swizzle<3,T,P, V, 3,2,1,-1> E3 ## E2 ## E1; }; \ - struct { detail::_swizzle<3,T,P, V, 3,2,2,-1> E3 ## E2 ## E2; }; \ - struct { detail::_swizzle<3,T,P, V, 3,2,3,-1> E3 ## E2 ## E3; }; \ - struct { detail::_swizzle<3,T,P, V, 3,3,0,-1> E3 ## E3 ## E0; }; \ - struct { detail::_swizzle<3,T,P, V, 3,3,1,-1> E3 ## E3 ## E1; }; \ - struct { detail::_swizzle<3,T,P, V, 3,3,2,-1> E3 ## E3 ## E2; }; \ - struct { detail::_swizzle<3,T,P, V, 3,3,3,-1> E3 ## E3 ## E3; }; +#define _GLM_SWIZZLE4_3_MEMBERS(T, P, V, E0,E1,E2,E3) \ + struct { detail::_swizzle<3, T, P, V, 0,0,0,-1> E0 ## E0 ## E0; }; \ + struct { detail::_swizzle<3, T, P, V, 0,0,1,-1> E0 ## E0 ## E1; }; \ + struct { detail::_swizzle<3, T, P, V, 0,0,2,-1> E0 ## E0 ## E2; }; \ + struct { detail::_swizzle<3, T, P, V, 0,0,3,-1> E0 ## E0 ## E3; }; \ + struct { detail::_swizzle<3, T, P, V, 0,1,0,-1> E0 ## E1 ## E0; }; \ + struct { detail::_swizzle<3, T, P, V, 0,1,1,-1> E0 ## E1 ## E1; }; \ + struct { detail::_swizzle<3, T, P, V, 0,1,2,-1> E0 ## E1 ## E2; }; \ + struct { detail::_swizzle<3, T, P, V, 0,1,3,-1> E0 ## E1 ## E3; }; \ + struct { detail::_swizzle<3, T, P, V, 0,2,0,-1> E0 ## E2 ## E0; }; \ + struct { detail::_swizzle<3, T, P, V, 0,2,1,-1> E0 ## E2 ## E1; }; \ + struct { detail::_swizzle<3, T, P, V, 0,2,2,-1> E0 ## E2 ## E2; }; \ + struct { detail::_swizzle<3, T, P, V, 0,2,3,-1> E0 ## E2 ## E3; }; \ + struct { detail::_swizzle<3, T, P, V, 0,3,0,-1> E0 ## E3 ## E0; }; \ + struct { detail::_swizzle<3, T, P, V, 0,3,1,-1> E0 ## E3 ## E1; }; \ + struct { detail::_swizzle<3, T, P, V, 0,3,2,-1> E0 ## E3 ## E2; }; \ + struct { detail::_swizzle<3, T, P, V, 0,3,3,-1> E0 ## E3 ## E3; }; \ + struct { detail::_swizzle<3, T, P, V, 1,0,0,-1> E1 ## E0 ## E0; }; \ + struct { detail::_swizzle<3, T, P, V, 1,0,1,-1> E1 ## E0 ## E1; }; \ + struct { detail::_swizzle<3, T, P, V, 1,0,2,-1> E1 ## E0 ## E2; }; \ + struct { detail::_swizzle<3, T, P, V, 1,0,3,-1> E1 ## E0 ## E3; }; \ + struct { detail::_swizzle<3, T, P, V, 1,1,0,-1> E1 ## E1 ## E0; }; \ + struct { detail::_swizzle<3, T, P, V, 1,1,1,-1> E1 ## E1 ## E1; }; \ + struct { detail::_swizzle<3, T, P, V, 1,1,2,-1> E1 ## E1 ## E2; }; \ + struct { detail::_swizzle<3, T, P, V, 1,1,3,-1> E1 ## E1 ## E3; }; \ + struct { detail::_swizzle<3, T, P, V, 1,2,0,-1> E1 ## E2 ## E0; }; \ + struct { detail::_swizzle<3, T, P, V, 1,2,1,-1> E1 ## E2 ## E1; }; \ + struct { detail::_swizzle<3, T, P, V, 1,2,2,-1> E1 ## E2 ## E2; }; \ + struct { detail::_swizzle<3, T, P, V, 1,2,3,-1> E1 ## E2 ## E3; }; \ + struct { detail::_swizzle<3, T, P, V, 1,3,0,-1> E1 ## E3 ## E0; }; \ + struct { detail::_swizzle<3, T, P, V, 1,3,1,-1> E1 ## E3 ## E1; }; \ + struct { detail::_swizzle<3, T, P, V, 1,3,2,-1> E1 ## E3 ## E2; }; \ + struct { detail::_swizzle<3, T, P, V, 1,3,3,-1> E1 ## E3 ## E3; }; \ + struct { detail::_swizzle<3, T, P, V, 2,0,0,-1> E2 ## E0 ## E0; }; \ + struct { detail::_swizzle<3, T, P, V, 2,0,1,-1> E2 ## E0 ## E1; }; \ + struct { detail::_swizzle<3, T, P, V, 2,0,2,-1> E2 ## E0 ## E2; }; \ + struct { detail::_swizzle<3, T, P, V, 2,0,3,-1> E2 ## E0 ## E3; }; \ + struct { detail::_swizzle<3, T, P, V, 2,1,0,-1> E2 ## E1 ## E0; }; \ + struct { detail::_swizzle<3, T, P, V, 2,1,1,-1> E2 ## E1 ## E1; }; \ + struct { detail::_swizzle<3, T, P, V, 2,1,2,-1> E2 ## E1 ## E2; }; \ + struct { detail::_swizzle<3, T, P, V, 2,1,3,-1> E2 ## E1 ## E3; }; \ + struct { detail::_swizzle<3, T, P, V, 2,2,0,-1> E2 ## E2 ## E0; }; \ + struct { detail::_swizzle<3, T, P, V, 2,2,1,-1> E2 ## E2 ## E1; }; \ + struct { detail::_swizzle<3, T, P, V, 2,2,2,-1> E2 ## E2 ## E2; }; \ + struct { detail::_swizzle<3, T, P, V, 2,2,3,-1> E2 ## E2 ## E3; }; \ + struct { detail::_swizzle<3, T, P, V, 2,3,0,-1> E2 ## E3 ## E0; }; \ + struct { detail::_swizzle<3, T, P, V, 2,3,1,-1> E2 ## E3 ## E1; }; \ + struct { detail::_swizzle<3, T, P, V, 2,3,2,-1> E2 ## E3 ## E2; }; \ + struct { detail::_swizzle<3, T, P, V, 2,3,3,-1> E2 ## E3 ## E3; }; \ + struct { detail::_swizzle<3, T, P, V, 3,0,0,-1> E3 ## E0 ## E0; }; \ + struct { detail::_swizzle<3, T, P, V, 3,0,1,-1> E3 ## E0 ## E1; }; \ + struct { detail::_swizzle<3, T, P, V, 3,0,2,-1> E3 ## E0 ## E2; }; \ + struct { detail::_swizzle<3, T, P, V, 3,0,3,-1> E3 ## E0 ## E3; }; \ + struct { detail::_swizzle<3, T, P, V, 3,1,0,-1> E3 ## E1 ## E0; }; \ + struct { detail::_swizzle<3, T, P, V, 3,1,1,-1> E3 ## E1 ## E1; }; \ + struct { detail::_swizzle<3, T, P, V, 3,1,2,-1> E3 ## E1 ## E2; }; \ + struct { detail::_swizzle<3, T, P, V, 3,1,3,-1> E3 ## E1 ## E3; }; \ + struct { detail::_swizzle<3, T, P, V, 3,2,0,-1> E3 ## E2 ## E0; }; \ + struct { detail::_swizzle<3, T, P, V, 3,2,1,-1> E3 ## E2 ## E1; }; \ + struct { detail::_swizzle<3, T, P, V, 3,2,2,-1> E3 ## E2 ## E2; }; \ + struct { detail::_swizzle<3, T, P, V, 3,2,3,-1> E3 ## E2 ## E3; }; \ + struct { detail::_swizzle<3, T, P, V, 3,3,0,-1> E3 ## E3 ## E0; }; \ + struct { detail::_swizzle<3, T, P, V, 3,3,1,-1> E3 ## E3 ## E1; }; \ + struct { detail::_swizzle<3, T, P, V, 3,3,2,-1> E3 ## E3 ## E2; }; \ + struct { detail::_swizzle<3, T, P, V, 3,3,3,-1> E3 ## E3 ## E3; }; #define _GLM_SWIZZLE4_4_MEMBERS(T, P, V, E0,E1,E2,E3) \ - struct { detail::_swizzle<4, T, P, V, 0,0,0,0> E0 ## E0 ## E0 ## E0; }; \ - struct { detail::_swizzle<4, T, P, V, 0,0,0,1> E0 ## E0 ## E0 ## E1; }; \ - struct { detail::_swizzle<4, T, P, V, 0,0,0,2> E0 ## E0 ## E0 ## E2; }; \ - struct { detail::_swizzle<4, T, P, V, 0,0,0,3> E0 ## E0 ## E0 ## E3; }; \ - struct { detail::_swizzle<4, T, P, V, 0,0,1,0> E0 ## E0 ## E1 ## E0; }; \ - struct { detail::_swizzle<4, T, P, V, 0,0,1,1> E0 ## E0 ## E1 ## E1; }; \ - struct { detail::_swizzle<4, T, P, V, 0,0,1,2> E0 ## E0 ## E1 ## E2; }; \ - struct { detail::_swizzle<4, T, P, V, 0,0,1,3> E0 ## E0 ## E1 ## E3; }; \ - struct { detail::_swizzle<4, T, P, V, 0,0,2,0> E0 ## E0 ## E2 ## E0; }; \ - struct { detail::_swizzle<4, T, P, V, 0,0,2,1> E0 ## E0 ## E2 ## E1; }; \ - struct { detail::_swizzle<4, T, P, V, 0,0,2,2> E0 ## E0 ## E2 ## E2; }; \ - struct { detail::_swizzle<4, T, P, V, 0,0,2,3> E0 ## E0 ## E2 ## E3; }; \ - struct { detail::_swizzle<4, T, P, V, 0,0,3,0> E0 ## E0 ## E3 ## E0; }; \ - struct { detail::_swizzle<4, T, P, V, 0,0,3,1> E0 ## E0 ## E3 ## E1; }; \ - struct { detail::_swizzle<4, T, P, V, 0,0,3,2> E0 ## E0 ## E3 ## E2; }; \ - struct { detail::_swizzle<4, T, P, V, 0,0,3,3> E0 ## E0 ## E3 ## E3; }; \ - struct { detail::_swizzle<4, T, P, V, 0,1,0,0> E0 ## E1 ## E0 ## E0; }; \ - struct { detail::_swizzle<4, T, P, V, 0,1,0,1> E0 ## E1 ## E0 ## E1; }; \ - struct { detail::_swizzle<4, T, P, V, 0,1,0,2> E0 ## E1 ## E0 ## E2; }; \ - struct { detail::_swizzle<4, T, P, V, 0,1,0,3> E0 ## E1 ## E0 ## E3; }; \ - struct { detail::_swizzle<4, T, P, V, 0,1,1,0> E0 ## E1 ## E1 ## E0; }; \ - struct { detail::_swizzle<4, T, P, V, 0,1,1,1> E0 ## E1 ## E1 ## E1; }; \ - struct { detail::_swizzle<4, T, P, V, 0,1,1,2> E0 ## E1 ## E1 ## E2; }; \ - struct { detail::_swizzle<4, T, P, V, 0,1,1,3> E0 ## E1 ## E1 ## E3; }; \ - struct { detail::_swizzle<4, T, P, V, 0,1,2,0> E0 ## E1 ## E2 ## E0; }; \ - struct { detail::_swizzle<4, T, P, V, 0,1,2,1> E0 ## E1 ## E2 ## E1; }; \ - struct { detail::_swizzle<4, T, P, V, 0,1,2,2> E0 ## E1 ## E2 ## E2; }; \ - struct { detail::_swizzle<4, T, P, V, 0,1,2,3> E0 ## E1 ## E2 ## E3; }; \ - struct { detail::_swizzle<4, T, P, V, 0,1,3,0> E0 ## E1 ## E3 ## E0; }; \ - struct { detail::_swizzle<4, T, P, V, 0,1,3,1> E0 ## E1 ## E3 ## E1; }; \ - struct { detail::_swizzle<4, T, P, V, 0,1,3,2> E0 ## E1 ## E3 ## E2; }; \ - struct { detail::_swizzle<4, T, P, V, 0,1,3,3> E0 ## E1 ## E3 ## E3; }; \ - struct { detail::_swizzle<4, T, P, V, 0,2,0,0> E0 ## E2 ## E0 ## E0; }; \ - struct { detail::_swizzle<4, T, P, V, 0,2,0,1> E0 ## E2 ## E0 ## E1; }; \ - struct { detail::_swizzle<4, T, P, V, 0,2,0,2> E0 ## E2 ## E0 ## E2; }; \ - struct { detail::_swizzle<4, T, P, V, 0,2,0,3> E0 ## E2 ## E0 ## E3; }; \ - struct { detail::_swizzle<4, T, P, V, 0,2,1,0> E0 ## E2 ## E1 ## E0; }; \ - struct { detail::_swizzle<4, T, P, V, 0,2,1,1> E0 ## E2 ## E1 ## E1; }; \ - struct { detail::_swizzle<4, T, P, V, 0,2,1,2> E0 ## E2 ## E1 ## E2; }; \ - struct { detail::_swizzle<4, T, P, V, 0,2,1,3> E0 ## E2 ## E1 ## E3; }; \ - struct { detail::_swizzle<4, T, P, V, 0,2,2,0> E0 ## E2 ## E2 ## E0; }; \ - struct { detail::_swizzle<4, T, P, V, 0,2,2,1> E0 ## E2 ## E2 ## E1; }; \ - struct { detail::_swizzle<4, T, P, V, 0,2,2,2> E0 ## E2 ## E2 ## E2; }; \ - struct { detail::_swizzle<4, T, P, V, 0,2,2,3> E0 ## E2 ## E2 ## E3; }; \ - struct { detail::_swizzle<4, T, P, V, 0,2,3,0> E0 ## E2 ## E3 ## E0; }; \ - struct { detail::_swizzle<4, T, P, V, 0,2,3,1> E0 ## E2 ## E3 ## E1; }; \ - struct { detail::_swizzle<4, T, P, V, 0,2,3,2> E0 ## E2 ## E3 ## E2; }; \ - struct { detail::_swizzle<4, T, P, V, 0,2,3,3> E0 ## E2 ## E3 ## E3; }; \ - struct { detail::_swizzle<4, T, P, V, 0,3,0,0> E0 ## E3 ## E0 ## E0; }; \ - struct { detail::_swizzle<4, T, P, V, 0,3,0,1> E0 ## E3 ## E0 ## E1; }; \ - struct { detail::_swizzle<4, T, P, V, 0,3,0,2> E0 ## E3 ## E0 ## E2; }; \ - struct { detail::_swizzle<4, T, P, V, 0,3,0,3> E0 ## E3 ## E0 ## E3; }; \ - struct { detail::_swizzle<4, T, P, V, 0,3,1,0> E0 ## E3 ## E1 ## E0; }; \ - struct { detail::_swizzle<4, T, P, V, 0,3,1,1> E0 ## E3 ## E1 ## E1; }; \ - struct { detail::_swizzle<4, T, P, V, 0,3,1,2> E0 ## E3 ## E1 ## E2; }; \ - struct { detail::_swizzle<4, T, P, V, 0,3,1,3> E0 ## E3 ## E1 ## E3; }; \ - struct { detail::_swizzle<4, T, P, V, 0,3,2,0> E0 ## E3 ## E2 ## E0; }; \ - struct { detail::_swizzle<4, T, P, V, 0,3,2,1> E0 ## E3 ## E2 ## E1; }; \ - struct { detail::_swizzle<4, T, P, V, 0,3,2,2> E0 ## E3 ## E2 ## E2; }; \ - struct { detail::_swizzle<4, T, P, V, 0,3,2,3> E0 ## E3 ## E2 ## E3; }; \ - struct { detail::_swizzle<4, T, P, V, 0,3,3,0> E0 ## E3 ## E3 ## E0; }; \ - struct { detail::_swizzle<4, T, P, V, 0,3,3,1> E0 ## E3 ## E3 ## E1; }; \ - struct { detail::_swizzle<4, T, P, V, 0,3,3,2> E0 ## E3 ## E3 ## E2; }; \ - struct { detail::_swizzle<4, T, P, V, 0,3,3,3> E0 ## E3 ## E3 ## E3; }; \ - struct { detail::_swizzle<4, T, P, V, 1,0,0,0> E1 ## E0 ## E0 ## E0; }; \ - struct { detail::_swizzle<4, T, P, V, 1,0,0,1> E1 ## E0 ## E0 ## E1; }; \ - struct { detail::_swizzle<4, T, P, V, 1,0,0,2> E1 ## E0 ## E0 ## E2; }; \ - struct { detail::_swizzle<4, T, P, V, 1,0,0,3> E1 ## E0 ## E0 ## E3; }; \ - struct { detail::_swizzle<4, T, P, V, 1,0,1,0> E1 ## E0 ## E1 ## E0; }; \ - struct { detail::_swizzle<4, T, P, V, 1,0,1,1> E1 ## E0 ## E1 ## E1; }; \ - struct { detail::_swizzle<4, T, P, V, 1,0,1,2> E1 ## E0 ## E1 ## E2; }; \ - struct { detail::_swizzle<4, T, P, V, 1,0,1,3> E1 ## E0 ## E1 ## E3; }; \ - struct { detail::_swizzle<4, T, P, V, 1,0,2,0> E1 ## E0 ## E2 ## E0; }; \ - struct { detail::_swizzle<4, T, P, V, 1,0,2,1> E1 ## E0 ## E2 ## E1; }; \ - struct { detail::_swizzle<4, T, P, V, 1,0,2,2> E1 ## E0 ## E2 ## E2; }; \ - struct { detail::_swizzle<4, T, P, V, 1,0,2,3> E1 ## E0 ## E2 ## E3; }; \ - struct { detail::_swizzle<4, T, P, V, 1,0,3,0> E1 ## E0 ## E3 ## E0; }; \ - struct { detail::_swizzle<4, T, P, V, 1,0,3,1> E1 ## E0 ## E3 ## E1; }; \ - struct { detail::_swizzle<4, T, P, V, 1,0,3,2> E1 ## E0 ## E3 ## E2; }; \ - struct { detail::_swizzle<4, T, P, V, 1,0,3,3> E1 ## E0 ## E3 ## E3; }; \ - struct { detail::_swizzle<4, T, P, V, 1,1,0,0> E1 ## E1 ## E0 ## E0; }; \ - struct { detail::_swizzle<4, T, P, V, 1,1,0,1> E1 ## E1 ## E0 ## E1; }; \ - struct { detail::_swizzle<4, T, P, V, 1,1,0,2> E1 ## E1 ## E0 ## E2; }; \ - struct { detail::_swizzle<4, T, P, V, 1,1,0,3> E1 ## E1 ## E0 ## E3; }; \ - struct { detail::_swizzle<4, T, P, V, 1,1,1,0> E1 ## E1 ## E1 ## E0; }; \ - struct { detail::_swizzle<4, T, P, V, 1,1,1,1> E1 ## E1 ## E1 ## E1; }; \ - struct { detail::_swizzle<4, T, P, V, 1,1,1,2> E1 ## E1 ## E1 ## E2; }; \ - struct { detail::_swizzle<4, T, P, V, 1,1,1,3> E1 ## E1 ## E1 ## E3; }; \ - struct { detail::_swizzle<4, T, P, V, 1,1,2,0> E1 ## E1 ## E2 ## E0; }; \ - struct { detail::_swizzle<4, T, P, V, 1,1,2,1> E1 ## E1 ## E2 ## E1; }; \ - struct { detail::_swizzle<4, T, P, V, 1,1,2,2> E1 ## E1 ## E2 ## E2; }; \ - struct { detail::_swizzle<4, T, P, V, 1,1,2,3> E1 ## E1 ## E2 ## E3; }; \ - struct { detail::_swizzle<4, T, P, V, 1,1,3,0> E1 ## E1 ## E3 ## E0; }; \ - struct { detail::_swizzle<4, T, P, V, 1,1,3,1> E1 ## E1 ## E3 ## E1; }; \ - struct { detail::_swizzle<4, T, P, V, 1,1,3,2> E1 ## E1 ## E3 ## E2; }; \ - struct { detail::_swizzle<4, T, P, V, 1,1,3,3> E1 ## E1 ## E3 ## E3; }; \ - struct { detail::_swizzle<4, T, P, V, 1,2,0,0> E1 ## E2 ## E0 ## E0; }; \ - struct { detail::_swizzle<4, T, P, V, 1,2,0,1> E1 ## E2 ## E0 ## E1; }; \ - struct { detail::_swizzle<4, T, P, V, 1,2,0,2> E1 ## E2 ## E0 ## E2; }; \ - struct { detail::_swizzle<4, T, P, V, 1,2,0,3> E1 ## E2 ## E0 ## E3; }; \ - struct { detail::_swizzle<4, T, P, V, 1,2,1,0> E1 ## E2 ## E1 ## E0; }; \ - struct { detail::_swizzle<4, T, P, V, 1,2,1,1> E1 ## E2 ## E1 ## E1; }; \ - struct { detail::_swizzle<4, T, P, V, 1,2,1,2> E1 ## E2 ## E1 ## E2; }; \ - struct { detail::_swizzle<4, T, P, V, 1,2,1,3> E1 ## E2 ## E1 ## E3; }; \ - struct { detail::_swizzle<4, T, P, V, 1,2,2,0> E1 ## E2 ## E2 ## E0; }; \ - struct { detail::_swizzle<4, T, P, V, 1,2,2,1> E1 ## E2 ## E2 ## E1; }; \ - struct { detail::_swizzle<4, T, P, V, 1,2,2,2> E1 ## E2 ## E2 ## E2; }; \ - struct { detail::_swizzle<4, T, P, V, 1,2,2,3> E1 ## E2 ## E2 ## E3; }; \ - struct { detail::_swizzle<4, T, P, V, 1,2,3,0> E1 ## E2 ## E3 ## E0; }; \ - struct { detail::_swizzle<4, T, P, V, 1,2,3,1> E1 ## E2 ## E3 ## E1; }; \ - struct { detail::_swizzle<4, T, P, V, 1,2,3,2> E1 ## E2 ## E3 ## E2; }; \ - struct { detail::_swizzle<4, T, P, V, 1,2,3,3> E1 ## E2 ## E3 ## E3; }; \ - struct { detail::_swizzle<4, T, P, V, 1,3,0,0> E1 ## E3 ## E0 ## E0; }; \ - struct { detail::_swizzle<4, T, P, V, 1,3,0,1> E1 ## E3 ## E0 ## E1; }; \ - struct { detail::_swizzle<4, T, P, V, 1,3,0,2> E1 ## E3 ## E0 ## E2; }; \ - struct { detail::_swizzle<4, T, P, V, 1,3,0,3> E1 ## E3 ## E0 ## E3; }; \ - struct { detail::_swizzle<4, T, P, V, 1,3,1,0> E1 ## E3 ## E1 ## E0; }; \ - struct { detail::_swizzle<4, T, P, V, 1,3,1,1> E1 ## E3 ## E1 ## E1; }; \ - struct { detail::_swizzle<4, T, P, V, 1,3,1,2> E1 ## E3 ## E1 ## E2; }; \ - struct { detail::_swizzle<4, T, P, V, 1,3,1,3> E1 ## E3 ## E1 ## E3; }; \ - struct { detail::_swizzle<4, T, P, V, 1,3,2,0> E1 ## E3 ## E2 ## E0; }; \ - struct { detail::_swizzle<4, T, P, V, 1,3,2,1> E1 ## E3 ## E2 ## E1; }; \ - struct { detail::_swizzle<4, T, P, V, 1,3,2,2> E1 ## E3 ## E2 ## E2; }; \ - struct { detail::_swizzle<4, T, P, V, 1,3,2,3> E1 ## E3 ## E2 ## E3; }; \ - struct { detail::_swizzle<4, T, P, V, 1,3,3,0> E1 ## E3 ## E3 ## E0; }; \ - struct { detail::_swizzle<4, T, P, V, 1,3,3,1> E1 ## E3 ## E3 ## E1; }; \ - struct { detail::_swizzle<4, T, P, V, 1,3,3,2> E1 ## E3 ## E3 ## E2; }; \ - struct { detail::_swizzle<4, T, P, V, 1,3,3,3> E1 ## E3 ## E3 ## E3; }; \ - struct { detail::_swizzle<4, T, P, V, 2,0,0,0> E2 ## E0 ## E0 ## E0; }; \ - struct { detail::_swizzle<4, T, P, V, 2,0,0,1> E2 ## E0 ## E0 ## E1; }; \ - struct { detail::_swizzle<4, T, P, V, 2,0,0,2> E2 ## E0 ## E0 ## E2; }; \ - struct { detail::_swizzle<4, T, P, V, 2,0,0,3> E2 ## E0 ## E0 ## E3; }; \ - struct { detail::_swizzle<4, T, P, V, 2,0,1,0> E2 ## E0 ## E1 ## E0; }; \ - struct { detail::_swizzle<4, T, P, V, 2,0,1,1> E2 ## E0 ## E1 ## E1; }; \ - struct { detail::_swizzle<4, T, P, V, 2,0,1,2> E2 ## E0 ## E1 ## E2; }; \ - struct { detail::_swizzle<4, T, P, V, 2,0,1,3> E2 ## E0 ## E1 ## E3; }; \ - struct { detail::_swizzle<4, T, P, V, 2,0,2,0> E2 ## E0 ## E2 ## E0; }; \ - struct { detail::_swizzle<4, T, P, V, 2,0,2,1> E2 ## E0 ## E2 ## E1; }; \ - struct { detail::_swizzle<4, T, P, V, 2,0,2,2> E2 ## E0 ## E2 ## E2; }; \ - struct { detail::_swizzle<4, T, P, V, 2,0,2,3> E2 ## E0 ## E2 ## E3; }; \ - struct { detail::_swizzle<4, T, P, V, 2,0,3,0> E2 ## E0 ## E3 ## E0; }; \ - struct { detail::_swizzle<4, T, P, V, 2,0,3,1> E2 ## E0 ## E3 ## E1; }; \ - struct { detail::_swizzle<4, T, P, V, 2,0,3,2> E2 ## E0 ## E3 ## E2; }; \ - struct { detail::_swizzle<4, T, P, V, 2,0,3,3> E2 ## E0 ## E3 ## E3; }; \ - struct { detail::_swizzle<4, T, P, V, 2,1,0,0> E2 ## E1 ## E0 ## E0; }; \ - struct { detail::_swizzle<4, T, P, V, 2,1,0,1> E2 ## E1 ## E0 ## E1; }; \ - struct { detail::_swizzle<4, T, P, V, 2,1,0,2> E2 ## E1 ## E0 ## E2; }; \ - struct { detail::_swizzle<4, T, P, V, 2,1,0,3> E2 ## E1 ## E0 ## E3; }; \ - struct { detail::_swizzle<4, T, P, V, 2,1,1,0> E2 ## E1 ## E1 ## E0; }; \ - struct { detail::_swizzle<4, T, P, V, 2,1,1,1> E2 ## E1 ## E1 ## E1; }; \ - struct { detail::_swizzle<4, T, P, V, 2,1,1,2> E2 ## E1 ## E1 ## E2; }; \ - struct { detail::_swizzle<4, T, P, V, 2,1,1,3> E2 ## E1 ## E1 ## E3; }; \ - struct { detail::_swizzle<4, T, P, V, 2,1,2,0> E2 ## E1 ## E2 ## E0; }; \ - struct { detail::_swizzle<4, T, P, V, 2,1,2,1> E2 ## E1 ## E2 ## E1; }; \ - struct { detail::_swizzle<4, T, P, V, 2,1,2,2> E2 ## E1 ## E2 ## E2; }; \ - struct { detail::_swizzle<4, T, P, V, 2,1,2,3> E2 ## E1 ## E2 ## E3; }; \ - struct { detail::_swizzle<4, T, P, V, 2,1,3,0> E2 ## E1 ## E3 ## E0; }; \ - struct { detail::_swizzle<4, T, P, V, 2,1,3,1> E2 ## E1 ## E3 ## E1; }; \ - struct { detail::_swizzle<4, T, P, V, 2,1,3,2> E2 ## E1 ## E3 ## E2; }; \ - struct { detail::_swizzle<4, T, P, V, 2,1,3,3> E2 ## E1 ## E3 ## E3; }; \ - struct { detail::_swizzle<4, T, P, V, 2,2,0,0> E2 ## E2 ## E0 ## E0; }; \ - struct { detail::_swizzle<4, T, P, V, 2,2,0,1> E2 ## E2 ## E0 ## E1; }; \ - struct { detail::_swizzle<4, T, P, V, 2,2,0,2> E2 ## E2 ## E0 ## E2; }; \ - struct { detail::_swizzle<4, T, P, V, 2,2,0,3> E2 ## E2 ## E0 ## E3; }; \ - struct { detail::_swizzle<4, T, P, V, 2,2,1,0> E2 ## E2 ## E1 ## E0; }; \ - struct { detail::_swizzle<4, T, P, V, 2,2,1,1> E2 ## E2 ## E1 ## E1; }; \ - struct { detail::_swizzle<4, T, P, V, 2,2,1,2> E2 ## E2 ## E1 ## E2; }; \ - struct { detail::_swizzle<4, T, P, V, 2,2,1,3> E2 ## E2 ## E1 ## E3; }; \ - struct { detail::_swizzle<4, T, P, V, 2,2,2,0> E2 ## E2 ## E2 ## E0; }; \ - struct { detail::_swizzle<4, T, P, V, 2,2,2,1> E2 ## E2 ## E2 ## E1; }; \ - struct { detail::_swizzle<4, T, P, V, 2,2,2,2> E2 ## E2 ## E2 ## E2; }; \ - struct { detail::_swizzle<4, T, P, V, 2,2,2,3> E2 ## E2 ## E2 ## E3; }; \ - struct { detail::_swizzle<4, T, P, V, 2,2,3,0> E2 ## E2 ## E3 ## E0; }; \ - struct { detail::_swizzle<4, T, P, V, 2,2,3,1> E2 ## E2 ## E3 ## E1; }; \ - struct { detail::_swizzle<4, T, P, V, 2,2,3,2> E2 ## E2 ## E3 ## E2; }; \ - struct { detail::_swizzle<4, T, P, V, 2,2,3,3> E2 ## E2 ## E3 ## E3; }; \ - struct { detail::_swizzle<4, T, P, V, 2,3,0,0> E2 ## E3 ## E0 ## E0; }; \ - struct { detail::_swizzle<4, T, P, V, 2,3,0,1> E2 ## E3 ## E0 ## E1; }; \ - struct { detail::_swizzle<4, T, P, V, 2,3,0,2> E2 ## E3 ## E0 ## E2; }; \ - struct { detail::_swizzle<4, T, P, V, 2,3,0,3> E2 ## E3 ## E0 ## E3; }; \ - struct { detail::_swizzle<4, T, P, V, 2,3,1,0> E2 ## E3 ## E1 ## E0; }; \ - struct { detail::_swizzle<4, T, P, V, 2,3,1,1> E2 ## E3 ## E1 ## E1; }; \ - struct { detail::_swizzle<4, T, P, V, 2,3,1,2> E2 ## E3 ## E1 ## E2; }; \ - struct { detail::_swizzle<4, T, P, V, 2,3,1,3> E2 ## E3 ## E1 ## E3; }; \ - struct { detail::_swizzle<4, T, P, V, 2,3,2,0> E2 ## E3 ## E2 ## E0; }; \ - struct { detail::_swizzle<4, T, P, V, 2,3,2,1> E2 ## E3 ## E2 ## E1; }; \ - struct { detail::_swizzle<4, T, P, V, 2,3,2,2> E2 ## E3 ## E2 ## E2; }; \ - struct { detail::_swizzle<4, T, P, V, 2,3,2,3> E2 ## E3 ## E2 ## E3; }; \ - struct { detail::_swizzle<4, T, P, V, 2,3,3,0> E2 ## E3 ## E3 ## E0; }; \ - struct { detail::_swizzle<4, T, P, V, 2,3,3,1> E2 ## E3 ## E3 ## E1; }; \ - struct { detail::_swizzle<4, T, P, V, 2,3,3,2> E2 ## E3 ## E3 ## E2; }; \ - struct { detail::_swizzle<4, T, P, V, 2,3,3,3> E2 ## E3 ## E3 ## E3; }; \ - struct { detail::_swizzle<4, T, P, V, 3,0,0,0> E3 ## E0 ## E0 ## E0; }; \ - struct { detail::_swizzle<4, T, P, V, 3,0,0,1> E3 ## E0 ## E0 ## E1; }; \ - struct { detail::_swizzle<4, T, P, V, 3,0,0,2> E3 ## E0 ## E0 ## E2; }; \ - struct { detail::_swizzle<4, T, P, V, 3,0,0,3> E3 ## E0 ## E0 ## E3; }; \ - struct { detail::_swizzle<4, T, P, V, 3,0,1,0> E3 ## E0 ## E1 ## E0; }; \ - struct { detail::_swizzle<4, T, P, V, 3,0,1,1> E3 ## E0 ## E1 ## E1; }; \ - struct { detail::_swizzle<4, T, P, V, 3,0,1,2> E3 ## E0 ## E1 ## E2; }; \ - struct { detail::_swizzle<4, T, P, V, 3,0,1,3> E3 ## E0 ## E1 ## E3; }; \ - struct { detail::_swizzle<4, T, P, V, 3,0,2,0> E3 ## E0 ## E2 ## E0; }; \ - struct { detail::_swizzle<4, T, P, V, 3,0,2,1> E3 ## E0 ## E2 ## E1; }; \ - struct { detail::_swizzle<4, T, P, V, 3,0,2,2> E3 ## E0 ## E2 ## E2; }; \ - struct { detail::_swizzle<4, T, P, V, 3,0,2,3> E3 ## E0 ## E2 ## E3; }; \ - struct { detail::_swizzle<4, T, P, V, 3,0,3,0> E3 ## E0 ## E3 ## E0; }; \ - struct { detail::_swizzle<4, T, P, V, 3,0,3,1> E3 ## E0 ## E3 ## E1; }; \ - struct { detail::_swizzle<4, T, P, V, 3,0,3,2> E3 ## E0 ## E3 ## E2; }; \ - struct { detail::_swizzle<4, T, P, V, 3,0,3,3> E3 ## E0 ## E3 ## E3; }; \ - struct { detail::_swizzle<4, T, P, V, 3,1,0,0> E3 ## E1 ## E0 ## E0; }; \ - struct { detail::_swizzle<4, T, P, V, 3,1,0,1> E3 ## E1 ## E0 ## E1; }; \ - struct { detail::_swizzle<4, T, P, V, 3,1,0,2> E3 ## E1 ## E0 ## E2; }; \ - struct { detail::_swizzle<4, T, P, V, 3,1,0,3> E3 ## E1 ## E0 ## E3; }; \ - struct { detail::_swizzle<4, T, P, V, 3,1,1,0> E3 ## E1 ## E1 ## E0; }; \ - struct { detail::_swizzle<4, T, P, V, 3,1,1,1> E3 ## E1 ## E1 ## E1; }; \ - struct { detail::_swizzle<4, T, P, V, 3,1,1,2> E3 ## E1 ## E1 ## E2; }; \ - struct { detail::_swizzle<4, T, P, V, 3,1,1,3> E3 ## E1 ## E1 ## E3; }; \ - struct { detail::_swizzle<4, T, P, V, 3,1,2,0> E3 ## E1 ## E2 ## E0; }; \ - struct { detail::_swizzle<4, T, P, V, 3,1,2,1> E3 ## E1 ## E2 ## E1; }; \ - struct { detail::_swizzle<4, T, P, V, 3,1,2,2> E3 ## E1 ## E2 ## E2; }; \ - struct { detail::_swizzle<4, T, P, V, 3,1,2,3> E3 ## E1 ## E2 ## E3; }; \ - struct { detail::_swizzle<4, T, P, V, 3,1,3,0> E3 ## E1 ## E3 ## E0; }; \ - struct { detail::_swizzle<4, T, P, V, 3,1,3,1> E3 ## E1 ## E3 ## E1; }; \ - struct { detail::_swizzle<4, T, P, V, 3,1,3,2> E3 ## E1 ## E3 ## E2; }; \ - struct { detail::_swizzle<4, T, P, V, 3,1,3,3> E3 ## E1 ## E3 ## E3; }; \ - struct { detail::_swizzle<4, T, P, V, 3,2,0,0> E3 ## E2 ## E0 ## E0; }; \ - struct { detail::_swizzle<4, T, P, V, 3,2,0,1> E3 ## E2 ## E0 ## E1; }; \ - struct { detail::_swizzle<4, T, P, V, 3,2,0,2> E3 ## E2 ## E0 ## E2; }; \ - struct { detail::_swizzle<4, T, P, V, 3,2,0,3> E3 ## E2 ## E0 ## E3; }; \ - struct { detail::_swizzle<4, T, P, V, 3,2,1,0> E3 ## E2 ## E1 ## E0; }; \ - struct { detail::_swizzle<4, T, P, V, 3,2,1,1> E3 ## E2 ## E1 ## E1; }; \ - struct { detail::_swizzle<4, T, P, V, 3,2,1,2> E3 ## E2 ## E1 ## E2; }; \ - struct { detail::_swizzle<4, T, P, V, 3,2,1,3> E3 ## E2 ## E1 ## E3; }; \ - struct { detail::_swizzle<4, T, P, V, 3,2,2,0> E3 ## E2 ## E2 ## E0; }; \ - struct { detail::_swizzle<4, T, P, V, 3,2,2,1> E3 ## E2 ## E2 ## E1; }; \ - struct { detail::_swizzle<4, T, P, V, 3,2,2,2> E3 ## E2 ## E2 ## E2; }; \ - struct { detail::_swizzle<4, T, P, V, 3,2,2,3> E3 ## E2 ## E2 ## E3; }; \ - struct { detail::_swizzle<4, T, P, V, 3,2,3,0> E3 ## E2 ## E3 ## E0; }; \ - struct { detail::_swizzle<4, T, P, V, 3,2,3,1> E3 ## E2 ## E3 ## E1; }; \ - struct { detail::_swizzle<4, T, P, V, 3,2,3,2> E3 ## E2 ## E3 ## E2; }; \ - struct { detail::_swizzle<4, T, P, V, 3,2,3,3> E3 ## E2 ## E3 ## E3; }; \ - struct { detail::_swizzle<4, T, P, V, 3,3,0,0> E3 ## E3 ## E0 ## E0; }; \ - struct { detail::_swizzle<4, T, P, V, 3,3,0,1> E3 ## E3 ## E0 ## E1; }; \ - struct { detail::_swizzle<4, T, P, V, 3,3,0,2> E3 ## E3 ## E0 ## E2; }; \ - struct { detail::_swizzle<4, T, P, V, 3,3,0,3> E3 ## E3 ## E0 ## E3; }; \ - struct { detail::_swizzle<4, T, P, V, 3,3,1,0> E3 ## E3 ## E1 ## E0; }; \ - struct { detail::_swizzle<4, T, P, V, 3,3,1,1> E3 ## E3 ## E1 ## E1; }; \ - struct { detail::_swizzle<4, T, P, V, 3,3,1,2> E3 ## E3 ## E1 ## E2; }; \ - struct { detail::_swizzle<4, T, P, V, 3,3,1,3> E3 ## E3 ## E1 ## E3; }; \ - struct { detail::_swizzle<4, T, P, V, 3,3,2,0> E3 ## E3 ## E2 ## E0; }; \ - struct { detail::_swizzle<4, T, P, V, 3,3,2,1> E3 ## E3 ## E2 ## E1; }; \ - struct { detail::_swizzle<4, T, P, V, 3,3,2,2> E3 ## E3 ## E2 ## E2; }; \ - struct { detail::_swizzle<4, T, P, V, 3,3,2,3> E3 ## E3 ## E2 ## E3; }; \ - struct { detail::_swizzle<4, T, P, V, 3,3,3,0> E3 ## E3 ## E3 ## E0; }; \ - struct { detail::_swizzle<4, T, P, V, 3,3,3,1> E3 ## E3 ## E3 ## E1; }; \ - struct { detail::_swizzle<4, T, P, V, 3,3,3,2> E3 ## E3 ## E3 ## E2; }; \ - struct { detail::_swizzle<4, T, P, V, 3,3,3,3> E3 ## E3 ## E3 ## E3; }; + struct { detail::_swizzle<4, T, P, V, 0,0,0,0> E0 ## E0 ## E0 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 0,0,0,1> E0 ## E0 ## E0 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 0,0,0,2> E0 ## E0 ## E0 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 0,0,0,3> E0 ## E0 ## E0 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 0,0,1,0> E0 ## E0 ## E1 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 0,0,1,1> E0 ## E0 ## E1 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 0,0,1,2> E0 ## E0 ## E1 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 0,0,1,3> E0 ## E0 ## E1 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 0,0,2,0> E0 ## E0 ## E2 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 0,0,2,1> E0 ## E0 ## E2 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 0,0,2,2> E0 ## E0 ## E2 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 0,0,2,3> E0 ## E0 ## E2 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 0,0,3,0> E0 ## E0 ## E3 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 0,0,3,1> E0 ## E0 ## E3 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 0,0,3,2> E0 ## E0 ## E3 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 0,0,3,3> E0 ## E0 ## E3 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 0,1,0,0> E0 ## E1 ## E0 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 0,1,0,1> E0 ## E1 ## E0 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 0,1,0,2> E0 ## E1 ## E0 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 0,1,0,3> E0 ## E1 ## E0 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 0,1,1,0> E0 ## E1 ## E1 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 0,1,1,1> E0 ## E1 ## E1 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 0,1,1,2> E0 ## E1 ## E1 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 0,1,1,3> E0 ## E1 ## E1 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 0,1,2,0> E0 ## E1 ## E2 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 0,1,2,1> E0 ## E1 ## E2 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 0,1,2,2> E0 ## E1 ## E2 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 0,1,2,3> E0 ## E1 ## E2 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 0,1,3,0> E0 ## E1 ## E3 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 0,1,3,1> E0 ## E1 ## E3 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 0,1,3,2> E0 ## E1 ## E3 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 0,1,3,3> E0 ## E1 ## E3 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 0,2,0,0> E0 ## E2 ## E0 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 0,2,0,1> E0 ## E2 ## E0 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 0,2,0,2> E0 ## E2 ## E0 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 0,2,0,3> E0 ## E2 ## E0 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 0,2,1,0> E0 ## E2 ## E1 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 0,2,1,1> E0 ## E2 ## E1 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 0,2,1,2> E0 ## E2 ## E1 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 0,2,1,3> E0 ## E2 ## E1 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 0,2,2,0> E0 ## E2 ## E2 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 0,2,2,1> E0 ## E2 ## E2 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 0,2,2,2> E0 ## E2 ## E2 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 0,2,2,3> E0 ## E2 ## E2 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 0,2,3,0> E0 ## E2 ## E3 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 0,2,3,1> E0 ## E2 ## E3 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 0,2,3,2> E0 ## E2 ## E3 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 0,2,3,3> E0 ## E2 ## E3 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 0,3,0,0> E0 ## E3 ## E0 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 0,3,0,1> E0 ## E3 ## E0 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 0,3,0,2> E0 ## E3 ## E0 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 0,3,0,3> E0 ## E3 ## E0 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 0,3,1,0> E0 ## E3 ## E1 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 0,3,1,1> E0 ## E3 ## E1 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 0,3,1,2> E0 ## E3 ## E1 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 0,3,1,3> E0 ## E3 ## E1 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 0,3,2,0> E0 ## E3 ## E2 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 0,3,2,1> E0 ## E3 ## E2 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 0,3,2,2> E0 ## E3 ## E2 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 0,3,2,3> E0 ## E3 ## E2 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 0,3,3,0> E0 ## E3 ## E3 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 0,3,3,1> E0 ## E3 ## E3 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 0,3,3,2> E0 ## E3 ## E3 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 0,3,3,3> E0 ## E3 ## E3 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 1,0,0,0> E1 ## E0 ## E0 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 1,0,0,1> E1 ## E0 ## E0 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 1,0,0,2> E1 ## E0 ## E0 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 1,0,0,3> E1 ## E0 ## E0 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 1,0,1,0> E1 ## E0 ## E1 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 1,0,1,1> E1 ## E0 ## E1 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 1,0,1,2> E1 ## E0 ## E1 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 1,0,1,3> E1 ## E0 ## E1 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 1,0,2,0> E1 ## E0 ## E2 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 1,0,2,1> E1 ## E0 ## E2 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 1,0,2,2> E1 ## E0 ## E2 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 1,0,2,3> E1 ## E0 ## E2 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 1,0,3,0> E1 ## E0 ## E3 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 1,0,3,1> E1 ## E0 ## E3 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 1,0,3,2> E1 ## E0 ## E3 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 1,0,3,3> E1 ## E0 ## E3 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 1,1,0,0> E1 ## E1 ## E0 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 1,1,0,1> E1 ## E1 ## E0 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 1,1,0,2> E1 ## E1 ## E0 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 1,1,0,3> E1 ## E1 ## E0 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 1,1,1,0> E1 ## E1 ## E1 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 1,1,1,1> E1 ## E1 ## E1 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 1,1,1,2> E1 ## E1 ## E1 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 1,1,1,3> E1 ## E1 ## E1 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 1,1,2,0> E1 ## E1 ## E2 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 1,1,2,1> E1 ## E1 ## E2 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 1,1,2,2> E1 ## E1 ## E2 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 1,1,2,3> E1 ## E1 ## E2 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 1,1,3,0> E1 ## E1 ## E3 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 1,1,3,1> E1 ## E1 ## E3 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 1,1,3,2> E1 ## E1 ## E3 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 1,1,3,3> E1 ## E1 ## E3 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 1,2,0,0> E1 ## E2 ## E0 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 1,2,0,1> E1 ## E2 ## E0 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 1,2,0,2> E1 ## E2 ## E0 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 1,2,0,3> E1 ## E2 ## E0 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 1,2,1,0> E1 ## E2 ## E1 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 1,2,1,1> E1 ## E2 ## E1 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 1,2,1,2> E1 ## E2 ## E1 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 1,2,1,3> E1 ## E2 ## E1 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 1,2,2,0> E1 ## E2 ## E2 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 1,2,2,1> E1 ## E2 ## E2 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 1,2,2,2> E1 ## E2 ## E2 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 1,2,2,3> E1 ## E2 ## E2 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 1,2,3,0> E1 ## E2 ## E3 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 1,2,3,1> E1 ## E2 ## E3 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 1,2,3,2> E1 ## E2 ## E3 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 1,2,3,3> E1 ## E2 ## E3 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 1,3,0,0> E1 ## E3 ## E0 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 1,3,0,1> E1 ## E3 ## E0 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 1,3,0,2> E1 ## E3 ## E0 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 1,3,0,3> E1 ## E3 ## E0 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 1,3,1,0> E1 ## E3 ## E1 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 1,3,1,1> E1 ## E3 ## E1 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 1,3,1,2> E1 ## E3 ## E1 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 1,3,1,3> E1 ## E3 ## E1 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 1,3,2,0> E1 ## E3 ## E2 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 1,3,2,1> E1 ## E3 ## E2 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 1,3,2,2> E1 ## E3 ## E2 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 1,3,2,3> E1 ## E3 ## E2 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 1,3,3,0> E1 ## E3 ## E3 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 1,3,3,1> E1 ## E3 ## E3 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 1,3,3,2> E1 ## E3 ## E3 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 1,3,3,3> E1 ## E3 ## E3 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 2,0,0,0> E2 ## E0 ## E0 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 2,0,0,1> E2 ## E0 ## E0 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 2,0,0,2> E2 ## E0 ## E0 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 2,0,0,3> E2 ## E0 ## E0 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 2,0,1,0> E2 ## E0 ## E1 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 2,0,1,1> E2 ## E0 ## E1 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 2,0,1,2> E2 ## E0 ## E1 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 2,0,1,3> E2 ## E0 ## E1 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 2,0,2,0> E2 ## E0 ## E2 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 2,0,2,1> E2 ## E0 ## E2 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 2,0,2,2> E2 ## E0 ## E2 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 2,0,2,3> E2 ## E0 ## E2 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 2,0,3,0> E2 ## E0 ## E3 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 2,0,3,1> E2 ## E0 ## E3 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 2,0,3,2> E2 ## E0 ## E3 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 2,0,3,3> E2 ## E0 ## E3 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 2,1,0,0> E2 ## E1 ## E0 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 2,1,0,1> E2 ## E1 ## E0 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 2,1,0,2> E2 ## E1 ## E0 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 2,1,0,3> E2 ## E1 ## E0 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 2,1,1,0> E2 ## E1 ## E1 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 2,1,1,1> E2 ## E1 ## E1 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 2,1,1,2> E2 ## E1 ## E1 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 2,1,1,3> E2 ## E1 ## E1 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 2,1,2,0> E2 ## E1 ## E2 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 2,1,2,1> E2 ## E1 ## E2 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 2,1,2,2> E2 ## E1 ## E2 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 2,1,2,3> E2 ## E1 ## E2 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 2,1,3,0> E2 ## E1 ## E3 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 2,1,3,1> E2 ## E1 ## E3 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 2,1,3,2> E2 ## E1 ## E3 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 2,1,3,3> E2 ## E1 ## E3 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 2,2,0,0> E2 ## E2 ## E0 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 2,2,0,1> E2 ## E2 ## E0 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 2,2,0,2> E2 ## E2 ## E0 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 2,2,0,3> E2 ## E2 ## E0 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 2,2,1,0> E2 ## E2 ## E1 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 2,2,1,1> E2 ## E2 ## E1 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 2,2,1,2> E2 ## E2 ## E1 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 2,2,1,3> E2 ## E2 ## E1 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 2,2,2,0> E2 ## E2 ## E2 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 2,2,2,1> E2 ## E2 ## E2 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 2,2,2,2> E2 ## E2 ## E2 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 2,2,2,3> E2 ## E2 ## E2 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 2,2,3,0> E2 ## E2 ## E3 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 2,2,3,1> E2 ## E2 ## E3 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 2,2,3,2> E2 ## E2 ## E3 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 2,2,3,3> E2 ## E2 ## E3 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 2,3,0,0> E2 ## E3 ## E0 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 2,3,0,1> E2 ## E3 ## E0 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 2,3,0,2> E2 ## E3 ## E0 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 2,3,0,3> E2 ## E3 ## E0 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 2,3,1,0> E2 ## E3 ## E1 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 2,3,1,1> E2 ## E3 ## E1 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 2,3,1,2> E2 ## E3 ## E1 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 2,3,1,3> E2 ## E3 ## E1 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 2,3,2,0> E2 ## E3 ## E2 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 2,3,2,1> E2 ## E3 ## E2 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 2,3,2,2> E2 ## E3 ## E2 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 2,3,2,3> E2 ## E3 ## E2 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 2,3,3,0> E2 ## E3 ## E3 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 2,3,3,1> E2 ## E3 ## E3 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 2,3,3,2> E2 ## E3 ## E3 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 2,3,3,3> E2 ## E3 ## E3 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 3,0,0,0> E3 ## E0 ## E0 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 3,0,0,1> E3 ## E0 ## E0 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 3,0,0,2> E3 ## E0 ## E0 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 3,0,0,3> E3 ## E0 ## E0 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 3,0,1,0> E3 ## E0 ## E1 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 3,0,1,1> E3 ## E0 ## E1 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 3,0,1,2> E3 ## E0 ## E1 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 3,0,1,3> E3 ## E0 ## E1 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 3,0,2,0> E3 ## E0 ## E2 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 3,0,2,1> E3 ## E0 ## E2 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 3,0,2,2> E3 ## E0 ## E2 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 3,0,2,3> E3 ## E0 ## E2 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 3,0,3,0> E3 ## E0 ## E3 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 3,0,3,1> E3 ## E0 ## E3 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 3,0,3,2> E3 ## E0 ## E3 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 3,0,3,3> E3 ## E0 ## E3 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 3,1,0,0> E3 ## E1 ## E0 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 3,1,0,1> E3 ## E1 ## E0 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 3,1,0,2> E3 ## E1 ## E0 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 3,1,0,3> E3 ## E1 ## E0 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 3,1,1,0> E3 ## E1 ## E1 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 3,1,1,1> E3 ## E1 ## E1 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 3,1,1,2> E3 ## E1 ## E1 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 3,1,1,3> E3 ## E1 ## E1 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 3,1,2,0> E3 ## E1 ## E2 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 3,1,2,1> E3 ## E1 ## E2 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 3,1,2,2> E3 ## E1 ## E2 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 3,1,2,3> E3 ## E1 ## E2 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 3,1,3,0> E3 ## E1 ## E3 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 3,1,3,1> E3 ## E1 ## E3 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 3,1,3,2> E3 ## E1 ## E3 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 3,1,3,3> E3 ## E1 ## E3 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 3,2,0,0> E3 ## E2 ## E0 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 3,2,0,1> E3 ## E2 ## E0 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 3,2,0,2> E3 ## E2 ## E0 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 3,2,0,3> E3 ## E2 ## E0 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 3,2,1,0> E3 ## E2 ## E1 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 3,2,1,1> E3 ## E2 ## E1 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 3,2,1,2> E3 ## E2 ## E1 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 3,2,1,3> E3 ## E2 ## E1 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 3,2,2,0> E3 ## E2 ## E2 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 3,2,2,1> E3 ## E2 ## E2 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 3,2,2,2> E3 ## E2 ## E2 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 3,2,2,3> E3 ## E2 ## E2 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 3,2,3,0> E3 ## E2 ## E3 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 3,2,3,1> E3 ## E2 ## E3 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 3,2,3,2> E3 ## E2 ## E3 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 3,2,3,3> E3 ## E2 ## E3 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 3,3,0,0> E3 ## E3 ## E0 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 3,3,0,1> E3 ## E3 ## E0 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 3,3,0,2> E3 ## E3 ## E0 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 3,3,0,3> E3 ## E3 ## E0 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 3,3,1,0> E3 ## E3 ## E1 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 3,3,1,1> E3 ## E3 ## E1 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 3,3,1,2> E3 ## E3 ## E1 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 3,3,1,3> E3 ## E3 ## E1 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 3,3,2,0> E3 ## E3 ## E2 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 3,3,2,1> E3 ## E3 ## E2 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 3,3,2,2> E3 ## E3 ## E2 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 3,3,2,3> E3 ## E3 ## E2 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 3,3,3,0> E3 ## E3 ## E3 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 3,3,3,1> E3 ## E3 ## E3 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 3,3,3,2> E3 ## E3 ## E3 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 3,3,3,3> E3 ## E3 ## E3 ## E3; }; diff --git a/common/glm/glm/detail/_swizzle_func.hpp b/common/glm/glm/detail/_swizzle_func.hpp index 7d725e10a..4b37edbbf 100644 --- a/common/glm/glm/detail/_swizzle_func.hpp +++ b/common/glm/glm/detail/_swizzle_func.hpp @@ -1,34 +1,5 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// /// @ref core /// @file glm/detail/_swizzle_func.hpp -/// @date 2011-10-16 / 2011-10-16 -/// @author Christophe Riccio -/////////////////////////////////////////////////////////////////////////////////// #pragma once diff --git a/common/glm/glm/detail/_vectorize.hpp b/common/glm/glm/detail/_vectorize.hpp index 8eea6b871..a08ed34df 100644 --- a/common/glm/glm/detail/_vectorize.hpp +++ b/common/glm/glm/detail/_vectorize.hpp @@ -1,34 +1,5 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// /// @ref core /// @file glm/detail/_vectorize.hpp -/// @date 2011-10-14 / 2011-10-14 -/// @author Christophe Riccio -/////////////////////////////////////////////////////////////////////////////////// #pragma once diff --git a/common/glm/glm/detail/dummy.cpp b/common/glm/glm/detail/dummy.cpp index c7ef99edb..a519a6dc2 100644 --- a/common/glm/glm/detail/dummy.cpp +++ b/common/glm/glm/detail/dummy.cpp @@ -1,40 +1,13 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// /// @ref core /// @file glm/core/dummy.cpp -/// @date 2011-01-19 / 2011-06-15 -/// @author Christophe Riccio /// /// GLM is a header only library. There is nothing to compile. /// dummy.cpp exist only a wordaround for CMake file. -/////////////////////////////////////////////////////////////////////////////////// +/* #define GLM_MESSAGES -#include "../glm.hpp" +#include +#include #include struct material @@ -148,6 +121,8 @@ struct intersection glm::vec4 position; glm::vec3 normal; }; +*/ + /* // Sample 4 @@ -190,7 +165,7 @@ glm::vec3 lighting } */ - +/* template class vecType> T normalizeDotA(vecType const & x, vecType const & y) { @@ -210,13 +185,23 @@ typename vecType::value_type normalizeDotC(vecType const & a, vecType const & b) { return glm::dot(a, b) * glm::inversesqrt(glm::dot(a, a) * glm::dot(b, b)); } - +*/ int main() { - glm::vec4 v(1); - float a = normalizeDotA(v, v); - float b = normalizeDotB(v, v); - float c = normalizeDotC(v, v); +/* + glm::vec1 o(1); + glm::vec2 a(1); + glm::vec3 b(1); + glm::vec4 c(1); + glm::quat q; + glm::dualquat p; + + glm::mat4 m(1); + + float a0 = normalizeDotA(a, a); + float b0 = normalizeDotB(b, b); + float c0 = normalizeDotC(c, c); +*/ return 0; } diff --git a/common/glm/glm/detail/func_common.hpp b/common/glm/glm/detail/func_common.hpp index 0cea49426..871fed6c4 100644 --- a/common/glm/glm/detail/func_common.hpp +++ b/common/glm/glm/detail/func_common.hpp @@ -1,33 +1,5 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// /// @ref core /// @file glm/detail/func_common.hpp -/// @date 2008-03-08 / 2010-01-26 -/// @author Christophe Riccio /// /// @see GLSL 4.20.8 specification, section 8.3 Common Functions /// @@ -35,7 +7,6 @@ /// @ingroup core /// /// These all operate component-wise. The description is per component. -/////////////////////////////////////////////////////////////////////////////////// #pragma once diff --git a/common/glm/glm/detail/func_common.inl b/common/glm/glm/detail/func_common.inl index e3cd4e221..327b058a2 100644 --- a/common/glm/glm/detail/func_common.inl +++ b/common/glm/glm/detail/func_common.inl @@ -1,34 +1,5 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// /// @ref core /// @file glm/detail/func_common.inl -/// @date 2008-08-03 / 2011-06-15 -/// @author Christophe Riccio -/////////////////////////////////////////////////////////////////////////////////// #include "func_vector_relational.hpp" #include "type_vec2.hpp" @@ -37,142 +8,24 @@ #include "_vectorize.hpp" #include -namespace glm{ -namespace detail +namespace glm { - template - struct compute_abs - {}; - - template - struct compute_abs + // min + template + GLM_FUNC_QUALIFIER genType min(genType x, genType y) { - GLM_FUNC_QUALIFIER static genFIType call(genFIType x) - { - GLM_STATIC_ASSERT( - std::numeric_limits::is_iec559 || std::numeric_limits::is_signed, - "'abs' only accept floating-point and integer scalar or vector inputs"); + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_UNRESTRICTED_GENTYPE, "'min' only accept floating-point or integer inputs"); + return x < y ? x : y; + } - return x >= genFIType(0) ? x : -x; - // TODO, perf comp with: *(((int *) &x) + 1) &= 0x7fffffff; - } - }; - - template - struct compute_abs + // max + template + GLM_FUNC_QUALIFIER genType max(genType x, genType y) { - GLM_FUNC_QUALIFIER static genFIType call(genFIType x) - { - GLM_STATIC_ASSERT( - !std::numeric_limits::is_signed && std::numeric_limits::is_integer, - "'abs' only accept floating-point and integer scalar or vector inputs"); - return x; - } - }; + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_UNRESTRICTED_GENTYPE, "'max' only accept floating-point or integer inputs"); - template class vecType> - struct compute_mix_vector - { - GLM_FUNC_QUALIFIER static vecType call(vecType const & x, vecType const & y, vecType const & a) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'mix' only accept floating-point inputs for the interpolator a"); - - return vecType(vecType(x) + a * vecType(y - x)); - } - }; - - template class vecType> - struct compute_mix_vector - { - GLM_FUNC_QUALIFIER static vecType call(vecType const & x, vecType const & y, vecType const & a) - { - vecType Result(uninitialize); - for(detail::component_count_t i = 0; i < detail::component_count(x); ++i) - Result[i] = a[i] ? y[i] : x[i]; - return Result; - } - }; - - template class vecType> - struct compute_mix_scalar - { - GLM_FUNC_QUALIFIER static vecType call(vecType const & x, vecType const & y, U const & a) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'mix' only accept floating-point inputs for the interpolator a"); - - return vecType(vecType(x) + a * vecType(y - x)); - } - }; - - template class vecType> - struct compute_mix_scalar - { - GLM_FUNC_QUALIFIER static vecType call(vecType const & x, vecType const & y, bool const & a) - { - return a ? y : x; - } - }; - - template - struct compute_mix - { - GLM_FUNC_QUALIFIER static T call(T const & x, T const & y, U const & a) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'mix' only accept floating-point inputs for the interpolator a"); - - return static_cast(static_cast(x) + a * static_cast(y - x)); - } - }; - - template - struct compute_mix - { - GLM_FUNC_QUALIFIER static T call(T const & x, T const & y, bool const & a) - { - return a ? y : x; - } - }; - - template class vecType, bool isFloat = true, bool isSigned = true> - struct compute_sign - { - GLM_FUNC_QUALIFIER static vecType call(vecType const & x) - { - return vecType(glm::lessThan(vecType(0), x)) - vecType(glm::lessThan(x, vecType(0))); - } - }; - - template class vecType> - struct compute_sign - { - GLM_FUNC_QUALIFIER static vecType call(vecType const & x) - { - return vecType(glm::greaterThan(x , vecType(0))); - } - }; - - template class vecType> - struct compute_sign - { - GLM_FUNC_QUALIFIER static vecType call(vecType const & x) - { - T const Shift(static_cast(sizeof(T) * 8 - 1)); - vecType const y(vecType::type, P>(-x) >> typename make_unsigned::type(Shift)); - - return (x >> Shift) | y; - } - }; - - template class vecType, typename genType, bool isFloat = true> - struct compute_mod - { - GLM_FUNC_QUALIFIER static vecType call(vecType const & a, genType const & b) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'mod' only accept floating-point inputs. Include for integer inputs."); - return a - b * floor(a / b); - } - }; -}//namespace detail + return x > y ? x : y; + } // abs template <> @@ -182,67 +35,6 @@ namespace detail return (x ^ y) - y; } - template - GLM_FUNC_QUALIFIER genFIType abs(genFIType x) - { - return detail::compute_abs::is_signed>::call(x); - } - - template class vecType> - GLM_FUNC_QUALIFIER vecType abs(vecType const & x) - { - return detail::functor1::call(abs, x); - } - - // sign - // fast and works for any type - template - GLM_FUNC_QUALIFIER genFIType sign(genFIType x) - { - GLM_STATIC_ASSERT( - std::numeric_limits::is_iec559 || (std::numeric_limits::is_signed && std::numeric_limits::is_integer), - "'sign' only accept signed inputs"); - - return detail::compute_sign::is_iec559>::call(tvec1(x)).x; - } - - template class vecType> - GLM_FUNC_QUALIFIER vecType sign(vecType const & x) - { - GLM_STATIC_ASSERT( - std::numeric_limits::is_iec559 || (std::numeric_limits::is_signed && std::numeric_limits::is_integer), - "'sign' only accept signed inputs"); - - return detail::compute_sign::is_iec559>::call(x); - } - - // floor - using ::std::floor; - template class vecType> - GLM_FUNC_QUALIFIER vecType floor(vecType const & x) - { - return detail::functor1::call(floor, x); - } - - // trunc -# if GLM_HAS_CXX11_STL - using ::std::trunc; -# else - template - GLM_FUNC_QUALIFIER genType trunc(genType x) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'trunc' only accept floating-point inputs"); - - return x < static_cast(0) ? -floor(-x) : floor(x); - } -# endif - - template class vecType> - GLM_FUNC_QUALIFIER vecType trunc(vecType const & x) - { - return detail::functor1::call(trunc, x); - } - // round # if GLM_HAS_CXX11_STL using ::std::round; @@ -256,10 +48,318 @@ namespace detail } # endif + // trunc +# if GLM_HAS_CXX11_STL + using ::std::trunc; +# else + template + GLM_FUNC_QUALIFIER genType trunc(genType x) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'trunc' only accept floating-point inputs"); + + return x < static_cast(0) ? -std::floor(-x) : std::floor(x); + } +# endif + +}//namespace glm + +namespace glm{ +namespace detail +{ + template + struct compute_abs + {}; + + template + struct compute_abs + { + GLM_FUNC_QUALIFIER static genFIType call(genFIType x) + { + GLM_STATIC_ASSERT( + std::numeric_limits::is_iec559 || std::numeric_limits::is_signed || GLM_UNRESTRICTED_GENTYPE, + "'abs' only accept floating-point and integer scalar or vector inputs"); + + return x >= genFIType(0) ? x : -x; + // TODO, perf comp with: *(((int *) &x) + 1) &= 0x7fffffff; + } + }; + + #if GLM_COMPILER & GLM_COMPILER_CUDA + template <> + struct compute_abs + { + GLM_FUNC_QUALIFIER static float call(float x) + { + return fabsf(x); + } + }; + #endif + + template + struct compute_abs + { + GLM_FUNC_QUALIFIER static genFIType call(genFIType x) + { + GLM_STATIC_ASSERT( + (!std::numeric_limits::is_signed && std::numeric_limits::is_integer) || GLM_UNRESTRICTED_GENTYPE, + "'abs' only accept floating-point and integer scalar or vector inputs"); + return x; + } + }; + + template class vecType, bool Aligned> + struct compute_abs_vector + { + GLM_FUNC_QUALIFIER static vecType call(vecType const & x) + { + return detail::functor1::call(abs, x); + } + }; + + template class vecType, bool Aligned> + struct compute_mix_vector + { + GLM_FUNC_QUALIFIER static vecType call(vecType const & x, vecType const & y, vecType const & a) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_UNRESTRICTED_GENTYPE, "'mix' only accept floating-point inputs for the interpolator a"); + + return vecType(vecType(x) + a * vecType(y - x)); + } + }; + + template class vecType, bool Aligned> + struct compute_mix_vector + { + GLM_FUNC_QUALIFIER static vecType call(vecType const & x, vecType const & y, vecType const & a) + { + vecType Result(uninitialize); + for(length_t i = 0; i < x.length(); ++i) + Result[i] = a[i] ? y[i] : x[i]; + return Result; + } + }; + + template class vecType, bool Aligned> + struct compute_mix_scalar + { + GLM_FUNC_QUALIFIER static vecType call(vecType const & x, vecType const & y, U const & a) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_UNRESTRICTED_GENTYPE, "'mix' only accept floating-point inputs for the interpolator a"); + + return vecType(vecType(x) + a * vecType(y - x)); + } + }; + + template class vecType, bool Aligned> + struct compute_mix_scalar + { + GLM_FUNC_QUALIFIER static vecType call(vecType const & x, vecType const & y, bool const & a) + { + return a ? y : x; + } + }; + + template + struct compute_mix + { + GLM_FUNC_QUALIFIER static T call(T const & x, T const & y, U const & a) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_UNRESTRICTED_GENTYPE, "'mix' only accept floating-point inputs for the interpolator a"); + + return static_cast(static_cast(x) + a * static_cast(y - x)); + } + }; + + template + struct compute_mix + { + GLM_FUNC_QUALIFIER static T call(T const & x, T const & y, bool const & a) + { + return a ? y : x; + } + }; + + template class vecType, bool isFloat, bool Aligned> + struct compute_sign + { + GLM_FUNC_QUALIFIER static vecType call(vecType const & x) + { + return vecType(glm::lessThan(vecType(0), x)) - vecType(glm::lessThan(x, vecType(0))); + } + }; + +# if GLM_ARCH == GLM_ARCH_X86 + template class vecType, bool Aligned> + struct compute_sign + { + GLM_FUNC_QUALIFIER static vecType call(vecType const & x) + { + T const Shift(static_cast(sizeof(T) * 8 - 1)); + vecType const y(vecType::type, P>(-x) >> typename make_unsigned::type(Shift)); + + return (x >> Shift) | y; + } + }; +# endif + + template class vecType, bool Aligned> + struct compute_floor + { + GLM_FUNC_QUALIFIER static vecType call(vecType const & x) + { + return detail::functor1::call(std::floor, x); + } + }; + + template class vecType, bool Aligned> + struct compute_ceil + { + GLM_FUNC_QUALIFIER static vecType call(vecType const & x) + { + return detail::functor1::call(std::ceil, x); + } + }; + + template class vecType, bool Aligned> + struct compute_fract + { + GLM_FUNC_QUALIFIER static vecType call(vecType const & x) + { + return x - floor(x); + } + }; + + template class vecType, bool Aligned> + struct compute_trunc + { + GLM_FUNC_QUALIFIER static vecType call(vecType const & x) + { + return detail::functor1::call(trunc, x); + } + }; + + template class vecType, bool Aligned> + struct compute_round + { + GLM_FUNC_QUALIFIER static vecType call(vecType const & x) + { + return detail::functor1::call(round, x); + } + }; + + template class vecType, bool Aligned> + struct compute_mod + { + GLM_FUNC_QUALIFIER static vecType call(vecType const & a, vecType const & b) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'mod' only accept floating-point inputs. Include for integer inputs."); + return a - b * floor(a / b); + } + }; + + template class vecType, bool Aligned> + struct compute_min_vector + { + GLM_FUNC_QUALIFIER static vecType call(vecType const & x, vecType const & y) + { + return detail::functor2::call(min, x, y); + } + }; + + template class vecType, bool Aligned> + struct compute_max_vector + { + GLM_FUNC_QUALIFIER static vecType call(vecType const & x, vecType const & y) + { + return detail::functor2::call(max, x, y); + } + }; + + template class vecType, bool Aligned> + struct compute_clamp_vector + { + GLM_FUNC_QUALIFIER static vecType call(vecType const & x, vecType const & minVal, vecType const & maxVal) + { + return min(max(x, minVal), maxVal); + } + }; + + template class vecType, bool Aligned> + struct compute_step_vector + { + GLM_FUNC_QUALIFIER static vecType call(vecType const & edge, vecType const & x) + { + return mix(vecType(1), vecType(0), glm::lessThan(x, edge)); + } + }; + + template class vecType, bool Aligned> + struct compute_smoothstep_vector + { + GLM_FUNC_QUALIFIER static vecType call(vecType const & edge0, vecType const & edge1, vecType const & x) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_UNRESTRICTED_GENTYPE, "'step' only accept floating-point inputs"); + vecType const tmp(clamp((x - edge0) / (edge1 - edge0), static_cast(0), static_cast(1))); + return tmp * tmp * (static_cast(3) - static_cast(2) * tmp); + } + }; +}//namespace detail + + template + GLM_FUNC_QUALIFIER genFIType abs(genFIType x) + { + return detail::compute_abs::is_signed>::call(x); + } + + template class vecType> + GLM_FUNC_QUALIFIER vecType abs(vecType const & x) + { + return detail::compute_abs_vector::value>::call(x); + } + + // sign + // fast and works for any type + template + GLM_FUNC_QUALIFIER genFIType sign(genFIType x) + { + GLM_STATIC_ASSERT( + std::numeric_limits::is_iec559 || (std::numeric_limits::is_signed && std::numeric_limits::is_integer), + "'sign' only accept signed inputs"); + + return detail::compute_sign::is_iec559, highp>::call(tvec1(x)).x; + } + + template class vecType> + GLM_FUNC_QUALIFIER vecType sign(vecType const & x) + { + GLM_STATIC_ASSERT( + std::numeric_limits::is_iec559 || (std::numeric_limits::is_signed && std::numeric_limits::is_integer), + "'sign' only accept signed inputs"); + + return detail::compute_sign::is_iec559, detail::is_aligned

::value>::call(x); + } + + // floor + using ::std::floor; + template class vecType> + GLM_FUNC_QUALIFIER vecType floor(vecType const & x) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'floor' only accept floating-point inputs."); + return detail::compute_floor::value>::call(x); + } + + template class vecType> + GLM_FUNC_QUALIFIER vecType trunc(vecType const & x) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'trunc' only accept floating-point inputs"); + return detail::compute_trunc::value>::call(x); + } + template class vecType> GLM_FUNC_QUALIFIER vecType round(vecType const & x) { - return detail::functor1::call(round, x); + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'round' only accept floating-point inputs"); + return detail::compute_round::value>::call(x); } /* @@ -308,6 +408,7 @@ namespace detail template class vecType> GLM_FUNC_QUALIFIER vecType roundEven(vecType const & x) { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'roundEven' only accept floating-point inputs"); return detail::functor1::call(roundEven, x); } @@ -316,41 +417,47 @@ namespace detail template class vecType> GLM_FUNC_QUALIFIER vecType ceil(vecType const & x) { - return detail::functor1::call(ceil, x); + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'ceil' only accept floating-point inputs"); + return detail::compute_ceil::value>::call(x); } // fract template GLM_FUNC_QUALIFIER genType fract(genType x) { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'fract' only accept floating-point inputs"); - return fract(tvec1(x)).x; } template class vecType> GLM_FUNC_QUALIFIER vecType fract(vecType const & x) { - return x - floor(x); + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'fract' only accept floating-point inputs"); + return detail::compute_fract::value>::call(x); } // mod template GLM_FUNC_QUALIFIER genType mod(genType x, genType y) { - return mod(tvec1(x), y).x; +# if GLM_COMPILER & GLM_COMPILER_CUDA + // Another Cuda compiler bug https://github.com/g-truc/glm/issues/530 + tvec1 Result(mod(tvec1(x), y)); + return Result.x; +# else + return mod(tvec1(x), y).x; +# endif } template class vecType> GLM_FUNC_QUALIFIER vecType mod(vecType const & x, T y) { - return detail::compute_mod::is_iec559>::call(x, y); + return detail::compute_mod::value>::call(x, vecType(y)); } template class vecType> GLM_FUNC_QUALIFIER vecType mod(vecType const & x, vecType const & y) { - return detail::compute_mod, std::numeric_limits::is_iec559>::call(x, y); + return detail::compute_mod::value>::call(x, y); } // modf @@ -358,7 +465,6 @@ namespace detail GLM_FUNC_QUALIFIER genType modf(genType x, genType & i) { GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'modf' only accept floating-point inputs"); - return std::modf(x, &i); } @@ -405,70 +511,53 @@ namespace detail //CHAR_BIT - 1))); // min - template - GLM_FUNC_QUALIFIER genType min(genType x, genType y) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer, "'min' only accept floating-point or integer inputs"); - - return x < y ? x : y; - } - template class vecType> GLM_FUNC_QUALIFIER vecType min(vecType const & a, T b) { - return detail::functor2_vec_sca::call(min, a, b); + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_UNRESTRICTED_GENTYPE, "'min' only accept floating-point inputs for the interpolator a"); + return detail::compute_min_vector::value>::call(a, vecType(b)); } template class vecType> GLM_FUNC_QUALIFIER vecType min(vecType const & a, vecType const & b) { - return detail::functor2::call(min, a, b); + return detail::compute_min_vector::value>::call(a, b); } // max - template - GLM_FUNC_QUALIFIER genType max(genType x, genType y) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer, "'max' only accept floating-point or integer inputs"); - - return x > y ? x : y; - } - template class vecType> GLM_FUNC_QUALIFIER vecType max(vecType const & a, T b) { - return detail::functor2_vec_sca::call(max, a, b); + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_UNRESTRICTED_GENTYPE, "'max' only accept floating-point inputs for the interpolator a"); + return detail::compute_max_vector::value>::call(a, vecType(b)); } template class vecType> GLM_FUNC_QUALIFIER vecType max(vecType const & a, vecType const & b) { - return detail::functor2::call(max, a, b); + return detail::compute_max_vector::value>::call(a, b); } // clamp template GLM_FUNC_QUALIFIER genType clamp(genType x, genType minVal, genType maxVal) { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer, "'clamp' only accept floating-point or integer inputs"); - + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_UNRESTRICTED_GENTYPE, "'clamp' only accept floating-point or integer inputs"); return min(max(x, minVal), maxVal); } template class vecType> GLM_FUNC_QUALIFIER vecType clamp(vecType const & x, T minVal, T maxVal) { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer, "'clamp' only accept floating-point or integer inputs"); - - return min(max(x, minVal), maxVal); + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_UNRESTRICTED_GENTYPE, "'clamp' only accept floating-point or integer inputs"); + return detail::compute_clamp_vector::value>::call(x, vecType(minVal), vecType(maxVal)); } template class vecType> GLM_FUNC_QUALIFIER vecType clamp(vecType const & x, vecType const & minVal, vecType const & maxVal) { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer, "'clamp' only accept floating-point or integer inputs"); - - return min(max(x, minVal), maxVal); + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_UNRESTRICTED_GENTYPE, "'clamp' only accept floating-point or integer inputs"); + return detail::compute_clamp_vector::value>::call(x, minVal, maxVal); } template @@ -480,13 +569,13 @@ namespace detail template class vecType> GLM_FUNC_QUALIFIER vecType mix(vecType const & x, vecType const & y, U a) { - return detail::compute_mix_scalar::call(x, y, a); + return detail::compute_mix_scalar::value>::call(x, y, a); } template class vecType> GLM_FUNC_QUALIFIER vecType mix(vecType const & x, vecType const & y, vecType const & a) { - return detail::compute_mix_vector::call(x, y, a); + return detail::compute_mix_vector::value>::call(x, y, a); } // step @@ -499,22 +588,20 @@ namespace detail template