mirror of https://github.com/AxioDL/metaforce.git
Final CCollisionInfoList imps
This commit is contained in:
parent
6ac01741a4
commit
60f8dfb9d1
|
@ -11,11 +11,36 @@ class CCollisionInfoList {
|
||||||
public:
|
public:
|
||||||
CCollisionInfoList() = default;
|
CCollisionInfoList() = default;
|
||||||
|
|
||||||
void GetAverageLeftNormal() const;
|
zeus::CVector3f GetAverageLeftNormal() const {
|
||||||
void GetAveragePoint() const;
|
zeus::CVector3f ret;
|
||||||
void GetUnionOfAllLeftMaterials() const;
|
for (const auto& inf : x0_list) {
|
||||||
|
ret += inf.GetNormalLeft();
|
||||||
|
}
|
||||||
|
|
||||||
|
return ret / x0_list.size();
|
||||||
|
}
|
||||||
|
zeus::CVector3f GetAveragePoint() const {
|
||||||
|
zeus::CVector3f ret;
|
||||||
|
for (const auto& inf : x0_list) {
|
||||||
|
ret += inf.GetPoint();
|
||||||
|
}
|
||||||
|
|
||||||
|
return ret / x0_list.size();
|
||||||
|
}
|
||||||
|
CMaterialList GetUnionOfAllLeftMaterials() const {
|
||||||
|
CMaterialList list;
|
||||||
|
for (const auto& inf : x0_list) {
|
||||||
|
list.Union(inf.GetMaterialLeft());
|
||||||
|
}
|
||||||
|
|
||||||
|
return list;
|
||||||
|
}
|
||||||
size_t GetCount() const { return x0_list.size(); }
|
size_t GetCount() const { return x0_list.size(); }
|
||||||
void Swap(s32);
|
void Swap(s32 idx) {
|
||||||
|
if (idx >= x0_list.size())
|
||||||
|
return;
|
||||||
|
x0_list[idx].Swap();
|
||||||
|
}
|
||||||
|
|
||||||
void Add(const CCollisionInfo& info, bool swap) {
|
void Add(const CCollisionInfo& info, bool swap) {
|
||||||
if (x0_list.size() == 32)
|
if (x0_list.size() == 32)
|
||||||
|
|
|
@ -134,6 +134,7 @@ public:
|
||||||
constexpr u64 Intersection(const CMaterialList& other) const noexcept { return other.x0_list & x0_list; }
|
constexpr u64 Intersection(const CMaterialList& other) const noexcept { return other.x0_list & x0_list; }
|
||||||
|
|
||||||
constexpr u64 XOR(const CMaterialList& other) const noexcept { return x0_list ^ other.x0_list; }
|
constexpr u64 XOR(const CMaterialList& other) const noexcept { return x0_list ^ other.x0_list; }
|
||||||
|
void Union(const CMaterialList& other) noexcept { x0_list |= other.x0_list; }
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace urde
|
} // namespace urde
|
||||||
|
|
|
@ -689,8 +689,11 @@ CEntity* ScriptLoader::LoadSound(CStateManager& mgr, CInputStream& in, int propC
|
||||||
bool allowDuplicates = in.readBool();
|
bool allowDuplicates = in.readBool();
|
||||||
s32 pitch = in.readInt32Big();
|
s32 pitch = in.readInt32Big();
|
||||||
|
|
||||||
if (soundId < 0)
|
if (soundId < 0) {
|
||||||
|
Log.report(logvisor::Warning, fmt("Invalid sound ID specified in Sound {} ({}), dropping..."), head.x0_name,
|
||||||
|
info.GetEditorId());
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
return new CScriptSound(mgr.AllocateUniqueId(), head.x0_name, info, head.x10_transform, u16(soundId), active, maxDist,
|
return new CScriptSound(mgr.AllocateUniqueId(), head.x0_name, info, head.x10_transform, u16(soundId), active, maxDist,
|
||||||
distComp, startDelay, minVol, vol, 0, prio, pan, 0, loop, nonEmitter, autoStart,
|
distComp, startDelay, minVol, vol, 0, prio, pan, 0, loop, nonEmitter, autoStart,
|
||||||
|
|
Loading…
Reference in New Issue