Skip to content

Instantly share code, notes, and snippets.

@Lurs
Created June 13, 2024 20:52
Show Gist options
  • Save Lurs/842f80919e71e5b02db63fd642d6341d to your computer and use it in GitHub Desktop.
Save Lurs/842f80919e71e5b02db63fd642d6341d to your computer and use it in GitHub Desktop.
This file has been truncated, but you can view the full file.
(base) larsvi@Lars-PC:~/botw$ tools/decompme -s src/KingSystem/Physics/System/physRayCast.cpp RayCast::worldRayCastImpl
ksys::phys::RayCast::worldRayCastImpl(hkpWorldRayCastOutput*, ksys::phys::ContactLayerType) (_ZN4ksys4phys7RayCast16worldRayCastImplEP21hkpWorldRayCastOutputNS0_16ContactLayerTypeE)
Disassembly:
_ZN4ksys4phys7RayCast16worldRayCastImplEP21hkpWorldRayCastOutputNS0_16ContactLayerTypeE:
sub sp, sp, #0xd0
str d10, [sp, #0x80]
stp d9, d8, [sp, #0x90]
stp x22, x21, [sp, #0xa0]
stp x20, x19, [sp, #0xb0]
stp x29, x30, [sp, #0xc0]
add x29, sp, #0xc0
mov w19, w2
sxtw x8, w19
cmp w19, #0x2
mov x21, x0
str wzr, [sp, #0x74]
csel x8, x8, xzr, cc
add x8, x21, x8, lsl #0x2
str xzr, [sp, #0x78]
ldr w22, [x8, #0x68]
orr w8, wzr, #0x1
strb w8, [sp, #0x70]
ldr x0, [x21, #0x20]
mov x20, x1
cbz x0, 32
ldr x8, [x0]
ldr x8, [x8, #0x28]
ldr w2, [x21, #0x28]
ldrb w3, [x21, #0x9a]
mov w1, w22
blr x8
b 48
adrp x8, 22762612
ldr x8, [x8, #0x8e8]
ldr x0, [x8]
mov w1, w19
bl 2436908
ldr x8, [x0]
ldr x8, [x8, #0x90]
ldr w2, [x21, #0x28]
ldrb w3, [x21, #0x9a]
mov w1, w22
blr x8
movi v0.2d, #0x0
mov v1.16b, v0.16b
str w0, [sp, #0x74]
add x8, x21, #0x8
ld1 {v1.s}[0], [x8]
add x8, x21, #0xc
ld1 {v1.s}[1], [x8]
add x8, x21, #0x10
ld1 {v1.s}[2], [x8]
str q1, [sp, #0x50]
add x8, x21, #0x14
ld1 {v0.s}[0], [x8]
add x8, x21, #0x18
ld1 {v0.s}[1], [x8]
add x8, x21, #0x1c
ld1 {v0.s}[2], [x8]
str q0, [sp, #0x60]
adrp x22, 22762500
ldr x22, [x22, #0x8e8]
ldr x0, [x22]
adrp x2, 15057912
add x2, x2, #0x2aa
orr w4, wzr, #0x1
mov w1, w19
mov w3, wzr
bl 2431800
ldr w8, [x21, #0x74]
cmp w8, #0x2
b.ne 28
mov x8, x21
ldr w9, [x8, #0xa0]!
cmp w9, #0x1
b.lt 196
ldr w10, [x21, #0xd8]
b 228
ldp s2, s3, [x21, #0x8]
ldp s0, s1, [x21, #0x10]
fsub s10, s1, s2
ldp s1, s2, [x21, #0x18]
fsub s8, s2, s0
fsub s9, s1, s3
fmul s0, s10, s10
str s8, [sp, #0x48]
fmul s1, s9, s9
fadd s0, s0, s1
fmul s1, s8, s8
fadd s1, s0, s1
fsqrt s0, s1
fcmp s0, s0
stp s10, s9, [sp, #0x40]
b.vc 12
mov v0.16b, v1.16b
bl 8635800
fcmp s0, #0
b.le 32
fmov s1, #1
fdiv s0, s1, s0
fmul s1, s0, s10
fmul s2, s0, s9
fmul s0, s0, s8
stp s1, s2, [sp, #0x40]
str s0, [sp, #0x48]
ldr w8, [x21, #0xa0]!
orr w9, wzr, #0x3f800000
ldr w11, [x21, #0x38]
ldur w10, [x21, #0xffffffffffffffd4]
str w9, [sp, #0x8]
str x20, [sp, #0x10]
str w19, [sp, #0x18]
adrp x9, 22913844
ldr x9, [x9, #0x900]
cmp w8, #0x0
add x8, sp, #0x40
csel x12, x21, xzr, gt
str x12, [sp, #0x20]
str x8, [sp, #0x30]
str w11, [sp, #0x28]
add x9, x9, #0x10
str x9, [sp]
str w10, [sp, #0x38]
b 92
ldr w10, [x21, #0xd8]
cmp w10, #0x10
b.ne 32
ldr x0, [x22]
mov w1, w19
bl 2431024
add x1, sp, #0x50
mov x2, x20
bl 6559272
b 76
orr w11, wzr, #0x3f800000
str w11, [sp, #0x8]
adrp x11, 22913748
ldr x11, [x11, #0x908]
cmp w9, #0x0
csel x8, x8, xzr, gt
str x8, [sp, #0x20]
add x9, x11, #0x10
str x9, [sp]
str x20, [sp, #0x10]
str w19, [sp, #0x18]
str w10, [sp, #0x28]
ldr x0, [x22]
mov w1, w19
bl 2430948
add x1, sp, #0x50
mov x2, sp
bl 6558972
ldr x0, [x22]
adrp x2, 15057552
add x2, x2, #0x2aa
orr w4, wzr, #0x1
mov w1, w19
mov w3, wzr
bl 2431488
ldp d9, d8, [sp, #0x90]
ldr d10, [sp, #0x80]
ldp x29, x30, [sp, #0xc0]
ldp x20, x19, [sp, #0xb0]
ldp x22, x21, [sp, #0xa0]
add sp, sp, #0xd0
ret
source file: src/KingSystem/Physics/System/physRayCast.cpp
context: 27406 lines
compile flags: --target=aarch64-linux-elf -DNON_MATCHING -DUKING_NX_V150 -g -D SWITCH -D NNSDK -D MATCHING_HACK_NX_CLANG -mcpu=cortex-a57+fp+simd+crypto+crc -mno-implicit-float -stdlib=libc++ -fPIC -fstandalone-debug -fcolor-diagnostics -Wno-unused-command-line-argument -fdebug-prefix-map=/tmp=/home/larsvi/botw/build -fno-rtti -fno-exceptions -fno-strict-aliasing -Wall -Wextra -Wdeprecated -Wno-unused-parameter -Wno-unused-private-field -Wno-invalid-offsetof -Wextra-semi -std=c++1z -x c++
> Upload? Yes
uploading...
Payload:
{
"address": 16530204,
"compile_flags": "--target=aarch64-linux-elf -DNON_MATCHING -DUKING_NX_V150 -g -D SWITCH -D NNSDK -D MATCHING_HACK_NX_CLANG -mcpu=cortex-a57+fp+simd+crypto+crc -mno-implicit-float -stdlib=libc++ -fPIC -fstandalone-debug -fcolor-diagnostics -Wno-unused-command-line-argument -fdebug-prefix-map=/tmp=/home/larsvi/botw/build -fno-rtti -fno-exceptions -fno-strict-aliasing -Wall -Wextra -Wdeprecated -Wno-unused-parameter -Wno-unused-private-field -Wno-invalid-offsetof -Wextra-semi -std=c++1z -x c++",
"context": "# 1 \"/home/larsvi/botw/src/KingSystem/Physics/System/physRayCast.cpp\"\n# 1 \"<built-in>\" 1\n# 1 \"<built-in>\" 3\n# 380 \"<built-in>\" 3\n# 1 \"<command line>\" 1\n# 1 \"<built-in>\" 2\n# 1 \"/home/larsvi/botw/src/KingSystem/Physics/System/physRayCast.cpp\" 2\n# 1 \"/home/larsvi/botw/src/KingSystem/Physics/System/physRayCast.h\" 1\n\n\n# 1 \"/home/larsvi/botw/lib/sead/include/container/seadPtrArray.h\" 1\n\n\n\n#include <algorithm>\n# 1 \"/home/larsvi/botw/lib/sead/include/basis/seadRawPrint.h\" 1\n\n\n#include <cstdarg>\n\n# 1 \"/home/larsvi/botw/lib/sead/include/basis/seadTypes.h\" 1\n# 10 \"/home/larsvi/botw/lib/sead/include/basis/seadTypes.h\"\nusing u8 = std::uint8_t;\nusing u16 = std::uint16_t;\nusing u32 = std::uint32_t;\nusing u64 = std::uint64_t;\n\nusing s8 = std::int8_t;\nusing s16 = std::int16_t;\nusing s32 = std::int32_t;\nusing s64 = std::int64_t;\n\nusing f32 = float;\nusing f64 = double;\n\nusing char16 = char16_t;\nusing size_t = std::size_t;\n# 6 \"/home/larsvi/botw/lib/sead/include/basis/seadRawPrint.h\" 2\n# 58 \"/home/larsvi/botw/lib/sead/include/basis/seadRawPrint.h\"\nnamespace sead\n{\nnamespace system\n{\nnamespace detail\n{\n// Dummy function whose only purpose is to trigger a format string check.\n\n[[maybe_unused]] [[gnu::format(printf, 1, 2)]]\n\ninline void\nCheckFormat(const char*, ...)\n{\n}\n} // namespace detail\n\nvoid Halt();\n\n[[gnu::format(printf, 3, 4)]]\n\nvoid HaltWithDetail(const char* file, int line, const char* msg, ...);\nvoid HaltWithDetailNoFormat(const char* file, int line, const char* msg);\nvoid DebugBreak();\n\n\n[[gnu::format(printf, 1, 2)]]\n\nvoid Print(const char* format, ...);\nvoid PrintV(const char* format, std::va_list);\nvoid PrintString(const char* format, s32);\n\n\n[[gnu::format(printf, 3, 4)]]\n\nvoid Warning(const char* file, int line, const char* msg, ...);\nvoid SetWarningEnable(bool enable);\n} // namespace system\n} // namespace sead\n# 6 \"/home/larsvi/botw/lib/sead/include/container/seadPtrArray.h\" 2\n\n# 1 \"/home/larsvi/botw/lib/sead/include/prim/seadMemUtil.h\" 1\n\n\n\n\n\nnamespace sead\n{\nclass MemUtil\n{\npublic:\n static void* fill(void* ptr, u8 c, size_t size);\n static void* fillZero(void* ptr, size_t size);\n static void* copyOverlap(void* dest, const void* src, size_t size);\n static void* copy(void* dest, const void* src, size_t size);\n static void* copyAlign32(void* dest, const void* src, size_t size);\n static int compare(const void* ptr1, const void* ptr2, size_t size);\n\n static bool isStack(const void* addr);\n static bool isHeap(const void* addr);\n\n /// Checks whether a region of memory is filled with 0.\n static bool checkFillType(const void* ptr, size_t size);\n\n static void dumpMemoryBinary(const void* ptr, u32 size_front, u32 size_back, bool is_align);\n};\n} // namespace sead\n\n\n\n\n\n\n# 1 \"/home/larsvi/botw/lib/sead/include/prim/nin/seadMemUtilNin.hpp\" 1\n\n\n\n\n\n\n\n\n# 1 \"/home/larsvi/botw/lib/sead/include/prim/seadPtrUtil.h\" 1\n\n\n\n\n\nnamespace sead\n{\nclass PtrUtil\n{\npublic:\n // XXX: these probably do not match Nintendo's implementation\n\n static void* roundUpPow2(const void* ptr, u32 n)\n {\n const uintptr_t result = uintptr_t(ptr) + (n - uintptr_t(ptr) % n) % n;\n return reinterpret_cast<void*>(result);\n }\n\n static void* roundUpN(const void* ptr, u32 n)\n {\n const uintptr_t result = uintptr_t(ptr) + (n - uintptr_t(ptr) % n) % n;\n return reinterpret_cast<void*>(result);\n }\n\n static void* roundDownPow2(const void* ptr, u32 n)\n {\n const uintptr_t result = uintptr_t(ptr) - uintptr_t(ptr) % n;\n return reinterpret_cast<void*>(result);\n }\n\n static void* roundDownN(const void* ptr, u32 n)\n {\n const uintptr_t result = uintptr_t(ptr) - uintptr_t(ptr) % n;\n return reinterpret_cast<void*>(result);\n }\n\n static void* addOffset(const void* ptr, intptr_t offset)\n {\n return reinterpret_cast<void*>(uintptr_t(ptr) + offset);\n }\n\n static intptr_t diff(const void* ptr1, const void* ptr2)\n {\n return intptr_t(ptr1) - intptr_t(ptr2);\n }\n\n static bool isInclude(const void* ptr, const void* begin, const void* end)\n {\n return uintptr_t(begin) <= uintptr_t(ptr) && uintptr_t(ptr) <= uintptr_t(end);\n }\n\n static bool isAligned(const void* ptr, s32 alignment)\n {\n do { if (false) static_cast<void>(alignment != 0); } while (0);\n return uintptr_t(ptr) % alignment == 0;\n }\n static bool isAlignedPow2(const void* ptr, u32 n) { return (uintptr_t(ptr) & (n - 1)) == 0; }\n static bool isAlignedN(const void* ptr, s32 n) { return uintptr_t(ptr) % n == 0; }\n};\n} // namespace sead\n# 10 \"/home/larsvi/botw/lib/sead/include/prim/nin/seadMemUtilNin.hpp\" 2\n\nnamespace sead\n{\ninline void* MemUtil::fill(void* ptr, u8 c, size_t size)\n{\n return std::memset(ptr, c, size);\n}\n\ninline void* MemUtil::fillZero(void* ptr, size_t size)\n{\n return std::memset(ptr, 0, size);\n}\n\ninline void* MemUtil::copyOverlap(void* dest, const void* src, size_t size)\n{\n return std::memmove(dest, src, size);\n}\n\ninline void* MemUtil::copy(void* dest, const void* src, size_t size)\n{\n do { if (false) { static_cast<void>(!((PtrUtil::addOffset(dest, size) > src && src >= dest) || (PtrUtil::addOffset(src, size) > dest && dest >= src))); sead::system::detail::CheckFormat(\"cross copy area\"); } } while (0);\n\n\n\n return std::memcpy(dest, src, size);\n}\n\ninline int MemUtil::compare(const void* ptr1, const void* ptr2, size_t size)\n{\n return std::memcmp(ptr1, ptr2, size);\n}\n} // namespace sead\n# 33 \"/home/larsvi/botw/lib/sead/include/prim/seadMemUtil.h\" 2\n# 8 \"/home/larsvi/botw/lib/sead/include/container/seadPtrArray.h\" 2\n# 1 \"/home/larsvi/botw/lib/sead/include/random/seadRandom.h\" 1\n\n\n\n\n# 1 \"/home/larsvi/botw/lib/sead/include/prim/seadBitUtil.h\" 1\n\n\n\n\n\n\nnamespace sead\n{\n// This does not actually seem to exist in Nintendo's sead, but for convenience reasons and to\n// easily avoid UB let's pretend this exists.\nnamespace BitUtil\n{\ninline void* addOffset(const void* ptr, intptr_t offset)\n{\n return reinterpret_cast<void*>(uintptr_t(ptr) + offset);\n}\n\n// Convenience function to avoid UB.\n// Nintendo appears to perform type punning, but we care about UB.\ntemplate <typename To, typename From>\ninline To bitCast(From value)\n{\n static_assert(sizeof(To) == sizeof(From), \"To and From must have the same size\");\n To result;\n std::memcpy(&result, &value, sizeof(value));\n return result;\n}\n\n// Convenience function to avoid UB.\n// Nintendo appears to perform type punning, but we care about UB.\ntemplate <typename To>\ninline To bitCastPtr(const void* value, intptr_t offset = 0)\n{\n To result;\n std::memcpy(&result, addOffset(value, offset), sizeof(To));\n return result;\n}\n\n// Convenience function to avoid UB.\n// Nintendo appears to perform type punning, but we care about UB.\ntemplate <typename To, typename From>\ninline void bitCastWrite(const From& value, To* ptr)\n{\n static_assert(sizeof(To) == sizeof(From), \"To and From must have the same size\");\n std::memcpy(ptr, &value, sizeof(To));\n}\n} // namespace BitUtil\n} // namespace sead\n# 6 \"/home/larsvi/botw/lib/sead/include/random/seadRandom.h\" 2\n\nnamespace sead\n{\n/// A fast non-cryptographically secure pseudorandom number generator based on Xorshift128.\nclass Random\n{\npublic:\n Random() { init(); }\n Random(u32 seed) { init(seed); }\n /// @warning Parameters have to be chosen carefully to get a long period. Using this is not\n /// recommended.\n Random(u32 seed_x, u32 seed_y, u32 seed_z, u32 seed_w) { init(seed_x, seed_y, seed_z, seed_w); }\n\n /// Reset and seed the engine with the current system tick count.\n void init();\n /// Reset and seed the engine with the specified value.\n void init(u32 seed);\n /// @warning Parameters have to be chosen carefully to get a long period. Using this is not\n /// recommended.\n void init(u32 seed_x, u32 seed_y, u32 seed_z, u32 seed_w);\n\n /// Generate a random u32.\n u32 getU32();\n /// Generate a random u64.\n u64 getU64();\n /// Generate a random u32 in [0 .. max).\n u32 getU32(u32 max);\n /// Generate a random s32 in [a .. b).\n /// Note that this does not provide a uniform distribution.\n s32 getS32Range(s32 a, s32 b);\n /// Generate a random s64 in [a .. b).\n /// Note that this does not provide a uniform distribution.\n s64 getS64Range(s64 a, s64 b);\n /// Generate a random f32 in [0, 1).\n f32 getF32();\n /// Generate a random f32 in [a, b).\n f32 getF32Range(f32 a, f32 b);\n /// Generate a random f64 in [0, 1).\n f64 getF64();\n /// Generate a random f64 in [a, b).\n f64 getF64Range(f64 a, f64 b);\n /// Generate a random boolean.\n bool getBool();\n\n void getContext(u32* x, u32* y, u32* z, u32* w) const;\n\nprivate:\n u32 mX;\n u32 mY;\n u32 mZ;\n u32 mW;\n};\n\ninline u32 Random::getU32(u32 max)\n{\n return getU32() * u64(max) >> 32u;\n}\n\ninline s32 Random::getS32Range(s32 a, s32 b)\n{\n do { if (false) { static_cast<void>(a <= b); sead::system::detail::CheckFormat(\"b[%d] >= a[%d]\", a, b); } } while (0);\n return getU32(b - a) + static_cast<u32>(a);\n}\n\n// UNCHECKED\ninline s64 Random::getS64Range(s64 a, s64 b)\n{\n do { if (false) { static_cast<void>(a <= b); sead::system::detail::CheckFormat(\"b[%ld] >= a[%ld]\", a, b); } } while (0);\n return (getU32() * u64(b - a) >> 32u) + a;\n}\n\ninline f32 Random::getF32()\n{\n return BitUtil::bitCast<f32>((getU32() >> 9u) | 0x3F800000u) - 1.0f;\n}\n\ninline f32 Random::getF32Range(f32 a, f32 b)\n{\n do { if (false) { static_cast<void>(a <= b); sead::system::detail::CheckFormat(\"b[%f] >= a[%f]\", a, b); } } while (0);\n return a + (b - a) * getF32();\n}\n\n// UNCHECKED\ninline f64 Random::getF64()\n{\n return BitUtil::bitCast<f64>((getU64() >> 12u) | 0x3FF0'0000'0000'0000lu) - 1.0;\n}\n\n// UNCHECKED\ninline f64 Random::getF64Range(f64 a, f64 b)\n{\n do { if (false) { static_cast<void>(a <= b); sead::system::detail::CheckFormat(\"b[%f] >= a[%f]\", a, b); } } while (0);\n return a + (b - a) * getF64();\n}\n\n// UNCHECKED\ninline bool Random::getBool()\n{\n return getU32() & 0x80000000u;\n}\n\n} // namespace sead\n# 9 \"/home/larsvi/botw/lib/sead/include/container/seadPtrArray.h\" 2\n\nnamespace sead\n{\nclass Heap;\nclass Random;\n\nclass PtrArrayImpl\n{\npublic:\n PtrArrayImpl() = default;\n PtrArrayImpl(s32 ptrNumMax, void* buf) { setBuffer(ptrNumMax, buf); }\n\n void setBuffer(s32 ptrNumMax, void* buf);\n void allocBuffer(s32 ptrNumMax, Heap* heap, s32 alignment = sizeof(void*));\n bool tryAllocBuffer(s32 ptrNumMax, Heap* heap, s32 alignment = sizeof(void*));\n void freeBuffer();\n bool isBufferReady() const { return mPtrs != nullptr; }\n\n bool isEmpty() const { return mPtrNum == 0; }\n bool isFull() const { return mPtrNum >= mPtrNumMax; }\n\n s32 size() const { return mPtrNum; }\n s32 capacity() const { return mPtrNumMax; }\n\n void erase(s32 position) { erase(position, 1); }\n void erase(s32 position, s32 count);\n void clear() { mPtrNum = 0; }\n\n // TODO\n void resize(s32 size);\n // TODO\n void unsafeResize(s32 size);\n\n void swap(s32 pos1, s32 pos2)\n {\n auto* ptr = mPtrs[pos1];\n mPtrs[pos1] = mPtrs[pos2];\n mPtrs[pos2] = ptr;\n }\n void reverse();\n void shuffle()\n {\n Random random;\n shuffle(&random);\n }\n void shuffle(Random* random);\n\nprotected:\n using CompareCallbackImpl = int (*)(const void* a, const void* b);\n\n void* at(s32 idx) const\n {\n if (u32(mPtrNum) <= u32(idx))\n {\n do { if (false) { static_cast<void>(false); sead::system::detail::CheckFormat(\"index exceeded [%d/%d]\", idx, mPtrNum); } } while (0);\n return nullptr;\n }\n return mPtrs[idx];\n }\n\n void* unsafeAt(s32 idx) const { return mPtrs[idx]; }\n\n // XXX: should this use at()?\n void* front() const { return mPtrs[0]; }\n void* back() const { return mPtrs[mPtrNum - 1]; }\n\n void pushBack(void* ptr)\n {\n if (isFull())\n {\n do { if (false) { static_cast<void>(false); sead::system::detail::CheckFormat(\"list is full.\"); } } while (0);\n return;\n }\n // Simplest insert case, so this is implemented directly without using insert().\n mPtrs[mPtrNum] = ptr;\n ++mPtrNum;\n }\n\n void pushFront(void* ptr) { insert(0, ptr); }\n\n void* popBack() { return isEmpty() ? nullptr : mPtrs[--mPtrNum]; }\n\n void* popFront()\n {\n if (isEmpty())\n return nullptr;\n\n void* result = mPtrs[0];\n erase(0);\n return result;\n }\n\n void replace(s32 idx, void* ptr) { mPtrs[idx] = ptr; }\n\n void* find(const void* ptr, CompareCallbackImpl cmp) const\n {\n for (s32 i = 0; i < mPtrNum; ++i)\n {\n if (cmp(mPtrs[i], ptr) == 0)\n return mPtrs[i];\n }\n return nullptr;\n }\n\n s32 search(const void* ptr, CompareCallbackImpl cmp) const\n {\n for (s32 i = 0; i < mPtrNum; ++i)\n {\n if (cmp(mPtrs[i], ptr) == 0)\n return i;\n }\n return -1;\n }\n\n bool equal(const PtrArrayImpl& other, CompareCallbackImpl cmp) const\n {\n if (mPtrNum != other.mPtrNum)\n return false;\n\n for (s32 i = 0; i < mPtrNum; ++i)\n {\n if (cmp(mPtrs[i], other.mPtrs[i]) != 0)\n return false;\n }\n return true;\n }\n\n s32 indexOf(const void* ptr) const\n {\n for (s32 i = 0; i < mPtrNum; ++i)\n {\n if (mPtrs[i] == ptr)\n return i;\n }\n return -1;\n }\n\n void createVacancy(s32 pos, s32 count)\n {\n if (mPtrNum <= pos)\n return;\n\n MemUtil::copyOverlap(mPtrs + pos + count, mPtrs + pos,\n s32(sizeof(void*)) * (mPtrNum - pos));\n }\n\n void insert(s32 idx, void* ptr);\n void insertArray(s32 idx, void* array, s32 array_length, s32 elem_size);\n bool checkInsert(s32 idx, s32 num);\n\n template <typename T, typename Compare>\n void sort_(Compare cmp)\n {\n // Note: Nintendo did not use <algorithm>\n std::sort(mPtrs, mPtrs + size(), [&](const void* a, const void* b) {\n return cmp(static_cast<const T*>(a), static_cast<const T*>(b)) < 0;\n });\n }\n\n template <typename T, typename Compare>\n void heapSort_(Compare cmp)\n {\n // Note: Nintendo did not use <algorithm>\n const auto less_cmp = [&](const void* a, const void* b) {\n return cmp(static_cast<const T*>(a), static_cast<const T*>(b)) < 0;\n };\n std::make_heap(mPtrs, mPtrs + size(), less_cmp);\n std::sort_heap(mPtrs, mPtrs + size(), less_cmp);\n }\n\n void heapSort(CompareCallbackImpl cmp);\n\n s32 compare(const PtrArrayImpl& other, CompareCallbackImpl cmp) const;\n void uniq(CompareCallbackImpl cmp);\n\n s32 binarySearch(const void* ptr, CompareCallbackImpl cmp) const\n {\n if (mPtrNum == 0)\n return -1;\n\n s32 a = 0;\n s32 b = mPtrNum - 1;\n while (a < b)\n {\n const s32 m = (a + b) / 2;\n const s32 c = cmp(mPtrs[m], ptr);\n if (c == 0)\n return m;\n if (c < 0)\n a = m + 1;\n else\n b = m;\n }\n\n if (cmp(mPtrs[a], ptr) == 0)\n return a;\n\n return -1;\n }\n\n s32 mPtrNum = 0;\n s32 mPtrNumMax = 0;\n void** mPtrs = nullptr;\n};\n\ntemplate <typename T>\nclass PtrArray : public PtrArrayImpl\n{\npublic:\n PtrArray() = default;\n PtrArray(s32 ptrNumMax, T** buf) : PtrArrayImpl(ptrNumMax, buf) {}\n\n T* at(s32 pos) const { return static_cast<T*>(PtrArrayImpl::at(pos)); }\n T* unsafeAt(s32 pos) const { return static_cast<T*>(PtrArrayImpl::unsafeAt(pos)); }\n T* operator()(s32 pos) const { return unsafeAt(pos); }\n T* operator[](s32 pos) const { return at(pos); }\n\n // XXX: Does this use at()?\n T* front() const { return at(0); }\n T* back() const { return at(mPtrNum - 1); }\n\n void pushBack(T* ptr) { PtrArrayImpl::pushBack(constCast(ptr)); }\n void pushFront(T* ptr) { PtrArrayImpl::pushFront(constCast(ptr)); }\n\n T* popBack() { return static_cast<T*>(PtrArrayImpl::popBack()); }\n T* popFront() { return static_cast<T*>(PtrArrayImpl::popFront()); }\n\n void insert(s32 pos, T* ptr) { PtrArrayImpl::insert(pos, constCast(ptr)); }\n void insert(s32 pos, T* array, s32 count)\n {\n // XXX: is this right?\n PtrArrayImpl::insertArray(pos, constCast(array), count, sizeof(T));\n }\n void replace(s32 pos, T* ptr) { PtrArrayImpl::replace(pos, constCast(ptr)); }\n\n s32 indexOf(const T* ptr) const { return PtrArrayImpl::indexOf(ptr); }\n\n using CompareCallback = s32 (*)(const T*, const T*);\n\n void sort() { sort(compareT); }\n void sort(CompareCallback cmp) { PtrArrayImpl::sort_<T>(cmp); }\n void heapSort() { heapSort(compareT); }\n void heapSort(CompareCallback cmp) { PtrArrayImpl::heapSort_<T>(cmp); }\n\n bool equal(const PtrArray& other, CompareCallback cmp) const\n {\n return PtrArrayImpl::equal(other, cmp);\n }\n\n s32 compare(const PtrArray& other, CompareCallback cmp) const\n {\n return PtrArrayImpl::compare(other, cmp);\n }\n\n T* find(const T* ptr) const\n {\n return PtrArrayImpl::find(ptr,\n [](const void* a, const void* b) { return a == b ? 0 : -1; });\n }\n T* find(const T* ptr, CompareCallback cmp) const { return PtrArrayImpl::find(ptr, cmp); }\n s32 search(const T* ptr) const\n {\n return PtrArrayImpl::search(ptr,\n [](const void* a, const void* b) { return a == b ? 0 : -1; });\n }\n s32 search(const T* ptr, CompareCallback cmp) const { return PtrArrayImpl::search(ptr, cmp); }\n s32 binarySearch(const T* ptr) const { return PtrArrayImpl::binarySearch(ptr, compareT); }\n s32 binarySearch(const T* ptr, CompareCallback cmp) const\n {\n return PtrArrayImpl::binarySearch(ptr, cmp);\n }\n\n bool operator==(const PtrArray& other) const { return equal(other, compareT); }\n bool operator!=(const PtrArray& other) const { return !(*this == other); }\n bool operator<(const PtrArray& other) const { return compare(other) < 0; }\n bool operator<=(const PtrArray& other) const { return compare(other) <= 0; }\n bool operator>(const PtrArray& other) const { return compare(other) > 0; }\n bool operator>=(const PtrArray& other) const { return compare(other) >= 0; }\n\n void uniq() { PtrArrayImpl::uniq(compareT); }\n void uniq(CompareCallback cmp) { PtrArrayImpl::uniq(cmp); }\n\n class iterator\n {\n public:\n iterator(T* const* pptr) : mPPtr{pptr} {}\n bool operator==(const iterator& other) const { return mPPtr == other.mPPtr; }\n bool operator!=(const iterator& other) const { return !(*this == other); }\n iterator& operator++()\n {\n ++mPPtr;\n return *this;\n }\n T& operator*() const { return **mPPtr; }\n T* operator->() const { return *mPPtr; }\n\n private:\n T* const* mPPtr;\n };\n\n iterator begin() const { return iterator(data()); }\n iterator end() const { return iterator(data() + mPtrNum); }\n\n class constIterator\n {\n public:\n constIterator(const T* const* pptr) : mPPtr{pptr} {}\n bool operator==(const constIterator& other) const { return mPPtr == other.mPPtr; }\n bool operator!=(const constIterator& other) const { return !(*this == other); }\n constIterator& operator++()\n {\n ++mPPtr;\n return *this;\n }\n const T& operator*() const { return **mPPtr; }\n const T* operator->() const { return *mPPtr; }\n\n private:\n const T* const* mPPtr;\n };\n\n constIterator constBegin() const { return constIterator(data()); }\n constIterator constEnd() const { return constIterator(data() + mPtrNum); }\n\n T** data() const { return reinterpret_cast<T**>(mPtrs); }\n T** dataBegin() const { return data(); }\n T** dataEnd() const { return data() + mPtrNum; }\n\nprotected:\n static void* constCast(const T* ptr)\n {\n // Unfortunately, we need to cast away const because several PtrArrayImpl functions\n // only take void* even though the pointed-to object isn't actually modified.\n return static_cast<void*>(const_cast<std::remove_const_t<T>*>(ptr));\n }\n\n static int compareT(const void* a_, const void* b_)\n {\n const T* a = static_cast<const T*>(a_);\n const T* b = static_cast<const T*>(b_);\n if (*a < *b)\n return -1;\n if (*b < *a)\n return 1;\n return 0;\n }\n};\n\ntemplate <typename T, s32 N>\nclass FixedPtrArray : public PtrArray<T>\n{\npublic:\n FixedPtrArray() : PtrArray<T>(N, mWork) {}\n\n // These do not make sense for a *fixed* array.\n void setBuffer(s32 ptrNumMax, void* buf) = delete;\n void allocBuffer(s32 ptrNumMax, Heap* heap, s32 alignment = sizeof(void*)) = delete;\n bool tryAllocBuffer(s32 ptrNumMax, Heap* heap, s32 alignment = sizeof(void*)) = delete;\n void freeBuffer() = delete;\n\nprivate:\n // Nintendo uses an untyped u8[N*sizeof(void*)] buffer. That is undefined behavior,\n // so we will not do that.\n T* mWork[N];\n};\n\n} // namespace sead\n# 4 \"/home/larsvi/botw/src/KingSystem/Physics/System/physRayCast.h\" 2\n# 1 \"/home/larsvi/botw/lib/sead/include/math/seadVector.h\" 1\n\n\n\n#include <cmath>\n# 1 \"/home/larsvi/botw/lib/sead/include/math/seadMathCalcCommon.h\" 1\n\n\n\n\n\n# 1 \"/home/larsvi/botw/lib/sead/include/math/seadMathNumbers.h\" 1\n\n\nnamespace sead::numbers\n{\ntemplate <typename T>\ninline constexpr T e_v = 2.718281828459045235360287471352662;\ntemplate <typename T>\ninline constexpr T log2e_v = 1.442695040888963407359924681001892;\ntemplate <typename T>\ninline constexpr T log10e_v = 0.434294481903251827651128918916605;\ntemplate <typename T>\ninline constexpr T pi_v = 3.141592653589793238462643383279502;\ntemplate <typename T>\ninline constexpr T inv_pi_v = 0.318309886183790671537767526745028;\ntemplate <typename T>\ninline constexpr T inv_sqrtpi_v = 0.564189583547756286948079451560772;\ntemplate <typename T>\ninline constexpr T ln2_v = 0.693147180559945309417232121458176;\ntemplate <typename T>\ninline constexpr T ln10_v = 2.302585092994045684017991454684364;\ntemplate <typename T>\ninline constexpr T sqrt2_v = 1.414213562373095048801688724209698;\ntemplate <typename T>\ninline constexpr T sqrt3_v = 1.732050807568877293527446341505872;\ntemplate <typename T>\ninline constexpr T inv_sqrt3_v = 0.577350269189625764509148780501957;\ntemplate <typename T>\ninline constexpr T egamma_v = 0.577215664901532860606512090082402;\ntemplate <typename T>\ninline constexpr T phi_v = 1.618033988749894848204586834365638;\n\ninline constexpr double e = e_v<double>;\ninline constexpr double log2e = log2e_v<double>;\ninline constexpr double log10e = log10e_v<double>;\ninline constexpr double pi = pi_v<double>;\ninline constexpr double inv_pi = inv_pi_v<double>;\ninline constexpr double inv_sqrtpi = inv_sqrtpi_v<double>;\ninline constexpr double ln2 = ln2_v<double>;\ninline constexpr double ln10 = ln10_v<double>;\ninline constexpr double sqrt2 = sqrt2_v<double>;\ninline constexpr double sqrt3 = sqrt3_v<double>;\ninline constexpr double inv_sqrt3 = inv_sqrt3_v<double>;\ninline constexpr double egamma = egamma_v<double>;\ninline constexpr double phi = phi_v<double>;\n\n} // namespace sead::numbers\n# 7 \"/home/larsvi/botw/lib/sead/include/math/seadMathCalcCommon.h\" 2\n\n\nnamespace sead\n{\ntemplate <typename T>\nclass MathCalcCommon\n{\npublic:\n static const u32 cQuarterRoundIdx = 0x40000000; // 90 degrees, PI/2 radians\n static const u32 cHalfRoundIdx = 0x80000000; // 180 degrees, PI radians\n\n struct SinCosSample\n {\n T sin_val;\n T sin_delta;\n T cos_val;\n T cos_delta;\n };\n\n struct AtanSample\n {\n u32 atan_val;\n T atan_delta;\n };\n\n struct ExpSample\n {\n T exp_val;\n T exp_delta;\n };\n\n struct LogSample\n {\n T log_val;\n T log_delta;\n };\n\n static T piHalf() { return numbers::pi_v<T> / static_cast<T>(2); }\n static T pi() { return numbers::pi_v<T>; }\n static T pi2() { return numbers::pi_v<T> * static_cast<T>(2); }\n static T zero() { return static_cast<T>(0); }\n static T one() { return static_cast<T>(1); }\n static T ln2() { return numbers::ln2_v<T>; }\n static T ln2Inv() { return numbers::log2e_v<T>; }\n\n static T neg(T t);\n static T inv(T t);\n\n /// Returns -1 for strictly negative values and 1 otherwise.\n static T sign(T value);\n\n static T fitSign(T value, T sign_value) { return abs(value) * sign(sign_value); }\n\n static T square(T t) { return t * t; }\n\n static T sqrt(T t);\n static T rsqrt(T t);\n\n static T pow(T x, T y);\n static T powTable(T, T);\n\n static T sin(T t);\n static T cos(T t);\n static T tan(T t);\n\n static T asin(T s);\n static T acos(T c);\n static T atan(T t);\n static T atan2(T y, T x);\n\n static T sinIdx(u32 idx);\n static T cosIdx(u32 idx);\n static T tanIdx(u32 idx);\n\n static u32 asinIdx(T s);\n static u32 acosIdx(T c);\n static u32 atanIdx(T t);\n static u32 atan2Idx(T y, T x);\n\n static void sinCosIdx(T* p_sin, T* p_cos, u32 idx);\n\n static T exp(T t);\n static T log(T t);\n static T log2(T n);\n static T log10(T t);\n\n static T expTable(T x);\n static T logTable(T x);\n\n static T minNumber();\n static T maxNumber();\n static T infinity();\n static T nan();\n static T epsilon() { return std::numeric_limits<T>::epsilon(); }\n\n static bool equalsEpsilon(T lhs, T rhs, T eps = epsilon())\n {\n const T diff = lhs - rhs;\n return -eps <= diff && diff <= eps;\n }\n\n static T abs(T x) { return x > 0 ? x : -x; }\n\n static T max(T a, T b);\n static T min(T a, T b);\n static T max3(T a, T b, T c);\n static T min3(T a, T b, T c);\n\n static T deg2rad(T deg);\n static T rad2deg(T rad);\n\n static u32 deg2idx(T a);\n static u32 rad2idx(T a);\n static T idx2deg(u32 a);\n static T idx2rad(u32 a);\n\n static T roundAngle(T);\n static T angleDist(T, T);\n static T random();\n static T getRand(T);\n static T getRandRange(T, T);\n static T getRandSign();\n static s32 roundOff(T);\n static s32 floor(T);\n static s32 ceil(T);\n static T roundUp(T x, s32 multNumber);\n static s32 roundUpPow2(T x, s32 y);\n static s32 roundDownN(T val, s32 multNumber);\n static s32 roundDownPow2(T x, s32 y);\n static T clampMax(T val, T max_);\n static T clampMin(T val, T min_);\n static T clamp(T value, T low, T high);\n // This is the same as clamp, but with a different order for arguments.\n static T clamp2(T min_, T val, T max_);\n static T gcd(T x, T y);\n static T lcm(T x, T y);\n static bool isZero(T, T);\n static bool isNan(T);\n static bool isPow2(T);\n static bool isMultiplePow2(T, T);\n static bool isInfinity(T);\n static bool isIntersect1d(T, T, T, T);\n\n /// Adds or subtracts `step` from `value` towards `target`.\n /// Returns whether the new value is equal to the target.\n static bool chase(T* value, T target, T step);\n static bool chaseAngle(T*, T, T);\n static bool chaseAngleIdx(u32*, u32, s64);\n\n static T lerp(T a, T b, f32 ratio);\n\nprotected:\n static u32 atanIdx_(T t);\n static T expLn2_(T x);\n static T log1_2_(T x);\n static void assertGreaterThanOrEqualToZero_(T);\n\npublic:\n /// Note: this is only defined for T = float at the moment.\n static const SinCosSample cSinCosTbl[256 + 1];\n static const AtanSample cAtanTbl[128 + 1];\n static const ExpSample cExpTbl[32 + 1];\n static const LogSample cLogTbl[256 + 1];\n};\n\ntypedef MathCalcCommon<s32> Mathi;\ntypedef MathCalcCommon<u32> Mathu;\ntypedef MathCalcCommon<f32> Mathf;\ntypedef MathCalcCommon<size_t> MathSizeT;\n\ntemplate <>\nu32 MathCalcCommon<f32>::atanIdx_(f32 t);\n\ntemplate <typename T>\nconstexpr T log2(T n)\n{\n static_assert(std::is_integral<T>(), \"T must be an integral type\");\n return n <= 1 ? 0 : 1 + log2(n >> 1);\n}\n\n} // namespace sead\n\n\n\n# 1 \"/home/larsvi/botw/lib/sead/include/math/seadMathCalcCommon.hpp\" 1\n# 11 \"/home/larsvi/botw/lib/sead/include/math/seadMathCalcCommon.hpp\"\nnamespace sead\n{\ntemplate <>\nconst MathCalcCommon<float>::SinCosSample MathCalcCommon<float>::cSinCosTbl[];\n\ntemplate <>\nconst MathCalcCommon<float>::AtanSample MathCalcCommon<float>::cAtanTbl[];\n\ntemplate <>\nconst MathCalcCommon<float>::ExpSample MathCalcCommon<float>::cExpTbl[];\n\ntemplate <>\nconst MathCalcCommon<float>::LogSample MathCalcCommon<float>::cLogTbl[];\n\ntemplate <typename T>\ninline T MathCalcCommon<T>::sign(T value)\n{\n return value < 0 ? -1 : 1;\n}\n\ntemplate <typename T>\ninline T MathCalcCommon<T>::sqrt(T t)\n{\n return std::sqrt(t);\n}\n\ntemplate <typename T>\ninline T MathCalcCommon<T>::rsqrt(T t)\n{\n return 1 / std::sqrt(t);\n}\n\ntemplate <typename T>\ninline T MathCalcCommon<T>::pow(T x, T y)\n{\n return std::pow(x, y);\n}\n\ntemplate <typename T>\ninline T MathCalcCommon<T>::sin(T t)\n{\n return std::sin(t);\n}\n\ntemplate <typename T>\ninline T MathCalcCommon<T>::cos(T t)\n{\n return std::cos(t);\n}\n\ntemplate <typename T>\ninline T MathCalcCommon<T>::tan(T t)\n{\n return std::tan(t);\n}\n\ntemplate <typename T>\ninline T MathCalcCommon<T>::asin(T t)\n{\n if constexpr (std::is_floating_point<T>())\n do { if (false) { static_cast<void>(-1.0 <= t && t <= 1.0); sead::system::detail::CheckFormat(\"t(%f) is not in [-1, 1].\", t); } } while (0);\n return std::asin(t);\n}\n\ntemplate <typename T>\ninline T MathCalcCommon<T>::acos(T t)\n{\n if constexpr (std::is_floating_point<T>())\n do { if (false) { static_cast<void>(-1.0 <= t && t <= 1.0); sead::system::detail::CheckFormat(\"t(%f) is not in [-1, 1].\", t); } } while (0);\n return std::acos(t);\n}\n\ntemplate <typename T>\ninline T MathCalcCommon<T>::atan(T t)\n{\n return std::atan(t);\n}\n\ntemplate <typename T>\ninline T MathCalcCommon<T>::atan2(T y, T x)\n{\n return std::atan2(y, x);\n}\n\ntemplate <>\ninline f32 MathCalcCommon<f32>::sinIdx(u32 idx)\n{\n u32 index = (idx >> 24) & 0xff;\n u32 rest = idx & 0xffffff;\n\n return cSinCosTbl[index].sin_val + cSinCosTbl[index].sin_delta * rest / 0x1000000;\n}\n\ntemplate <>\ninline f32 MathCalcCommon<f32>::cosIdx(u32 idx)\n{\n u32 index = (idx >> 24) & 0xff;\n u32 rest = idx & 0xffffff;\n\n return cSinCosTbl[index].cos_val + cSinCosTbl[index].cos_delta * rest / 0x1000000;\n}\n\ntemplate <>\ninline f32 MathCalcCommon<f32>::tanIdx(u32 idx)\n{\n u32 index = (idx >> 24) & 0xff;\n f32 rest = static_cast<f32>(idx & 0xffffff) / 0x1000000;\n const SinCosSample& sample = cSinCosTbl[index];\n\n return (sample.sin_val + sample.sin_delta * rest) / (sample.cos_val + sample.cos_delta * rest);\n}\n\ntemplate <>\ninline u32 MathCalcCommon<f32>::asinIdx(f32 s)\n{\n do { if (false) { static_cast<void>(s <= 1 && s >= -1); sead::system::detail::CheckFormat(\"s(%f) is not in [-1, 1].\", s); } } while (0);\n\n const f32 rsqrt_2 = 0.7071067690849304f; // rsqrt(2)\n\n if (s >= 0)\n {\n if (s > rsqrt_2)\n return 0x40000000 - atanIdx_(sqrt(1 - s * s) / s);\n\n else\n return atanIdx_(s / sqrt(1 - s * s));\n }\n else\n {\n if (s < -rsqrt_2)\n return 0xC0000000 + atanIdx_(-sqrt(1 - s * s) / s);\n\n else\n return -atanIdx_(-s / sqrt(1 - s * s));\n }\n}\n\ntemplate <>\ninline u32 MathCalcCommon<f32>::acosIdx(f32 c)\n{\n do { if (false) { static_cast<void>(c <= 1 && c >= -1); sead::system::detail::CheckFormat(\"c(%f) is not in [-1, 1].\", c); } } while (0);\n\n const f32 rsqrt_2 = 0.7071067690849304f; // rsqrt(2)\n\n if (c >= 0)\n {\n if (c > rsqrt_2)\n return atanIdx_(sqrt(1 - c * c) / c);\n\n else\n return 0x40000000 - atanIdx_(c / sqrt(1 - c * c));\n }\n else\n {\n if (c < -rsqrt_2)\n return 0x80000000 - atanIdx_(-sqrt(1 - c * c) / c);\n\n else\n return 0x40000000 + atanIdx_(-c / sqrt(1 - c * c));\n }\n}\n\ntemplate <>\ninline u32 MathCalcCommon<f32>::atanIdx(f32 t)\n{\n if (t >= 0)\n {\n if (t > 1)\n return 0x40000000 - atanIdx_(1 / t);\n\n else\n return atanIdx_(t);\n }\n else\n {\n if (t < -1)\n return 0xC0000000 + atanIdx_(-1 / t);\n\n else\n return -atanIdx_(-t);\n }\n}\n\ntemplate <>\ninline u32 MathCalcCommon<f32>::atan2Idx(f32 y, f32 x)\n{\n if (x == 0 && y == 0)\n return 0;\n\n if (x >= 0)\n {\n if (y >= 0)\n {\n if (x >= y)\n return atanIdx_(y / x);\n\n else\n return 0x40000000 - atanIdx_(x / y);\n }\n else\n {\n if (x >= -y)\n
return -atanIdx_(-y / x);\n\n else\n return 0xC0000000 + atanIdx_(x / -y);\n }\n }\n else\n {\n if (y >= 0)\n {\n if (-x >= y)\n return 0x80000000 - atanIdx_(y / -x);\n\n else\n return 0x40000000 + atanIdx_(-x / y);\n }\n else\n {\n if (x <= y)\n return 0x80000000 + atanIdx_(y / x);\n\n else\n return 0xC0000000 - atanIdx_(x / y);\n }\n }\n}\n\ntemplate <>\ninline void MathCalcCommon<f32>::sinCosIdx(f32* pSin, f32* pCos, u32 idx)\n{\n u32 index = (idx >> 24) & 0xff;\n f32 rest = static_cast<f32>(idx & 0xffffff) / 0x1000000;\n const SinCosSample& sample = cSinCosTbl[index];\n\n /*if (pSin != NULL)*/ *pSin = sample.sin_val + sample.sin_delta * rest;\n /*if (pCos != NULL)*/ *pCos = sample.cos_val + sample.cos_delta * rest;\n}\n\ntemplate <typename T>\ninline T MathCalcCommon<T>::exp(T t)\n{\n return std::exp(t);\n}\n\ntemplate <typename T>\ninline T MathCalcCommon<T>::log(T t)\n{\n return std::log(t);\n}\n\ntemplate <typename T>\ninline T MathCalcCommon<T>::log2(T n)\n{\n return std::log2(n);\n}\n\ntemplate <typename T>\ninline T MathCalcCommon<T>::log10(T t)\n{\n return std::log10(t);\n}\n\ntemplate <typename T>\ninline T MathCalcCommon<T>::minNumber()\n{\n return std::numeric_limits<T>::min();\n}\n\ntemplate <typename T>\ninline T MathCalcCommon<T>::maxNumber()\n{\n return std::numeric_limits<T>::max();\n}\n\ntemplate <>\ninline float MathCalcCommon<float>::minNumber()\n{\n return -std::numeric_limits<float>::max();\n}\n\ntemplate <>\ninline float MathCalcCommon<float>::maxNumber()\n{\n return std::numeric_limits<float>::max();\n}\n\ntemplate <>\ninline double MathCalcCommon<double>::minNumber()\n{\n return -std::numeric_limits<double>::max();\n}\n\ntemplate <>\ninline double MathCalcCommon<double>::maxNumber()\n{\n return std::numeric_limits<double>::max();\n}\n\ntemplate <>\ninline long double MathCalcCommon<long double>::minNumber()\n{\n return -std::numeric_limits<long double>::max();\n}\n\ntemplate <>\ninline long double MathCalcCommon<long double>::maxNumber()\n{\n return std::numeric_limits<long double>::max();\n}\n\ntemplate <typename T>\ninline T MathCalcCommon<T>::infinity()\n{\n return std::numeric_limits<T>::infinity();\n}\n\ntemplate <>\ninline f32 MathCalcCommon<f32>::nan()\n{\n return BitUtil::bitCast<f32>(0x7FFFFFFF);\n}\n\ntemplate <>\ninline f64 MathCalcCommon<f64>::nan()\n{\n return BitUtil::bitCast<f64>(0x7FFFFFFFFFFFFFFF);\n}\n\ntemplate <>\ninline s32 MathCalcCommon<s32>::abs(s32 x)\n{\n return (x ^ x >> 31) - (x >> 31);\n}\n\ntemplate <>\ninline u32 MathCalcCommon<u32>::abs(u32 x)\n{\n return x;\n}\n# 369 \"/home/larsvi/botw/lib/sead/include/math/seadMathCalcCommon.hpp\"\ntemplate <typename T>\ninline T MathCalcCommon<T>::max(T a, T b)\n{\n return a < b ? b : a;\n}\n\ntemplate <typename T>\ninline T MathCalcCommon<T>::min(T a, T b)\n{\n return a < b ? a : b;\n}\n\ntemplate <typename T>\ninline T MathCalcCommon<T>::max3(T a, T b, T c)\n{\n return max(max(a, b), c);\n}\n\ntemplate <typename T>\ninline T MathCalcCommon<T>::min3(T a, T b, T c)\n{\n return min(min(a, b), c);\n}\n\ntemplate <typename T>\ninline T MathCalcCommon<T>::deg2rad(T deg)\n{\n return deg * (numbers::pi_v<T> / static_cast<T>(180));\n}\n\ntemplate <typename T>\ninline T MathCalcCommon<T>::rad2deg(T rad)\n{\n return rad * (static_cast<T>(180) / numbers::pi_v<T>);\n}\n\ntemplate <typename T>\ninline u32 MathCalcCommon<T>::deg2idx(T a)\n{\n return static_cast<u32>(a * (cHalfRoundIdx / static_cast<T>(180)));\n}\n\ntemplate <typename T>\ninline u32 MathCalcCommon<T>::rad2idx(T a)\n{\n return static_cast<u32>(a * (cHalfRoundIdx / pi()));\n}\n\ntemplate <typename T>\ninline T MathCalcCommon<T>::idx2deg(u32 a)\n{\n return static_cast<T>(a * (static_cast<T>(180) / cHalfRoundIdx));\n}\n\ntemplate <typename T>\ninline T MathCalcCommon<T>::idx2rad(u32 a)\n{\n return static_cast<T>(a * (pi() / cHalfRoundIdx));\n}\n\ntemplate <typename T>\ninline s32 MathCalcCommon<T>::roundOff(T val)\n{\n return std::floor(val + 0.5f);\n}\n\ntemplate <>\ninline s32 MathCalcCommon<s32>::roundOff(s32 val)\n{\n return val;\n}\n\ntemplate <typename T>\ninline s32 MathCalcCommon<T>::floor(T val)\n{\n return std::floor(val);\n}\n\ntemplate <>\ninline s32 MathCalcCommon<s32>::floor(s32 val)\n{\n return val;\n}\n\ntemplate <typename T>\ninline s32 MathCalcCommon<T>::ceil(T val)\n{\n return std::ceil(val);\n}\n\ntemplate <>\ninline s32 MathCalcCommon<s32>::ceil(s32 val)\n{\n return val;\n}\n\ntemplate <typename T>\ninline T MathCalcCommon<T>::roundUp(T x, s32 multNumber)\n{\n do { if (false) static_cast<void>(multNumber > 0); } while (0);\n return (x + multNumber - 1) / multNumber * multNumber;\n}\n\ntemplate <>\ninline s32 MathCalcCommon<u32>::roundUpPow2(u32 val, s32 base)\n{\n do { if (false) { static_cast<void>((u32(base - 1) & u32(base)) == 0); sead::system::detail::CheckFormat(\"illegal param[val:%d, base:%d]\", val, base); } } while (0);\n return (val + base - 1) & (u32)-base;\n}\n\ntemplate <>\ninline s32 MathCalcCommon<s32>::roundUpPow2(s32 val, s32 base)\n{\n do { if (false) { static_cast<void>(val >= 0 && (u32(base - 1) & u32(base)) == 0); sead::system::detail::CheckFormat(\"illegal param[val:%d, base:%d]\", val, base); } } while (0);\n\n return (val + base - 1) & (u32)-base;\n}\n\ntemplate <typename T>\ninline T MathCalcCommon<T>::clampMax(T val, T max_)\n{\n return val > max_ ? max_ : val;\n}\n\ntemplate <typename T>\ninline T MathCalcCommon<T>::clampMin(T val, T min_)\n{\n return val < min_ ? min_ : val;\n}\n\ntemplate <typename T>\ninline T MathCalcCommon<T>::clamp2(T min_, T val, T max_)\n{\n return clamp(val, min_, max_);\n}\n\ntemplate <typename T>\ninline T MathCalcCommon<T>::clamp(T value, T low, T high)\n{\n if (value < low)\n value = low;\n else if (value > high)\n value = high;\n return value;\n}\n\ntemplate <typename T>\ninline bool MathCalcCommon<T>::chase(T* value, T target, T step)\n{\n const T current = *value;\n\n if (current < target)\n {\n const T new_value = current + step;\n if (target <= new_value || new_value < current)\n {\n *value = target;\n return true;\n }\n *value = new_value;\n return false;\n }\n\n if (current > target)\n {\n const T new_value = current - step;\n if (target >= new_value || current < new_value)\n {\n *value = target;\n return true;\n }\n *value = new_value;\n return false;\n }\n\n return true;\n}\n\ntemplate <typename T, typename T2>\ninline T lerp(T a, T b, T2 t)\n{\n return a + (b - a) * t;\n}\n\n} // namespace sead\n# 191 \"/home/larsvi/botw/lib/sead/include/math/seadMathCalcCommon.h\" 2\n# 6 \"/home/larsvi/botw/lib/sead/include/math/seadVector.h\" 2\n# 1 \"/home/larsvi/botw/lib/sead/include/math/seadMathPolicies.h\" 1\n\n\n# 1 \"/home/larsvi/botw/lib/sead/include/math/seadMathBase.h\" 1\n\n\n#include <array>\n\nnamespace sead\n{\ntemplate <typename T>\nstruct BaseVec2\n{\n union\n {\n struct\n {\n T x;\n T y;\n };\n std::array<T, 2> e;\n };\n};\n\ntemplate <typename T>\nstruct BaseVec3\n{\n union\n {\n struct\n {\n T x;\n T y;\n T z;\n };\n std::array<T, 3> e;\n };\n};\n\ntemplate <typename T>\nstruct BaseVec4\n{\n union\n {\n struct\n {\n T x;\n T y;\n T z;\n T w;\n };\n std::array<T, 4> e;\n };\n};\n\ntemplate <typename T>\nstruct BaseQuat\n{\n T x;\n T y;\n T z;\n T w;\n};\n\ntemplate <typename T>\nstruct BaseMtx22\n{\n union\n {\n T m[2][2];\n T a[4];\n };\n};\n\ntemplate <typename T>\nstruct BaseMtx33\n{\n union\n {\n T m[3][3];\n std::array<T, 9> a;\n };\n};\n\ntemplate <typename T>\nstruct BaseMtx34\n{\n union\n {\n T m[3][4];\n std::array<T, 12> a;\n };\n};\n\ntemplate <typename T>\nstruct BaseMtx44\n{\n union\n {\n T m[4][4];\n std::array<T, 16> a;\n };\n};\n\n} // namespace sead\n# 4 \"/home/larsvi/botw/lib/sead/include/math/seadMathPolicies.h\" 2\n\nnamespace sead\n{\ntemplate <typename T>\nclass Policies\n{\npublic:\n using Vec2Base = BaseVec2<T>;\n using Vec3Base = BaseVec3<T>;\n using Vec4Base = BaseVec4<T>;\n using QuatBase = BaseQuat<T>;\n using Mtx22Base = BaseMtx22<T>;\n using Mtx33Base = BaseMtx33<T>;\n using Mtx34Base = BaseMtx34<T>;\n using Mtx44Base = BaseMtx44<T>;\n};\n\n} // namespace sead\n# 7 \"/home/larsvi/botw/lib/sead/include/math/seadVector.h\" 2\n# 1 \"/home/larsvi/botw/lib/sead/include/math/seadVectorCalcCommon.h\" 1\n\n\n\n\nnamespace sead\n{\ntemplate <typename T>\nclass Vector2CalcCommon\n{\npublic:\n using Base = typename Policies<T>::Vec2Base;\n\npublic:\n static void add(Base& o, const Base& a, const Base& b);\n static void sub(Base& o, const Base& a, const Base& b);\n\n static void set(Base& o, const Base& v);\n static void set(Base& v, T x, T y);\n\n static T squaredLength(const Base& v);\n static T length(const Base& v);\n};\n\ntemplate <typename T>\nclass Vector3CalcCommon\n{\npublic:\n using Base = typename Policies<T>::Vec3Base;\n using Mtx33 = typename Policies<T>::Mtx33Base;\n using Mtx34 = typename Policies<T>::Mtx34Base;\n\n static void add(Base& o, const Base& a, const Base& b);\n static void sub(Base& o, const Base& a, const Base& b);\n /// Apply a rotation `m` to the vector `a`.\n static void mul(Base& o, const Mtx33& m, const Base& a);\n /// Apply a transformation `m` (rotation then translation) to the vector `a`.\n static void mul(Base& o, const Mtx34& m, const Base& a);\n\n /// Apply a rotation `m` to the vector `a`.\n static void rotate(Base& o, const Mtx33& m, const Base& a);\n /// Apply a rotation `m` to the vector `a`.\n static void rotate(Base& o, const Mtx34& m, const Base& a);\n\n static void cross(Base& o, const Base& a, const Base& b);\n static T dot(const Base& a, const Base& b);\n static T squaredLength(const Base& v);\n static T length(const Base& v);\n static bool equals(const Base& lhs, const Base& rhs, T epsilon);\n static void multScalar(Base& o, const Base& v, T t);\n static void multScalarAdd(Base& o, T t, const Base& a, const Base& b);\n static T normalize(Base& v);\n static void set(Base& o, const Base& v);\n static void set(Base& v, T x, T y, T z);\n};\n\ntemplate <typename T>\nclass Vector4CalcCommon\n{\npublic:\n using Base = typename Policies<T>::Vec4Base;\n\npublic:\n static void set(Base& o, const Base& v);\n static void set(Base& v, T x, T y, T z, T w);\n};\n\n} // namespace sead\n\n\n\n# 1 \"/home/larsvi/botw/lib/sead/include/math/seadVectorCalcCommon.hpp\" 1\n# 12 \"/home/larsvi/botw/lib/sead/include/math/seadVectorCalcCommon.hpp\"\nnamespace sead\n{\ntemplate <typename T>\ninline void Vector2CalcCommon<T>::add(Base& o, const Base& a, const Base& b)\n{\n o.x = a.x + b.x;\n o.y = a.y + b.y;\n}\n\ntemplate <typename T>\ninline void Vector2CalcCommon<T>::sub(Base& o, const Base& a, const Base& b)\n{\n o.x = a.x - b.x;\n o.y = a.y - b.y;\n}\n\ntemplate <typename T>\ninline void Vector2CalcCommon<T>::set(Base& o, const Base& v)\n{\n o.x = v.x;\n o.y = v.y;\n}\n\ntemplate <typename T>\ninline void Vector2CalcCommon<T>::set(Base& v, T x, T y)\n{\n v.x = x;\n v.y = y;\n}\n\ntemplate <typename T>\ninline T Vector2CalcCommon<T>::squaredLength(const Base& v)\n{\n return v.x * v.x + v.y * v.y;\n}\n\ntemplate <typename T>\ninline T Vector2CalcCommon<T>::length(const Base& v)\n{\n return MathCalcCommon<T>::sqrt(squaredLength(v));\n}\n\ntemplate <typename T>\ninline void Vector3CalcCommon<T>::add(Base& o, const Base& a, const Base& b)\n{\n o.x = a.x + b.x;\n o.y = a.y + b.y;\n o.z = a.z + b.z;\n}\n# 73 \"/home/larsvi/botw/lib/sead/include/math/seadVectorCalcCommon.hpp\"\ntemplate <typename T>\ninline void Vector3CalcCommon<T>::sub(Base& o, const Base& a, const Base& b)\n{\n o.x = a.x - b.x;\n o.y = a.y - b.y;\n o.z = a.z - b.z;\n}\n# 92 \"/home/larsvi/botw/lib/sead/include/math/seadVectorCalcCommon.hpp\"\ntemplate <typename T>\ninline void Vector3CalcCommon<T>::mul(Base& o, const Mtx33& m, const Base& a)\n{\n const Base tmp = a;\n o.x = m.m[0][0] * tmp.x + m.m[0][1] * tmp.y + m.m[0][2] * tmp.z;\n o.y = m.m[1][0] * tmp.x + m.m[1][1] * tmp.y + m.m[1][2] * tmp.z;\n o.z = m.m[2][0] * tmp.x + m.m[2][1] * tmp.y + m.m[2][2] * tmp.z;\n}\n\ntemplate <typename T>\ninline void Vector3CalcCommon<T>::mul(Base& o, const Mtx34& m, const Base& a)\n{\n const Base tmp = a;\n o.x = m.m[0][0] * tmp.x + m.m[0][1] * tmp.y + m.m[0][2] * tmp.z + m.m[0][3];\n o.y = m.m[1][0] * tmp.x + m.m[1][1] * tmp.y + m.m[1][2] * tmp.z + m.m[1][3];\n o.z = m.m[2][0] * tmp.x + m.m[2][1] * tmp.y + m.m[2][2] * tmp.z + m.m[2][3];\n}\n\ntemplate <typename T>\ninline void Vector3CalcCommon<T>::rotate(Base& o, const Mtx33& m, const Base& a)\n{\n mul(o, m, a);\n}\n\ntemplate <typename T>\ninline void Vector3CalcCommon<T>::rotate(Base& o, const Mtx34& m, const Base& a)\n{\n const Base tmp = a;\n o.x = m.m[0][0] * tmp.x + m.m[0][1] * tmp.y + m.m[0][2] * tmp.z;\n o.y = m.m[1][0] * tmp.x + m.m[1][1] * tmp.y + m.m[1][2] * tmp.z;\n o.z = m.m[2][0] * tmp.x + m.m[2][1] * tmp.y + m.m[2][2] * tmp.z;\n}\n\ntemplate <typename T>\ninline void Vector3CalcCommon<T>::cross(Base& o, const Base& a, const Base& b)\n{\n Vector3CalcCommon<T>::set(o, (a.y * b.z) - (a.z * b.y), (a.z * b.x) - (a.x * b.z),\n (a.x * b.y) - (a.y * b.x));\n}\n# 142 \"/home/larsvi/botw/lib/sead/include/math/seadVectorCalcCommon.hpp\"\ntemplate <typename T>\ninline T Vector3CalcCommon<T>::dot(const Base& a, const Base& b)\n{\n return a.x * b.x + a.y * b.y + a.z * b.z;\n}\n# 159 \"/home/larsvi/botw/lib/sead/include/math/seadVectorCalcCommon.hpp\"\ntemplate <typename T>\ninline T Vector3CalcCommon<T>::squaredLength(const Base& v)\n{\n return v.x * v.x + v.y * v.y + v.z * v.z;\n}\n\ntemplate <typename T>\ninline T Vector3CalcCommon<T>::length(const Base& v)\n{\n return MathCalcCommon<T>::sqrt(squaredLength(v));\n}\n# 181 \"/home/larsvi/botw/lib/sead/include/math/seadVectorCalcCommon.hpp\"\ntemplate <typename T>\ninline bool Vector3CalcCommon<T>::equals(const Base& lhs, const Base& rhs, T epsilon)\n{\n return MathCalcCommon<T>::equalsEpsilon(lhs.x, rhs.x, epsilon) &&\n MathCalcCommon<T>::equalsEpsilon(lhs.y, rhs.y, epsilon) &&\n MathCalcCommon<T>::equalsEpsilon(lhs.z, rhs.z, epsilon);\n}\n\ntemplate <typename T>\ninline void Vector3CalcCommon<T>::multScalar(Base& o, const Base& v, T t)\n{\n o.x = v.x * t;\n o.y = v.y * t;\n o.z = v.z * t;\n}\n# 208 \"/home/larsvi/botw/lib/sead/include/math/seadVectorCalcCommon.hpp\"\ntemplate <typename T>\ninline void Vector3CalcCommon<T>::multScalarAdd(Base& o, T t, const Base& a, const Base& b)\n{\n o.x = a.x * t + b.x;\n o.y = a.y * t + b.y;\n o.z = a.z * t + b.z;\n}\n# 228 \"/home/larsvi/botw/lib/sead/include/math/seadVectorCalcCommon.hpp\"\ntemplate <typename T>\nT Vector3CalcCommon<T>::normalize(Base& v)\n{\n const T len = length(v);\n if (len > 0)\n {\n const T inv_len = 1 / len;\n v.x *= inv_len;\n v.y *= inv_len;\n v.z *= inv_len;\n }\n\n return len;\n}\n\ntemplate <typename T>\ninline void Vector3CalcCommon<T>::set(Base& o, const Base& v)\n{\n o.x = v.x;\n o.y = v.y;\n o.z = v.z;\n}\n\ntemplate <typename T>\ninline void Vector3CalcCommon<T>::set(Base& v, T x, T y, T z)\n{\n v.x = x;\n v.y = y;\n v.z = z;\n}\n\ntemplate <typename T>\ninline void Vector4CalcCommon<T>::set(Base& o, const Base& v)\n{\n o.x = v.x;\n o.y = v.y;\n o.z = v.z;\n o.w = v.w;\n}\n\ntemplate <typename T>\ninline void Vector4CalcCommon<T>::set(Base& v, T x, T y, T z, T w)\n{\n v.x = x;\n v.y = y;\n v.z = z;\n v.w = w;\n}\n\n} // namespace sead\n# 71 \"/home/larsvi/botw/lib/sead/include/math/seadVectorCalcCommon.h\" 2\n# 8 \"/home/larsvi/botw/lib/sead/include/math/seadVector.h\" 2\n# 1 \"/home/larsvi/botw/lib/sead/include/math/seadVectorFwd.h\" 1\n\n\n// Forward declarations for Vector types.\n// Most users should #include <seadVector.h> instead.\n\n\n\nnamespace sead\n{\ntemplate <typename T>\nstruct Vector2;\n\ntemplate <typename T>\nstruct Vector3;\n\ntemplate <typename T>\nstruct Vector4;\n\nusing Vector2i = Vector2<s32>;\nusing Vector2f = Vector2<f32>;\n\nusing Vector3i = Vector3<s32>;\nusing Vector3f = Vector3<f32>;\n\nusing Vector4i = Vector4<s32>;\nusing Vector4f = Vector4<f32>;\n\n} // namespace sead\n# 9 \"/home/larsvi/botw/lib/sead/include/math/seadVector.h\" 2\n\nnamespace sead\n{\ntemplate <typename T>\nstruct Vector2 : public Policies<T>::Vec2Base\n{\n /// @warning This constructor leaves member variables uninitialized.\n Vector2() {}\n Vector2(const Vector2& other) = default;\n Vector2(T x, T y);\n\n Vector2& operator=(const Vector2& other);\n\n Vector2& operator+=(const Vector2& other);\n\n friend Vector2 operator+(const Vector2& a, const Vector2& b)\n {\n Vector2 o;\n Vector2CalcCommon<T>::add(o, a, b);\n return o;\n }\n\n Vector2& operator-=(const Vector2& other);\n\n friend Vector2 operator-(const Vector2& a, const Vector2& b)\n {\n Vector2 o;\n Vector2CalcCommon<T>::sub(o, a, b);\n return o;\n }\n\n Vector2& operator*=(T t);\n\n friend Vector2 operator*(const Vector2& a, T t)\n {\n Vector2 o;\n o.x = a.x * t;\n o.y = a.y * t;\n return o;\n }\n\n friend Vector2 operator*(T t, const Vector2& a) { return operator*(a, t); }\n\n Vector2& operator/=(T t);\n\n friend Vector2 operator/(const Vector2& a, T t) { return {a.x / t, a.y / t}; }\n\n bool operator==(const Vector2& rhs) const { return this->x == rhs.x && this->y == rhs.y; }\n bool operator!=(const Vector2& rhs) const { return !operator==(rhs); }\n\n void set(const Vector2& other);\n void set(T x_, T y_);\n\n T length() const;\n bool isZero() const { return *this == zero; }\n\n static const Vector2 zero;\n static const Vector2 ex;\n static const Vector2 ey;\n static const Vector2 ones;\n};\n\ntemplate <typename T>\nstruct Vector3 : public Policies<T>::Vec3Base\n{\n using Mtx33 = typename Policies<T>::Mtx33Base;\n using Mtx34 = typename Policies<T>::Mtx34Base;\n\n /// @warning This constructor leaves member variables uninitialized.\n Vector3() {}\n Vector3(const Vector3& other) = default;\n Vector3(T x, T y, T z);\n\n Vector3& operator=(const Vector3& other);\n bool operator==(const Vector3& rhs) const;\n bool operator!=(const Vector3& rhs) const;\n\n Vector3& operator+=(const Vector3& other);\n friend Vector3 operator+(const Vector3& a, const Vector3& b)\n {\n Vector3 o;\n Vector3CalcCommon<T>::add(o, a, b);\n return o;\n }\n\n Vector3& operator-=(const Vector3& other);\n friend Vector3 operator-(const Vector3& a, const Vector3& b)\n {\n Vector3 o;\n Vector3CalcCommon<T>::sub(o, a, b);\n return o;\n }\n\n Vector3& operator*=(T t);\n Vector3& operator*=(const Mtx33& m);\n Vector3& operator*=(const Mtx34& m);\n friend Vector3 operator*(const Vector3& a, T t)\n {\n Vector3 o;\n Vector3CalcCommon<T>::multScalar(o, a, t);\n return o;\n }\n friend Vector3 operator*(T t, const Vector3& a) { return operator*(a, t); }\n friend Vector3 operator*(const Mtx33& m, const Vector3& a)\n {\n Vector3 o;\n o.setMul(m, a);\n return o;\n }\n friend Vector3 operator*(const Mtx34& m, const Vector3& a)\n {\n Vector3 o;\n o.setMul(m, a);\n return o;\n }\n\n Vector3& operator/=(T t);\n friend Vector3 operator/(const Vector3& a, T t) { return {a.x / t, a.y / t, a.z / t}; }\n\n Vector3 operator-() const { return {-this->x, -this->y, -this->z}; }\n\n T dot(const Vector3& t) const;\n T length() const;\n T squaredLength() const;\n\n /// Checks if the differences of all components of lhs and rhs are within `epsilon`.\n /// (i.e. -epsilon <= lhs.x - rhs.x <= epsilon, and so on).\n bool equals(const Vector3& rhs, T epsilon = 0) const;\n\n void add(const Vector3& a);\n /// Apply a rotation `m` to this vector.\n void mul(const Mtx33& m);\n /// Apply a transformation `m` (rotation then translation) to this vector.\n void mul(const Mtx34& m);\n /// Apply a rotation `m` to this vector.\n void rotate(const Mtx33& m);\n /// Apply a rotation `m` to this vector.\n void rotate(const Mtx34& m);\n void multScalar(T t);\n\n T normalize();\n void set(const Vector3& other);\n void set(T x, T y, T z);\n void setCross(const Vector3<T>& a, const Vector3<T>& b);\n void setScaleAdd(T t, const Vector3<T>& a, const Vector3<T>& b);\n void setMul(const Mtx33& m, const Vector3& a);\n void setMul(const Mtx34& m, const Vector3& a);\n void setRotated(const Mtx33& m, const Vector3& a);\n void setRotated(const Mtx34& m, const Vector3& a);\n\n static const Vector3 zero;\n static const Vector3 ex;\n static const Vector3 ey;\n static const Vector3 ez;\n static const Vector3 ones;\n};\n\ntemplate <typename T>\nstruct Vector4 : public Policies<T>::Vec4Base\n{\n /// @warning This constructor leaves member variables uninitialized.\n Vector4() {}\n Vector4(const Vector4& other) = default;\n Vector4(T x, T y, T z, T w);\n\n Vector4& operator=(const Vector4& other);\n\n Vector4& operator+=(const Vector4& other);\n\n friend Vector4 operator+(const Vector4& a, const Vector4& b)\n {\n return {a.x + b.x, a.y + b.y, a.z + b.z, a.w + b.w};\n }\n\n Vector4& operator-=(const Vector4& other);\n\n friend Vector4 operator-(const Vector4& a, const Vector4& b)\n {\n return {a.x - b.x, a.y - b.y, a.z - b.z, a.w - b.w};\n }\n\n Vector4& operator*=(T t);\n\n friend Vector4 operator*(const Vector4& a, T t) { return {a.x * t, a.y * t, a.z * t, a.w * t}; }\n\n friend Vector4 operator*(T t, const Vector4& a) { return operator*(a, t); }\n\n Vector4& operator/=(T t);\n\n friend Vector4 operator/(const Vector4& a, T t) { return {a.x / t, a.y / t, a.z / t, a.w / t}; }\n\n bool operator==(const Vector4& rhs) const\n {\n return this->x == rhs.x && this->y == rhs.y && this->z == rhs.z && this->w == rhs.w;\n }\n bool operator!=(const Vector4& rhs) const { return !operator==(rhs); }\n\n void set(const Vector4& v);\n void set(T x_, T y_, T z_, T w_);\n\n static const Vector4 zero;\n static const Vector4 ex;\n static const Vector4 ey;\n static const Vector4 ez;\n static const Vector4 ew;\n static const Vector4 ones;\n};\n\ntemplate <>\nconst Vector2<f32> Vector2<f32>::zero;\n\ntemplate <>\nconst Vector2<f32> Vector2<f32>::ex;\n\ntemplate <>\nconst Vector2<f32> Vector2<f32>::ey;\n\ntemplate <>\nconst Vector2<f32> Vector2<f32>::ones;\n\ntemplate <>\nconst Vector3<f32> Vector3<f32>::zero;\n\ntemplate <>\nconst Vector3<f32> Vector3<f32>::ex;\n\ntemplate <>\nconst Vector3<f32> Vector3<f32>::ey;\n\ntemplate <>\nconst Vector3<f32> Vector3<f32>::ez;\n\ntemplate <>\nconst Vector3<f32> Vector3<f32>::ones;\n\ntemplate <>\nconst Vector4<f32> Vector4<f32>::zero;\n\ntemplate <>\nconst Vector4<f32> Vector4<f32>::ex;\n\ntemplate <>\nconst Vector4<f32> Vector4<f32>::ey;\n\ntemplate <>\nconst Vector4<f32> Vector4<f32>::ez;\n\ntemplate <>\nconst Vector4<f32> Vector4<f32>::ew;\n\ntemplate <>\nconst Vector4<f32> Vector4<f32>::ones;\n\n} // namespace sead\n\n\n\n# 1 \"/home/larsvi/botw/lib/sead/include/math/seadVector.hpp\" 1\n\n\n\n\n\n\n\nnamespace sead\n{\ntemplate <typename T>\ninline Vector2<T>::Vector2(T x_, T y_)\n{\n Vector2CalcCommon<T>::set(*this, x_, y_);\n}\n\ntemplate <typename T>\ninline Vector2<T>& Vector2<T>::operator+=(const Vector2<T>& other)\n{\n Vector2CalcCommon<T>::add(*this, *this, other);\n return *this;\n}\n\ntemplate <typename T>\ninline Vector2<T>& Vector2<T>::operator-=(const Vector2<T>& other)\n{\n Vector2CalcCommon<T>::sub(*this, *this, other);\n return *this;\n}\n\ntemplate <typename T>\ninline Vector2<T>& Vector2<T>::operator*=(T t)\n{\n this->x *= t;\n this->y *= t;\n return *this;\n}\n\ntemplate <typename T>\ninline Vector2<T>& Vector2<T>::operator/=(T t)\n{\n this->x /= t;\n this->y /= t;\n return *this;\n}\n\ntemplate <typename T>\ninline Vector2<T>& Vector2<T>::operator=(const Vector2<T>& other)\n{\n Vector2CalcCommon<T>::set(*this, other);\n return *this;\n}\n\ntemplate <typename T>\ninline void Vector2<T>::set(const Vector2<T>& other)\n{\n Vector2CalcCommon<T>::set(*this, other);\n}\n\ntemplate <typename T>\ninline void Vector2<T>::set(T x_, T y_)\n{\n Vector2CalcCommon<T>::set(*this, x_, y_);\n}\n\ntemplate <typename T>\ninline T Vector2<T>::length() const\n{\n return Vector2CalcCommon<T>::length(*this);\n}\n\ntemplate <typename T>\ninline Vector3<T>::Vector3(T x_, T y_, T z_)\n{\n Vector3CalcCommon<T>::set(*this, x_, y_, z_);\n}\n\ntemplate <typename T>\ninline Vector3<T>& Vector3<T>::operator=(const Vector3<T>& other)\n{\n Vector3CalcCommon<T>::set(*this, other);\n return *this;\n}\n\ntemplate <typename T>\ninline bool Vector3<T>::operator==(const Vector3& rhs) const\n{\n return this->x == rhs.x && this->y == rhs.y && this->z == rhs.z;\n}\n\ntemplate <typename T>\ninline bool Vector3<T>::operator!=(const Vector3& rhs) const\n{\n return !operator==(rhs);\n}\n\ntemplate <typename T>\ninline Vector3<T>& Vector3<T>::operator+=(const Vector3<T>& other)\n{\n Vector3CalcCommon<T>::add(*this, *this, other);\n return *this;\n}\n\ntemplate <typename T>\ninline Vector3<T>& Vector3<T>::operator-=(const Vector3<T>& other)\n{\n Vector3CalcCommon<T>::sub(*this, *this, other);\n return *this;\n}\n\ntemplate <typename T>\ninline Vector3<T>& Vector3<T>::operator*=(T t)\n{\n Vector3CalcCommon<T>::multScalar(*this, *this, t);\n return *this;\n}\n\ntemplate <typename T>\ninline Vector3<T>& Vector3<T>::operator*=(const Mtx33& m)\n{\n mul(m);\n return *this;\n}\n\ntemplate <typename T>\ninline Vector3<T>& Vector3<T>::operator*=(const Mtx34& m)\n{\n mul(m);\n return *this;\n}\n\ntemplate <typename T>\ninline Vector3<T>& Vector3<T>::operator/=(T t)\n{\n this->x /= t;\n this->y /= t;\n this->z /= t;\n return *this;\n}\n\ntemplate <typename T>\ninline T Vector3<T>::dot(const Vector3<T>& t) const\n{\n return Vector3CalcCommon<T>::dot(*this, t);\n}\n\ntemplate <typename T>\ninline T Vector3<T>::length() const\n{\n return Vector3CalcCommon<T>::length(*this);\n}\n\ntemplate <typename T>\ninline T Vector3<T>::squaredLength() const\n{\n return Vector3CalcCommon<T>::squaredLength(*this);\n}\n\ntemplate <typename T>\ninline bool Vector3<T>::equals(const Vector3<T>& rhs, T epsilon) const\n{\n return Vector3CalcCommon<T>::equals(*this, rhs, epsilon);\n}\n\ntemplate <typename T>\ninline void Vector3<T>::add(const Vector3<T>& a)\n{\n Vector3CalcCommon<T>::add(*this, *this, a);\n}\n\ntemplate <typename T>\ninline void Vector3<T>::mul(const Mtx33& m)\n{\n setMul(m, *this);\n}\n\ntemplate <typename T>\ninline void Vector3<T>::mul(const Mtx34& m)\n{\n setMul(m, *this);\n}\n\ntemplate <typename T>\ninline void Vector3<T>::rotate(const Mtx33& m)\n{\n setRotated(m, *this);\n}\n\ntemplate <typename T>\ninline void Vector3<T>::rotate(const Mtx34& m)\n{\n setRotated(m, *this);\n}\n\ntemplate <typename T>\ninline void Vector3<T>::multScalar(T t)\n{\n Vector3CalcCommon<T>::multScalar(*this, *this, t);\n}\n\ntemplate <typename T>\ninline T Vector3<T>::normalize()\n{\n return Vector3CalcCommon<T>::normalize(*this);\n}\n\ntemplate <typename T>\ninline void Vector3<T>::set(const Vector3<T>& other)\n{\n Vector3CalcCommon<T>::set(*this, other);\n}\n\ntemplate <typename T>\ninline void Vector3<T>::set(T x_, T y_, T z_)\n{\n Vector3CalcCommon<T>::set(*this, x_, y_, z_);\n}\n\ntemplate <typename T>\ninline void Vector3<T>::setCross(const Vector3<T>& a, const Vector3<T>& b)\n{\n Vector3CalcCommon<T>::cross(*this, a, b);\n}\n\ntemplate <typename T>\ninline void Vector3<T>::setScaleAdd(T t, const Vector3<T>& a, const Vector3<T>& b)\n{\n Vector3CalcCommon<T>::multScalarAdd(*this, t, a, b);\n}\n\ntemplate <typename T>\ninline void Vector3<T>::setMul(const Mtx33& m, const Vector3<T>& a)\n{\n Vector3CalcCommon<T>::mul(*this, m, a);\n}\n\ntemplate <typename T>\ninline void Vector3<T>::setMul(const Mtx34& m, const Vector3<T>& a)\n{\n Vector3CalcCommon<T>::mul(*this, m, a);\n}\n\ntemplate <typename T>\ninline void Vector3<T>::setRotated(const Mtx33& m, const Vector3<T>& a)\n{\n Vector3CalcCommon<T>::rotate(*this, m, a);\n}\n\ntemplate <typename T>\ninline void Vector3<T>::setRotated(const Mtx34& m, const Vector3<T>& a)\n{\n Vector3CalcCommon<T>::rotate(*this, m, a);\n}\n\ntemplate <typename T>\ninline Vector4<T>::Vector4(T x_, T y_, T z_, T w_)\n{\n Vector4CalcCommon<T>::set(*this, x_, y_, z_, w_);\n}\n\ntemplate <typename T>\ninline Vector4<T>& Vector4<T>::operator+=(const Vector4<T>& other)\n{\n this->x += other.x;\n this->y += other.y;\n this->z += other.z;\n this->w += other.w;\n return *this;\n}\n\ntemplate <typename T>\ninline Vector4<T>& Vector4<T>::operator-=(const Vector4<T>& other)\n{\n this->x -= other.x;\n this->y -= other.y;\n this->z -= other.z;\n this->w -= other.w;\n return *this;\n}\n\ntemplate <typename T>\ninline Vector4<T>& Vector4<T>::operator*=(T t)\n{\n this->x *= t;\n this->y *= t;\n this->z *= t;\n this->w *= t;\n return *this;\n}\n\ntemplate <typename T>\ninline Vector4<T>& Vector4<T>::operator/=(T t)\n{\n this->x /= t;\n this->y /= t;\n this->z /= t;\n this->w /= t;\n return *this;\n}\n\ntemplate <typename T>\ninline Vector4<T>& Vector4<T>::operator=(const Vector4<T>& other)\n{\n Vector4CalcCommon<T>::set(*this, other);\n return *this;\n}\n\ntemplate <typename T>\ninline void Vector4<T>::set(const Vector4<T>& other)\n{\n Vector4CalcCommon<T>::set(*this, other);\n}\n\ntemplate <typename T>\ninline void Vector4<T>::set(T x_, T y_, T z_, T w_)\n{\n Vector4CalcCommon<T>::set(*this, x_, y_, z_, w_);\n}\n\n} // namespace sead\n# 266 \"/home/larsvi/botw/lib/sead/include/math/seadVector.h\" 2\n# 5 \"/home/larsvi/botw/src/KingSystem/Physics/System/physRayCast.h\" 2\n# 1 \"/home/larsvi/botw/lib/sead/include/prim/seadBitFlag.h\" 1\n\n\n\n\n\nnamespace sead\n{\nclass BitFlagUtil\n{\npublic:\n /// Popcount.\n static int countOnBit(u32 x);\n /// Count trailing zeroes (ctz).\n static int countContinuousOffBitFromRight(u32 x) { return countOnBit((x & -x) - 1); }\n static int countRightOnBit(u32 x, int bit);\n static int findOnBitFromRight(u32 x, int num);\n\n /// Popcount.\n static int countOnBit64(u64 x)\n {\n return countOnBit(static_cast<u32>(x)) + countOnBit(static_cast<u32>(x >> 32));\n }\n /// Count trailing zeroes (ctz).\n static int countContinuousOffBitFromRight64(u64 x) { return countOnBit64((x & -x) - 1); }\n static int countRightOnBit64(u64 x, int bit);\n static int findOnBitFromRight64(u64 x, int num);\n};\n\ntemplate <typename T>\nclass BitFlag\n{\npublic:\n BitFlag() : mBits(0) {}\n BitFlag(T bits) : mBits(bits) {}\n\n operator T() const { return mBits; }\n\n void makeAllZero() { mBits = 0; }\n void makeAllOne() { mBits = ~T(0); }\n\n void setDirect(T bits) { mBits = bits; }\n T getDirect() const { return mBits; }\n T* getPtr() { return &mBits; }\n const T* getPtr() const { return &mBits; }\n size_t getByteSize() const { return sizeof(T); }\n\n void set(T val) { mBits |= val; }\n void reset(T val) { mBits &= ~val; }\n void toggle(T val) { mBits ^= val; }\n void change(T val, bool on)\n {\n if (on)\n set(val);\n else\n reset(val);\n }\n bool isZero() const { return mBits == 0; }\n /// Checks if (at least) one of the bits are set.\n bool isOn(T val) const { return (mBits & val) != 0; }\n /// Checks if all of the bits are set.\n bool isOnAll(T val) const { return (mBits & val) == val; }\n bool isOff(T val) const { return !isOn(val); }\n\n bool testAndClear(T val)\n {\n if (!isOn(val))\n return false;\n reset(val);\n return true;\n }\n\n // TODO: what is this even supposed to do? (This function is known to exist\n // because it is present in debug info for pead in Super Mario Run.)\n T getMask(T v) const;\n\n static T makeMask(int bit) { return T(1) << bit; }\n\n void setBit(int bit) { set(makeMask(bit)); }\n void resetBit(int bit) { reset(makeMask(bit)); }\n void changeBit(int bit, bool on) { change(makeMask(bit), on); }\n void toggleBit(int bit) { toggle(makeMask(bit)); }\n bool isOnBit(int bit) const { return isOn(makeMask(bit)); }\n bool isOffBit(int bit) const { return isOff(makeMask(bit)); }\n bool testAndClearBit(int bit) { return testAndClear(makeMask(bit)); }\n\n /// Popcount.\n int countOnBit() const\n {\n if constexpr (sizeof(T) <= 4)\n
return BitFlagUtil::countOnBit(mBits);\n else\n return BitFlagUtil::countOnBit64(mBits);\n }\n /// Count trailing zeroes.\n int countContinuousOffBitFromRight() const\n {\n if constexpr (sizeof(T) <= 4)\n return BitFlagUtil::countContinuousOffBitFromRight(mBits);\n else\n return BitFlagUtil::countContinuousOffBitFromRight64(mBits);\n }\n int countRightOnBit(int bit) const\n {\n if constexpr (sizeof(T) <= 4)\n return BitFlagUtil::countRightOnBit(mBits, bit);\n else\n return BitFlagUtil::countRightOnBit64(mBits, bit);\n }\n int findOnBitFromRight(int num) const\n {\n if constexpr (sizeof(T) <= 4)\n return BitFlagUtil::findOnBitFromRight(mBits, num);\n else\n return BitFlagUtil::findOnBitFromRight64(mBits, num);\n }\n\nprotected:\n T mBits;\n};\n\nusing BitFlag8 = BitFlag<u8>;\nusing BitFlag16 = BitFlag<u16>;\nusing BitFlag32 = BitFlag<u32>;\nusing BitFlag64 = BitFlag<u64>;\n\n} // namespace sead\n# 6 \"/home/larsvi/botw/src/KingSystem/Physics/System/physRayCast.h\" 2\n# 1 \"/home/larsvi/botw/lib/sead/include/prim/seadDelegate.h\" 1\n\n\n// A delegate is a wrapper around a pointer to member function or a lambda function.\n//\n// IDelegates: interface types.\n// Delegates: implementations of delegates for pointer to member functions (only).\n// LambdaDelegates: implementations of delegates for lambda functions (and more generally functors).\n// AnyDelegates: type-erased type that can store any Delegate or LambdaDelegate.\n//\n// Unlike std::function or inplace_function, delegates cannot wrap functions with arbitrary\n// signatures. Each category of delegate has several variants:\n//\n// - XDelegate (no argument, no return value),\n// - XDelegateR (no argument),\n// - XDelegate1 (1 argument, no return value)\n// - XDelegate1R (1 argument)\n// - XDelegate2 (2 argument, no return value)\n// - XDelegate2R (2 arguments)\n//\n// To make a lambda delegate, use the makeLambdaDelegate functions, which will return a\n// LambdaDelegate with most template arguments automatically deduced.\n\n\n\n\n\n# 1 \"/home/larsvi/botw/lib/sead/include/basis/seadNew.h\" 1\n\n\n\n\n\n\n\n\nnamespace sead\n{\nclass Heap;\n\nvoid AllocFailAssert(Heap* heap, size_t size, u32 alignment);\n\n\ninline void AllocFailAssert(Heap*, size_t, u32) {}\n\n} // namespace sead\n\nvoid* operator new(size_t size);\nvoid* operator new[](size_t size);\nvoid* operator new(size_t size, const std::nothrow_t&) noexcept;\nvoid* operator new[](size_t size, const std::nothrow_t&) noexcept;\n\nvoid* operator new(size_t size, s32 alignment);\nvoid* operator new[](size_t size, s32 alignment);\nvoid* operator new(size_t size, s32 alignment, const std::nothrow_t&) noexcept;\nvoid* operator new[](size_t size, s32 alignment, const std::nothrow_t&) noexcept;\n\nvoid* operator new(size_t size, sead::Heap* heap, const std::nothrow_t&) noexcept;\nvoid* operator new[](size_t size, sead::Heap* heap, const std::nothrow_t&) noexcept;\n\nvoid* operator new(size_t size, sead::Heap* heap, s32 alignment = sizeof(void*));\nvoid* operator new[](size_t size, sead::Heap* heap, s32 alignment = sizeof(void*));\nvoid* operator new(size_t size, sead::Heap* heap, s32 alignment, const std::nothrow_t&) noexcept;\nvoid* operator new[](size_t size, sead::Heap* heap, s32 alignment, const std::nothrow_t&) noexcept;\n\nvoid operator delete(void* ptr) noexcept;\nvoid operator delete[](void* ptr) noexcept;\nvoid operator delete(void* ptr, const std::nothrow_t&) noexcept;\nvoid operator delete[](void* ptr, const std::nothrow_t&) noexcept;\n\nvoid operator delete(void* ptr, s32);\nvoid operator delete[](void* ptr, s32);\nvoid operator delete(void* ptr, s32, const std::nothrow_t&) noexcept;\nvoid operator delete[](void* ptr, s32, const std::nothrow_t&) noexcept;\n\nvoid operator delete(void* ptr, sead::Heap*, const std::nothrow_t&) noexcept;\nvoid operator delete[](void* ptr, sead::Heap*, const std::nothrow_t&) noexcept;\n\nvoid operator delete(void* ptr, sead::Heap*, s32);\nvoid operator delete[](void* ptr, sead::Heap*, s32);\nvoid operator delete(void* ptr, sead::Heap*, s32, const std::nothrow_t&) noexcept;\nvoid operator delete[](void* ptr, sead::Heap*, s32, const std::nothrow_t&) noexcept;\n\nnamespace sead\n{\ninline u8* AllocBuffer(size_t size, Heap* heap, s32 alignment)\n{\n u8* buffer = new (heap, alignment, std::nothrow) u8[size];\n if (buffer)\n return buffer;\n\n\n\n\n return nullptr;\n}\n} // namespace sead\n# 27 \"/home/larsvi/botw/lib/sead/include/prim/seadDelegate.h\" 2\n\nnamespace sead\n{\nclass Heap;\n\n/// Interface of a delegate for a member function with no argument.\nclass IDelegate\n{\npublic:\n virtual void invoke() = 0;\n virtual IDelegate* clone(Heap*) const { return nullptr; }\n virtual bool isNoDummy() const { return true; }\n void operator()() { return invoke(); }\n};\n\n/// @tparam R Return type\ntemplate <typename R>\nclass IDelegateR\n{\npublic:\n virtual R invoke() = 0;\n virtual IDelegateR* clone(Heap*) const { return nullptr; }\n virtual bool isNoDummy() const { return true; }\n R operator()() { return invoke(); }\n};\n\n/// Interface of a delegate for a member function with one argument.\n/// @tparam A1 Type of the argument\ntemplate <typename A1>\nclass IDelegate1\n{\npublic:\n virtual void invoke(A1 a1) = 0;\n virtual IDelegate1* clone(Heap*) const { return nullptr; }\n virtual bool isNoDummy() const { return true; }\n void operator()(A1 a1) { return invoke(a1); }\n};\n\n/// @tparam A1 Type of the argument\n/// @tparam R Return type\ntemplate <typename A1, typename R>\nclass IDelegate1R\n{\npublic:\n virtual R invoke(A1 a1) = 0;\n virtual IDelegate1R* clone(Heap*) const { return nullptr; }\n virtual bool isNoDummy() const { return true; }\n R operator()(A1 a1) { return invoke(a1); }\n};\n\n/// Interface of a delegate for a member function with two arguments.\n/// @tparam A1 Type of the first argument\n/// @tparam A2 Type of the second argument\ntemplate <typename A1, typename A2>\nclass IDelegate2\n{\npublic:\n virtual void invoke(A1 a1, A2 a2) = 0;\n virtual IDelegate2* clone(Heap*) const { return nullptr; }\n virtual bool isNoDummy() const { return true; }\n void operator()(A1 a1, A2 a2) { return invoke(a1, a2); }\n};\n\n/// @tparam A1 Type of the first argument\n/// @tparam A2 Type of the second argument\n/// @tparam R Return type\ntemplate <typename A1, typename A2, typename R>\nclass IDelegate2R\n{\npublic:\n virtual R invoke(A1 a1, A2 a2) = 0;\n virtual IDelegate2R* clone(Heap*) const { return nullptr; }\n virtual bool isNoDummy() const { return true; }\n R operator()(A1 a1, A2 a2) { return invoke(a1, a2); }\n};\n\n/// Base class for delegate implementations.\ntemplate <typename T, typename PTMF, typename Base>\nclass DelegateBase : public Base\n{\npublic:\n DelegateBase() = default;\n DelegateBase(T* instance, PTMF fn) : mInstance(instance), mFunctionPtr(fn) {}\n\n T* instance() const { return mInstance; }\n void setInstance(T* instance) { mInstance = instance; }\n void setFunction(PTMF fn) { mFunctionPtr = fn; }\n\n void bind(T* instance, PTMF fn)\n {\n setInstance(instance);\n setFunction(fn);\n }\n\nprotected:\n T* mInstance = nullptr;\n PTMF mFunctionPtr = nullptr;\n};\n\n/// Partial specialization of DelegateBase for regular function pointers\n/// (*not* pointers-to-member-function).\ntemplate <typename FunctionPointer, typename Base>\nclass DelegateBase<void, FunctionPointer, Base> : public Base\n{\npublic:\n DelegateBase() = default;\n explicit DelegateBase(FunctionPointer fn) : mFunctionPtr(fn) {}\n\n void setFunction(FunctionPointer fn) { mFunctionPtr = fn; }\n\nprotected:\n FunctionPointer mFunctionPtr = nullptr;\n};\n\n/// Delegate for a member function with no argument.\n/// @tparam T Class type\ntemplate <typename T>\nclass Delegate : public DelegateBase<T, void (T::*)(), IDelegate>\n{\npublic:\n using Base = DelegateBase<T, void (T::*)(), IDelegate>;\n using Base::Base;\n void invoke() override { operator()(); }\n void operator()() const\n {\n if (this->mInstance && this->mFunctionPtr)\n return (this->mInstance->*(this->mFunctionPtr))();\n }\n Delegate* clone(Heap* heap) const override { return new (heap) Delegate(*this); }\n};\n\n/// @tparam T Class type\n/// @tparam R Return type\ntemplate <typename T, typename R>\nclass DelegateR : public DelegateBase<T, R (T::*)(), IDelegateR<R>>\n{\npublic:\n using Base = DelegateBase<T, R (T::*)(), IDelegateR<R>>;\n using Base::Base;\n R invoke() override { return operator()(); }\n R operator()() const\n {\n if (this->mInstance && this->mFunctionPtr)\n return (this->mInstance->*(this->mFunctionPtr))();\n return {};\n }\n DelegateR* clone(Heap* heap) const override { return new (heap) DelegateR(*this); }\n};\n\n/// Delegate for a member function with one argument.\n/// @tparam T Class type\n/// @tparam A1 Type of the argument\ntemplate <typename T, typename A1>\nclass Delegate1 : public DelegateBase<T, void (T::*)(A1), IDelegate1<A1>>\n{\npublic:\n using Base = DelegateBase<T, void (T::*)(A1), IDelegate1<A1>>;\n using Base::Base;\n void invoke(A1 a1) override { operator()(a1); }\n void operator()(A1 a1) const\n {\n if (this->mInstance && this->mFunctionPtr)\n return (this->mInstance->*(this->mFunctionPtr))(a1);\n }\n Delegate1* clone(Heap* heap) const override { return new (heap) Delegate1(*this); }\n};\n\n/// @tparam T Class type\n/// @tparam A1 Type of the argument\n/// @tparam R Return type\ntemplate <typename T, typename A1, typename R>\nclass Delegate1R : public DelegateBase<T, R (T::*)(A1), IDelegate1R<A1, R>>\n{\npublic:\n using Base = DelegateBase<T, R (T::*)(A1), IDelegate1R<A1, R>>;\n using Base::Base;\n R invoke(A1 a1) override { return operator()(a1); }\n R operator()(A1 a1) const\n {\n if (this->mInstance && this->mFunctionPtr)\n return (this->mInstance->*(this->mFunctionPtr))(a1);\n return {};\n }\n Delegate1R* clone(Heap* heap) const override { return new (heap) Delegate1R(*this); }\n};\n\n/// Delegate for a member function with two arguments.\n/// @tparam T Class type\n/// @tparam A1 Type of the first argument\n/// @tparam A2 Type of the second argument\ntemplate <typename T, typename A1, typename A2>\nclass Delegate2 : public DelegateBase<T, void (T::*)(A1, A2), IDelegate2<A1, A2>>\n{\npublic:\n using Base = DelegateBase<T, void (T::*)(A1, A2), IDelegate2<A1, A2>>;\n using Base::Base;\n void invoke(A1 a1, A2 a2) override { return operator()(a1, a2); }\n void operator()(A1 a1, A2 a2) const\n {\n if (this->mInstance && this->mFunctionPtr)\n return (this->mInstance->*(this->mFunctionPtr))(a1, a2);\n }\n Delegate2* clone(Heap* heap) const override { return new (heap) Delegate2(*this); }\n};\n\n/// @tparam T Class type\n/// @tparam A1 Type of the first argument\n/// @tparam A2 Type of the second argument\n/// @tparam R Return type\ntemplate <typename T, typename A1, typename A2, typename R>\nclass Delegate2R : public DelegateBase<T, R (T::*)(A1, A2), IDelegate2R<A1, A2, R>>\n{\npublic:\n using Base = DelegateBase<T, R (T::*)(A1, A2), IDelegate2R<A1, A2, R>>;\n using Base::Base;\n R invoke(A1 a1, A2 a2) override { return operator()(a1, a2); }\n R operator()(A1 a1, A2 a2) const\n {\n if (this->mInstance && this->mFunctionPtr)\n return (this->mInstance->*(this->mFunctionPtr))(a1, a2);\n return {};\n }\n Delegate2R* clone(Heap* heap) const override { return new (heap) Delegate2R(*this); }\n};\n\nclass DelegateFunc : public DelegateBase<void, void (*)(), IDelegate>\n{\npublic:\n using Base = DelegateBase<void, void (*)(), IDelegate>;\n using Base::Base;\n void invoke() override { operator()(); }\n void operator()() const\n {\n if (this->mFunctionPtr)\n return (*this->mFunctionPtr)();\n }\n DelegateFunc* clone(Heap* heap) const override { return new (heap) DelegateFunc(*this); }\n};\n\ntemplate <typename R>\nclass DelegateRFunc : public DelegateBase<void, R (*)(), IDelegateR<R>>\n{\npublic:\n using Base = DelegateBase<void, R (*)(), IDelegateR<R>>;\n using Base::Base;\n R invoke() override { return operator()(); }\n R operator()() const\n {\n if (this->mFunctionPtr)\n return (*this->mFunctionPtr)();\n return {};\n }\n DelegateRFunc* clone(Heap* heap) const override { return new (heap) DelegateRFunc(*this); }\n};\n\ntemplate <typename A1>\nclass Delegate1Func : public DelegateBase<void, void (*)(A1), IDelegate1<A1>>\n{\npublic:\n using Base = DelegateBase<void, void (*)(A1), IDelegate1<A1>>;\n using Base::Base;\n void invoke(A1 a1) override { operator()(a1); }\n void operator()(A1 a1) const\n {\n if (this->mFunctionPtr)\n return (*this->mFunctionPtr)(a1);\n }\n Delegate1Func* clone(Heap* heap) const override { return new (heap) Delegate1Func(*this); }\n};\n\ntemplate <typename A1, typename R>\nclass Delegate1RFunc : public DelegateBase<void, R (*)(A1), IDelegate1R<A1, R>>\n{\npublic:\n using Base = DelegateBase<void, R (*)(A1), IDelegate1R<A1, R>>;\n using Base::Base;\n R invoke(A1 a1) override { return operator()(a1); }\n R operator()(A1 a1) const\n {\n if (this->mFunctionPtr)\n return (*this->mFunctionPtr)(a1);\n return {};\n }\n Delegate1RFunc* clone(Heap* heap) const override { return new (heap) Delegate1RFunc(*this); }\n};\n\ntemplate <typename A1, typename A2>\nclass Delegate2Func : public DelegateBase<void, void (*)(A1, A2), IDelegate2<A1, A2>>\n{\npublic:\n using Base = DelegateBase<void, void (*)(A1, A2), IDelegate2<A1, A2>>;\n using Base::Base;\n void invoke(A1 a1, A2 a2) override { return operator()(a1, a2); }\n void operator()(A1 a1, A2 a2) const\n {\n if (this->mFunctionPtr)\n return (*this->mFunctionPtr)(a1, a2);\n }\n Delegate2Func* clone(Heap* heap) const override { return new (heap) Delegate2Func(*this); }\n};\n\ntemplate <typename A1, typename A2, typename R>\nclass Delegate2RFunc : public DelegateBase<void, R (*)(A1, A2), IDelegate2R<A1, A2, R>>\n{\npublic:\n using Base = DelegateBase<void, R (*)(A1, A2), IDelegate2R<A1, A2, R>>;\n using Base::Base;\n R invoke(A1 a1, A2 a2) override { return operator()(a1, a2); }\n R operator()(A1 a1, A2 a2) const\n {\n if (this->mFunctionPtr)\n return (*this->mFunctionPtr)(a1, a2);\n return {};\n }\n Delegate2RFunc* clone(Heap* heap) const override { return new (heap) Delegate2RFunc(*this); }\n};\n\ntemplate <typename Lambda>\nclass LambdaDelegate : public IDelegate\n{\npublic:\n explicit LambdaDelegate(Lambda l) : mLambda(std::move(l)) {}\n auto invoke() override { return mLambda(); }\n auto operator()() const { return mLambda(); }\n auto clone(Heap* heap) const override { return new (heap) LambdaDelegate(*this); }\n\nprotected:\n Lambda mLambda;\n};\n\ntemplate <typename Lambda, typename R>\nclass LambdaDelegateR : public IDelegateR<R>\n{\npublic:\n explicit LambdaDelegateR(Lambda l) : mLambda(std::move(l)) {}\n auto invoke() override { return mLambda(); }\n auto operator()() const { return mLambda(); }\n auto clone(Heap* heap) const override { return new (heap) LambdaDelegateR(*this); }\n\nprotected:\n Lambda mLambda;\n};\n\ntemplate <typename Lambda, typename A1>\nclass LambdaDelegate1 : public IDelegate1<A1>\n{\npublic:\n explicit LambdaDelegate1(Lambda l) : mLambda(std::move(l)) {}\n auto invoke(A1 a1) override { return mLambda(a1); }\n auto operator()(A1 a1) const { return mLambda(a1); }\n auto clone(Heap* heap) const override { return new (heap) LambdaDelegate1(*this); }\n\nprotected:\n Lambda mLambda;\n};\n\ntemplate <typename Lambda, typename A1, typename R>\nclass LambdaDelegate1R : public IDelegate1R<A1, R>\n{\npublic:\n explicit LambdaDelegate1R(Lambda l) : mLambda(std::move(l)) {}\n auto invoke(A1 a1) override { return mLambda(a1); }\n auto operator()(A1 a1) const { return mLambda(a1); }\n auto clone(Heap* heap) const override { return new (heap) LambdaDelegate1R(*this); }\n\nprotected:\n Lambda mLambda;\n};\n\ntemplate <typename Lambda, typename A1, typename A2>\nclass LambdaDelegate2 : public IDelegate2<A1, A2>\n{\npublic:\n explicit LambdaDelegate2(Lambda l) : mLambda(std::move(l)) {}\n auto invoke(A1 a1, A2 a2) override { return mLambda(a1, a2); }\n auto operator()(A1 a1, A2 a2) const { return mLambda(a1, a2); }\n auto clone(Heap* heap) const override { return new (heap) LambdaDelegate2(*this); }\n\nprotected:\n Lambda mLambda;\n};\n\ntemplate <typename Lambda, typename A1, typename A2, typename R>\nclass LambdaDelegate2R : public IDelegate2R<A1, A2, R>\n{\npublic:\n explicit LambdaDelegate2R(Lambda l) : mLambda(std::move(l)) {}\n auto invoke(A1 a1, A2 a2) override { return mLambda(a1, a2); }\n auto operator()(A1 a1, A2 a2) const { return mLambda(a1, a2); }\n auto clone(Heap* heap) const override { return new (heap) LambdaDelegate2R(*this); }\n\nprotected:\n Lambda mLambda;\n};\n\n// To work around the lack of CTAD.\ntemplate <typename Lambda>\nstatic auto makeLambdaDelegate(Lambda&& l)\n{\n return LambdaDelegate<Lambda>(std::forward<Lambda>(l));\n}\n\ntemplate <typename Lambda>\nstatic auto makeLambdaDelegateR(Lambda&& l)\n{\n using R = std::result_of_t<Lambda()>;\n return LambdaDelegateR<Lambda, R>(std::forward<Lambda>(l));\n}\n\ntemplate <typename A1, typename Lambda>\nstatic auto makeLambdaDelegate1(Lambda&& l)\n{\n return LambdaDelegate1<Lambda, A1>(std::forward<Lambda>(l));\n}\n\ntemplate <typename A1, typename Lambda>\nstatic auto makeLambdaDelegate1R(Lambda&& l)\n{\n using R = std::result_of_t<Lambda(A1)>;\n return LambdaDelegate1R<Lambda, A1, R>(std::forward<Lambda>(l));\n}\n\ntemplate <typename A1, typename A2, typename Lambda>\nstatic auto makeLambdaDelegate2(Lambda&& l)\n{\n return LambdaDelegate2<Lambda, A1, A2>(std::forward<Lambda>(l));\n}\n\ntemplate <typename A1, typename A2, typename Lambda>\nstatic auto makeLambdaDelegate2R(Lambda&& l)\n{\n using R = std::result_of_t<Lambda(A1, A2)>;\n return LambdaDelegate2R<Lambda, A1, A2, R>(std::forward<Lambda>(l));\n}\n\nnamespace detail\n{\nclass DummyClassForDelegate\n{\n};\n\ntemplate <typename Interface, typename AnyClass, size_t StorageSize>\nclass AnyDelegateImpl\n{\npublic:\n /// Stores a dummy function.\n AnyDelegateImpl() { new (&mStorage) typename AnyClass::UnbindDummy(); }\n\n /// Stores a function.\n template <typename DelegateType>\n AnyDelegateImpl(DelegateType other)\n {\n *this = std::move(other);\n }\n\n /// Stores a function.\n template <typename DelegateType>\n AnyDelegateImpl& operator=(DelegateType other)\n {\n static_assert(std::is_trivially_destructible<DelegateType>());\n static_assert(std::is_base_of<Interface, DelegateType>());\n static_assert(sizeof(DelegateType) <= sizeof(mStorage));\n new (&mStorage) DelegateType(std::move(other));\n return *this;\n }\n\n /// Calls the stored function.\n template <typename... Args>\n auto operator()(Args&&... args)\n {\n return getDelegate()->invoke(std::forward<Args>(args)...);\n }\n\n /// Calls the stored function.\n template <typename... Args>\n auto operator()(Args&&... args) const\n {\n return getDelegate()->invoke(std::forward<Args>(args)...);\n }\n\n /// Checks if a non-dummy function is stored.\n explicit operator bool() const { return getDelegate()->isNoDummy(); }\n\n Interface* getDelegate() { return reinterpret_cast<Interface*>(&mStorage); }\n const Interface* getDelegate() const { return reinterpret_cast<const Interface*>(&mStorage); }\n\nprotected:\n using Interface_ = Interface;\n std::aligned_storage_t<StorageSize, alignof(Interface)> mStorage;\n};\n} // namespace detail\n\n/// A type-erased delegate that can store either a Delegate or a LambdaDelegate\n/// without heap allocations.\nclass AnyDelegate : public detail::AnyDelegateImpl<IDelegate, AnyDelegate,\n sizeof(Delegate<detail::DummyClassForDelegate>)>\n{\npublic:\n using Base = AnyDelegateImpl;\n\n class UnbindDummy final : public Base::Interface_\n {\n public:\n void invoke() override {}\n bool isNoDummy() const override { return false; }\n };\n using Base::Base;\n using Base::operator=;\n};\n\ntemplate <typename R>\nclass AnyDelegateR\n : public detail::AnyDelegateImpl<IDelegateR<R>, AnyDelegateR<R>,\n sizeof(DelegateR<detail::DummyClassForDelegate, R>)>\n{\npublic:\n using Base = detail::AnyDelegateImpl<IDelegateR<R>, AnyDelegateR<R>,\n sizeof(DelegateR<detail::DummyClassForDelegate, R>)>;\n\n class UnbindDummy final : public Base::Interface_\n {\n public:\n R invoke() override { return {}; }\n bool isNoDummy() const override { return false; }\n };\n using Base::Base;\n using Base::operator=;\n};\n\ntemplate <typename A1>\nclass AnyDelegate1\n : public detail::AnyDelegateImpl<IDelegate1<A1>, AnyDelegate1<A1>,\n sizeof(Delegate1<detail::DummyClassForDelegate, A1>)>\n{\npublic:\n using Base = detail::AnyDelegateImpl<IDelegate1<A1>, AnyDelegate1<A1>,\n sizeof(Delegate1<detail::DummyClassForDelegate, A1>)>;\n\n class UnbindDummy final : public Base::Interface_\n {\n public:\n void invoke(A1) override {}\n bool isNoDummy() const override { return false; }\n };\n using Base::Base;\n using Base::operator=;\n};\n\ntemplate <typename A1, typename R>\nclass AnyDelegate1R\n : public detail::AnyDelegateImpl<IDelegate1R<A1, R>, AnyDelegate1R<A1, R>,\n sizeof(Delegate1R<detail::DummyClassForDelegate, A1, R>)>\n{\npublic:\n using Base = detail::AnyDelegateImpl<IDelegate1R<A1, R>, AnyDelegate1R<A1, R>,\n sizeof(Delegate1R<detail::DummyClassForDelegate, A1, R>)>;\n\n class UnbindDummy final : public Base::Interface_\n {\n public:\n R invoke(A1) override { return {}; }\n bool isNoDummy() const override { return false; }\n };\n using Base::Base;\n using Base::operator=;\n};\n\ntemplate <typename A1, typename A2>\nclass AnyDelegate2\n : public detail::AnyDelegateImpl<IDelegate2<A1, A2>, AnyDelegate2<A1, A2>,\n sizeof(Delegate2<detail::DummyClassForDelegate, A1, A2>)>\n{\npublic:\n using Base = detail::AnyDelegateImpl<IDelegate2<A1, A2>, AnyDelegate2<A1, A2>,\n
sizeof(Delegate2<detail::DummyClassForDelegate, A1, A2>)>;\n\n class UnbindDummy final : public Base::Interface_\n {\n public:\n void invoke(A1, A2) override {}\n bool isNoDummy() const override { return false; }\n };\n using Base::Base;\n using Base::operator=;\n};\n\ntemplate <typename A1, typename A2, typename R>\nclass AnyDelegate2R\n : public detail::AnyDelegateImpl<IDelegate2R<A1, A2, R>, AnyDelegate2R<A1, A2, R>,\n sizeof(Delegate2R<detail::DummyClassForDelegate, A1, A2, R>)>\n{\npublic:\n using Base =\n detail::AnyDelegateImpl<IDelegate2R<A1, A2, R>, AnyDelegate2R<A1, A2, R>,\n sizeof(Delegate2R<detail::DummyClassForDelegate, A1, A2, R>)>;\n\n class UnbindDummy final : public Base::Interface_\n {\n public:\n R invoke(A1, A2) override { return {}; }\n bool isNoDummy() const override { return false; }\n };\n using Base::Base;\n using Base::operator=;\n};\n} // namespace sead\n# 7 \"/home/larsvi/botw/src/KingSystem/Physics/System/physRayCast.h\" 2\n# 1 \"/home/larsvi/botw/lib/sead/include/prim/seadRuntimeTypeInfo.h\" 1\n\n\n\nnamespace sead\n{\nnamespace RuntimeTypeInfo\n{\nclass Interface\n{\npublic:\n Interface() {}\n\n virtual bool isDerived(const Interface* typeInfo) const = 0;\n};\n\nclass Root : public Interface\n{\npublic:\n Root() {}\n\n bool isDerived(const Interface* typeInfo) const override { return typeInfo == this; }\n};\n\ntemplate <typename BaseType>\nclass Derive : public Interface\n{\npublic:\n Derive() {}\n\n bool isDerived(const Interface* typeInfo) const override\n {\n if (this == typeInfo)\n return true;\n\n const RuntimeTypeInfo::Interface* rootTypeInfo = BaseType::getRuntimeTypeInfoStatic();\n return rootTypeInfo->isDerived(typeInfo);\n }\n};\n\n} // namespace RuntimeTypeInfo\n\n/// Tests if the object is a DerivedType or any type that derives from (i.e. inherits) DerivedType.\ntemplate <typename DerivedType, typename Type>\ninline bool IsDerivedFrom(const Type* obj)\n{\n const RuntimeTypeInfo::Interface* typeInfo = DerivedType::getRuntimeTypeInfoStatic();\n return obj != nullptr && obj->checkDerivedRuntimeTypeInfo(typeInfo);\n}\n\n/// If the object is a DerivedType or any type that derives from (i.e. inherits) DerivedType,\n/// this returns obj casted to DerivedType* -- otherwise this returns nullptr.\n///\n/// @note This is similar to C++'s dynamic_cast or LLVM's dyn_cast but only works with types\n/// that use the sead RTTI mechanism.\ntemplate <typename DerivedType, typename Type>\ninline DerivedType* DynamicCast(Type* obj)\n{\n if (IsDerivedFrom<DerivedType, Type>(obj))\n return static_cast<DerivedType*>(obj);\n\n return nullptr;\n}\n\n} // namespace sead\n\n/// Use this macro to declare sead RTTI machinery for a base class.\n/// You must use SEAD_RTTI_OVERRIDE in all derived classes.\n/// @param CLASS The name of the class.\n# 95 \"/home/larsvi/botw/lib/sead/include/prim/seadRuntimeTypeInfo.h\"\n/// Use this macro to declare sead RTTI machinery for a derived class.\n/// @param CLASS The name of the class.\n/// @param BASE The name of the base class of CLASS.\n# 8 \"/home/larsvi/botw/src/KingSystem/Physics/System/physRayCast.h\" 2\n# 1 \"/home/larsvi/botw/lib/sead/include/thread/seadAtomic.h\" 1\n\n\n\n\n\n\nnamespace sead\n{\nstruct AtomicDirectInitTag\n{\n};\n\ntemplate <class T>\nstruct AtomicBase\n{\npublic:\n AtomicBase(T value = {}); // NOLINT(google-explicit-constructor)\n /// Directly initialises the underlying atomic with the specified value.\n /// Note that initialisation is not atomic.\n AtomicBase(AtomicDirectInitTag, T value);\n AtomicBase(const AtomicBase& rhs) { *this = rhs; }\n\n operator T() const { return load(); }\n\n AtomicBase& operator=(const AtomicBase& rhs)\n {\n store(rhs.load());\n return *this;\n }\n\n AtomicBase& operator=(T value)\n {\n store(value);\n return *this;\n }\n\n /// Load the current value, as if with memory_order_relaxed.\n T load() const;\n /// Store a new value, as if with memory_order_relaxed.\n void store(T value);\n /// Non-atomically store a new value.\n void storeNonAtomic(T value);\n /// Exchange/swap the current value, as if with memory_order_relaxed.\n /// @return the previous value\n T exchange(T value);\n /// Load the current value and if it is equal to `expected`, store `desired`\n /// as if with memory_order_relaxed.\n /// Otherwise, this sets `original` to the current value.\n /// @param expected The value expected to be found in the atomic object, and to be replaced.\n /// @param desired The new value to store in the atomic object if `expected` was found.\n /// @param original The value that was found in the atomic object if the comparison fails. May\n /// be null. Note that this is only updated when false is returned.\n /// @return true if and only if the value was modified\n bool compareExchange(T expected, T desired, T* original = nullptr);\n\nprotected:\n\n // Nintendo appears to have manually implemented atomics with volatile and platform specific\n // intrinsics (e.g. __builtin_arm_ldrex).\n // For ease of implementation and portability, we will use std::atomic and cast to volatile\n // when necessary. That is formally undefined behavior, but it should be safe because\n // sead is built with -fno-strict-aliasing and because of the following static assertions.\n std::atomic<T> mValue;\n static_assert(sizeof(mValue) == sizeof(T),\n \"std::atomic<T> and T do not have the same size; unsupported case\");\n static_assert(alignof(decltype(mValue)) == alignof(volatile T),\n \"std::atomic<T> and T do not have the same alignment; unsupported case\");\n static_assert(std::atomic<T>::is_always_lock_free,\n \"std::atomic<T>::is_always_lock_free is not true; unsupported case\");\n\n const volatile T* getValuePtr() const { return reinterpret_cast<const volatile T*>(&mValue); }\n volatile T* getValuePtr() { return reinterpret_cast<volatile T*>(&mValue); }\n\n\n};\n\ntemplate <class T>\nstruct Atomic : AtomicBase<T>\n{\n using AtomicBase<T>::AtomicBase;\n using AtomicBase<T>::operator=;\n\n T fetchAdd(T x);\n T fetchSub(T x);\n T fetchAnd(T x);\n T fetchOr(T x);\n T fetchXor(T x);\n T increment() { return fetchAdd(1); }\n T decrement() { return fetchSub(1); }\n\n bool isBitOn(unsigned int bit) const;\n /// @return whether the bit was cleared and is now set.\n bool setBitOn(unsigned int bit);\n /// @return whether the bit was set and is now cleared.\n bool setBitOff(unsigned int bit);\n\n T operator+=(T x) { return fetchAdd(x); }\n T operator-=(T x) { return fetchSub(x); }\n T operator&=(T x) { return fetchAnd(x); }\n T operator|=(T x) { return fetchOr(x); }\n T operator^=(T x) { return fetchXor(x); }\n T operator++() { return fetchAdd(1) + 1; }\n T operator++(int) { return fetchAdd(1); }\n T operator--() { return fetchSub(1) - 1; }\n T operator--(int) { return fetchSub(1); }\n};\n\n/// Specialization for pointer types.\ntemplate <class T>\nstruct Atomic<T*> : AtomicBase<T*>\n{\n using AtomicBase<T*>::AtomicBase;\n using AtomicBase<T*>::operator=;\n\n T& operator*() const { return *this->load(); }\n T* operator->() const { return this->load(); }\n};\n\n// Implementation.\n\n\ntemplate <class T>\ninline AtomicBase<T>::AtomicBase(T value)\n{\n storeNonAtomic(value);\n}\n\ntemplate <class T>\ninline AtomicBase<T>::AtomicBase(AtomicDirectInitTag, T value) : mValue(value)\n{\n}\n\ntemplate <class T>\ninline T AtomicBase<T>::load() const\n{\n\n // Using std::atomic<T>::load prevents LLVM from folding ldr+sext into ldrsw.\n return *getValuePtr();\n\n\n\n}\n\ntemplate <class T>\ninline void AtomicBase<T>::store(T value)\n{\n mValue.store(value, std::memory_order_relaxed);\n}\n\ntemplate <class T>\ninline void AtomicBase<T>::storeNonAtomic(T value)\n{\n *getValuePtr() = value;\n}\n\ntemplate <class T>\ninline T AtomicBase<T>::exchange(T value)\n{\n return mValue.exchange(value, std::memory_order_relaxed);\n}\n\ntemplate <class T>\ninline bool AtomicBase<T>::compareExchange(T expected, T desired, T* original)\n{\n\n // Unlike Clang (https://reviews.llvm.org/D13033), Nintendo's implementation does not use clrex.\n do\n {\n T value = __builtin_arm_ldrex(getValuePtr());\n if (value != expected)\n {\n if (original)\n *original = value;\n return false;\n }\n } while (__builtin_arm_strex(desired, getValuePtr()));\n return true;\n# 186 \"/home/larsvi/botw/lib/sead/include/thread/seadAtomic.h\"\n}\n\n\nnamespace detail\n{\n// To match Nintendo's implementation of atomics.\ntemplate <typename T, typename F>\ninline T atomicReadModifyWrite(volatile T* value_ptr, F op)\n{\n T value;\n do\n {\n value = __builtin_arm_ldrex(value_ptr);\n } while (__builtin_arm_strex(op(value), value_ptr));\n return value;\n}\n} // namespace detail\n\n\ntemplate <class T>\ninline T Atomic<T>::fetchAdd(T x)\n{\n\n return detail::atomicReadModifyWrite(this->getValuePtr(), [&](T val) { return val + x; });\n\n\n\n}\n\ntemplate <class T>\ninline T Atomic<T>::fetchSub(T x)\n{\n\n return detail::atomicReadModifyWrite(this->getValuePtr(), [&](T val) { return val - x; });\n\n\n\n}\n\ntemplate <class T>\ninline T Atomic<T>::fetchAnd(T x)\n{\n\n return detail::atomicReadModifyWrite(this->getValuePtr(), [&](T val) { return val & x; });\n\n\n\n}\n\ntemplate <class T>\ninline T Atomic<T>::fetchOr(T x)\n{\n\n return detail::atomicReadModifyWrite(this->getValuePtr(), [&](T val) { return val | x; });\n\n\n\n}\n\ntemplate <class T>\ninline T Atomic<T>::fetchXor(T x)\n{\n\n return detail::atomicReadModifyWrite(this->getValuePtr(), [&](T val) { return val ^ x; });\n\n\n\n}\n\ntemplate <class T>\nbool Atomic<T>::isBitOn(unsigned int bit) const\n{\n return (this->load() & (1 << bit)) != 0;\n}\n\ntemplate <class T>\nbool Atomic<T>::setBitOn(unsigned int bit)\n{\n\n const auto old = detail::atomicReadModifyWrite(this->getValuePtr(),\n
[bit](T val) { return val | (1 << bit); });\n\n\n\n return (old & (1 << bit)) == 0;\n}\n\ntemplate <class T>\nbool Atomic<T>::setBitOff(unsigned int bit)\n{\n\n const auto old = detail::atomicReadModifyWrite(this->getValuePtr(),\n [bit](T val) { return val & ~(1 << bit); });\n\n\n\n return (old & (1 << bit)) != 0;\n}\n\n\n\n} // namespace sead\n# 9 \"/home/larsvi/botw/src/KingSystem/Physics/System/physRayCast.h\" 2\n# 1 \"/home/larsvi/botw/src/KingSystem/Physics/physDefines.h\" 1\n\n\n\n# 1 \"/home/larsvi/botw/lib/sead/include/prim/seadEnum.h\" 1\n\n\n\n\n# 1 \"/home/larsvi/botw/lib/sead/include/container/seadSafeArray.h\" 1\n\n\n\n\n\n\n\nnamespace sead\n{\n/// A lightweight std::array like wrapper for a C style array.\ntemplate <typename T, s32 N>\nclass SafeArray\n{\npublic:\n T mBuffer[N];\n\n T& operator[](s32 idx)\n {\n if (u32(idx) < N)\n return mBuffer[idx];\n\n // Force __LINE__ to be an odd number that cannot be encoded as an immediate for ORR.\n // Otherwise, LLVM's register coalescer can get rid of too many register copies,\n // which messes up register allocation.\n# 44 \"/home/larsvi/botw/lib/sead/include/container/seadSafeArray.h\"\n\n do { if (false) { static_cast<void>(false); sead::system::detail::CheckFormat(\"range over [0, %d) : %d\", N, idx); } } while (0);\n return mBuffer[0];\n }\n\n const T& operator[](s32 idx) const\n {\n if (u32(idx) < N)\n return mBuffer[idx];\n\n // Force __LINE__ to be an even number that can be encoded as an immediate for ORR.\n // Otherwise, LLVM's register coalescer can fail to get rid of some register copies,\n // which messes up register allocation.\n# 59 \"/home/larsvi/botw/lib/sead/include/container/seadSafeArray.h\"\n\n do { if (false) { static_cast<void>(false); sead::system::detail::CheckFormat(\"range over [0, %d) : %d\", N, idx); } } while (0);\n return mBuffer[0];\n }\n\n T& operator()(s32 idx) { return mBuffer[idx]; }\n const T& operator()(s32 idx) const { return mBuffer[idx]; }\n\n T& front() { return mBuffer[0]; }\n const T& front() const { return mBuffer[0]; }\n T& back() { return mBuffer[N - 1]; }\n const T& back() const { return mBuffer[N - 1]; }\n\n int size() const { return N; }\n u32 getByteSize() const { return N * sizeof(T); }\n\n T* getBufferPtr() { return mBuffer; }\n const T* getBufferPtr() const { return mBuffer; }\n\n void fill(const T& value)\n {\n for (s32 i = 0; i < N; ++i)\n mBuffer[i] = value;\n }\n\n class iterator\n {\n public:\n iterator(T* buffer, s32 idx) : mBuffer(buffer), mIdx(idx) {}\n bool operator==(const iterator& rhs) const\n {\n return mBuffer == rhs.mBuffer && mIdx == rhs.mIdx;\n }\n bool operator!=(const iterator& rhs) const { return !(*this == rhs); }\n iterator& operator++()\n {\n ++mIdx;\n return *this;\n }\n iterator& operator--()\n {\n --mIdx;\n return *this;\n }\n T* operator->() const { return &mBuffer[mIdx]; }\n T& operator*() const { return mBuffer[mIdx]; }\n\n private:\n T* mBuffer;\n s32 mIdx;\n };\n\n iterator begin() { return iterator(mBuffer, 0); }\n iterator end() { return iterator(mBuffer, N); }\n\n class constIterator\n {\n public:\n constIterator(const T* buffer, s32 idx) : mBuffer(buffer), mIdx(idx) {}\n bool operator==(const constIterator& rhs) const\n {\n return mBuffer == rhs.mBuffer && mIdx == rhs.mIdx;\n }\n bool operator!=(const constIterator& rhs) const { return !(*this == rhs); }\n constIterator& operator++()\n {\n ++mIdx;\n return *this;\n }\n constIterator& operator--()\n {\n --mIdx;\n return *this;\n }\n const T* operator->() const { return &mBuffer[mIdx]; }\n const T& operator*() const { return mBuffer[mIdx]; }\n\n private:\n const T* mBuffer;\n s32 mIdx;\n };\n\n constIterator constBegin() const { return constIterator(mBuffer, 0); }\n constIterator constEnd() const { return constIterator(mBuffer, N); }\n\n constIterator begin() const { return constIterator(mBuffer, 0); }\n constIterator end() const { return constIterator(mBuffer, N); }\n};\n\n/// A lightweight std::array like wrapper for a C style array.\n/// Unlike sead::SafeArray and std::array, this performs no bounds checking whatsoever.\ntemplate <typename T, s32 N>\nclass UnsafeArray\n{\npublic:\n T mBuffer[N];\n\n T& operator[](s32 idx) { return mBuffer[idx]; }\n const T& operator[](s32 idx) const { return mBuffer[idx]; }\n\n T& operator()(s32 idx) { return mBuffer[idx]; }\n const T& operator()(s32 idx) const { return mBuffer[idx]; }\n\n T& front() { return mBuffer[0]; }\n const T& front() const { return mBuffer[0]; }\n T& back() { return mBuffer[N - 1]; }\n const T& back() const { return mBuffer[N - 1]; }\n\n int size() const { return N; }\n u32 getByteSize() const { return N * sizeof(T); }\n\n T* getBufferPtr() { return mBuffer; }\n const T* getBufferPtr() const { return mBuffer; }\n\n void fill(const T& value)\n {\n for (s32 i = 0; i < N; ++i)\n mBuffer[i] = value;\n }\n\n class iterator\n {\n public:\n iterator(T* buffer, s32 idx) : mBuffer(buffer), mIdx(idx) {}\n bool operator==(const iterator& rhs) const\n {\n return mBuffer == rhs.mBuffer && mIdx == rhs.mIdx;\n }\n bool operator!=(const iterator& rhs) const { return !(*this == rhs); }\n iterator& operator++()\n {\n ++mIdx;\n return *this;\n }\n iterator& operator--()\n {\n --mIdx;\n return *this;\n }\n T* operator->() const { return &mBuffer[mIdx]; }\n T& operator*() const { return mBuffer[mIdx]; }\n\n private:\n T* mBuffer;\n s32 mIdx;\n };\n\n iterator begin() { return iterator(mBuffer, 0); }\n iterator end() { return iterator(mBuffer, N); }\n\n class constIterator\n {\n public:\n constIterator(const T* buffer, s32 idx) : mBuffer(buffer), mIdx(idx) {}\n bool operator==(const constIterator& rhs) const\n {\n return mBuffer == rhs.mBuffer && mIdx == rhs.mIdx;\n }\n bool operator!=(const constIterator& rhs) const { return !(*this == rhs); }\n constIterator& operator++()\n {\n ++mIdx;\n return *this;\n }\n constIterator& operator--()\n {\n --mIdx;\n return *this;\n }\n const T* operator->() const { return &mBuffer[mIdx]; }\n const T& operator*() const { return mBuffer[mIdx]; }\n\n private:\n const T* mBuffer;\n s32 mIdx;\n };\n\n constIterator constBegin() const { return constIterator(mBuffer, 0); }\n constIterator constEnd() const { return constIterator(mBuffer, N); }\n\n constIterator begin() const { return constIterator(mBuffer, 0); }\n constIterator end() const { return constIterator(mBuffer, N); }\n};\n\nnamespace detail\n{\n// From https://en.cppreference.com/w/cpp/container/array/to_array\ntemplate <class T, std::size_t N, std::size_t... I>\nconstexpr SafeArray<std::remove_cv_t<T>, N> to_array_impl(T (&a)[N], std::index_sequence<I...>)\n{\n return {{a[I]...}};\n}\n\ntemplate <class T, std::size_t N, std::size_t... I>\nconstexpr SafeArray<std::remove_cv_t<T>, N> to_array_impl(T(&&a)[N], std::index_sequence<I...>)\n{\n return {{std::move(a[I])...}};\n}\n} // namespace detail\n\n// Implementation of C++20 std::to_array for sead::SafeArray.\ntemplate <class T, std::size_t N>\nconstexpr sead::SafeArray<std::remove_cv_t<T>, N> toArray(T (&a)[N])\n{\n return detail::to_array_impl(a, std::make_index_sequence<N>{});\n}\n\n// Implementation of C++20 std::to_array for sead::SafeArray.\ntemplate <class T, std::size_t N>\nconstexpr sead::SafeArray<std::remove_cv_t<T>, N> toArray(T(&&a)[N])\n{\n return detail::to_array_impl(std::move(a), std::make_index_sequence<N>{});\n}\n} // namespace sead\n# 6 \"/home/larsvi/botw/lib/sead/include/prim/seadEnum.h\" 2\n# 1 \"/home/larsvi/botw/lib/sead/include/prim/seadSafeString.h\" 1\n\n\n\n\n\n\n\nnamespace sead\n{\nclass Heap;\n\ntemplate <typename T>\nclass BufferedSafeStringBase;\n\ntemplate <typename T>\nclass SafeStringBase\n{\npublic:\n /// Iterates over every character of a string.\n /// Note that this is extremely inefficient and leads to quadratic time complexity\n /// because of the redundant calls to calcLength() in operator*.\n class iterator\n {\n public:\n explicit iterator(const SafeStringBase* string) : mString(string), mIndex(0) {}\n iterator(const SafeStringBase* string, s32 index) : mString(string), mIndex(index) {}\n bool operator==(const iterator& rhs) const\n {\n return mString == rhs.mString && mIndex == rhs.mIndex;\n }\n bool operator!=(const iterator& rhs) const { return !(rhs == *this); }\n iterator& operator++() { return mIndex++, *this; }\n iterator& operator--() { return mIndex--, *this; }\n const char& operator*() const { return mString->at(mIndex); }\n\n const SafeStringBase* getString() const { return mString; }\n s32 getIndex() const { return mIndex; }\n\n protected:\n const SafeStringBase* mString;\n s32 mIndex;\n };\n\n /// Iterates over a string as if it were split by one or several delimiter characters.\n class token_iterator : public iterator\n {\n public:\n token_iterator(const SafeStringBase* string, const SafeStringBase& delimiter)\n : iterator(string), mDelimiter(delimiter)\n {\n }\n\n token_iterator(const SafeStringBase* string, s32 index, const SafeStringBase& delimiter)\n
: iterator(string, index), mDelimiter(delimiter)\n {\n }\n\n bool operator==(const token_iterator& rhs) const\n {\n return static_cast<const iterator&>(*this) == static_cast<const iterator&>(rhs);\n }\n bool operator!=(const token_iterator& rhs) const { return !(rhs == *this); }\n\n token_iterator& operator++();\n token_iterator& operator--();\n\n s32 get(BufferedSafeStringBase<T>* out) const;\n inline s32 getAndForward(BufferedSafeStringBase<T>* out);\n s32 cutOffGet(BufferedSafeStringBase<T>* out) const;\n s32 cutOffGetAndForward(BufferedSafeStringBase<T>* out);\n\n private:\n const SafeStringBase mDelimiter;\n };\n\n SafeStringBase() : mStringTop(&cNullChar) {}\n SafeStringBase(const T* str) : mStringTop(str)\n {\n do { if (false) { static_cast<void>(str != nullptr); sead::system::detail::CheckFormat(\"str must not be nullptr.\"); } } while (0);\n }\n SafeStringBase(const SafeStringBase& other) = default;\n\n virtual ~SafeStringBase() = default;\n\n virtual SafeStringBase& operator=(const SafeStringBase& other);\n\n bool operator==(const SafeStringBase& rhs) const { return isEqual(rhs); }\n bool operator!=(const SafeStringBase& rhs) const { return !(*this == rhs); }\n\n iterator begin() const { return iterator(this, 0); }\n iterator end() const { return iterator(this, calcLength()); }\n\n token_iterator tokenBegin(const SafeStringBase& delimiter) const\n {\n return token_iterator(this, delimiter);\n }\n\n token_iterator tokenEnd(const SafeStringBase& delimiter) const\n {\n return token_iterator(this, calcLength() + 1, delimiter);\n }\n\n const T* cstr() const\n {\n assureTerminationImpl_();\n return mStringTop;\n }\n\n inline const T& at(s32 idx) const;\n inline const T& operator[](s32 idx) const { return at(idx); }\n\n inline s32 calcLength() const;\n\n inline SafeStringBase<T> getPart(s32 at) const;\n inline SafeStringBase<T> getPart(const iterator& it) const;\n inline SafeStringBase<T> getPart(const token_iterator& it) const;\n\n inline bool include(const T& c) const;\n inline bool include(const SafeStringBase<T>& str) const;\n\n bool isEqual(const SafeStringBase<T>& str) const;\n inline s32 compare(const SafeStringBase<T>& str) const { return comparen(str, cMaximumLength); }\n inline s32 comparen(const SafeStringBase<T>& str, s32 n) const;\n\n s32 findIndex(const SafeStringBase<T>& str) const;\n s32 findIndex(const SafeStringBase<T>& str, s32 start_pos) const;\n s32 rfindIndex(const SafeStringBase<T>& str) const;\n\n iterator findIterator(const SafeStringBase& str) const { return {this, findIndex(str)}; }\n iterator rfindIterator(const SafeStringBase& str) const { return {this, rfindIndex(str)}; }\n\n bool isEmpty() const;\n bool startsWith(const SafeStringBase<T>& prefix) const;\n bool endsWith(const SafeStringBase<T>& suffix) const;\n\n static const T cNullChar;\n static const T cLineBreakChar;\n static const SafeStringBase cEmptyString;\n static const s32 cMaximumLength = 0x80000;\n\nprotected:\n virtual void assureTerminationImpl_() const {}\n const T& unsafeAt_(s32 idx) const { return mStringTop[idx]; }\n\n const T* mStringTop;\n};\n\ntemplate <>\nconst SafeStringBase<char> SafeStringBase<char>::cEmptyString;\n\ntemplate <typename T>\ns32 replaceStringImpl_(T* dst, s32* length, s32 dst_size, const T* src, s32 src_size,\n const SafeStringBase<T>& old_str, const SafeStringBase<T>& new_str,\n bool* is_buffer_overflow);\n\ntemplate <typename T>\nclass BufferedSafeStringBase : public SafeStringBase<T>\n{\npublic:\n __attribute__((always_inline)) BufferedSafeStringBase(T* buffer, s32 size)\n : SafeStringBase<T>(buffer)\n {\n mBufferSize = size;\n if (size <= 0)\n {\n do { if (false) { static_cast<void>(false); sead::system::detail::CheckFormat(\"Invalied buffer size(%d).\\n\", this->getBufferSize()); } } while (0);\n this->mStringTop = nullptr;\n this->mBufferSize = 0;\n }\n else\n {\n this->assureTerminationImpl_();\n }\n }\n\n BufferedSafeStringBase(const BufferedSafeStringBase&) = default;\n ~BufferedSafeStringBase() override = default;\n\n BufferedSafeStringBase<T>& operator=(const SafeStringBase<T>& other) override;\n\n const T& operator[](s32 idx) const;\n\n T* getBuffer()\n {\n assureTerminationImpl_();\n return getMutableStringTop_();\n }\n s32 getBufferSize() const { return mBufferSize; }\n\n /// Copy up to copyLength characters to the beginning of the string, then writes NUL.\n /// @param src Source string\n /// @param copyLength Number of characters from src to copy (must not cause a buffer overflow)\n inline s32 copy(const SafeStringBase<T>& src, s32 copyLength = -1);\n /// Copy up to copyLength characters to the specified position, then writes NUL if the copy\n /// makes this string longer.\n /// @param at Start position (-1 for end of string)\n /// @param src Source string\n /// @param copyLength Number of characters from src to copy (must not cause a buffer overflow)\n inline s32 copyAt(s32 at, const SafeStringBase<T>& src, s32 copyLength = -1);\n /// Copy up to copyLength characters to the beginning of the string, then writes NUL.\n /// Silently truncates the source string if the buffer is too small.\n /// @param src Source string\n /// @param copyLength Number of characters from src to copy\n inline s32 cutOffCopy(const SafeStringBase<T>& src, s32 copyLength = -1);\n /// Copy up to copyLength characters to the specified position, then writes NUL if the copy\n /// makes this string longer.\n /// Silently truncates the source string if the buffer is too small.\n /// @param at Start position (-1 for end of string)\n /// @param src Source string\n /// @param copyLength Number of characters from src to copy\n inline s32 cutOffCopyAt(s32 at, const SafeStringBase<T>& src, s32 copyLength = -1);\n /// Copy up to copyLength characters to the specified position, then *always* writes NUL.\n /// @param at Start position (-1 for end of string)\n /// @param src Source string\n /// @param copyLength Number of characters from src to copy (must not cause a buffer overflow)\n inline s32 copyAtWithTerminate(s32 at, const SafeStringBase<T>& src, s32 copyLength = -1);\n\n s32 format(const T* format, ...);\n s32 formatV(const T* format, std::va_list args);\n s32 appendWithFormat(const T* formatStr, ...);\n s32 appendWithFormatV(const T* formatStr, std::va_list args);\n\n /// Append append_length characters from str.\n s32 append(const SafeStringBase<T>& str, s32 append_length = -1);\n /// Append a character.\n s32 append(T c) { return append(c, 1); }\n /// Append a character n times.\n s32 append(T c, s32 n);\n\n // Implementation note: These member functions appear to be inlined in most titles.\n // However, StringBuilderBase<T> conveniently duplicates the APIs and implementations of\n // SafeStringBase<T> and BufferedSafeString<T>: some assertion messages are even identical,\n // and the good news is that most StringBuilderBase<T> functions are not inlined!\n\n /// Append prepend_length characters from str.\n /// @return the new length\n s32 prepend(const SafeStringBase<T>& str, s32 prepend_length = -1);\n\n /// Remove num characters from the end of the string.\n /// @return the number of characters that were removed\n s32 chop(s32 num);\n /// Remove the last character if it is equal to c.\n /// @return the number of characters that were removed\n s32 chopMatchedChar(T c);\n /// Remove the last character if it is equal to any of the specified characters.\n /// @param characters List of characters to remove\n /// @return the number of characters that were removed\n s32 chopMatchedChar(const T* characters);\n /// Remove the last character if it is unprintable.\n /// @warning The behavior of this function is not standard: a character is considered\n /// unprintable if it is <= 0x20 or == 0x7F. In particular, the space character is unprintable.\n /// @return the number of characters that were removed\n s32 chopUnprintableAsciiChar();\n\n /// Remove trailing characters that are in the specified list.\n /// @param characters List of characters to remove\n /// @return the number of characters that were removed\n s32 rstrip(const T* characters);\n /// Remove trailing characters that are unprintable.\n /// @warning The behavior of this function is not standard: a character is considered\n /// unprintable if it is <= 0x20 or == 0x7F. In particular, the space character is unprintable.\n /// @return the number of characters that were removed\n s32 rstripUnprintableAsciiChars();\n\n /// Trim a string to only keep trimLength characters.\n /// @return the new length\n inline s32 trim(s32 trim_length);\n /// Remove the specified suffix from the string if it ends with the suffix.\n /// @return the new length\n inline s32 trimMatchedString(const SafeStringBase<T>& suffix);\n /// Remove the specified suffix from the string if it ends with the suffix.\n /// Alias of trimMatchedString.\n /// @return the new length\n inline s32 removeSuffix(const SafeStringBase<T>& suffix) { return trimMatchedString(suffix); }\n\n /// @return the number of characters that were replaced\n inline s32 replaceChar(T old_char, T new_char);\n /// @return the number of characters that were replaced\n inline s32 replaceCharList(const SafeStringBase<T>& old_chars,\n const SafeStringBase<T>& new_chars);\n /// Set the contents of this string to target_str, after replacing occurrences of old_str in\n /// target_str with new_str.\n /// @return the number of replaced occurrences\n inline s32 setReplaceString(const SafeStringBase<T>& target_str,\n const SafeStringBase<T>& old_str, const SafeStringBase<T>& new_str);\n /// Replace occurrences of old_str in this string with new_str.\n /// @return the number of replaced occurrences\n inline s32 replaceString(const SafeStringBase<T>& old_str, const SafeStringBase<T>& new_str);\n\n s32 convertFromMultiByteString(const SafeStringBase<char>& str, s32 str_length);\n s32 convertFromWideCharString(const SafeStringBase<char16>& str, s32 str_length);\n\n inline void clear() { getMutableStringTop_()[0] = this->cNullChar; }\n\nprotected:\n void assureTerminationImpl_() const override;\n\n T* getMutableStringTop_() { return const_cast<T*>(this->mStringTop); }\n\n static s32 formatImpl_(T* dst, s32 dst_size, const T* format, std::va_list arg);\n\n template <typename OtherType>\n s32 convertFromOtherType_(const SafeStringBase<OtherType>& src, s32 src_size);\n\n s32 mBufferSize;\n};\n\ntemplate <typename T, s32 L>\nclass FixedSafeStringBase : public BufferedSafeStringBase<T>\n{\npublic:\n FixedSafeStringBase() : BufferedSafeStringBase<T>(mBuffer, L) { this->clear(); }\n\n FixedSafeStringBase(const SafeStringBase<T>& str) : BufferedSafeStringBase<T>(mBuffer, L)\n {\n this->copy(str);\n }\n\n FixedSafeStringBase(const FixedSafeStringBase& str) : BufferedSafeStringBase<T>(mBuffer, L)\n {\n this->copy(str);\n }\n\n ~FixedSafeStringBase() override = default;\n\n FixedSafeStringBase& operator=(const FixedSafeStringBase& other)\n {\n this->copy(other);\n return *this;\n }\n\n FixedSafeStringBase& operator=(const SafeStringBase<T>& other) override\n {\n this->copy(other);\n return *this;\n }\n\n T mBuffer[L];\n};\n\ntypedef SafeStringBase<char> SafeString;\ntypedef SafeStringBase<char16> WSafeString;\ntypedef BufferedSafeStringBase<char> BufferedSafeString;\ntypedef BufferedSafeStringBase<char16> WBufferedSafeString;\n\ntemplate <>\ns32 BufferedSafeStringBase<char>::format(const char* formatStr, ...);\ntemplate <>\ns32 BufferedSafeStringBase<char16>::format(const char16* formatStr, ...);\ntemplate <>\ns32 BufferedSafeStringBase<char>::formatV(const char* formatStr, va_list args);\ntemplate <>\ns32 BufferedSafeStringBase<char16>::formatV(const char16* formatStr, va_list args);\ntemplate <>\ns32 BufferedSafeStringBase<char>::appendWithFormat(const char* formatStr, ...);\ntemplate <>\ns32 BufferedSafeStringBase<char16>::appendWithFormat(const char16* formatStr, ...);\ntemplate <>\ns32 BufferedSafeStringBase<char>::appendWithFormatV(const char* formatStr, va_list args);\ntemplate <>\ns32 BufferedSafeStringBase<char16>::appendWithFormatV(const char16* formatStr, va_list args);\n\ntemplate <s32 L>\nclass FixedSafeString : public FixedSafeStringBase<char, L>\n{\npublic:\n FixedSafeString() : FixedSafeStringBase<char, L>() {}\n FixedSafeString(const SafeString& str) : FixedSafeStringBase<char, L>(str) {}\n FixedSafeString(const FixedSafeString& other)\n : FixedSafeString(static_cast<const SafeString&>(other))\n {\n }\n\n FixedSafeString& operator=(const FixedSafeString& other)\n {\n this->copy(other);\n return *this;\n }\n\n FixedSafeString<L>& operator=(const SafeStringBase<char>& other) override\n {\n this->copy(other);\n return *this;\n }\n};\n\ntemplate <s32 L>\nclass WFixedSafeString : public FixedSafeStringBase<char16, L>\n{\npublic:\n WFixedSafeString() : FixedSafeStringBase<char16, L>() {}\n\n WFixedSafeString(const WSafeString& str) : FixedSafeStringBase<char16, L>(str) {}\n};\n\ntemplate <s32 L>\nclass FormatFixedSafeString : public FixedSafeString<L>\n{\npublic:\n FormatFixedSafeString() : FormatFixedSafeString(\"\") {}\n\n\n [[gnu::format(printf, 2, 3)]]\n\n explicit FormatFixedSafeString(const char* format, ...)\n : FixedSafeString<L>()\n {\n std::va_list args;\n __builtin_va_start(args, format);\n this->formatV(format, args);\n __builtin_va_end(args);\n }\n ~FormatFixedSafeString() override = default;\n};\n\ntemplate <s32 L>\nclass WFormatFixedSafeString : public WFixedSafeString<L>\n{\npublic:\n explicit WFormatFixedSafeString(const char16* format, ...)\n {\n std::va_list args;\n __builtin_va_start(args, format);\n this->formatV(format, args);\n __builtin_va_end(args);\n }\n ~WFormatFixedSafeString() override = default;\n};\n\ntemplate <typename T>\nclass HeapSafeStringBase : public BufferedSafeStringBase<T>\n{\npublic:\n HeapSafeStringBase(Heap* heap, const SafeStringBase<T>& string, s32 alignment = sizeof(void*))\n : BufferedSafeStringBase<T>(new (heap, alignment) T[string.calcLength() + 1](),\n string.calcLength() + 1)\n {\n this->copy(string);\n }\n\n HeapSafeStringBase(const HeapSafeStringBase&) = delete;\n HeapSafeStringBase& operator=(const HeapSafeStringBase&) = delete;\n\n HeapSafeStringBase(HeapSafeStringBase&& other) noexcept\n {\n this->mStringTop = other.mStringTop;\n other.mStringTop = nullptr;\n }\n HeapSafeStringBase& operator=(HeapSafeStringBase&& other) noexcept\n {\n this->mStringTop = other.mStringTop;\n other.mStringTop = nullptr;\n return *this;\n }\n\n ~HeapSafeStringBase() override\n {\n if (this->mStringTop)\n delete[] this->mStringTop;\n }\n\n HeapSafeStringBase<T>& operator=(const SafeStringBase<T>& other) override;\n};\n\nusing HeapSafeString = HeapSafeStringBase<char>;\nusing WHeapSafeString = HeapSafeStringBase<char16>;\n\ninline bool operator<(const SafeString& lhs, const SafeString& rhs)\n{\n return lhs.compare(rhs) < 0;\n}\n\ninline bool operator>(const SafeString& lhs, const SafeString& rhs)\n{\n return lhs.compare(rhs) > 0;\n}\n\ninline bool operator<=(const SafeString& lhs, const SafeString& rhs)\n{\n return lhs.compare(rhs) <= 0;\n}\n\ninline bool operator>=(const SafeString& lhs, const SafeString& rhs)\n{\n return lhs.compare(rhs) >= 0;\n}\n\n} // namespace sead\n\n\n\n# 1 \"/home/larsvi/botw/lib/sead/include/prim/seadSafeString.hpp\" 1\n# 11 \"/home/larsvi/botw/lib/sead/include/prim/seadSafeString.hpp\"\nnamespace sead\n{\ntemplate <typename T>\ninline typename SafeStringBase<T>::token_iterator& SafeStringBase<T>::token_iterator::operator++()\n{\n s32 index = this->mIndex;\n const s32 length = this->mString->calcLength();\n if (0 <= index && index <= length)\n {\n while (true)\n {\n do { if (false) static_cast<void>(0 <= index && index <= length); } while (0);\n if (this->mString->unsafeAt_(index) == cNullChar)\n break;\n if (mDelimiter.include(this->mString->unsafeAt_(index)))\n break;\n ++index;\n }\n\n this->mIndex = index + 1;\n }\n else\n {\n do { if (false) { static_cast<void>(false); sead::system::detail::CheckFormat(\"index(%d) out of range [0, %d].\\n\", index, length); } } while (0);\n }\n return *this;\n}\n\ntemplate <typename T>\ninline typename SafeStringBase<T>::token_iterator& SafeStringBase<T>::token_iterator::operator--()\n{\n s32 index = this->mIndex;\n const s32 length = this->mString->calcLength();\n\n if (index == 0)\n return *this;\n\n if (index == 1)\n {\n this->mIndex = 0;\n return *this;\n }\n\n if (0 <= index && index <= length + 1)\n {\n index -= 2;\n s32 j;\n while (true)\n {\n j = index;\n do { if (false) static_cast<void>(0 <= index && index <= length); } while (0);\n if (this->mString->unsafeAt_(index) == cNullChar)\n break;\n if (mDelimiter.include(this->mString->unsafeAt_(index)))\n break;\n --index;\n if (j == 0)\n {\n j = index;\n break;\n }\n }\n\n this->mIndex = j + 1;\n }\n else\n {\n do { if (false) { static_cast<void>(false); sead::system::detail::CheckFormat(\"index(%d) out of range [0, %d].\\n\", index, length + 1); } } while (0);\n }\n return *this;\n}\n\ntemplate <typename T>\ninline s32 SafeStringBase<T>::token_iterator::get(BufferedSafeStringBase<T>* out) const\n{\n token_iterator it = *this;\n ++it;\n const s32 part_length = it.getIndex() - this->getIndex() - 1;\n\n const SafeStringBase<T> part = this->mString->getPart(*this);\n return out->copy(part, part_length);\n}\n\ntemplate <typename T>\ninline s32 SafeStringBase<T>::token_iterator::getAndForward(BufferedSafeStringBase<T>* out)\n{\n s32 index = this->mIndex;\n const s32 length = this->mString->calcLength();\n if (index < 0 || index > length)\n {\n do { if (false) { static_cast<void>(false); sead::system::detail::CheckFormat(\"index(%d) out of range [0, %d].\\n\", index, length); } } while (0);\n return 0;\n }\n\n T* outc = out->getBuffer();\n const s32 out_max_length = out->getBufferSize() - 1;\n\n s32 i = 0;\n while (true)\n {\n do { if (false) static_cast<void>(0 <= index && index <= length); } while (0);\n if (out_max_length < i)\n {\n
do { if (false) { static_cast<void>(false); sead::system::detail::CheckFormat(\"token str exceeds out buffer length[%d]\", out_max_length); } } while (0);\n return 0;\n }\n\n const T& c = this->mString->unsafeAt_(index);\n if (c == cNullChar || mDelimiter.include(c))\n break;\n\n outc[i] = c;\n ++i;\n ++index;\n }\n\n outc[i] = cNullChar;\n this->mIndex = index + 1;\n return i;\n}\n\ntemplate <typename T>\ninline s32 SafeStringBase<T>::token_iterator::cutOffGet(BufferedSafeStringBase<T>* out) const\n{\n token_iterator it = *this;\n ++it;\n const s32 part_length = it.getIndex() - this->getIndex() - 1;\n\n const SafeStringBase<T> part = this->mString->getPart(this->getIndex());\n return out->cutOffCopy(part, part_length);\n}\n\ntemplate <typename T>\ninline s32 SafeStringBase<T>::token_iterator::cutOffGetAndForward(BufferedSafeStringBase<T>* out)\n{\n s32 index = this->mIndex;\n const s32 length = this->mString->calcLength();\n if (index < 0 || index > length)\n {\n do { if (false) { static_cast<void>(false); sead::system::detail::CheckFormat(\"index(%d) out of range [0, %d].\\n\", index, length); } } while (0);\n return 0;\n }\n\n T* outc = out->getBuffer();\n const s32 out_max_length = out->getBufferSize() - 1;\n\n s32 i = 0;\n while (true)\n {\n do { if (false) static_cast<void>(0 <= index && index <= length); } while (0);\n\n const T& c = this->mString->unsafeAt_(index);\n if (c == cNullChar || mDelimiter.include(c))\n break;\n\n if (i < out_max_length)\n outc[i++] = c;\n ++index;\n }\n\n do { if (false) static_cast<void>(i <= out_max_length); } while (0);\n outc[i] = cNullChar;\n this->mIndex = index + 1;\n return i;\n}\n\ntemplate <typename T>\ninline const T& SafeStringBase<T>::at(s32 idx) const\n{\n const int length = calcLength();\n if (idx < 0 || idx > length)\n {\n do { if (false) { static_cast<void>(false); sead::system::detail::CheckFormat(\"index(%d) out of range[0, %d]\", idx, length); } } while (0);\n return cNullChar;\n }\n return mStringTop[idx];\n}\n\ntemplate <typename T>\ninline SafeStringBase<T> SafeStringBase<T>::getPart(s32 at) const\n{\n s32 len = calcLength();\n if (at < 0 || at > len)\n {\n do { if (false) { static_cast<void>(false); sead::system::detail::CheckFormat(\"index(%d) out of range[0, %d]\", at, len); } } while (0);\n return SafeStringBase<T>::cEmptyString;\n }\n\n return SafeStringBase<T>(mStringTop + at);\n}\n\ntemplate <typename T>\ninline SafeStringBase<T> SafeStringBase<T>::getPart(const SafeStringBase::iterator& it) const\n{\n return getPart(it.getIndex());\n}\n\ntemplate <typename T>\ninline SafeStringBase<T> SafeStringBase<T>::getPart(const SafeStringBase::token_iterator& it) const\n{\n return getPart(it.getIndex());\n}\n\ntemplate <typename T>\ninline s32 SafeStringBase<T>::calcLength() const\n{\n do { if (false) static_cast<void>(mStringTop); } while (0);\n assureTerminationImpl_();\n s32 length = 0;\n\n for (;;)\n {\n if (length > cMaximumLength || mStringTop[length] == cNullChar)\n break;\n\n length++;\n }\n\n if (length > cMaximumLength)\n {\n do { if (false) { static_cast<void>(false); sead::system::detail::CheckFormat(\"too long string\"); } } while (0);\n return 0;\n }\n\n return length;\n}\n\ntemplate <typename T>\ninline bool SafeStringBase<T>::include(const T& c) const\n{\n assureTerminationImpl_();\n for (s32 i = 0; i <= cMaximumLength; ++i)\n {\n if (unsafeAt_(i) == cNullChar)\n
break;\n if (unsafeAt_(i) == c)\n return true;\n }\n return false;\n}\n\ntemplate <typename T>\ninline bool SafeStringBase<T>::include(const SafeStringBase<T>& str) const\n{\n return findIndex(str) != -1;\n}\n\ntemplate <typename T>\ninline bool SafeStringBase<T>::isEqual(const SafeStringBase<T>& str) const\n{\n assureTerminationImpl_();\n if (cstr() == str.cstr())\n return true;\n\n for (s32 i = 0; i <= cMaximumLength; i++)\n {\n if (unsafeAt_(i) != str.unsafeAt_(i))\n return false;\n\n if (unsafeAt_(i) == cNullChar)\n return true;\n }\n\n do { if (false) { static_cast<void>(false); sead::system::detail::CheckFormat(\"too long string\\n\"); } } while (0);\n return false;\n}\n\ntemplate <typename T>\ninline s32 SafeStringBase<T>::comparen(const SafeStringBase<T>& str, s32 n) const\n{\n assureTerminationImpl_();\n const char* top = cstr();\n if (top == str.cstr())\n return 0;\n\n if (n > cMaximumLength)\n {\n do { if (false) { static_cast<void>(false); sead::system::detail::CheckFormat(\"paramater(%d) out of bounds [0, %d]\", n, cMaximumLength); } } while (0);\n n = cMaximumLength;\n }\n\n for (s32 i = 0; i < n; ++i)\n {\n const s32 cmp = unsafeAt_(i) - str.unsafeAt_(i);\n\n if (cmp != 0)\n return cmp < 0 ? -1 : 1;\n\n if (unsafeAt_(i) == cNullChar)\n return 0;\n }\n\n return 0;\n}\n\ntemplate <typename T>\ninline s32 SafeStringBase<T>::findIndex(const SafeStringBase<T>& str) const\n{\n const s32 len = calcLength();\n const s32 sub_str_len = str.calcLength();\n\n for (s32 i = 0; i <= len - sub_str_len; ++i)\n {\n if (SafeStringBase<T>(&mStringTop[i]).comparen(str, sub_str_len) == 0)\n return i;\n }\n return -1;\n}\n\ntemplate <typename T>\ninline s32 SafeStringBase<T>::findIndex(const SafeStringBase<T>& str, s32 start_pos) const\n{\n const s32 len = calcLength();\n\n if (start_pos < 0 || start_pos > len)\n {\n do { if (false) { static_cast<void>(false); sead::system::detail::CheckFormat(\"start_pos(%d) out of range[0, %d]\", start_pos, len); } } while (0);\n return -1;\n }\n\n const s32 sub_str_len = str.calcLength();\n\n for (s32 i = start_pos; i <= len - sub_str_len; ++i)\n {\n if (SafeStringBase<T>(&mStringTop[i]).comparen(str, sub_str_len) == 0)\n return i;\n }\n return -1;\n}\n\ntemplate <typename T>\ninline s32 SafeStringBase<T>::rfindIndex(const SafeStringBase<T>& str) const\n{\n const s32 len = calcLength();\n const s32 sub_str_len = str.calcLength();\n\n for (s32 i = len - sub_str_len; i >= 0; --i)\n {\n if (SafeStringBase<T>(&mStringTop[i]).comparen(str, sub_str_len) == 0)\n return i;\n }\n return -1;\n}\n\ntemplate <typename T>\ninline bool SafeStringBase<T>::isEmpty() const\n{\n return unsafeAt_(0) == cNullChar;\n}\n\ntemplate <typename T>\ninline bool SafeStringBase<T>::startsWith(const SafeStringBase<T>& prefix) const\n{\n const T* strc = mStringTop;\n const T* prefixc = prefix.mStringTop;\n s32 i = 0;\n while (prefixc[i] != cNullChar)\n {\n if (strc[i] != prefixc[i])\n return false;\n ++i;\n }\n return true;\n}\n\ntemplate <typename T>\ninline bool SafeStringBase<T>::endsWith(const SafeStringBase<T>& suffix) const\n{\n const s32 sub_str_len = suffix.calcLength();\n if (sub_str_len == 0)\n return true;\n\n const T* strc = mStringTop;\n const T* suffixc = suffix.mStringTop;\n\n const s32 len = calcLength();\n if (len < sub_str_len)\n return false;\n\n for (s32 i = 0; i < sub_str_len; ++i)\n {\n if (strc[len - sub_str_len + i] != suffixc[i])\n return false;\n }\n return true;\n}\n\ntemplate <typename T>\ninline const T& BufferedSafeStringBase<T>::operator[](s32 idx) const\n{\n if (idx >= 0 && idx < this->mBufferSize)\n return this->mStringTop[idx];\n\n do { if (false) { static_cast<void>(false); sead::system::detail::CheckFormat(\"index(%d) out of range[0, %d]\", idx, this->mBufferSize - 1); } } while (0);\n return this->cNullChar;\n}\n\ntemplate <typename T>\ninline s32 BufferedSafeStringBase<T>::copy(const SafeStringBase<T>& src, s32 copyLength)\n{\n T* dst = getMutableStringTop_();\n const T* csrc = src.cstr();\n if (dst == csrc)\n return 0;\n\n if (copyLength < 0)\n copyLength = src.calcLength();\n\n if (copyLength >= mBufferSize)\n {\n do { if (false) { static_cast<void>(false); sead::system::detail::CheckFormat(\"Buffer overflow. (Buffer Size: %d, Copy Size: %d)\", mBufferSize, copyLength); } } while (0);\n\n copyLength = mBufferSize - 1;\n }\n\n MemUtil::copy(dst, csrc, copyLength * sizeof(T));\n dst[copyLength] = SafeStringBase<T>::cNullChar;\n\n return copyLength;\n}\n\ntemplate <typename T>\ninline s32 BufferedSafeStringBase<T>::copyAt(s32 at, const SafeStringBase<T>& src, s32 copyLength)\n{\n T* dst = getMutableStringTop_();\n s32 len = this->calcLength();\n\n if (at < 0)\n {\n at = len + at + 1;\n if (at < 0)\n {\n do { if (false) { static_cast<void>(false); sead::system::detail::CheckFormat(\"at(%d) out of range[0, %d]\", at, len); } } while (0);\n at = 0;\n }\n }\n\n if (copyLength < 0)\n copyLength = src.calcLength();\n\n if (copyLength >= mBufferSize - at)\n {\n do { if (false) { static_cast<void>(false); sead::system::detail::CheckFormat(\"Buffer overflow. (Buffer Size: %d, At: %d, Copy Length: %d)\", mBufferSize, at, copyLength); } } while (0);\n\n copyLength = mBufferSize - at - 1;\n }\n\n if (copyLength <= 0)\n return 0;\n\n MemUtil::copy(dst + at, src.cstr(), copyLength * sizeof(T));\n if (at + copyLength > len)\n dst[at + copyLength] = SafeStringBase<T>::cNullChar;\n\n return copyLength;\n}\n\ntemplate <typename T>\ninline s32 BufferedSafeStringBase<T>::cutOffCopy(const SafeStringBase<T>& src, s32 copyLength)\n{\n T* dst = getMutableStringTop_();\n const T* csrc = src.cstr();\n if (dst == csrc)\n return 0;\n\n if (copyLength < 0)\n copyLength = src.calcLength();\n\n if (copyLength >= mBufferSize)\n copyLength = mBufferSize - 1;\n\n MemUtil::copy(dst, csrc, copyLength * sizeof(T));\n dst[copyLength] = SafeStringBase<T>::cNullChar;\n\n return copyLength;\n}\n\ntemplate <typename T>\ninline s32 BufferedSafeStringBase<T>::cutOffCopyAt(s32 at, const SafeStringBase<T>& src,\n s32 copyLength)\n{\n T* dst = getMutableStringTop_();\n s32 len = this->calcLength();\n\n if (at < 0)\n {\n at = len + at + 1;\n if (at < 0)\n at = 0;\n }\n\n if (copyLength < 0)\n copyLength = src.calcLength();\n\n if (copyLength >= mBufferSize - at)\n copyLength = mBufferSize - at - 1;\n\n if (copyLength <= 0)\n return 0;\n\n MemUtil::copy(dst + at, src.cstr(), copyLength * sizeof(T));\n if (at + copyLength > len)\n dst[at + copyLength] = SafeStringBase<T>::cNullChar;\n\n return copyLength;\n}\n\ntemplate <typename T>\ninline s32 BufferedSafeStringBase<T>::copyAtWithTerminate(s32 at, const SafeStringBase<T>& src,\n s32 copyLength)\n{\n T* dst = getMutableStringTop_();\n\n if (at < 0)\n {\n const s32 len = this->calcLength();\n at = len + at + 1;\n if (at < 0)\n {\n do { if (false) { static_cast<void>(false); sead::system::detail::CheckFormat(\"at(%d) out of range[0, %d]\", at, len); } } while (0);\n at = 0;\n }\n }\n\n if (copyLength < 0)\n copyLength = src.calcLength();\n\n if (copyLength >= mBufferSize - at)\n {\n do { if (false) { static_cast<void>(false); sead::system::detail::CheckFormat(\"Buffer overflow. (Buffer Size: %d, At: %d, Copy Length: %d)\", mBufferSize, at, copyLength); } } while (0);\n\n copyLength = mBufferSize - at - 1;\n }\n\n if (copyLength <= 0)\n return 0;\n\n MemUtil::copy(dst + at, src.cstr(), copyLength * sizeof(T));\n dst[at + copyLength] = SafeStringBase<T>::cNullChar;\n\n return copyLength;\n}\n\ntemplate <typename T>\ninline s32 BufferedSafeStringBase<T>::append(const SafeStringBase<T>& str, s32 append_length)\n{\n return copyAt(-1, str, append_length);\n}\n\ntemplate <typename T>\ninline s32 BufferedSafeStringBase<T>::append(T c, s32 num)\n{\n if (num < 0)\n {\n do { if (false) { static_cast<void>(false); sead::system::detail::CheckFormat(\"append error. num < 0, num = %d\", num); } } while (0);\n return 0;\n }\n\n if (num < 1)\n return 0;\n\n const s32 length = this->calcLength();\n\n if (getBufferSize() - length <= num)\n {\n do { if (false) { static_cast<void>(false); sead::system::detail::CheckFormat(\"Buffer overflow. (Buffer Size: %d, Length: %d, Num: %d)\", getBufferSize(), length, num); } } while (0);\n\n num = getBufferSize() - length - 1;\n }\n\n T* top = getMutableStringTop_();\n for (s32 i = 0; i < num; ++i)\n top[length + i] = c;\n\n top[num + length] = this->cNullChar;\n return num;\n}\n\ntemplate <typename T>\ns32 BufferedSafeStringBase<T>::prepend(const SafeStringBase<T>& str, s32 prepend_length)\n{\n if (prepend_length == -1)\n prepend_length = str.calcLength();\n\n s32 length = this->calcLength();\n T* buffer = getMutableStringTop_();\n const s32 buffer_size = mBufferSize;\n\n if (prepend_length >= buffer_size - length)\n {\n do { if (false) { static_cast<void>(false); sead::system::detail::CheckFormat(\"Buffer overflow. (Buffer Size: %d, Length: %d, Prepend Length: %d)\", buffer_size, length, prepend_length); } } while (0);\n\n if (prepend_length >= buffer_size)\n prepend_length = buffer_size - 1;\n length = buffer_size + (-prepend_length - 1);\n }\n\n MemUtil::copyOverlap(&buffer[prepend_length], buffer, length * sizeof(T));\n MemUtil::copy(buffer, str.cstr(), prepend_length * sizeof(T));\n buffer[length + prepend_length] = SafeStringBase<T>::cNullChar;\n return length + prepend_length;\n}\n\n// UNCHECKED\ntemplate <typename T>\ninline s32 BufferedSafeStringBase<T>::chop(s32 chop_num)\n{\n s32 length = this->calcLength();\n T* buffer = getMutableStringTop_();\n const auto fail = [=] {\n do { if (false) { static_cast<void>(false); sead::system::detail::CheckFormat(\"chop_num(%d) out of range[0, %d]\", chop_num, length); } } while (0);\n };\n\n if (chop_num < 0)\n {\n fail();\n return 0;\n }\n\n if (chop_num > length)\n {\n fail();\n chop_num = length;\n }\n\n const s32 new_length = length - chop_num;\n buffer[new_length] = SafeStringBase<T>::cNullChar;\n return chop_num;\n}\n\n// UNCHECKED\ntemplate <typename T>\ninline s32 BufferedSafeStringBase<T>::chopMatchedChar(T c)\n{\n const s32 length = this->calcLength();\n if (length < 1)\n return 0;\n\n const s32 new_length = length - 1;\n T* buffer = getMutableStringTop_();\n if (buffer[new_length] == c)\n {\n buffer[new_length] = SafeStringBase<T>::cNullChar;\n return 1;\n }\n\n return 0;\n}\n\n// UNCHECKED\ntemplate <typename T>\ninline s32 BufferedSafeStringBase<T>::chopMatchedChar(const T* characters)\n{\n const s32 length = this->calcLength();\n if (length < 1)\n return 0;\n\n T* buffer = getMutableStringTop_();\n for (const T* it = characters; *it; ++it)\n {\n if (buffer[length - 1] == *it)\n {\n buffer[length - 1] = SafeStringBase<T>::cNullChar;\n return 1;\n }\n }\n\n return 0;\n}\n\n// UNCHECKED\ntemplate <typename T>\ninline s32 BufferedSafeStringBase<T>::chopUnprintableAsciiChar()\n{\n const s32 length = this->calcLength();\n if (length < 1)\n return 0;\n\n T* buffer = getMutableStringTop_();\n if (buffer[length - 1] <= ' ' || buffer[length - 1] == 0x7F)\n {\n buffer[length - 1] = this->cNullChar;\n return 1;\n }\n\n return 0;\n}\n\n// UNCHECKED\ntemplate <typename T>\ninline s32 BufferedSafeStringBase<T>::rstrip(const T* characters)\n{\n const s32 length = this->calcLength();\n if (length <= 0)\n return 0;\n\n T* buffer = getMutableStringTop_();\n s32 new_length = length;\n const auto should_strip = [characters, buffer](s32 idx) {\n for (auto it = characters; *it; ++it)\n {\n if (buffer[idx] == *it)\n return true;\n }\n return false;\n };\n while (new_length >= 1 && should_strip(new_length - 1))\n --new_length;\n\n if (length <= new_length)\n return 0;\n\n buffer[new_length] = SafeStringBase<T>::cNullChar;\n return length - new_length;\n}\n\n// UNCHECKED\ntemplate <typename T>\ninline s32 BufferedSafeStringBase<T>::rstripUnprintableAsciiChars()\n{\n const s32 length = this->calcLength();\n if (length < 1)\n return 0;\n\n T* buffer = getMutableStringTop_();\n s32 new_length = length;\n while (new_length && (buffer[new_length - 1] <= 0x20 || buffer[new_length - 1] == 0x7F))\n --new_length;\n\n if (length <= new_length)\n return 0;\n\n buffer[new_length] = this->cNullChar;\n return length - new_length;\n}\n\ntemplate <typename T>\ninline s32 BufferedSafeStringBase<T>::trim(s32 trim_length)\n{\n T* mutableString = getMutableStringTop_();\n\n if (trim_length >= mBufferSize)\n {\n do { if (false) { static_cast<void>(false); sead::system::detail::CheckFormat(\"trim_length(%d) out of bounds. [0, %d)\", trim_length, mBufferSize); } } while (0);\n return this->calcLength();\n }\n\n if (trim_length < 0)\n {\n do { if (false) { static_cast<void>(false); sead::system::detail::CheckFormat(\"trim_length(%d) out of bounds. [0, %d)\", trim_length, mBufferSize); } } while (0);\n trim_length = 0;\n }\n\n mutableString[trim_length] = SafeStringBase<T>::cNullChar;\n return trim_length;\n}\n\ntemplate <typename T>\ninline s32 calcStrLength_(const T* str)\n{\n s32 len = 0;\n while (str[len])\n ++len;\n return len;\n}\n\ntemplate <typename T>\ninline s32 BufferedSafeStringBase<T>::trimMatchedString(const SafeStringBase<T>& suffix)\n{\n const s32 length = this->calcLength();\n T* buffer = getMutableStringTop_();\n\n const s32 suffix_length = suffix.calcLength();\n const s32 new_length = length - suffix_length;\n\n if (length < suffix_length)\n return length;\n\n if (SafeStringBase<T>(&buffer[new_length]).comparen(suffix, suffix_length) != 0)\n return length;\n\n buffer[new_length] = SafeStringBase<T>::cNullChar;\n return new_length;\n}\n\n// UNCHECKED\ntemplate <typename T>\ninline s32 BufferedSafeStringBase<T>::replaceChar(T old_char, T new_char)\n{\n const s32 length = this->calcLength();\n T* buffer = getMutableStringTop_();\n\n s32 replaced_count = 0;\n for (s32 i = 0; i < length; ++i)\n {\n if (buffer[i] == old_char)\n {\n ++replaced_count;\n buffer[i] = new_char;\n }\n }\n return replaced_count;\n}\n\ntemplate <typename T>\ninline s32 BufferedSafeStringBase<T>::replaceCharList(const SafeStringBase<T>& old_chars,\n
const SafeStringBase<T>& new_chars)\n{\n const s32 length = this->calcLength();\n T* buffer = getMutableStringTop_();\n\n s32 old_chars_len = old_chars.calcLength();\n const s32 new_chars_len = new_chars.calcLength();\n\n if (old_chars_len != new_chars_len)\n {\n // yes, this is undefined behavior for T = char16. Nintendo, fix your code\n do { if (false) { static_cast<void>(false); sead::system::detail::CheckFormat(\"old_chars(%s).length is not equal to new_chars(%s).length.\", old_chars.cstr(), new_chars.cstr()); } } while (0);\n\n if (old_chars_len > new_chars_len)\n old_chars_len = new_chars_len;\n }\n\n const T* old_chars_c = old_chars.cstr();\n const T* new_chars_c = new_chars.cstr();\n\n s32 replaced_count = 0;\n for (s32 i = 0; i < length; ++i)\n {\n for (s32 character_idx = 0; character_idx < old_chars_len; ++character_idx)\n {\n if (buffer[i] == old_chars_c[character_idx])\n
{\n ++replaced_count;\n buffer[i] = new_chars_c[character_idx];\n break;\n }\n }\n }\n return replaced_count;\n}\n\ntemplate <typename T>\ninline s32 BufferedSafeStringBase<T>::setReplaceString(const SafeStringBase<T>& target_str,\n const SafeStringBase<T>& old_str,\n
const SafeStringBase<T>& new_str)\n{\n bool is_buffer_overflow = false;\n const s32 ret =\n replaceStringImpl_(getMutableStringTop_(), nullptr, getBufferSize(), target_str.cstr(),\n target_str.calcLength(), old_str, new_str, &is_buffer_overflow);\n do { if (false) { static_cast<void>(!is_buffer_overflow); sead::system::detail::CheckFormat(\"Buffer overflow! (%s : s/%s/%s/g, Buffer Size: %d )\", target_str.cstr(), old_str.cstr(), new_str.cstr(), getBufferSize()); } } while (0);\n\n return ret;\n}\n\ntemplate <typename T>\ninline s32 BufferedSafeStringBase<T>::replaceString(const SafeStringBase<T>& old_str,\n const SafeStringBase<T>& new_str)\n{\n bool is_buffer_overflow = false;\n const s32 ret =\n replaceStringImpl_(getMutableStringTop_(), nullptr, getBufferSize(), this->cstr(),\n this->calcLength(), old_str, new_str, &is_buffer_overflow);\n do { if (false) { static_cast<void>(!is_buffer_overflow); sead::system::detail::CheckFormat(\"Buffer overflow! (%s(replacing) : s/%s/%s/g, Buffer Size: %d )\", this->cstr(), old_str.cstr(), new_str.cstr(), getBufferSize()); } } while (0);\n\n\n return ret;\n}\n\ntemplate <typename T>\ntemplate <typename OtherType>\ninline s32 BufferedSafeStringBase<T>::convertFromOtherType_(const SafeStringBase<OtherType>& src,\n
s32 src_size)\n{\n s32 copy_size = src.calcLength();\n\n if (src_size != -1)\n {\n if (src_size < 0)\n {\n do { if (false) { static_cast<void>(false); sead::system::detail::CheckFormat(\"src_size(%d) out of bounds [%d,%d]\", src_size, 0, copy_size); } } while (0);\n copy_size = 0;\n return copy_size;\n }\n if (copy_size < src_size)\n do { if (false) { static_cast<void>(false); sead::system::detail::CheckFormat(\"src_size(%d) out of bounds [%d,%d]\", src_size, 0, copy_size); } } while (0);\n else\n copy_size = src_size;\n }\n\n if (getBufferSize() <= copy_size)\n {\n do { if (false) { static_cast<void>(false); sead::system::detail::CheckFormat(\"copy_size(%d) out of bounds[%d, %d)\", copy_size, 0, getBufferSize()); } } while (0);\n\n copy_size = getBufferSize() - 1;\n }\n\n T* raw_dst = getMutableStringTop_();\n const OtherType* raw_src = src.cstr();\n\n for (s32 i = 0; i < copy_size; ++i)\n raw_dst[i] = raw_src[i];\n\n raw_dst[copy_size] = this->cNullChar;\n return copy_size;\n}\n\ntemplate <typename T>\ninline s32 BufferedSafeStringBase<T>::convertFromMultiByteString(const SafeStringBase<char>& str,\n s32 str_length)\n{\n if constexpr (std::is_same<char, T>())\n return copy(str, str_length);\n else\n return convertFromOtherType_(str, str_length);\n}\n\ntemplate <typename T>\ninline s32 BufferedSafeStringBase<T>::convertFromWideCharString(const SafeStringBase<char16>& str,\n s32 str_length)\n{\n if constexpr (std::is_same<char16, T>())\n return copy(str, str_length);\n else\n return convertFromOtherType_(str, str_length);\n}\n\n} // namespace sead\n# 492 \"/home/larsvi/botw/lib/sead/include/prim/seadSafeString.h\" 2\n# 7 \"/home/larsvi/botw/lib/sead/include/prim/seadEnum.h\" 2\n# 1 \"/home/larsvi/botw/lib/sead/include/prim/seadScopedLock.h\" 1\n\n\n\n\nnamespace sead\n{\ntemplate <typename T>\nclass ScopedLock\n{\npublic:\n explicit ScopedLock(T* lock) : mLocked(lock) { mLocked->lock(); }\n\n ScopedLock(const ScopedLock& other) = delete;\n ScopedLock& operator=(const ScopedLock& other) = delete;\n\n ScopedLock(ScopedLock&& other) noexcept { *this = std::move(other); }\n ScopedLock& operator=(ScopedLock&& other) noexcept\n {\n if (this == &other)\n return *this;\n\n mLocked = other.mLocked;\n mEngaged = std::exchange(other.mEngaged, false);\n return *this;\n }\n\n virtual ~ScopedLock()\n {\n if (mEngaged)\n mLocked->unlock();\n }\n\nprotected:\n bool mEngaged = true;\n T* mLocked;\n};\n\ntemplate <typename T>\n[[nodiscard]] inline ScopedLock<T> makeScopedLock(T& lock)\n{\n return ScopedLock<T>{&lock};\n}\n\ntemplate <typename T>\nclass ConditionalScopedLock\n{\npublic:\n ConditionalScopedLock(T* lock, bool do_lock)\n {\n if (!do_lock)\n return;\n mLocked = lock;\n mLocked->lock();\n }\n\n ConditionalScopedLock(const ConditionalScopedLock& other) = delete;\n ConditionalScopedLock& operator=(const ConditionalScopedLock& other) = delete;\n\n ConditionalScopedLock(ConditionalScopedLock&& other) noexcept { *this = std::move(other); }\n ConditionalScopedLock& operator=(ConditionalScopedLock&& other) noexcept\n {\n if (this == &other)\n return *this;\n\n mLocked = other.mLocked;\n mEngaged = std::exchange(other.mEngaged, false);\n return *this;\n }\n\n virtual ~ConditionalScopedLock()\n {\n if (mEngaged && mLocked)\n mLocked->unlock();\n }\n\nprotected:\n bool mEngaged = true;\n T* mLocked = nullptr;\n};\n\ntemplate <typename T>\n[[nodiscard]] inline ConditionalScopedLock<T> makeScopedLock(T& lock, bool do_lock)\n{\n return ConditionalScopedLock<T>(&lock, do_lock);\n}\n} // namespace sead\n# 8 \"/home/larsvi/botw/lib/sead/include/prim/seadEnum.h\" 2\n# 1 \"/home/larsvi/botw/lib/sead/include/thread/seadCriticalSection.h\" 1\n\n\n\n\n\n\n# 1 \"/home/larsvi/botw/lib/NintendoSDK/include/nn/os.h\" 1\n/**\n * @file os.h\n * @brief Operating System implementations.\n */\n\n\n\n\n\n\n# 1 \"/home/larsvi/botw/lib/NintendoSDK/include/nn/time.h\" 1\n/**\n * @file time.h\n * @brief Time implementation.\n */\n\n\n\n\n# 1 \"/home/larsvi/botw/lib/NintendoSDK/include/nn/types.h\" 1\n\n\n\n\n# 1 \"/home/larsvi/botw/lib/NintendoSDK/include/vapours/results.hpp\" 1\n/*\n * Copyright (c) 2018-2020 Atmosphère-NX\n *\n * This program is free software; you can redistribute it and/or modify it\n * under the terms and conditions of the GNU General Public License,\n * version 2, as published by the Free Software Foundation.\n *\n * This program is distributed in the hope it will be useful, but WITHOUT\n * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or\n * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for\n * more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\n\n\n/* Utilities. */\n\n# 1 \"/home/larsvi/botw/lib/NintendoSDK/include/vapours/results/results_common.hpp\" 1\n\n\n#include <climits>\n\n\nnamespace nn {\n\n namespace result::detail {\n\n class ResultTraits {\n public:\n using BaseType = std::uint32_t;\n static const BaseType SuccessValue = BaseType();\n static const int ModuleBits = 9;\n static const int DescriptionBits = 13;\n static const int ReservedBits = 10;\n static_assert(ModuleBits + DescriptionBits + ReservedBits == sizeof(BaseType) * 8, \"ModuleBits + DescriptionBits + ReservedBits == sizeof(BaseType) * CHAR_BIT\");\n private:\n static BaseType GetBitsValue(BaseType v, int ofs, int num) noexcept {\n return (v >> ofs) & ~(~BaseType() << num);\n }\n public:\n template<int M, int D>\n struct MakeInnerValueStatic : public std::integral_constant<BaseType, (M) | (D << ModuleBits)> {\n static_assert(M < (1 << ModuleBits), \"Invalid Module\");\n static_assert(D < (1 << DescriptionBits), \"Invalid Description\");\n };\n\n static BaseType MakeInnerValue(int m, int d) noexcept {\n return (static_cast<BaseType>(m) << 0) | (static_cast<BaseType>(d) << ModuleBits);\n }\n\n static BaseType GetModuleFromValue(BaseType value) noexcept {\n
return GetBitsValue(value, 0, ModuleBits);\n }\n\n static BaseType GetDescriptionFromValue(BaseType value) noexcept {\n return GetBitsValue(value, ModuleBits, DescriptionBits);\n }\n };\n\n /* Use CRTP for Results. */\n template<typename Self>\n class ResultBase {\n public:\n using BaseType = typename ResultTraits::BaseType;\n static const BaseType SuccessValue = ResultTraits::SuccessValue;\n\n int GetModule() const noexcept {\n return static_cast<int>(ResultTraits::GetModuleFromValue(static_cast<const Self &>(*this).GetInnerValueForDebug()));\n }\n\n int GetDescription() const noexcept {\n return static_cast<int>(ResultTraits::GetDescriptionFromValue(static_cast<const Self &>(*this).GetInnerValueForDebug()));\n }\n };\n\n class ResultInternalAccessor;\n\n }\n\n class ResultSuccess;\n\n class Result : public result::detail::ResultBase<Result> {\n friend class result::detail::ResultInternalAccessor;\n private:\n using Base = typename result::detail::ResultBase<Result>;\n private:\n BaseType m_value;\n private:\n explicit Result(BaseType v) noexcept : m_value(v) { /* ... */ }\n public:\n Result() noexcept { /* ... */ }\n\n BaseType GetInnerValueForDebug() const noexcept { return m_value; }\n\n bool IsSuccess() const noexcept { return m_value == SuccessValue; }\n bool IsFailure() const noexcept { return !IsSuccess(); }\n\n operator ResultSuccess() const noexcept;\n static bool CanAccept(Result result) noexcept;\n\n int GetModule() const noexcept { return Base::GetModule(); }\n int GetDescription() const noexcept { return Base::GetDescription(); }\n };\n static_assert(sizeof(Result) == sizeof(result::detail::ResultTraits::BaseType), \"sizeof(Result) == sizeof(detail::ResultTraits::BaseType)\");\n static_assert(std::is_trivially_destructible<Result>::value, \"std::is_trivially_destructible<Result>::value\");\n\n inline bool Result::CanAccept(Result result) noexcept {\n (void)(result);\n return true;\n }\n\n namespace result::detail {\n\n class ResultInternalAccessor {\n public:\n static Result ConstructResult(ResultTraits::BaseType v) noexcept { return Result(v); }\n };\n\n inline Result ConstructResult(ResultTraits::BaseType v) noexcept { return ResultInternalAccessor::ConstructResult(v); }\n\n }\n\n class ResultSuccess : public result::detail::ResultBase<ResultSuccess> {\n public:\n using Base = typename result::detail::ResultBase<ResultSuccess>;\n public:\n operator Result() const noexcept { return result::detail::ConstructResult(SuccessValue); }\n\n BaseType GetInnerValueForDebug() const noexcept { return SuccessValue; }\n\n bool IsSuccess() const noexcept { return true; }\n\n static bool CanAccept(Result result) noexcept { return result.IsSuccess(); }\n\n int GetModule() const noexcept { return Base::GetModule(); }\n int GetDescription() const noexcept { return Base::GetDescription(); }\n };\n\n namespace result::detail {\n\n __attribute__((noreturn)) void OnUnhandledResult(Result result) noexcept;\n\n }\n\n inline Result::operator ResultSuccess() const noexcept {\n if (!ResultSuccess::CanAccept(*this)) {\n result::detail::OnUnhandledResult(*this);\n }\n return ResultSuccess();\n }\n\n namespace result::detail {\n\n template<int Module_, int Description_>\n class ErrorResultBase : public ResultBase<ErrorResultBase<Module_, Description_>> {\n private:\n using Base = ResultBase<ErrorResultBase<Module_, Description_>>;\n public:\n static constexpr int Module = Module_;\n static constexpr int Description = Description_;\n static constexpr typename Base::BaseType InnerValue = ResultTraits::MakeInnerValueStatic<Module, Description>::value;\n static_assert(InnerValue != Base::SuccessValue, \"InnerValue != Base::SuccessValue\");\n public:\n operator Result() const noexcept { return ConstructResult(InnerValue); }\n operator ResultSuccess() const noexcept { OnUnhandledResult(*this); }\n\n bool IsSuccess() const noexcept { return false; }\n\n typename Base::BaseType GetInnerValueForDebug() const noexcept { return InnerValue; }\n };\n\n template<int Module_, int DescStart, int DescEnd>\n class ErrorRange {\n public:\n static const int Module = Module_;\n
static const int DescriptionStart = DescStart;\n static const int DescriptionEnd = DescEnd;\n static_assert(DescriptionStart < DescriptionEnd, \"DescriptionStart < DescriptionEnd\");\n public:\n static bool Includes(Result result) noexcept {\n return result.GetModule() == Module && DescriptionStart <= result.GetDescription() && result.GetDescription() < DescriptionEnd;\n }\n\n friend bool operator <=(Result result, ErrorRange) noexcept {\n return Includes(result);\n }\n };\n\n }\n\n}\n\n/* Macros for defining new results. */\n# 21 \"/home/larsvi/botw/lib/NintendoSDK/include/vapours/results.hpp\" 2\n\n/* Official. */\n\n# 1 \"/home/larsvi/botw/lib/NintendoSDK/include/vapours/results/cal_results.hpp\" 1\n/*\n * Copyright (c) 2018-2020 Atmosphère-NX\n *\n * This program is free software; you can redistribute it and/or modify it\n * under the terms and conditions of the GNU General Public License,\n * version 2, as published by the Free Software Foundation.\n *\n * This program is distributed in the hope it will be useful, but WITHOUT\n * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or\n * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for\n * more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\n\n\n\nnamespace ams::cal {\n\n namespace detail::result { using ResultModuleId = std::integral_constant<int, 198>; };\n\n class ResultCalibrationDataCrcError : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 101>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 101, 101 + 1> {};\n\n}\n# 24 \"/home/larsvi/botw/lib/NintendoSDK/include/vapours/results.hpp\" 2\n# 1 \"/home/larsvi/botw/lib/NintendoSDK/include/vapours/results/capsrv_results.hpp\" 1\n/*\n * Copyright (c) 2018-2019 Atmosphère-NX\n *\n * This program is free software; you can redistribute it and/or modify it\n * under the terms and conditions of the GNU General Public License,\n * version 2, as published by the Free Software Foundation.\n *\n * This program is distributed in the hope it will be useful, but WITHOUT\n * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or\n * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for\n * more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\n\n\nnamespace ams::capsrv {\n\n namespace detail::result { using ResultModuleId = std::integral_constant<int, 206>; };\n\n class ResultAlbumError : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 2>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 2, 99 + 1> {};\n class ResultAlbumWorkMemoryError : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 3>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 3, 3 + 1> {};\n\n class ResultAlbumAlreadyOpened : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 7>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 7, 7 + 1> {};\n class ResultAlbumOutOfRange : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 8>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 8, 8 + 1> {};\n\n class ResultAlbumInvalidFileId : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 10>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 10, 19 + 1> {};\n class ResultAlbumInvalidApplicationId : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 11>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 11, 11 + 1> {};\n class ResultAlbumInvalidTimestamp : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 12>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 12, 12 + 1> {};\n class ResultAlbumInvalidStorage : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 13>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 13, 13 + 1> {};\n class ResultAlbumInvalidFileContents : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 14>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 14, 14 + 1> {};\n\n class ResultAlbumIsNotMounted : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 21>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 21, 21 + 1> {};\n class ResultAlbumIsFull : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 22>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 22, 22 + 1> {};\n class ResultAlbumFileNotFound : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 23>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 23, 23 + 1> {};\n class ResultAlbumInvalidFileData : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 24>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 24, 24 + 1> {};\n class ResultAlbumFileCountLimit : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 25>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 25, 25 + 1> {};\n class ResultAlbumFileNoThumbnail : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 26>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 26, 26 + 1> {};\n\n class ResultAlbumReadBufferShortage : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 30>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 30, 30 + 1> {};\n\n class ResultAlbumFileSystemError : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 90>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 90, 99 + 1> {};\n class ResultAlbumAccessCorrupted : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 94>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 94, 96 + 1> {};\n class ResultAlbumDestinationAccessCorrupted : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 96>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 96, 96 + 1> {};\n\n class ResultControlError : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 800>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 800, 899 + 1> {};\n class ResultControlResourceLimit : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 820>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 820, 820 + 1> {};\n class ResultControlNotOpened : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 822>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 822, 822 + 1> {};\n\n class ResultNotSupported : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 1023>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 1023, 1023 + 1> {};\n\n class ResultInternalError : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 1024>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 1024, 2047 + 1> {};\n class ResultInternalJpegEncoderError : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 1210>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 1210, 1210 + 1> {};\n class ResultInternalJpegWorkMemoryShortage : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 1212>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 1212, 1212 + 1> {};\n\n class ResultInternalFileDataVerificationError : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 1300>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 1300, 1399 + 1> {};\n class ResultInternalFileDataVerificationEmptyFileData : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 1301>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 1301, 1301 + 1> {};\n class ResultInternalFileDataVerificationExifExtractionFailed : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 1302>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 1302, 1302 + 1> {};\n class ResultInternalFileDataVerificationExifAnalyzationFailed : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 1303>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 1303, 1303 + 1> {};\n class ResultInternalFileDataVerificationDateTimeExtractionFailed : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 1304>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 1304, 1304 + 1> {};\n class ResultInternalFileDataVerificationInvalidDateTimeLength : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 1305>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 1305, 1305 + 1> {};\n class ResultInternalFileDataVerificationInconsistentDateTime : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 1306>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 1306, 1306 + 1> {};\n class ResultInternalFileDataVerificationMakerNoteExtractionFailed : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 1307>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 1307, 1307 + 1> {};\n class ResultInternalFileDataVerificationInconsistentApplicationId : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 1308>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 1308, 1308 + 1> {};\n class ResultInternalFileDataVerificationInconsistentSignature : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 1309>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 1309, 1309 + 1> {};\n class ResultInternalFileDataVerificationUnsupportedOrientation : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 1310>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 1310, 1310 + 1> {};\n class ResultInternalFileDataVerificationInvalidDataDimension : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 1311>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 1311, 1311 + 1> {};\n class ResultInternalFileDataVerificationInconsistentOrientation : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 1312>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 1312, 1312 + 1> {};\n\n class ResultInternalAlbumLimitationError : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 1400>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 1400, 1499 + 1> {};\n class ResultInternalAlbumLimitationFileCountLimit : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 1401>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 1401, 1401 + 1> {};\n\n class ResultInternalSignatureError : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 1500>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 1500, 1599 + 1> {};\n class ResultInternalSignatureExifExtractionFailed : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 1501>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 1501, 1501 + 1> {};\n class ResultInternalSignatureMakerNoteExtractionFailed : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 1502>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 1502, 1502 + 1> {};\n\n class ResultInternalAlbumSessionError : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 1700>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 1700, 1799 + 1> {};\n class ResultInternalAlbumLimitationSessionCountLimit : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 1701>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 1701, 1701 + 1> {};\n\n class ResultInternalAlbumTemporaryFileError : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 1900>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 1900, 1999 + 1> {};\n class ResultInternalAlbumTemporaryFileCountLimit : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 1901>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 1901, 1901 + 1> {};\n class ResultInternalAlbumTemporaryFileCreateError : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 1902>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 1902, 1902 + 1> {};\n class ResultInternalAlbumTemporaryFileCreateRetryCountLimit : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 1903>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 1903, 1903 + 1> {};\n class ResultInternalAlbumTemporaryFileOpenError : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 1904>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 1904, 1904 + 1> {};\n
class ResultInternalAlbumTemporaryFileGetFileSizeError : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 1905>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 1905, 1905 + 1> {};\n class ResultInternalAlbumTemporaryFileSetFileSizeError : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 1906>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 1906, 1906 + 1> {};\n class ResultInternalAlbumTemporaryFileReadFileError : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 1907>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 1907, 1907 + 1> {};\n class ResultInternalAlbumTemporaryFileWriteFileError : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 1908>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 1908, 1908 + 1> {};\n\n}\n# 25 \"/home/larsvi/botw/lib/NintendoSDK/include/vapours/results.hpp\" 2\n# 1 \"/home/larsvi/botw/lib/NintendoSDK/include/vapours/results/creport_results.hpp\" 1\n/*\n * Copyright (c) 2018-2020 Atmosphère-NX\n *\n * This program is free software; you can redistribute it and/or modify it\n * under the terms and conditions of the GNU General Public License,\n * version 2, as published by the Free Software Foundation.\n *\n * This program is distributed in the hope it will be useful, but WITHOUT\n * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or\n * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for\n * more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\n\n\n\nnamespace ams::creport {\n\n namespace detail::result { using ResultModuleId = std::integral_constant<int, 168>; };\n\n class ResultUndefinedInstruction : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 0>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 0, 0 + 1> {};\n class ResultInstructionAbort : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 1>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 1, 1 + 1> {};\n class ResultDataAbort : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 2>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 2, 2 + 1> {};\n class ResultAlignmentFault : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 3>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 3, 3 + 1> {};\n class ResultDebuggerAttached : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 4>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 4, 4 + 1> {};\n class ResultBreakPoint : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 5>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 5, 5 + 1> {};\n class ResultUserBreak : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 6>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 6, 6 + 1> {};\n class ResultDebuggerBreak : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 7>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 7, 7 + 1> {};\n class ResultUndefinedSystemCall : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 8>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 8, 8 + 1> {};\n class ResultMemorySystemError : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 9>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 9, 9 + 1> {};\n\n class ResultIncompleteReport : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 99>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 99, 99 + 1> {};\n\n}\n# 26 \"/home/larsvi/botw/lib/NintendoSDK/include/vapours/results.hpp\" 2\n# 1 \"/home/larsvi/botw/lib/NintendoSDK/include/vapours/results/debug_results.hpp\" 1\n/*\n * Copyright (c) 2018-2020 Atmosphère-NX\n *\n * This program is free software; you can redistribute it and/or modify it\n * under the terms and conditions of the GNU General Public License,\n * version 2, as published by the Free Software Foundation.\n *\n * This program is distributed in the hope it will be useful, but WITHOUT\n * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or\n * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for\n * more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\n\n\n\nnamespace ams::dbg {\n\n namespace detail::result { using ResultModuleId = std::integral_constant<int, 183>; };\n\n class ResultCannotDebug : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 1>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 1, 1 + 1> {};\n class ResultAlreadyAttached : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 2>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 2, 2 + 1> {};\n class ResultCancelled : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 3>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 3, 3 + 1> {};\n\n}\n# 27 \"/home/larsvi/botw/lib/NintendoSDK/include/vapours/results.hpp\" 2\n# 1 \"/home/larsvi/botw/lib/NintendoSDK/include/vapours/results/dmnt_results.hpp\" 1\n/*\n * Copyright (c) 2018-2020 Atmosphère-NX\n *\n * This program is free software; you can redistribute it and/or modify it\n * under the terms and conditions of the GNU General Public License,\n * version 2, as published by the Free Software Foundation.\n *\n * This program is distributed in the hope it will be useful, but WITHOUT\n * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or\n * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for\n * more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\n\n\n\nnamespace ams::dmnt {\n\n namespace detail::result { using ResultModuleId = std::integral_constant<int, 13>; };\n\n class ResultUnknown : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 1>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 1, 1 + 1> {};\n class ResultDebuggingDisabled : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 2>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 2, 2 + 1> {};\n\n /* Atmosphere extension. */\n namespace cheat {\n\n class ResultCheatError : public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 6500, 6599 + 1> {};\n class ResultCheatNotAttached : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 6500>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 6500, 6500 + 1> {};\n class ResultCheatNullBuffer : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 6501>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 6501, 6501 + 1> {};\n class ResultCheatInvalidBuffer : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 6502>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 6502, 6502 + 1> {};\n class ResultCheatUnknownId : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 6503>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 6503, 6503 + 1> {};\n class ResultCheatOutOfResource : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 6504>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 6504, 6504 + 1> {};\n class ResultCheatInvalid : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 6505>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 6505, 6505 + 1> {};\n class ResultCheatCannotDisable : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 6506>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 6506, 6506 + 1> {};\n\n class ResultFrozenAddressError : public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 6600, 6699 + 1> {};\n class ResultFrozenAddressInvalidWidth : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 6600>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 6600, 6600 + 1> {};\n class ResultFrozenAddressAlreadyExists : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 6601>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 6601, 6601 + 1> {};\n class ResultFrozenAddressNotFound : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 6602>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 6602, 6602 + 1> {};\n
class ResultFrozenAddressOutOfResource : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 6603>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 6603, 6603 + 1> {};\n\n class ResultVirtualMachineError : public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 6700, 6799 + 1> {};\n class ResultVirtualMachineInvalidConditionDepth : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 6700>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 6700, 6700 + 1> {};\n\n }\n\n}\n# 28 \"/home/larsvi/botw/lib/NintendoSDK/include/vapours/results.hpp\" 2\n# 1 \"/home/larsvi/botw/lib/NintendoSDK/include/vapours/results/erpt_results.hpp\" 1\n/*\n * Copyright (c) 2018-2020 Atmosphère-NX\n *\n * This program is free software; you can redistribute it and/or modify it\n * under the terms and conditions of the GNU General Public License,\n * version 2, as published by the Free Software Foundation.\n *\n * This program is distributed in the hope it will be useful, but WITHOUT\n * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or\n * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for\n * more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\n\n\n\nnamespace ams::erpt {\n\n namespace detail::result { using ResultModuleId = std::integral_constant<int, 147>; };\n\n class ResultNotInitialized : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 1>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 1, 1 + 1> {};\n class ResultAlreadyInitialized : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 2>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 2, 2 + 1> {};\n class ResultOutOfArraySpace : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 3>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 3, 3 + 1> {};\n class ResultOutOfFieldSpace : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 4>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 4, 4 + 1> {};\n class ResultOutOfMemory : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 5>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 5, 5 + 1> {};\n class ResultInvalidArgument : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 7>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 7, 7 + 1> {};\n class ResultNotFound : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 8>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 8, 8 + 1> {};\n class ResultFieldCategoryMismatch : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 9>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 9, 9 + 1> {};\n class ResultFieldTypeMismatch : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 10>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 10, 10 + 1> {};\n class ResultAlreadyExists : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 11>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 11, 11 + 1> {};\n class ResultCorruptJournal : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 12>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 12, 12 + 1> {};\n class ResultCategoryNotFound : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 13>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 13, 13 + 1> {};\n class ResultRequiredContextMissing : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 14>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 14, 14 + 1> {};\n class ResultRequiredFieldMissing : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 15>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 15, 15 + 1> {};\n class ResultFormatterError : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 16>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 16, 16 + 1> {};\n class ResultInvalidPowerState : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 17>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 17, 17 + 1> {};\n class ResultArrayFieldTooLarge : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 18>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 18, 18 + 1> {};\n class ResultAlreadyOwned : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 19>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 19, 19 + 1> {};\n\n}\n# 29 \"/home/larsvi/botw/lib/NintendoSDK/include/vapours/results.hpp\" 2\n# 1 \"/home/larsvi/botw/lib/NintendoSDK/include/vapours/results/err_results.hpp\" 1\n/*\n * Copyright (c) 2018-2020 Atmosphère-NX\n *\n * This program is free software; you can redistribute it and/or modify it\n * under the terms and conditions of the GNU General Public License,\n * version 2, as published by the Free Software Foundation.\n *\n * This program is distributed in the hope it will be useful, but WITHOUT\n * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or\n * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for\n * more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\n\n\n\nnamespace ams::err {\n\n namespace detail::result { using ResultModuleId = std::integral_constant<int, 162>; };\n\n class ResultApplicationAborted : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 1>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 1, 1 + 1> {};\n class ResultSystemModuleAborted : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 2>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 2, 2 + 1> {};\n\n}\n# 30 \"/home/larsvi/botw/lib/NintendoSDK/include/vapours/results.hpp\" 2\n# 1 \"/home/larsvi/botw/lib/NintendoSDK/include/vapours/results/fatal_results.hpp\" 1\n/*\n * Copyright (c) 2018-2020 Atmosphère-NX\n *\n * This program is free software; you can redistribute it and/or modify it\n * under the terms and conditions of the GNU General Public License,\n * version 2, as published by the Free Software Foundation.\n *\n * This program is distributed in the hope it will be useful, but WITHOUT\n * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or\n * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for\n * more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\n\n\n\nnamespace ams::fatal {\n\n namespace detail::result { using ResultModuleId = std::integral_constant<int, 163>; };\n\n class ResultAllocationFailed : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 1>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 1, 1 + 1> {};\n class ResultNullGraphicsBuffer : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 2>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 2, 2 + 1> {};\n class ResultAlreadyThrown : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 3>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 3, 3 + 1> {};\n class ResultTooManyEvents : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 4>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 4, 4 + 1> {};\n class ResultInRepairWithoutVolHeld : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 5>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 5, 5 + 1> {};\n class ResultInRepairWithoutTimeReviserCartridge : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 6>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 6, 6 + 1> {};\n\n}\n# 31 \"/home/larsvi/botw/lib/NintendoSDK/include/vapours/results.hpp\" 2\n# 1 \"/home/larsvi/botw/lib/NintendoSDK/include/vapours/results/fs_results.hpp\" 1\n/*\n * Copyright (c) 2018-2020 Atmosphère-NX\n *\n * This program is free software; you can redistribute it and/or modify it\n * under the terms and conditions of the GNU General Public License,\n * version 2, as published by the Free Software Foundation.\n *\n * This program is distributed in the hope it will be useful, but WITHOUT\n * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or\n * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for\n * more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\n\n\n\nnamespace ams::fs {\n\n namespace detail::result { using ResultModuleId = std::integral_constant<int, 2>; };\n\n class ResultHandledByAllProcess : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 0>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 0, 999 + 1> {};\n class ResultPathNotFound : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 1>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 1, 1 + 1> {};\n class ResultPathAlreadyExists : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 2>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 2, 2 + 1> {};\n\n class ResultTargetLocked : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 7>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 7, 7 + 1> {};\n class ResultDirectoryNotEmpty : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 8>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 8, 8 + 1> {};\n\n class ResultNotEnoughFreeSpace : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 30>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 30, 45 + 1> {};\n class ResultNotEnoughFreeSpaceBis : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 34>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 34, 38 + 1> {};\n
class ResultNotEnoughFreeSpaceBisCalibration : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 35>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 35, 35 + 1> {};\n class ResultNotEnoughFreeSpaceBisSafe : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 36>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 36, 36 + 1> {};\n class ResultNotEnoughFreeSpaceBisUser : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 37>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 37, 37 + 1> {};\n class ResultNotEnoughFreeSpaceBisSystem : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 38>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 38, 38 + 1> {};\n class ResultNotEnoughFreeSpaceSdCard : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 39>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 39, 39 + 1> {};\n\n class ResultUnsupportedSdkVersion : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 50>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 50, 50 + 1> {};\n\n class ResultMountNameAlreadyExists : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 60>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 60, 60 + 1> {};\n\n class ResultHandledBySystemProcess : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 1000>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 1000, 2999 + 1> {};\n class ResultPartitionNotFound : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 1001>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 1001, 1001 + 1> {};\n class ResultTargetNotFound : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 1002>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 1002, 1002 + 1> {};\n\n class ResultSdCardAccessFailed : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 2000>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 2000, 2499 + 1> {};\n class ResultSdCardNotPresent : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 2001>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 2001, 2001 + 1> {};\n\n class ResultGameCardAccessFailed : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 2500>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 2500, 2999 + 1> {};\n\n class ResultNotImplemented : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 3001>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 3001, 3001 + 1> {};\n class ResultUnsupportedVersion : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 3002>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 3002, 3002 + 1> {};\n class ResultOutOfRange : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 3005>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 3005, 3005 + 1> {};\n\n class ResultSystemPartitionNotReady : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 3100>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 3100, 3100 + 1> {};\n\n class ResultAllocationFailure : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 3200>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 3200, 3499 + 1> {};\n class ResultAllocationFailureInFileSystemAccessorA : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 3211>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 3211, 3211 + 1> {};\n class ResultAllocationFailureInFileSystemAccessorB : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 3212>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 3212, 3212 + 1> {};\n class ResultAllocationFailureInApplicationA : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 3213>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 3213, 3213 + 1> {};\n class ResultAllocationFailureInBisA : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 3215>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 3215, 3215 + 1> {};\n
class ResultAllocationFailureInBisB : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 3216>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 3216, 3216 + 1> {};\n class ResultAllocationFailureInBisC : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 3217>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 3217, 3217 + 1> {};\n class ResultAllocationFailureInCodeA : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 3218>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 3218, 3218 + 1> {};\n class ResultAllocationFailureInContentA : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 3219>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 3219, 3219 + 1> {};\n class ResultAllocationFailureInContentStorageA : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 3220>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 3220, 3220 + 1> {};\n class ResultAllocationFailureInContentStorageB : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 3221>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 3221, 3221 + 1> {};\n class ResultAllocationFailureInDataA : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 3222>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 3222, 3222 + 1> {};\n class ResultAllocationFailureInDataB : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 3223>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 3223, 3223 + 1> {};\n class ResultAllocationFailureInDeviceSaveDataA : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 3224>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 3224, 3224 + 1> {};\n class ResultAllocationFailureInGameCardA : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 3225>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 3225, 3225 + 1> {};\n class ResultAllocationFailureInGameCardB : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 3226>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 3226, 3226 + 1> {};\n class ResultAllocationFailureInGameCardC : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 3227>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 3227, 3227 + 1> {};\n class ResultAllocationFailureInGameCardD : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 3228>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 3228, 3228 + 1> {};\n class ResultAllocationFailureInImageDirectoryA : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 3232>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 3232, 3232 + 1> {};\n class ResultAllocationFailureInSdCardA : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 3244>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 3244, 3244 + 1> {};\n class ResultAllocationFailureInSdCardB : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 3245>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 3245, 3245 + 1> {};\n class ResultAllocationFailureInSystemSaveDataA : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 3246>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 3246, 3246 + 1> {};\n class ResultAllocationFailureInRomFsFileSystemA : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 3247>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 3247, 3247 + 1> {};\n class ResultAllocationFailureInRomFsFileSystemB : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 3248>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 3248, 3248 + 1> {};\n class ResultAllocationFailureInRomFsFileSystemC : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 3249>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 3249, 3249 + 1> {};\n class ResultAllocationFailureInFileSystemProxyCoreImplD : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 3256>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 3256, 3256 + 1> {};\n class ResultAllocationFailureInFileSystemProxyCoreImplE : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 3257>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 3257, 3257 + 1> {};\n class ResultAllocationFailureInPartitionFileSystemCreatorA : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 3280>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 3280, 3280 + 1> {};\n class ResultAllocationFailureInRomFileSystemCreatorA : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 3281>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 3281, 3281 + 1> {};\n class ResultAllocationFailureInStorageOnNcaCreatorA : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 3288>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 3288, 3288 + 1> {};\n class ResultAllocationFailureInStorageOnNcaCreatorB : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 3289>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 3289, 3289 + 1> {};\n class ResultAllocationFailureInFileSystemBuddyHeapA : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 3294>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 3294, 3294 + 1> {};\n class ResultAllocationFailureInFileSystemBufferManagerA : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 3295>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 3295, 3295 + 1> {};\n class ResultAllocationFailureInBlockCacheBufferedStorageA : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 3296>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 3296, 3296 + 1> {};\n class ResultAllocationFailureInBlockCacheBufferedStorageB : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 3297>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 3297, 3297 + 1> {};\n class ResultAllocationFailureInIntegrityVerificationStorageA : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 3304>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 3304, 3304 + 1> {};\n class ResultAllocationFailureInIntegrityVerificationStorageB : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 3305>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 3305, 3305 + 1> {};\n class ResultAllocationFailureInDirectorySaveDataFileSystem : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 3321>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 3321, 3321 + 1> {};\n class ResultAllocationFailureInNcaFileSystemDriverI : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 3341>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 3341, 3341 + 1> {};\n class ResultAllocationFailureInPartitionFileSystemA : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 3347>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 3347, 3347 + 1> {};\n class ResultAllocationFailureInPartitionFileSystemB : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 3348>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 3348, 3348 + 1> {};\n class ResultAllocationFailureInPartitionFileSystemC : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 3349>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 3349, 3349 + 1> {};\n class ResultAllocationFailureInPartitionFileSystemMetaA : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 3350>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 3350, 3350 + 1> {};\n class ResultAllocationFailureInPartitionFileSystemMetaB : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 3351>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 3351, 3351 + 1> {};\n class ResultAllocationFailureInRomFsFileSystemD : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 3352>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 3352, 3352 + 1> {};\n class ResultAllocationFailureInSubDirectoryFileSystem : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 3355>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 3355, 3355 + 1> {};\n class ResultAllocationFailureInNcaReaderA : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 3363>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 3363, 3363 + 1> {};\n class ResultAllocationFailureInRegisterA : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 3365>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 3365, 3365 + 1> {};\n class ResultAllocationFailureInRegisterB : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 3366>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 3366, 3366 + 1> {};\n class ResultAllocationFailureInPathNormalizer : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 3367>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 3367, 3367 + 1> {};\n class ResultAllocationFailureInDbmRomKeyValueStorage : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 3375>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 3375, 3375 + 1> {};\n class ResultAllocationFailureInRomFsFileSystemE : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 3377>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 3377, 3377 + 1> {};\n class ResultAllocationFailureInReadOnlyFileSystemA : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 3386>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 3386, 3386 + 1> {};\n class ResultAllocationFailureInAesCtrCounterExtendedStorageA : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 3399>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 3399, 3399 + 1> {};\n class ResultAllocationFailureInAesCtrCounterExtendedStorageB : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 3400>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 3400, 3400 + 1> {};\n class ResultAllocationFailureInFileSystemInterfaceAdapter : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 3407>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 3407, 3407 + 1> {};\n
class ResultAllocationFailureInBufferedStorageA : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 3411>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 3411, 3411 + 1> {};\n class ResultAllocationFailureInIntegrityRomFsStorageA : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 3412>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 3412, 3412 + 1> {};\n class ResultAllocationFailureInNew : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 3420>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 3420, 3420 + 1> {};\n class ResultAllocationFailureInMakeUnique : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 3422>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 3422, 3422 + 1> {};\n class ResultAllocationFailureInAllocateShared : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 3423>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 3423, 3423 + 1> {};\n class ResultAllocationFailurePooledBufferNotEnoughSize : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 3424>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 3424, 3424 + 1> {};\n\n class ResultInternal : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 3000>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 3000, 7999 + 1> {};\n class ResultMmcAccessFailed : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 3500>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 3500, 3999 + 1> {};\n\n class ResultDataCorrupted : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 4000>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 4000, 4999 + 1> {};\n class ResultRomCorrupted : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 4001>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 4001, 4299 + 1> {};\n class ResultUnsupportedRomVersion : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 4002>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 4002, 4002 + 1> {};\n\n class ResultAesCtrCounterExtendedStorageCorrupted : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 4011>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 4011, 4019 + 1> {};\n
class ResultInvalidAesCtrCounterExtendedEntryOffset : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 4012>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 4012, 4012 + 1> {};\n class ResultInvalidAesCtrCounterExtendedTableSize : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 4013>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 4013, 4013 + 1> {};\n class ResultInvalidAesCtrCounterExtendedGeneration : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 4014>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 4014, 4014 + 1> {};\n class ResultInvalidAesCtrCounterExtendedOffset : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 4015>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 4015, 4015 + 1> {};\n\n class ResultIndirectStorageCorrupted : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 4021>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 4021, 4029 + 1> {};\n class ResultInvalidIndirectEntryOffset : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 4022>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 4022, 4022 + 1> {};\n class ResultInvalidIndirectEntryStorageIndex : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 4023>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 4023, 4023 + 1> {};\n class ResultInvalidIndirectStorageSize : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 4024>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 4024, 4024 + 1> {};\n class ResultInvalidIndirectVirtualOffset : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 4025>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 4025, 4025 + 1> {};\n class ResultInvalidIndirectPhysicalOffset : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 4026>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 4026, 4026 + 1> {};\n class ResultInvalidIndirectStorageIndex : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 4027>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 4027, 4027 + 1> {};\n\n class ResultBucketTreeCorrupted : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 4031>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 4031, 4039 + 1> {};\n class ResultInvalidBucketTreeSignature : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 4032>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 4032, 4032 + 1> {};\n class ResultInvalidBucketTreeEntryCount : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 4033>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 4033, 4033 + 1> {};\n class ResultInvalidBucketTreeNodeEntryCount : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 4034>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 4034, 4034 + 1> {};\n class ResultInvalidBucketTreeNodeOffset : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 4035>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 4035, 4035 + 1> {};\n class ResultInvalidBucketTreeEntryOffset : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 4036>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 4036, 4036 + 1> {};\n class ResultInvalidBucketTreeEntrySetOffset : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 4037>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 4037, 4037 + 1> {};\n
class ResultInvalidBucketTreeNodeIndex : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 4038>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 4038, 4038 + 1> {};\n class ResultInvalidBucketTreeVirtualOffset : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 4039>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 4039, 4039 + 1> {};\n\n class ResultRomNcaCorrupted : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 4041>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 4041, 4139 + 1> {};\n class ResultRomNcaFileSystemCorrupted : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 4051>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 4051, 4069 + 1> {};\n class ResultInvalidRomNcaFileSystemType : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 4052>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 4052, 4052 + 1> {};\n
class ResultInvalidRomAcidFileSize : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 4053>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 4053, 4053 + 1> {};\n class ResultInvalidRomAcidSize : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 4054>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 4054, 4054 + 1> {};\n class ResultInvalidRomAcid : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 4055>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 4055, 4055 + 1> {};\n class ResultRomAcidVerificationFailed : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 4056>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 4056, 4056 + 1> {};\n class ResultInvalidRomNcaSignature : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 4057>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 4057, 4057 + 1> {};\n
class ResultRomNcaHeaderSignature1VerificationFailed : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 4058>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 4058, 4058 + 1> {};\n class ResultRomNcaHeaderSignature2VerificationFailed : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 4059>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 4059, 4059 + 1> {};\n class ResultRomNcaFsHeaderHashVerificationFailed : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 4060>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 4060, 4060 + 1> {};\n class ResultInvalidRomNcaKeyIndex : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 4061>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 4061, 4061 + 1> {};\n
class ResultInvalidRomNcaFsHeaderHashType : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 4062>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 4062, 4062 + 1> {};\n class ResultInvalidRomNcaFsHeaderEncryptionType : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 4063>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 4063, 4063 + 1> {};\n\n class ResultRomNcaHierarchicalSha256StorageCorrupted : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 4071>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 4071, 4079 + 1> {};\n class ResultInvalidRomHierarchicalSha256BlockSize : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 4072>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 4072, 4072 + 1> {};\n class ResultInvalidRomHierarchicalSha256LayerCount : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 4073>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 4073, 4073 + 1> {};\n class ResultRomHierarchicalSha256BaseStorageTooLarge : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 4074>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 4074, 4074 + 1> {};\n class ResultRomHierarchicalSha256HashVerificationFailed : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 4075>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 4075, 4075 + 1> {};\n\n class ResultRomIntegrityVerificationStorageCorrupted : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 4141>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 4141, 4179 + 1> {};\n class ResultIncorrectRomIntegrityVerificationMagic : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 4142>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 4142, 4142 + 1> {};\n class ResultInvalidRomZeroHash : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 4143>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 4143, 4143 + 1> {};\n class ResultRomNonRealDataVerificationFailed : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 4144>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 4144, 4144 + 1> {};\n class ResultInvalidRomHierarchicalIntegrityVerificationLayerCount : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 4145>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 4145, 4145 + 1> {};\n\n class ResultRomRealDataVerificationFailed : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 4151>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 4151, 4159 + 1> {};\n class ResultClearedRomRealDataVerificationFailed : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 4152>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 4152, 4152 + 1> {};\n class ResultUnclearedRomRealDataVerificationFailed : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 4153>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 4153, 4153 + 1> {};\n\n class ResultRomPartitionFileSystemCorrupted : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 4181>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 4181, 4199 + 1> {};\n class ResultInvalidRomSha256PartitionHashTarget : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 4182>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 4182, 4182 + 1> {};\n class ResultRomSha256PartitionHashVerificationFailed : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 4183>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 4183, 4183 + 1> {};\n class ResultRomPartitionSignatureVerificationFailed : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 4184>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 4184, 4184 + 1> {};\n class ResultRomSha256PartitionSignatureVerificationFailed : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 4185>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 4185, 4185 + 1> {};\n class ResultInvalidRomPartitionEntryOffset : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 4186>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 4186, 4186 + 1> {};\n class ResultInvalidRomSha256PartitionMetaDataSize : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 4187>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 4187, 4187 + 1> {};\n\n class ResultRomBuiltInStorageCorrupted : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 4201>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 4201, 4219 + 1> {};\n class ResultRomGptHeaderVerificationFailed : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 4202>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 4202, 4202 + 1> {};\n\n class ResultRomHostFileSystemCorrupted : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 4241>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 4241, 4259 + 1> {};\n class ResultRomHostEntryCorrupted : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 4242>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 4242, 4242 + 1> {};\n class ResultRomHostFileDataCorrupted : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 4243>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 4243, 4243 + 1> {};\n class ResultRomHostFileCorrupted : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 4244>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 4244, 4244 + 1> {};\n
class ResultInvalidRomHostHandle : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 4245>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 4245, 4245 + 1> {};\n\n class ResultRomDatabaseCorrupted : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 4261>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 4261, 4279 + 1> {};\n class ResultInvalidRomAllocationTableBlock : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 4262>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 4262, 4262 + 1> {};\n class ResultInvalidRomKeyValueListElementIndex : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 4263>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 4263, 4263 + 1> {};\n\n class ResultSaveDataCorrupted : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 4301>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 4301, 4499 + 1> {};\n class ResultNcaCorrupted : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 4501>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 4501, 4599 + 1> {};\n class ResultNcaBaseStorageOutOfRangeA : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 4508>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 4508, 4508 + 1> {};\n class ResultNcaBaseStorageOutOfRangeB : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 4509>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 4509, 4509 + 1> {};\n\n class ResultNcaFileSystemCorrupted : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 4511>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 4511, 4529 + 1> {};\n class ResultInvalidNcaFileSystemType : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 4512>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 4512, 4512 + 1> {};\n class ResultInvalidAcidFileSize : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 4513>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 4513, 4513 + 1> {};\n class ResultInvalidAcidSize : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 4514>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 4514, 4514 + 1> {};\n class ResultInvalidAcid : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 4515>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 4515, 4515 + 1> {};\n class ResultAcidVerificationFailed : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 4516>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 4516, 4516 + 1> {};\n class ResultInvalidNcaSignature : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 4517>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 4517, 4517 + 1> {};\n class ResultNcaHeaderSignature1VerificationFailed : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 4518>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 4518, 4518 + 1> {};\n class ResultNcaHeaderSignature2VerificationFailed : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 4519>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 4519, 4519 + 1> {};\n class ResultNcaFsHeaderHashVerificationFailed : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 4520>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 4520, 4520 + 1> {};\n class ResultInvalidNcaKeyIndex : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 4521>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 4521, 4521 + 1> {};\n class ResultInvalidNcaFsHeaderHashType : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 4522>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 4522, 4522 + 1> {};\n class ResultInvalidNcaFsHeaderEncryptionType : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 4523>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 4523, 4523 + 1> {};\n
class ResultInvalidNcaPatchInfoIndirectSize : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 4524>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 4524, 4524 + 1> {};\n class ResultInvalidNcaPatchInfoAesCtrExSize : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 4525>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 4525, 4525 + 1> {};\n class ResultInvalidNcaPatchInfoAesCtrExOffset : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 4526>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 4526, 4526 + 1> {};\n class ResultInvalidNcaId : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 4527>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 4527, 4527 + 1> {};\n class ResultInvalidNcaHeader : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 4528>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 4528, 4528 + 1> {};\n
class ResultInvalidNcaFsHeader : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 4529>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 4529, 4529 + 1> {};\n\n class ResultNcaHierarchicalSha256StorageCorrupted : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 4531>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 4531, 4539 + 1> {};\n class ResultInvalidHierarchicalSha256BlockSize : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 4532>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 4532, 4532 + 1> {};\n class ResultInvalidHierarchicalSha256LayerCount : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 4533>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 4533, 4533 + 1> {};\n class ResultHierarchicalSha256BaseStorageTooLarge : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 4534>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 4534, 4534 + 1> {};\n class ResultHierarchicalSha256HashVerificationFailed : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 4535>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 4535, 4535 + 1> {};\n\n /* TODO: Range? */\n class ResultInvalidNcaHeader1SignatureKeyGeneration : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 4543>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 4543, 4543 + 1> {};\n\n class ResultIntegrityVerificationStorageCorrupted : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 4601>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 4601, 4639 + 1> {};\n class ResultIncorrectIntegrityVerificationMagic : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 4602>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 4602, 4602 + 1> {};\n class ResultInvalidZeroHash : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 4603>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 4603, 4603 + 1> {};\n class ResultNonRealDataVerificationFailed : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 4604>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 4604, 4604 + 1> {};\n class ResultInvalidHierarchicalIntegrityVerificationLayerCount : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 4605>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 4605, 4605 + 1> {};\n\n class ResultRealDataVerificationFailed : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 4611>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 4611, 4619 + 1> {};\n class ResultClearedRealDataVerificationFailed : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 4612>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 4612, 4612 + 1> {};\n class ResultUnclearedRealDataVerificationFailed : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 4613>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 4613, 4613 + 1> {};\n\n class ResultPartitionFileSystemCorrupted : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 4641>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 4641, 4659 + 1> {};\n class ResultInvalidSha256PartitionHashTarget : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 4642>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 4642, 4642 + 1> {};\n class ResultSha256PartitionHashVerificationFailed : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 4643>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 4643, 4643 + 1> {};\n class ResultPartitionSignatureVerificationFailed : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 4644>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 4644, 4644 + 1> {};\n class ResultSha256PartitionSignatureVerificationFailed : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 4645>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 4645, 4645 + 1> {};\n class ResultInvalidPartitionEntryOffset : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 4646>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 4646, 4646 + 1> {};\n class ResultInvalidSha256PartitionMetaDataSize : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 4647>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 4647, 4647 + 1> {};\n\n class ResultBuiltInStorageCorrupted : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 4661>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 4661, 4679 + 1> {};\n class ResultGptHeaderVerificationFailed : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 4662>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 4662, 4662 + 1> {};\n\n class ResultFatFileSystemCorrupted : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 4681>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 4681, 4699 + 1> {};\n\n class ResultHostFileSystemCorrupted : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 4701>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 4701, 4719 + 1> {};\n class ResultHostEntryCorrupted : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 4702>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 4702, 4702 + 1> {};\n class ResultHostFileDataCorrupted : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 4703>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 4703, 4703 + 1> {};\n class ResultHostFileCorrupted : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 4704>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 4704, 4704 + 1> {};\n class ResultInvalidHostHandle : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 4705>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 4705, 4705 + 1> {};\n\n class ResultDatabaseCorrupted : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 4721>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 4721, 4739 + 1> {};\n class ResultInvalidAllocationTableBlock : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 4722>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 4722, 4722 + 1> {};\n class ResultInvalidKeyValueListElementIndex : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 4723>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 4723, 4723 + 1> {};\n\n class ResultAesXtsFileSystemCorrupted : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 4741>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 4741, 4759 + 1> {};\n class ResultSaveDataTransferDataCorrupted : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 4761>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 4761, 4769 + 1> {};\n class ResultSignedSystemPartitionDataCorrupted : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 4771>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 4771, 4779 + 1> {};\n\n class ResultGameCardLogoDataCorrupted : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 4781>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 4781, 4781 + 1> {};\n\n class ResultUnexpected : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 5000>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 5000, 5999 + 1> {};\n class ResultUnexpectedInAesCtrStorageA : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 5315>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 5315, 5315 + 1> {};\n class ResultUnexpectedInAesXtsStorageA : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 5316>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 5316, 5316 + 1> {};\n class ResultUnexpectedInFindFileSystemA : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 5319>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 5319, 5319 + 1> {};\n\n class ResultPreconditionViolation : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 6000>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 6000, 6499 + 1> {};\n class ResultInvalidArgument : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 6001>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 6001, 6199 + 1> {};\n class ResultInvalidPath : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 6002>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 6002, 6029 + 1> {};\n class ResultTooLongPath : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 6003>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 6003, 6003 + 1> {};\n class ResultInvalidCharacter : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 6004>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 6004, 6004 + 1> {};\n
class ResultInvalidPathFormat : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 6005>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 6005, 6005 + 1> {};\n class ResultDirectoryUnobtainable : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 6006>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 6006, 6006 + 1> {};\n class ResultNotNormalized : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 6007>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 6007, 6007 + 1> {};\n\n class ResultInvalidPathForOperation : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 6030>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 6030, 6059 + 1> {};\n class ResultDirectoryNotDeletable : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 6031>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 6031, 6031 + 1> {};\n class ResultDirectoryNotRenamable : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 6032>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 6032, 6032 + 1> {};\n class ResultIncompatiblePath : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 6033>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 6033, 6033 + 1> {};\n class ResultRenameToOtherFileSystem : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 6034>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 6034, 6034 + 1> {};\n\n class ResultInvalidOffset : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 6061>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 6061, 6061 + 1> {};\n class ResultInvalidSize : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 6062>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 6062, 6062 + 1> {};\n class ResultNullptrArgument : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 6063>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 6063, 6063 + 1> {};\n class ResultInvalidAlignment : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 6064>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 6064, 6064 + 1> {};\n class ResultInvalidMountName : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 6065>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 6065, 6065 + 1> {};\n\n class ResultExtensionSizeTooLarge : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 6066>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 6066, 6066 + 1> {};\n class ResultExtensionSizeInvalid : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 6067>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 6067, 6067 + 1> {};\n\n class ResultInvalidOpenMode : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 6072>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 6072, 6072 + 1> {};\n\n class ResultInvalidEnumValue : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 6080>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 6080, 6099 + 1> {};\n class ResultInvalidSaveDataState : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 6081>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 6081, 6081 + 1> {};\n class ResultInvalidSaveDataSpaceId : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 6082>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 6082, 6082 + 1> {};\n\n class ResultInvalidOperationForOpenMode : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 6200>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 6200, 6299 + 1> {};\n class ResultFileExtensionWithoutOpenModeAllowAppend : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 6201>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 6201, 6201 + 1> {};\n class ResultReadNotPermitted : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 6202>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 6202, 6202 + 1> {};\n class ResultWriteNotPermitted : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 6203>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 6203, 6203 + 1> {};\n\n class ResultUnsupportedOperation : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 6300>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 6300, 6399 + 1> {};\n
class ResultUnsupportedOperationInSubStorageA : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 6302>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 6302, 6302 + 1> {};\n class ResultUnsupportedOperationInSubStorageB : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 6303>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 6303, 6303 + 1> {};\n class ResultUnsupportedOperationInMemoryStorageA : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 6304>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 6304, 6304 + 1> {};\n class ResultUnsupportedOperationInMemoryStorageB : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 6305>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 6305, 6305 + 1> {};\n class ResultUnsupportedOperationInFileStorageA : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 6306>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 6306, 6306 + 1> {};\n class ResultUnsupportedOperationInFileStorageB : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 6307>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 6307, 6307 + 1> {};\n class ResultUnsupportedOperationInSwitchStorageA : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 6308>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 6308, 6308 + 1> {};\n class ResultUnsupportedOperationInAesCtrCounterExtendedStorageA : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 6310>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 6310, 6310 + 1> {};\n class ResultUnsupportedOperationInAesCtrCounterExtendedStorageB : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 6311>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 6311, 6311 + 1> {};\n class ResultUnsupportedOperationInAesCtrCounterExtendedStorageC : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 6312>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 6312, 6312 + 1> {};\n class ResultUnsupportedOperationInAesCtrStorageExternalA : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 6313>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 6313, 6313 + 1> {};\n
class ResultUnsupportedOperationInAesCtrStorageExternalB : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 6314>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 6314, 6314 + 1> {};\n class ResultUnsupportedOperationInAesCtrStorageA : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 6315>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 6315, 6315 + 1> {};\n class ResultUnsupportedOperationInHierarchicalIntegrityVerificationStorageA : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 6316>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 6316, 6316 + 1> {};\n class ResultUnsupportedOperationInHierarchicalIntegrityVerificationStorageB : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 6317>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 6317, 6317 + 1> {};\n class ResultUnsupportedOperationInIntegrityVerificationStorageA : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 6318>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 6318, 6318 + 1> {};\n class ResultUnsupportedOperationInIntegrityVerificationStorageB : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 6319>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 6319, 6319 + 1> {};\n class ResultUnsupportedOperationInIntegrityVerificationStorageC : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 6320>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 6320, 6320 + 1> {};\n class ResultUnsupportedOperationInBlockCacheBufferedStorageA : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 6321>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 6321, 6321 + 1> {};\n class ResultUnsupportedOperationInBlockCacheBufferedStorageB : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 6322>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 6322, 6322 + 1> {};\n class ResultUnsupportedOperationInBlockCacheBufferedStorageC : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 6323>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 6323, 6323 + 1> {};\n class ResultUnsupportedOperationInIndirectStorageA : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 6324>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 6324, 6324 + 1> {};\n class ResultUnsupportedOperationInIndirectStorageB : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 6325>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 6325, 6325 + 1> {};\n class ResultUnsupportedOperationInIndirectStorageC : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 6326>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 6326, 6326 + 1> {};\n
class ResultUnsupportedOperationInZeroStorageA : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 6327>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 6327, 6327 + 1> {};\n class ResultUnsupportedOperationInZeroStorageB : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 6328>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 6328, 6328 + 1> {};\n class ResultUnsupportedOperationInHierarchicalSha256StorageA : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 6329>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 6329, 6329 + 1> {};\n class ResultUnsupportedOperationInReadOnlyBlockCacheStorageA : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 6330>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 6330, 6330 + 1> {};\n class ResultUnsupportedOperationInReadOnlyBlockCacheStorageB : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 6331>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 6331, 6331 + 1> {};\n class ResultUnsupportedOperationInIntegrityRomFsStorageA : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 6332>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 6332, 6332 + 1> {};\n class ResultUnsupportedOperationInFileServiceObjectAdapterA : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 6362>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 6362, 6362 + 1> {};\n
class ResultUnsupportedOperationInRomFsFileSystemA : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 6364>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 6364, 6364 + 1> {};\n class ResultUnsupportedOperationInRomFsFileSystemB : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 6365>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 6365, 6365 + 1> {};\n class ResultUnsupportedOperationInRomFsFileSystemC : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 6366>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 6366, 6366 + 1> {};\n class ResultUnsupportedOperationInRomFsFileA : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 6367>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 6367, 6367 + 1> {};\n class ResultUnsupportedOperationInRomFsFileB : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 6368>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 6368, 6368 + 1> {};\n class ResultUnsupportedOperationInReadOnlyFileSystemTemplateA : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 6369>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 6369, 6369 + 1> {};\n class ResultUnsupportedOperationInReadOnlyFileSystemTemplateB : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 6370>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 6370, 6370 + 1> {};\n class ResultUnsupportedOperationInReadOnlyFileSystemTemplateC : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 6371>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 6371, 6371 + 1> {};\n class ResultUnsupportedOperationInReadOnlyFileA : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 6372>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 6372, 6372 + 1> {};\n class ResultUnsupportedOperationInReadOnlyFileB : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 6373>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 6373, 6373 + 1> {};\n class ResultUnsupportedOperationInPartitionFileSystemA : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 6374>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 6374, 6374 + 1> {};\n
class ResultUnsupportedOperationInPartitionFileSystemB : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 6375>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 6375, 6375 + 1> {};\n class ResultUnsupportedOperationInPartitionFileA : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 6376>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 6376, 6376 + 1> {};\n class ResultUnsupportedOperationInPartitionFileB : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 6377>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 6377, 6377 + 1> {};\n\n class ResultPermissionDenied : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 6400>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 6400, 6449 + 1> {};\n\n class ResultNeedFlush : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 6454>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 6454, 6454 + 1> {};\n class ResultFileNotClosed : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 6455>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 6455, 6455 + 1> {};\n class ResultDirectoryNotClosed : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 6456>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 6456, 6456 + 1> {};\n class ResultWriteModeFileNotClosed : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 6457>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 6457, 6457 + 1> {};\n class ResultAllocatorAlreadyRegistered : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 6458>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 6458, 6458 + 1> {};\n class ResultDefaultAllocatorUsed : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 6459>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 6459, 6459 + 1> {};\n class ResultAllocatorAlignmentViolation : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 6461>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 6461, 6461 + 1> {};\n
class ResultUserNotExist : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 6465>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 6465, 6465 + 1> {};\n\n class ResultNotFound : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 6600>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 6600, 6699 + 1> {};\n\n class ResultOutOfResource : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 6700>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 6700, 6799 + 1> {};\n class ResultBufferAllocationFailed : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 6705>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 6705, 6705 + 1> {};\n class ResultMappingTableFull : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 6706>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 6706, 6706 + 1> {};\n class ResultOpenCountLimit : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 6709>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 6709, 6709 + 1> {};\n\n class ResultMappingFailed : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 6800>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 6800, 6899 + 1> {};\n class ResultMapFull : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 6811>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 6811, 6811 + 1> {};\n\n class ResultBadState : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 6900>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 6900, 6999 + 1> {};\n class ResultNotInitialized : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 6902>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 6902, 6902 + 1> {};\n class ResultNotMounted : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 6905>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 6905, 6905 + 1> {};\n\n\n class ResultDbmNotFound : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 7901>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 7901, 7904 + 1> {};\n class ResultDbmKeyNotFound : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 7902>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 7902, 7902 + 1> {};\n class ResultDbmFileNotFound : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 7903>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 7903, 7903 + 1> {};\n class ResultDbmDirectoryNotFound : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 7904>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 7904, 7904 + 1> {};\n\n class ResultDbmAlreadyExists : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 7906>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 7906, 7906 + 1> {};\n class ResultDbmKeyFull : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 7907>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 7907, 7907 + 1> {};\n class ResultDbmDirectoryEntryFull : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 7908>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 7908, 7908 + 1> {};\n class ResultDbmFileEntryFull : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 7909>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 7909, 7909 + 1> {};\n\n class ResultDbmFindFinished : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 7910>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 7910, 7912 + 1> {};\n class ResultDbmFindKeyFinished : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 7911>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 7911, 7911 + 1> {};\n class ResultDbmIterationFinished : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 7912>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 7912, 7912 + 1> {};\n\n class ResultDbmInvalidOperation : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 7914>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 7914, 7914 + 1> {};\n class ResultDbmInvalidPathFormat : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 7915>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 7915, 7915 + 1> {};\n class ResultDbmDirectoryNameTooLong : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 7916>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 7916, 7916 + 1> {};\n class ResultDbmFileNameTooLong : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 7917>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 7917, 7917 + 1> {};\n\n}\n# 32 \"/home/larsvi/botw/lib/NintendoSDK/include/vapours/results.hpp\" 2\n# 1 \"/home/larsvi/botw/lib/NintendoSDK/include/vapours/results/hipc_results.hpp\" 1\n/*\n * Copyright (c) 2018-2020 Atmosphère-NX\n *\n * This program is free software; you can redistribute it and/or modify it\n * under the terms and conditions of the GNU General Public License,\n * version 2, as published by the Free Software Foundation.\n *\n * This program is distributed in the hope it will be useful, but WITHOUT\n * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or\n * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for\n * more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\n\n\n\nnamespace ams::sf::hipc {\n\n namespace detail::result { using ResultModuleId = std::integral_constant<int, 11>; };\n\n class ResultOutOfResource : public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 100, 299 + 1> {};\n class ResultOutOfSessionMemory : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 102>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 102, 102 + 1> {};\n class ResultOutOfSessions : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 131>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 131, 139 + 1> {};\n class ResultPointerBufferTooSmall : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 141>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 141, 141 + 1> {};\n\n class ResultOutOfDomains : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 200>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 200, 200 + 1> {};\n\n class ResultSessionClosed : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 301>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 301, 301 + 1> {};\n\n class ResultInvalidRequestSize : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 402>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 402, 402 + 1> {};\n class ResultUnknownCommandType : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 403>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 403, 403 + 1> {};\n\n class ResultInvalidCmifRequest : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 420>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 420, 420 + 1> {};\n\n class ResultTargetNotDomain : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 491>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 491, 491 + 1> {};\n class ResultDomainObjectNotFound : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 492>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 492, 492 + 1> {};\n\n}\n# 33 \"/home/larsvi/botw/lib/NintendoSDK/include/vapours/results.hpp\" 2\n# 1 \"/home/larsvi/botw/lib/NintendoSDK/include/vapours/results/i2c_results.hpp\" 1\n/*\n * Copyright (c) 2018-2020 Atmosphère-NX\n *\n * This program is free software; you can redistribute it and/or modify it\n * under the terms and conditions of the GNU General Public License,\n * version 2, as published by the Free Software Foundation.\n *\n * This program is distributed in the hope it will be useful, but WITHOUT\n * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or\n * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for\n * more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\n\n\n\nnamespace ams::i2c {\n\n namespace detail::result { using ResultModuleId = std::integral_constant<int, 101>; };\n\n class ResultNoAck : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 1>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 1, 1 + 1> {};\n class ResultBusBusy : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 2>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 2, 2 + 1> {};\n class ResultFullCommandList : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 3>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 3, 3 + 1> {};\n class ResultTimedOut : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 4>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 4, 4 + 1> {};\n class ResultUnknownDevice : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 5>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 5, 5 + 1> {};\n\n}\n# 34 \"/home/larsvi/botw/lib/NintendoSDK/include/vapours/results.hpp\" 2\n# 1 \"/home/larsvi/botw/lib/NintendoSDK/include/vapours/results/kvdb_results.hpp\" 1\n/*\n * Copyright (c) 2018-2020 Atmosphère-NX\n *\n * This program is free software; you can redistribute it and/or modify it\n * under the terms and conditions of the GNU General Public License,\n * version 2, as published by the Free Software Foundation.\n *\n * This program is distributed in the hope it will be useful, but WITHOUT\n * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or\n * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for\n * more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\n\n\n\nnamespace ams::kvdb {\n\n namespace detail::result { using ResultModuleId = std::integral_constant<int, 20>; };\n\n class ResultOutOfKeyResource : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 1>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 1, 1 + 1> {};\n class ResultKeyNotFound : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 2>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 2, 2 + 1> {};\n class ResultAllocationFailed : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 4>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 4, 4 + 1> {};\n class ResultInvalidKeyValue : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 5>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 5, 5 + 1> {};\n class ResultBufferInsufficient : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 6>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 6, 6 + 1> {};\n\n class ResultInvalidFilesystemState : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 8>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 8, 8 + 1> {};\n class ResultNotCreated : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 9>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 9, 9 + 1> {};\n\n}\n# 35 \"/home/larsvi/botw/lib/NintendoSDK/include/vapours/results.hpp\" 2\n# 1 \"/home/larsvi/botw/lib/NintendoSDK/include/vapours/results/loader_results.hpp\" 1\n/*\n * Copyright (c) 2018-2020 Atmosphère-NX\n *\n * This program is free software; you can redistribute it and/or modify it\n * under the terms and conditions of the GNU General Public License,\n * version 2, as published by the Free Software Foundation.\n *\n * This program is distributed in the hope it will be useful, but WITHOUT\n * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or\n * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for\n * more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\n\n\n\nnamespace ams::ldr {\n\n namespace detail::result { using ResultModuleId = std::integral_constant<int, 9>; };\n\n class ResultTooLongArgument : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 1>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 1, 1 + 1> {};\n class ResultTooManyArguments : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 2>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 2, 2 + 1> {};\n class ResultTooLargeMeta : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 3>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 3, 3 + 1> {};\n class ResultInvalidMeta : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 4>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 4, 4 + 1> {};\n class ResultInvalidNso : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 5>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 5, 5 + 1> {};\n class ResultInvalidPath : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 6>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 6, 6 + 1> {};\n class ResultTooManyProcesses : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 7>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 7, 7 + 1> {};\n class ResultNotPinned : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 8>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 8, 8 + 1> {};\n class ResultInvalidProgramId : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 9>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 9, 9 + 1> {};\n class ResultInvalidVersion : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 10>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 10, 10 + 1> {};\n class ResultInvalidAcidSignature : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 11>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 11, 11 + 1> {};\n class ResultInvalidNcaSignature : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 12>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 12, 12 + 1> {};\n\n class ResultInsufficientAddressSpace : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 51>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 51, 51 + 1> {};\n class ResultInvalidNro : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 52>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 52, 52 + 1> {};\n class ResultInvalidNrr : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 53>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 53, 53 + 1> {};\n class ResultInvalidSignature : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 54>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 54, 54 + 1> {};\n class ResultInsufficientNroRegistrations : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 55>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 55, 55 + 1> {};\n class ResultInsufficientNrrRegistrations : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 56>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 56, 56 + 1> {};\n class ResultNroAlreadyLoaded : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 57>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 57, 57 + 1> {};\n\n class ResultInvalidAddress : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 81>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 81, 81 + 1> {};\n class ResultInvalidSize : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 82>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 82, 82 + 1> {};\n class ResultNotLoaded : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 84>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 84, 84 + 1> {};\n class ResultNotRegistered : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 85>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 85, 85 + 1> {};\n class ResultInvalidSession : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 86>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 86, 86 + 1> {};\n class ResultInvalidProcess : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 87>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 87, 87 + 1> {};\n\n class ResultUnknownCapability : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 100>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 100, 100 + 1> {};\n class ResultInvalidCapabilityKernelFlags : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 103>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 103, 103 + 1> {};\n class ResultInvalidCapabilitySyscallMask : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 104>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 104, 104 + 1> {};\n class ResultInvalidCapabilityMapRange : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 106>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 106, 106 + 1> {};\n class ResultInvalidCapabilityMapPage : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 107>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 107, 107 + 1> {};\n class ResultInvalidCapabilityInterruptPair : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 111>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 111, 111 + 1> {};\n class ResultInvalidCapabilityApplicationType : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 113>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 113, 113 + 1> {};\n class ResultInvalidCapabilityKernelVersion : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 114>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 114, 114 + 1> {};\n class ResultInvalidCapabilityHandleTable : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 115>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 115, 115 + 1> {};\n class ResultInvalidCapabilityDebugFlags : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 116>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 116, 116 + 1> {};\n\n class ResultInternalError : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 200>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 200, 200 + 1> {};\n\n}\n# 36 \"/home/larsvi/botw/lib/NintendoSDK/include/vapours/results.hpp\" 2\n# 1 \"/home/larsvi/botw/lib/NintendoSDK/include/vapours/results/lr_results.hpp\" 1\n/*\n * Copyright (c) 2018-2020 Atmosphère-NX\n *\n * This program is free software; you can redistribute it and/or modify it\n * under the terms and conditions of the GNU General Public License,\n * version 2, as published by the Free Software Foundation.\n *\n * This program is distributed in the hope it will be useful, but WITHOUT\n * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or\n * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for\n * more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\n\n\n\nnamespace ams::lr {\n\n namespace detail::result { using ResultModuleId = std::integral_constant<int, 8>; };\n\n class ResultProgramNotFound : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 2>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 2, 2 + 1> {};\n class ResultDataNotFound : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 3>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 3, 3 + 1> {};\n class ResultUnknownStorageId : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 4>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 4, 4 + 1> {};\n class ResultHtmlDocumentNotFound : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 6>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 6, 6 + 1> {};\n class ResultAddOnContentNotFound : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 7>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 7, 7 + 1> {};\n class ResultControlNotFound : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 8>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 8, 8 + 1> {};\n class ResultLegalInformationNotFound : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 9>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 9, 9 + 1> {};\n class ResultDebugProgramNotFound : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 10>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 10, 10 + 1> {};\n\n class ResultTooManyRegisteredPaths : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 90>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 90, 90 + 1> {};\n\n}\n# 37 \"/home/larsvi/botw/lib/NintendoSDK/include/vapours/results.hpp\" 2\n# 1 \"/home/larsvi/botw/lib/NintendoSDK/include/vapours/results/ncm_results.hpp\" 1\n/*\n * Copyright (c) 2018-2020 Atmosphère-NX\n *\n * This program is free software; you can redistribute it and/or modify it\n * under the terms and conditions of the GNU General Public License,\n * version 2, as published by the Free Software Foundation.\n *\n * This program is distributed in the hope it will be useful, but WITHOUT\n * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or\n * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for\n * more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\n\n\n\nnamespace ams::ncm {\n\n namespace detail::result { using ResultModuleId = std::integral_constant<int, 5>; };\n\n class ResultInvalidContentStorageBase : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 1>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 1, 1 + 1> {};\n class ResultPlaceHolderAlreadyExists : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 2>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 2, 2 + 1> {};\n class ResultPlaceHolderNotFound : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 3>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 3, 3 + 1> {};\n class ResultContentAlreadyExists : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 4>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 4, 4 + 1> {};\n class ResultContentNotFound : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 5>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 5, 5 + 1> {};\n class ResultContentMetaNotFound : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 7>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 7, 7 + 1> {};\n class ResultAllocationFailed : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 8>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 8, 8 + 1> {};\n class ResultUnknownStorage : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 12>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 12, 12 + 1> {};\n\n class ResultInvalidContentStorage : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 100>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 100, 100 + 1> {};\n class ResultInvalidContentMetaDatabase : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 110>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 110, 110 + 1> {};\n class ResultInvalidPackageFormat : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 130>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 130, 130 + 1> {};\n class ResultInvalidContentHash : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 140>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 140, 140 + 1> {};\n\n class ResultInvalidInstallTaskState : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 160>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 160, 160 + 1> {};\n class ResultInvalidPlaceHolderFile : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 170>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 170, 170 + 1> {};\n class ResultBufferInsufficient : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 180>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 180, 180 + 1> {};\n class ResultWriteToReadOnlyContentStorage : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 190>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 190, 190 + 1> {};\n class ResultNotEnoughInstallSpace : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 200>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 200, 200 + 1> {};\n class ResultSystemUpdateNotFoundInPackage : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 210>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 210, 210 + 1> {};\n class ResultContentInfoNotFound : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 220>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 220, 220 + 1> {};\n class ResultDeltaNotFound : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 237>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 237, 237 + 1> {};\n class ResultInvalidContentMetaKey : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 240>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 240, 240 + 1> {};\n class ResultIgnorableInstallTicketFailure : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 280>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 280, 280 + 1> {};\n\n class ResultContentStorageBaseNotFound : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 310>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 310, 310 + 1> {};\n class ResultListPartiallyNotCommitted : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 330>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 330, 330 + 1> {};\n class ResultUnexpectedContentMetaPrepared : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 360>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 360, 360 + 1> {};\n class ResultInvalidFirmwareVariation : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 380>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 380, 380 + 1> {};\n\n class ResultContentStorageNotActive : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 250>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 250, 258 + 1> {};\n class ResultGameCardContentStorageNotActive : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 251>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 251, 251 + 1> {};\n class ResultBuiltInSystemContentStorageNotActive : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 252>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 252, 252 + 1> {};\n class ResultBuiltInUserContentStorageNotActive : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 253>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 253, 253 + 1> {};\n class ResultSdCardContentStorageNotActive : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 254>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 254, 254 + 1> {};\n class ResultUnknownContentStorageNotActive : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 258>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 258, 258 + 1> {};\n\n class ResultContentMetaDatabaseNotActive : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 260>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 260, 268 + 1> {};\n class ResultGameCardContentMetaDatabaseNotActive : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 261>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 261, 261 + 1> {};\n class ResultBuiltInSystemContentMetaDatabaseNotActive : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 262>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 262, 262 + 1> {};\n class ResultBuiltInUserContentMetaDatabaseNotActive : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 263>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 263, 263 + 1> {};\n class ResultSdCardContentMetaDatabaseNotActive : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 264>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 264, 264 + 1> {};\n class ResultUnknownContentMetaDatabaseNotActive : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 268>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 268, 268 + 1> {};\n\n class ResultInstallTaskCancelled : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 290>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 290, 299 + 1> {};\n class ResultCreatePlaceHolderCancelled : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 291>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 291, 291 + 1> {};\n class ResultWritePlaceHolderCancelled : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 292>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 292, 292 + 1> {};\n\n class ResultInvalidArgument : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 8181>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 8181, 8191 + 1> {};\n class ResultInvalidOffset : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 8182>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 8182, 8182 + 1> {};\n\n}\n# 38 \"/home/larsvi/botw/lib/NintendoSDK/include/vapours/results.hpp\" 2\n# 1 \"/home/larsvi/botw/lib/NintendoSDK/include/vapours/results/nim_results.hpp\" 1\n/*\n * Copyright (c) 2018-2020 Atmosphère-NX\n *\n * This program is free software; you can redistribute it and/or modify it\n * under the terms and conditions of the GNU General Public License,\n * version 2, as published by the Free Software Foundation.\n *\n * This program is distributed in the hope it will be useful, but WITHOUT\n * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or\n * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for\n * more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\n\n\n\nnamespace ams::nim {\n\n namespace detail::result { using ResultModuleId = std::integral_constant<int, 137>; };\n\n class ResultHttpConnectionCanceled : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 70>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 70, 70 + 1> {};\n\n}\n# 39 \"/home/larsvi/botw/lib/NintendoSDK/include/vapours/results.hpp\" 2\n# 1 \"/home/larsvi/botw/lib/NintendoSDK/include/vapours/results/ns_results.hpp\" 1\n/*\n * Copyright (c) 2018-2020 Atmosphère-NX\n *\n * This program is free software; you can redistribute it and/or modify it\n * under the terms and conditions of the GNU General Public License,\n * version 2, as published by the Free Software Foundation.\n *\n * This program is distributed in the hope it will be useful, but WITHOUT\n * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or\n * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for\n * more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\n\n\n\nnamespace ams::ns {\n\n namespace detail::result { using ResultModuleId = std::integral_constant<int, 16>; };\n\n class ResultCanceled : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 90>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 90, 90 + 1> {};\n class ResultOutOfMaxRunningTask : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 110>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 110, 110 + 1> {};\n class ResultCardUpdateNotSetup : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 270>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 270, 270 + 1> {};\n class ResultCardUpdateNotPrepared : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 280>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 280, 280 + 1> {};\n class ResultCardUpdateAlreadySetup : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 290>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 290, 290 + 1> {};\n class ResultPrepareCardUpdateAlreadyRequested : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 460>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 460, 460 + 1> {};\n\n}\n# 40 \"/home/larsvi/botw/lib/NintendoSDK/include/vapours/results.hpp\" 2\n# 1 \"/home/larsvi/botw/lib/NintendoSDK/include/vapours/results/os_results.hpp\" 1\n/*\n * Copyright (c) 2018-2020 Atmosphère-NX\n *\n * This program is free software; you can redistribute it and/or modify it\n * under the terms and conditions of the GNU General Public License,\n * version 2, as published by the Free Software Foundation.\n *\n * This program is distributed in the hope it will be useful, but WITHOUT\n * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or\n * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for\n * more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\n\n\n\nnamespace ams::os {\n\n namespace detail::result { using ResultModuleId = std::integral_constant<int, 3>; };\n\n class ResultBusy : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 4>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 4, 4 + 1> {};\n\n class ResultOutOfMemory : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 8>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 8, 8 + 1> {};\n class ResultOutOfResource : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 9>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 9, 9 + 1> {};\n\n class ResultOutOfVirtualAddressSpace : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 12>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 12, 12 + 1> {};\n class ResultResourceLimit : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 13>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 13, 13 + 1> {};\n\n class ResultOutOfHandles : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 500>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 500, 500 + 1> {};\n class ResultInvalidHandle : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 501>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 501, 501 + 1> {};\n class ResultInvalidCurrentMemoryState : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 502>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 502, 502 + 1> {};\n class ResultInvalidTransferMemoryState : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 503>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 503, 503 + 1> {};\n class ResultInvalidTransferMemorySize : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 504>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 504, 504 + 1> {};\n class ResultOutOfTransferMemory : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 505>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 505, 505 + 1> {};\n class ResultOutOfAddressSpace : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 506>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 506, 506 + 1> {};\n\n}\n# 41 \"/home/larsvi/botw/lib/NintendoSDK/include/vapours/results.hpp\" 2\n# 1 \"/home/larsvi/botw/lib/NintendoSDK/include/vapours/results/pgl_results.hpp\" 1\n/*\n * Copyright (c) 2018-2020 Atmosphère-NX\n *\n * This program is free software; you can redistribute it and/or modify it\n * under the terms and conditions of the GNU General Public License,\n * version 2, as published by the Free Software Foundation.\n *\n * This program is distributed in the hope it will be useful, but WITHOUT\n * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or\n * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for\n * more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\n\n\n\nnamespace ams::pgl {\n\n namespace detail::result { using ResultModuleId = std::integral_constant<int, 228>; };\n\n class ResultNotAvailable : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 2>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 2, 2 + 1> {};\n class ResultApplicationNotRunning : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 3>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 3, 3 + 1> {};\n class ResultBufferNotEnough : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 4>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 4, 4 + 1> {};\n class ResultApplicationContentNotFound : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 5>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 5, 5 + 1> {};\n class ResultContentMetaNotFound : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 6>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 6, 6 + 1> {};\n\n}\n# 42 \"/home/larsvi/botw/lib/NintendoSDK/include/vapours/results.hpp\" 2\n# 1 \"/home/larsvi/botw/lib/NintendoSDK/include/vapours/results/pm_results.hpp\" 1\n/*\n * Copyright (c) 2018-2020 Atmosphère-NX\n *\n * This program is free software; you can redistribute it and/or modify it\n * under the terms and conditions of the GNU General Public License,\n * version 2, as published by the Free Software Foundation.\n *\n * This program is distributed in the hope it will be useful, but WITHOUT\n * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or\n * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for\n * more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\n\n\n\nnamespace ams::pm {\n\n namespace detail::result { using ResultModuleId = std::integral_constant<int, 15>; };\n\n class ResultProcessNotFound : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 1>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 1, 1 + 1> {};\n class ResultAlreadyStarted : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 2>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 2, 2 + 1> {};\n class ResultNotTerminated : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 3>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 3, 3 + 1> {};\n class ResultDebugHookInUse : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 4>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 4, 4 + 1> {};\n class ResultApplicationRunning : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 5>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 5, 5 + 1> {};\n class ResultInvalidSize : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 6>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 6, 6 + 1> {};\n\n}\n# 43 \"/home/larsvi/botw/lib/NintendoSDK/include/vapours/results.hpp\" 2\n# 1 \"/home/larsvi/botw/lib/NintendoSDK/include/vapours/results/psc_results.hpp\" 1\n/*\n * Copyright (c) 2018-2020 Atmosphère-NX\n *\n * This program is free software; you can redistribute it and/or modify it\n * under the terms and conditions of the GNU General Public License,\n * version 2, as published by the Free Software Foundation.\n *\n * This program is distributed in the hope it will be useful, but WITHOUT\n * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or\n * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for\n * more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\n\n\n\nnamespace ams::psc {\n\n namespace detail::result { using ResultModuleId = std::integral_constant<int, 138>; };\n\n class ResultAlreadyInitialized : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 2>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 2, 2 + 1> {};\n class ResultNotInitialized : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 3>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 3, 3 + 1> {};\n\n}\n# 44 \"/home/larsvi/botw/lib/NintendoSDK/include/vapours/results.hpp\" 2\n# 1 \"/home/larsvi/botw/lib/NintendoSDK/include/vapours/results/ro_results.hpp\" 1\n/*\n * Copyright (c) 2018-2020 Atmosphère-NX\n *\n * This program is free software; you can redistribute it and/or modify it\n * under the terms and conditions of the GNU General Public License,\n * version 2, as published by the Free Software Foundation.\n *\n * This program is distributed in the hope it will be useful, but WITHOUT\n * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or\n * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for\n * more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\n\n\n\nnamespace ams::ro {\n\n namespace detail::result { using ResultModuleId = std::integral_constant<int, 22>; };\n\n class ResultRoError : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 1>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 1, 1023 + 1> {};\n class ResultOutOfAddressSpace : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 2>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 2, 2 + 1> {};\n class ResultAlreadyLoaded : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 3>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 3, 3 + 1> {};\n class ResultInvalidNro : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 4>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 4, 4 + 1> {};\n\n class ResultInvalidNrr : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 6>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 6, 6 + 1> {};\n class ResultTooManyNro : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 7>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 7, 7 + 1> {};\n class ResultTooManyNrr : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 8>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 8, 8 + 1> {};\n class ResultNotAuthorized : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 9>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 9, 9 + 1> {};\n class ResultInvalidNrrType : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 10>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 10, 10 + 1> {};\n\n class ResultInternalError : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 1023>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 1023, 1023 + 1> {};\n\n class ResultInvalidAddress : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 1025>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 1025, 1025 + 1> {};\n class ResultInvalidSize : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 1026>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 1026, 1026 + 1> {};\n\n class ResultNotLoaded : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 1028>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 1028, 1028 + 1> {};\n class ResultNotRegistered : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 1029>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 1029, 1029 + 1> {};\n class ResultInvalidSession : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 1030>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 1030, 1030 + 1> {};\n class ResultInvalidProcess : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 1031>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 1031, 1031 + 1> {};\n\n}\n# 45 \"/home/larsvi/botw/lib/NintendoSDK/include/vapours/results.hpp\" 2\n# 1 \"/home/larsvi/botw/lib/NintendoSDK/include/vapours/results/settings_results.hpp\" 1\n/*\n * Copyright (c) 2018-2020 Atmosphère-NX\n *\n * This program is free software; you can redistribute it and/or modify it\n * under the terms and conditions of the GNU General Public License,\n * version 2, as published by the Free Software Foundation.\n *\n * This program is distributed in the hope it will be useful, but WITHOUT\n * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or\n * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for\n * more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\n\n\n\nnamespace ams::settings {\n\n namespace detail::result { using ResultModuleId = std::integral_constant<int, 105>; };\n\n class ResultSettingsItemNotFound : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 11>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 11, 11 + 1> {};\n\n class ResultInternalError : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 100>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 100, 149 + 1> {};\n class ResultSettingsItemKeyAllocationFailed : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 101>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 101, 101 + 1> {};\n class ResultSettingsItemValueAllocationFailed : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 102>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 102, 102 + 1> {};\n\n class ResultInvalidArgument : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 200>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 200, 399 + 1> {};\n class ResultSettingsNameNull : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 201>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 201, 201 + 1> {};\n class ResultSettingsItemKeyNull : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 202>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 202, 202 + 1> {};\n class ResultSettingsItemValueNull : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 203>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 203, 203 + 1> {};\n class ResultSettingsItemKeyBufferNull : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 204>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 204, 204 + 1> {};\n class ResultSettingsItemValueBufferNull : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 205>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 205, 205 + 1> {};\n\n class ResultSettingsNameEmpty : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 221>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 221, 221 + 1> {};\n class ResultSettingsItemKeyEmpty : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 222>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 222, 222 + 1> {};\n\n class ResultSettingsNameTooLong : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 241>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 241, 241 + 1> {};\n class ResultSettingsItemKeyTooLong : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 242>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 242, 242 + 1> {};\n\n class ResultSettingsNameInvalidFormat : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 261>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 261, 261 + 1> {};\n class ResultSettingsItemKeyInvalidFormat : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 262>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 262, 262 + 1> {};\n class ResultSettingsItemValueInvalidFormat : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 263>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 263, 263 + 1> {};\n\n}\n# 46 \"/home/larsvi/botw/lib/NintendoSDK/include/vapours/results.hpp\" 2\n# 1 \"/home/larsvi/botw/lib/NintendoSDK/include/vapours/results/sf_results.hpp\" 1\n/*\n * Copyright (c) 2018-2020 Atmosphère-NX\n *\n * This program is free software; you can redistribute it and/or modify it\n * under the terms and conditions of the GNU General Public License,\n * version 2, as published by the Free Software Foundation.\n *\n * This program is distributed in the hope it will be useful, but WITHOUT\n * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or\n * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for\n * more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\n\n\n\nnamespace ams::sf {\n\n namespace detail::result { using ResultModuleId = std::integral_constant<int, 10>; };\n\n class ResultNotSupported : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 1>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 1, 1 + 1> {};\n class ResultPreconditionViolation : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 3>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 3, 3 + 1> {};\n\n namespace cmif {\n\n class ResultInvalidHeaderSize : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 202>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 202, 202 + 1> {};\n class ResultInvalidInHeader : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 211>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 211, 211 + 1> {};\n class ResultUnknownCommandId : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 221>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 221, 221 + 1> {};\n class ResultInvalidOutRawSize : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 232>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 232, 232 + 1> {};\n class ResultInvalidNumInObjects : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 235>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 235, 235 + 1> {};\n class ResultInvalidNumOutObjects : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 236>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 236, 236 + 1> {};\n class ResultInvalidInObject : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 239>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 239, 239 + 1> {};\n\n class ResultTargetNotFound : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 261>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 261, 261 + 1> {};\n\n class ResultOutOfDomainEntries : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 301>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 301, 301 + 1> {};\n\n }\n\n namespace impl {\n\n class ResultRequestContextChanged : public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 800, 899 + 1> {};\n class ResultRequestInvalidated : public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 801, 809 + 1> {};\n class ResultRequestInvalidatedByUser : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 802>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 802, 802 + 1> {};\n\n }\n\n class ResultRequestDeferred : public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 811, 819 + 1> {};\n class ResultRequestDeferredByUser : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 812>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 812, 812 + 1> {};\n\n}\n# 47 \"/home/larsvi/botw/lib/NintendoSDK/include/vapours/results.hpp\" 2\n# 1 \"/home/larsvi/botw/lib/NintendoSDK/include/vapours/results/sm_results.hpp\" 1\n/*\n * Copyright (c) 2018-2020 Atmosphère-NX\n *\n * This program is free software; you can redistribute it and/or modify it\n * under the terms and conditions of the GNU General Public License,\n * version 2, as published by the Free Software Foundation.\n *\n * This program is distributed in the hope it will be useful, but WITHOUT\n * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or\n * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for\n * more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\n\n\n\nnamespace ams::sm {\n\n namespace detail::result { using ResultModuleId = std::integral_constant<int, 21>; };\n\n class ResultOutOfProcesses : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 1>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 1, 1 + 1> {};\n class ResultInvalidClient : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 2>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 2, 2 + 1> {};\n class ResultOutOfSessions : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 3>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 3, 3 + 1> {};\n class ResultAlreadyRegistered : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 4>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 4, 4 + 1> {};\n class ResultOutOfServices : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 5>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 5, 5 + 1> {};\n class ResultInvalidServiceName : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 6>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 6, 6 + 1> {};\n class ResultNotRegistered : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 7>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 7, 7 + 1> {};\n class ResultNotAllowed : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 8>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 8, 8 + 1> {};\n class ResultTooLargeAccessControl : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 9>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 9, 9 + 1> {};\n\n /* Results 1000-2000 used as extension for Atmosphere Mitm. */\n namespace mitm {\n\n class ResultShouldForwardToSession : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 1000>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 1000, 1000 + 1> {};\n class ResultProcessNotAssociated : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 1100>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 1100, 1100 + 1> {};\n\n }\n\n}\n# 48 \"/home/larsvi/botw/lib/NintendoSDK/include/vapours/results.hpp\" 2\n# 1 \"/home/larsvi/botw/lib/NintendoSDK/include/vapours/results/spl_results.hpp\" 1\n/*\n * Copyright (c) 2018-2020 Atmosphère-NX\n *\n * This program is free software; you can redistribute it and/or modify it\n * under the terms and conditions of the GNU General Public License,\n * version 2, as published by the Free Software Foundation.\n *\n * This program is distributed in the hope it will be useful, but WITHOUT\n * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or\n * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for\n * more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\n\n\n\nnamespace ams::spl {\n\n namespace detail::result { using ResultModuleId = std::integral_constant<int, 26>; };\n\n class ResultSecureMonitorError : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 0>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 0, 99 + 1> {};\n class ResultSecureMonitorNotImplemented : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 1>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 1, 1 + 1> {};\n class ResultSecureMonitorInvalidArgument : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 2>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 2, 2 + 1> {};\n class ResultSecureMonitorBusy : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 3>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 3, 3 + 1> {};\n class ResultSecureMonitorNoAsyncOperation : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 4>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 4, 4 + 1> {};\n class ResultSecureMonitorInvalidAsyncOperation : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 5>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 5, 5 + 1> {};\n class ResultSecureMonitorNotPermitted : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 6>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 6, 6 + 1> {};\n class ResultSecureMonitorNotInitialized : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 7>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 7, 7 + 1> {};\n\n class ResultInvalidSize : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 100>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 100, 100 + 1> {};\n class ResultUnknownSecureMonitorError : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 101>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 101, 101 + 1> {};\n class ResultDecryptionFailed : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 102>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 102, 102 + 1> {};\n\n class ResultOutOfKeySlots : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 104>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 104, 104 + 1> {};\n class ResultInvalidKeySlot : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 105>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 105, 105 + 1> {};\n class ResultBootReasonAlreadySet : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 106>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 106, 106 + 1> {};\n class ResultBootReasonNotSet : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 107>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 107, 107 + 1> {};\n class ResultInvalidArgument : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 108>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 108, 108 + 1> {};\n\n}\n# 49 \"/home/larsvi/botw/lib/NintendoSDK/include/vapours/results.hpp\" 2\n# 1 \"/home/larsvi/botw/lib/NintendoSDK/include/vapours/results/svc_results.hpp\" 1\n/*\n * Copyright (c) 2018-2020 Atmosphère-NX\n *\n * This program is free software; you can redistribute it and/or modify it\n * under the terms and conditions of the GNU General Public License,\n * version 2, as published by the Free Software Foundation.\n *\n * This program is distributed in the hope it will be useful, but WITHOUT\n * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or\n * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for\n * more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\n\n\n\nnamespace ams::svc {\n\n namespace detail::result { using ResultModuleId = std::integral_constant<int, 1>; };\n\n class ResultOutOfSessions : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 7>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 7, 7 + 1> {};\n\n class ResultInvalidArgument : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 14>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 14, 14 + 1> {};\n\n class ResultNotImplemented : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 33>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 33, 33 + 1> {};\n\n class ResultStopProcessingException : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 54>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 54, 54 + 1> {};\n\n class ResultNoSynchronizationObject : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 57>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 57, 57 + 1> {};\n\n class ResultTerminationRequested : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 59>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 59, 59 + 1> {};\n\n class ResultNoEvent : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 70>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 70, 70 + 1> {};\n\n class ResultInvalidSize : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 101>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 101, 101 + 1> {};\n class ResultInvalidAddress : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 102>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 102, 102 + 1> {};\n class ResultOutOfResource : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 103>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 103, 103 + 1> {};\n class ResultOutOfMemory : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 104>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 104, 104 + 1> {};\n class ResultOutOfHandles : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 105>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 105, 105 + 1> {};\n class ResultInvalidCurrentMemory : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 106>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 106, 106 + 1> {};\n\n class ResultInvalidNewMemoryPermission : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 108>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 108, 108 + 1> {};\n\n class ResultInvalidMemoryRegion : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 110>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 110, 110 + 1> {};\n\n class ResultInvalidPriority : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 112>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 112, 112 + 1> {};\n class ResultInvalidCoreId : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 113>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 113, 113 + 1> {};\n class ResultInvalidHandle : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 114>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 114, 114 + 1> {};\n class ResultInvalidPointer : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 115>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 115, 115 + 1> {};\n class ResultInvalidCombination : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 116>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 116, 116 + 1> {};\n class ResultTimedOut : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 117>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 117, 117 + 1> {};\n class ResultCancelled : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 118>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 118, 118 + 1> {};\n class ResultOutOfRange : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 119>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 119, 119 + 1> {};\n class ResultInvalidEnumValue : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 120>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 120, 120 + 1> {};\n class ResultNotFound : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 121>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 121, 121 + 1> {};\n class ResultBusy : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 122>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 122, 122 + 1> {};\n class ResultSessionClosed : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 123>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 123, 123 + 1> {};\n class ResultNotHandled : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 124>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 124, 124 + 1> {};\n class ResultInvalidState : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 125>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 125, 125 + 1> {};\n class ResultReservedUsed : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 126>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 126, 126 + 1> {};\n class ResultNotSupported : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 127>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 127, 127 + 1> {};\n class ResultDebug : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 128>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 128, 128 + 1> {};\n class ResultNoThread : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 129>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 129, 129 + 1> {};\n class ResultUnknownThread : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 130>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 130, 130 + 1> {};\n class ResultPortClosed : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 131>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 131, 131 + 1> {};\n class ResultLimitReached : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 132>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 132, 132 + 1> {};\n class ResultInvalidMemoryPool : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 133>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 133, 133 + 1> {};\n\n class ResultReceiveListBroken : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 258>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 258, 258 + 1> {};\n class ResultOutOfAddressSpace : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 259>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 259, 259 + 1> {};\n class ResultMessageTooLarge : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 260>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 260, 260 + 1> {};\n\n class ResultInvalidProcessId : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 517>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 517, 517 + 1> {};\n class ResultInvalidThreadId : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 518>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 518, 518 + 1> {};\n class ResultInvalidId : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 519>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 519, 519 + 1> {};\n class ResultProcessTerminated : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 520>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 520, 520 + 1> {};\n\n}\n# 50 \"/home/larsvi/botw/lib/NintendoSDK/include/vapours/results.hpp\" 2\n# 1 \"/home/larsvi/botw/lib/NintendoSDK/include/vapours/results/time_results.hpp\" 1\n/*\n * Copyright (c) 2018-2020 Atmosphère-NX\n *\n * This program is free software; you can redistribute it and/or modify it\n * under the terms and conditions of the GNU General Public License,\n * version 2, as published by the Free Software Foundation.\n *\n * This program is distributed in the hope it will be useful, but WITHOUT\n * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or\n * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for\n * more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\n\n\n\nnamespace ams::time {\n\n namespace detail::result { using ResultModuleId = std::integral_constant<int, 116>; };\n\n class ResultNotInitialized : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 0>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 0, 0 + 1> {};\n\n class ResultNotComparable : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 200>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 200, 200 + 1> {};\n class ResultOverflowed : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 201>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 201, 201 + 1> {};\n\n class ResultInvalidArgument : public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 900, 919 + 1> {};\n class ResultInvalidPointer : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 901>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 901, 901 + 1> {};\n\n}\n# 51 \"/home/larsvi/botw/lib/NintendoSDK/include/vapours/results.hpp\" 2\n# 1 \"/home/larsvi/botw/lib/NintendoSDK/include/vapours/results/updater_results.hpp\" 1\n/*\n * Copyright (c) 2018-2020 Atmosphère-NX\n *\n * This program is free software; you can redistribute it and/or modify it\n * under the terms and conditions of the GNU General Public License,\n * version 2, as published by the Free Software Foundation.\n *\n * This program is distributed in the hope it will be useful, but WITHOUT\n * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or\n * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for\n * more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\n\n\n\nnamespace ams::updater {\n\n namespace detail::result { using ResultModuleId = std::integral_constant<int, 158>; };\n\n class ResultBootImagePackageNotFound : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 2>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 2, 2 + 1> {};\n class ResultInvalidBootImagePackage : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 3>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 3, 3 + 1> {};\n class ResultTooSmallWorkBuffer : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 4>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 4, 4 + 1> {};\n class ResultNotAlignedWorkBuffer : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 5>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 5, 5 + 1> {};\n class ResultNeedsRepairBootImages : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 6>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 6, 6 + 1> {};\n\n}\n# 52 \"/home/larsvi/botw/lib/NintendoSDK/include/vapours/results.hpp\" 2\n# 1 \"/home/larsvi/botw/lib/NintendoSDK/include/vapours/results/vi_results.hpp\" 1\n/*\n * Copyright (c) 2018-2020 Atmosphère-NX\n *\n * This program is free software; you can redistribute it and/or modify it\n * under the terms and conditions of the GNU General Public License,\n * version 2, as published by the Free Software Foundation.\n *\n * This program is distributed in the hope it will be useful, but WITHOUT\n * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or\n * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for\n * more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\n\n\n\nnamespace ams::vi {\n\n namespace detail::result { using ResultModuleId = std::integral_constant<int, 114>; };\n\n class ResultOperationFailed : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 1>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 1, 1 + 1> {};\n class ResultNotSupported : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 6>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 6, 6 + 1> {};\n class ResultNotFound : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 7>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 7, 7 + 1> {};\n\n}\n# 53 \"/home/larsvi/botw/lib/NintendoSDK/include/vapours/results.hpp\" 2\n\n/* Unofficial. */\n\n# 1 \"/home/larsvi/botw/lib/NintendoSDK/include/vapours/results/exosphere_results.hpp\" 1\n/*\n * Copyright (c) 2018-2020 Atmosphère-NX\n *\n * This program is free software; you can redistribute it and/or modify it\n * under the terms and conditions of the GNU General Public License,\n * version 2, as published by the Free Software Foundation.\n *\n * This program is distributed in the hope it will be useful, but WITHOUT\n * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or\n * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for\n * more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\n\n\n\nnamespace ams::exosphere {\n\n /* Please note: These results are all custom, and not official. */\n namespace detail::result { using ResultModuleId = std::integral_constant<int, 444>; };\n\n\n /* Result 1-1000 reserved for Atmosphere. */\n class ResultNotPresent : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 1>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 1, 1 + 1> {};\n class ResultVersionMismatch : public ::nn::result::detail::ErrorResultBase<detail::result::ResultModuleId::value, 2>, public ::nn::result::detail::ErrorRange<detail::result::ResultModuleId::value, 2, 2 + 1> {};\n\n}\n# 56 \"/home/larsvi/botw/lib/NintendoSDK/include/vapours/results.hpp\" 2\n# 6 \"/home/larsvi/botw/lib/NintendoSDK/include/nn/types.h\" 2\n\nusing u8 = std::uint8_t;\nusing u16 = std::uint16_t;\nusing u32 = std::uint32_t;\nusing u64 = std::uint64_t;\nusing u128 = __uint128_t;\n\nusing s8 = std::int8_t;\nusing s16 = std::int16_t;\nusing s32 = std::int32_t;\nusing s64 = std::int64_t;\n\nusing f32 = float;\nusing f64 = double;\n\nusing char16 = char16_t;\nusing size_t = std::size_t;\nusing ulong = u64;\nusing ptrdiff_t = std::ptrdiff_t;\n# 9 \"/home/larsvi/botw/lib/NintendoSDK/include/nn/time.h\" 2\n\nnamespace nn {\nclass TimeSpan {\npublic:\n u64 nanoseconds;\n\n static TimeSpan FromNanoSeconds(u64 nanoSeconds) {\n TimeSpan ret;\n ret.nanoseconds = nanoSeconds;\n return ret;\n }\n\n static TimeSpan FromSeconds(u64 seconds) {\n return FromNanoSeconds(seconds * 1000 * 1000 * 1000);\n }\n static TimeSpan FromMinutes(u64 minutes) {\n return FromNanoSeconds(minutes * 1000 * 1000 * 1000 * 60);\n }\n static TimeSpan FromHours(u64 hours) {\n return FromNanoSeconds(hours * 1000 * 1000 * 1000 * 60 * 60);\n }\n static TimeSpan FromDays(u64 days) {\n return FromNanoSeconds(days * 1000 * 1000 * 1000 * 60 * 60 * 24);\n }\n};\n\nnamespace time {\n\nResult Initialize();\nbool IsInitialized();\n\nstruct CalendarTime {\n s16 year;\n s8 month;\n s8 day;\n s8 hour;\n s8 minute;\n s8 second;\n};\n\nenum DayOfTheWeek { Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday };\n\nstruct TimeZone {\n char standardTimeName[0x8];\n bool _9; // daylight savings or something?\n s32 utcOffset; // in seconds\n};\n\nstruct CalendarAdditionalInfo {\n nn::time::DayOfTheWeek dayOfTheWeek;\n s32 dayofYear;\n nn::time::TimeZone timeZone;\n};\n\nstruct PosixTime {\n u64 time;\n};\n\nclass StandardUserSystemClock {\npublic:\n static Result GetCurrentTime(nn::time::PosixTime*);\n};\n\nstruct TimeZoneRule; // shrug\n\nResult ToCalendarTime(nn::time::CalendarTime*, nn::time::CalendarAdditionalInfo*,\n nn::time::PosixTime const&);\nResult ToCalendarTime(nn::time::CalendarTime*, nn::time::CalendarAdditionalInfo*,\n
nn::time::PosixTime const&, nn::time::TimeZoneRule const&);\nResult ToPosixTime(int*, PosixTime*, int, const CalendarTime&);\nCalendarTime ToCalendarTimeInUtc(const PosixTime&);\nPosixTime ToPosixTimeFromUtc(const CalendarTime&);\n} // namespace time\n} // namespace nn\n# 11 \"/home/larsvi/botw/lib/NintendoSDK/include/nn/os.h\" 2\n\n\n# 1 \"/home/larsvi/botw/lib/NintendoSDK/include/nn/os/detail/os_InternalCriticalSection.h\" 1\n\n\n# 1 \"/home/larsvi/botw/lib/NintendoSDK/include/nn/os/detail/os_InternalCriticalSection-os.horizon.h\" 1\n\n\n# 1 \"/home/larsvi/botw/lib/NintendoSDK/include/nn/nn_BitTypes.h\" 1\n\n\n\n\nnamespace nn {\n\ntypedef u8 Bit8;\ntypedef u16 Bit16;\ntypedef u32 Bit32;\ntypedef u64 Bit64;\n\n} // namespace nn\n# 4 \"/home/larsvi/botw/lib/NintendoSDK/include/nn/os/detail/os_InternalCriticalSection-os.horizon.h\" 2\n\nnamespace nn::os::detail {\n\nclass InternalCriticalSectionImplByHorizon {\npublic:\n InternalCriticalSectionImplByHorizon();\n void Initialize();\n void Finalize();\n void Enter();\n bool TryEnter();\n void Leave();\n bool IsLockedByCurrentThread() const;\n void lock();\n void unlock();\n\nprivate:\n Bit32 m_ThreadHandle;\n};\n\ntypedef InternalCriticalSectionImplByHorizon InternalCriticalSectionImpl;\n\n} // namespace nn::os::detail\n# 4 \"/home/larsvi/botw/lib/NintendoSDK/include/nn/os/detail/os_InternalCriticalSection.h\" 2\n# 1 \"/home/larsvi/botw/lib/NintendoSDK/include/nn/util/util_TypedStorage.h\" 1\n\n\n\n\n\nnamespace nn::util {\n\ntemplate <class T, size_t Size, size_t Alignment>\nstruct TypedStorage {\n alignas(Alignment) char storage[Size];\n};\n\n} // namespace nn::util\n# 5 \"/home/larsvi/botw/lib/NintendoSDK/include/nn/os/detail/os_InternalCriticalSection.h\" 2\n\nnamespace nn::os::detail {\n\nclass InternalCriticalSection {\npublic:\n void Initialize();\n void Finalize();\n void Enter();\n bool TryEnter();\n void Leave();\n bool IsLockedByCurrentThread() const;\n void lock();\n void unlock();\n InternalCriticalSectionImpl* Get();\n\nprivate:\n InternalCriticalSectionImpl m_Impl;\n};\n\ntypedef nn::util::TypedStorage<InternalCriticalSection, 4, 4> InternalCriticalSectionStorage;\n\n} // namespace nn::os::detail\n# 14 \"/home/larsvi/botw/lib/NintendoSDK/include/nn/os.h\" 2\n# 1 \"/home/larsvi/botw/lib/NintendoSDK/include/nn/os/os_MessageQueueTypes.h\" 1\n\n\n# 1 \"/home/larsvi/botw/lib/NintendoSDK/include/nn/os/detail/os_InternalConditionVariable.h\" 1\n\n\n# 1 \"/home/larsvi/botw/lib/NintendoSDK/include/nn/os/detail/os_InternalConditionVariable-os.horizon.h\" 1\n\n\n\n# 1 \"/home/larsvi/botw/lib/NintendoSDK/include/nn/os/os_ConditionVariableCommon.h\" 1\n\n\nnamespace nn::os {\n\nenum ConditionVariableStatus { ConditionVariableStatus_Timeout, ConditionVariableStatus_NoTimeout };\n\n} // namespace nn::os\n# 5 \"/home/larsvi/botw/lib/NintendoSDK/include/nn/os/detail/os_InternalConditionVariable-os.horizon.h\" 2\n\n\nnamespace nn::os::detail {\n\nclass TimeoutHelper;\n\nclass InternalConditionVariableImplByHorizon {\npublic:\n InternalConditionVariableImplByHorizon();\n void Initialize();\n void Signal();\n void Broadcast();\n void Wait(InternalCriticalSection*);\n ConditionVariableStatus TimedWait(InternalCriticalSection*, const TimeoutHelper&);\n\nprivate:\n uint32_t m_Value;\n};\n\ntypedef InternalConditionVariableImplByHorizon InternalConditionVariableImpl;\n\n} // namespace nn::os::detail\n# 4 \"/home/larsvi/botw/lib/NintendoSDK/include/nn/os/detail/os_InternalConditionVariable.h\" 2\n\n\nnamespace nn::os::detail {\n\nclass InternalConditionVariable {\n InternalConditionVariableImpl m_Impl;\n\npublic:\n void Initialize();\n void Signal();\n void Broadcast();\n void Wait(InternalCriticalSection*);\n ConditionVariableStatus TimedWait(InternalCriticalSection*, const TimeoutHelper&);\n};\n\ntypedef util::TypedStorage<InternalConditionVariable, 4, 4> InternalConditionVariableStorage;\n\n} // namespace nn::os::detail\n# 4 \"/home/larsvi/botw/lib/NintendoSDK/include/nn/os/os_MessageQueueTypes.h\" 2\n\n\n\nnamespace nn::os {\n\nnamespace detail {\nclass MultiWaitObjectList;\n}\n\nstruct MessageQueueType {\n util::TypedStorage<detail::MultiWaitObjectList, 16, 8> _multiWaitObjectListNotFull;\n util::TypedStorage<detail::MultiWaitObjectList, 16, 8> _multiWaitObjectListNotEmpty;\n uintptr_t* _buffer;\n int _maxCount;\n int _count;\n int _offset;\n uint8_t _state;\n detail::InternalCriticalSectionStorage _csQueue;\n detail::InternalConditionVariableStorage _cvNotFull;\n detail::InternalConditionVariableStorage _cvNotEmpty;\n};\n\n} // namespace nn::os\n# 15 \"/home/larsvi/botw/lib/NintendoSDK/include/nn/os.h\" 2\n# 1 \"/home/larsvi/botw/lib/NintendoSDK/include/nn/os/os_Mutex.h\" 1\n\n\n# 1 \"/home/larsvi/botw/lib/NintendoSDK/include/nn/os/os_MutexTypes.h\" 1\n\n\n\n\n\n\nnamespace nn::os {\n\nstruct ThreadType;\n\nstruct MutexType {\n uint8_t _state;\n bool _isRecursive;\n int _lockLevel;\n int _nestCount;\n ThreadType* _ownerThread;\n union {\n int32_t _mutexImage[1];\n detail::InternalCriticalSectionStorage _mutex;\n };\n};\n\n} // namespace nn::os\n# 4 \"/home/larsvi/botw/lib/NintendoSDK/include/nn/os/os_Mutex.h\" 2\n# 1 \"/home/larsvi/botw/lib/NintendoSDK/include/nn/util.h\" 1\n/**\n * @file util.h\n * @brief Helper functions for OS functionality.\n */\n\n\n\n\n\n\nnamespace nn {\nnamespace util {\n\nenum CharacterEncodingResult { Success, BadLength, InvalidFormat };\n\nCharacterEncodingResult PickOutCharacterFromUtf8String(char*, char const** str);\nCharacterEncodingResult ConvertCharacterUtf8ToUtf32(u32* dest, char const* src);\nCharacterEncodingResult ConvertStringUtf16NativeToUtf8(char*, s32, u16 const*, s32);\nCharacterEncodingResult ConvertStringUtf8ToUtf16Native(u16*, s32, char const*, s32);\n\ns32 SNPrintf(char* s, ulong n, const char* format, ...);\ns32 VSNPrintf(char* s, ulong n, const char* format, va_list arg);\n\nvoid ReferSymbol(const void*);\n} // namespace util\n} // namespace nn\n# 61 \"/home/larsvi/botw/lib/NintendoSDK/include/nn/util.h\"\n// todo: move/rename with more info\n# 70 \"/home/larsvi/botw/lib/NintendoSDK/include/nn/util.h\"\nnamespace nn::detail {\n\n[[noreturn]] void UnexpectedDefaultImpl(const char*, const char*, int);\n\n} // namespace nn::detail\n\n// todo: ifdef to support debug functionality?\n# 5 \"/home/larsvi/botw/lib/NintendoSDK/include/nn/os/os_Mutex.h\" 2\n\nnamespace nn::os {\n\n// todo: figure out where these go\nvoid InitializeMutex(MutexType*, bool, s32);\nvoid FinalizeMutex(MutexType*);\nvoid LockMutex(MutexType*);\nbool TryLockMutex(MutexType*);\nvoid UnlockMutex(MutexType*);\nbool IsMutexLockedByCurrentThread(const MutexType*);\n\nclass Mutex {\n Mutex(const Mutex&) = delete; Mutex& operator=(const Mutex&) = delete;\n Mutex(Mutex&&) = delete; Mutex& operator=(Mutex&&) = delete;\n\npublic:\n explicit Mutex(bool recursive) { InitializeMutex(&m_Mutex, recursive, 0); }\n\n Mutex(bool, int);\n ~Mutex();\n\n void Lock() { LockMutex(&m_Mutex); }\n\n bool TryLock();\n void Unlock() { UnlockMutex(&m_Mutex); }\n bool IsLockedByCurrentThread() const;\n void lock();\n bool try_lock();\n void unlock();\n operator MutexType&();\n operator const MutexType&() const;\n MutexType* GetBase();\n\nprivate:\n MutexType m_Mutex;\n};\n\n} // namespace nn::os\n# 16 \"/home/larsvi/botw/lib/NintendoSDK/include/nn/os.h\" 2\n\n# 1 \"/home/larsvi/botw/lib/NintendoSDK/include/nn/os/os_ThreadTypes.h\" 1\n\n\n\n\n# 1 \"/home/larsvi/botw/lib/NintendoSDK/include/nn/os/detail/os_ThreadTypes-os.horizon.h\" 1\n\n\n\n\nnamespace nn::os::detail {\n\ntypedef uint32_t InternalThreadHandle;\n\n} // namespace nn::os::detail\n# 6 \"/home/larsvi/botw/lib/NintendoSDK/include/nn/os/os_ThreadTypes.h\" 2\n# 1 \"/home/larsvi/botw/lib/NintendoSDK/include/nn/os/os_ThreadCommon.h\" 1\n\n\nnamespace nn::os {\n\ntypedef void (*ThreadFunction)(void*);\n\n} // namespace nn::os\n# 7 \"/home/larsvi/botw/lib/NintendoSDK/include/nn/os/os_ThreadTypes.h\" 2\n\n\nnamespace nn {\n\nnamespace util {\nclass IntrusiveListNode;\n}\n\nnamespace os {\n\nstruct FiberType;\n\nnamespace detail {\nclass MultiWaitObjectList;\n}\n\nstruct ThreadType {\n util::TypedStorage<util::IntrusiveListNode, 16, 8> _allThreadsListNode;\n util::TypedStorage<detail::MultiWaitObjectList, 16, 8> _multiWaitObjectList;\n\n uintptr_t reserved[4];\n\n uint8_t _state;\n bool _stackIsAliased;\n bool _autoRegistered;\n uint8_t _suspendCount;\n int _basePriority;\n void* _originalStack;\n void* _stack;\n size_t _stackSize;\n void* _argument;\n ThreadFunction _threadFunction;\n FiberType* _currentFiber;\n FiberType* _initialFiber;\n uint32_t _lockHistory;\n uintptr_t _tlsValueArray[32];\n char _threadNameBuffer[32];\n const char* _namePointer;\n detail::InternalCriticalSectionStorage _csThread;\n detail::InternalConditionVariableStorage _cvThread;\n detail::InternalThreadHandle _handle;\n};\n\nstatic_assert(sizeof(ThreadType) == 0x1C0, \"Wrong size\");\n\n\n} // namespace os\n\n} // namespace nn\n# 18 \"/home/larsvi/botw/lib/NintendoSDK/include/nn/os.h\" 2\n\nnamespace nn {\nnamespace os {\n\nnamespace detail {\n\nclass MultiWaitObjectList;\nstruct InterProcessEventType {\n enum State {\n State_NotInitialized = 0,\n State_Initialized = 1,\n };\n\n nn::os::detail::InterProcessEventType* _x0;\n nn::os::detail::InterProcessEventType* _x8;\n bool shouldAutoClear;\n u8 state;\n bool isReadableHandleManaged;\n bool isWritableHandleManaged;\n u32 readableHandle;\n u32 writableHandle;\n};\n} // namespace detail\n\ntypedef u64 Tick;\n\nstruct LightEventType {\n std::aligned_storage_t<0xc, 4> storage;\n};\n\nstruct EventType {\n util::TypedStorage<detail::MultiWaitObjectList, 16, 8> _multiWaitObjectList;\n bool _signalState;\n bool _initiallySignaled;\n uint8_t _clearMode;\n uint8_t _state;\n uint32_t _broadcastCounterLower;\n uint32_t _broadcastCounterUpper;\n detail::InternalCriticalSectionStorage _csEvent;\n detail::InternalConditionVariableStorage _cvSignaled;\n};\nstatic_assert(std::is_trivial<EventType>::value, \"EventType non trivial\");\ntypedef EventType Event;\n\nenum EventClearMode { EventClearMode_ManualClear, EventClearMode_AutoClear };\n\nstruct ConditionVariableType {};\n\nstruct SemaphoreType {\n std::aligned_storage_t<0x28, 8> storage;\n};\n\nstruct SystemEvent;\nstruct SystemEventType {\n enum State {\n State_NotInitialized = 0,\n State_InitializedAsEvent = 1,\n State_InitializedAsInterProcessEvent = 2,\n };\n\n union {\n nn::os::EventType event;\n nn::os::detail::InterProcessEventType interProcessEvent;\n };\n u8 state;\n};\n\n// ARG\nvoid SetHostArgc(s32);\ns32 GetHostArgc();\nvoid SetHostArgv(char**);\nchar** GetHostArgv();\n\n// MEMORY\nvoid InitializeVirtualAddressMemory();\nResult AllocateAddressRegion(u64*, u64);\nResult AllocateMemory(u64*, u64);\nResult AllocateMemoryPages(u64, u64);\nvoid AllocateMemoryBlock(u64*, u64);\nvoid FreeMemoryBlock(u64, u64);\nvoid SetMemoryHeapSize(u64);\n\n// QUEUE\nvoid InitializeMessageQueue(nn::os::MessageQueueType*, u64* buf, u64 queueCount);\nvoid FinalizeMessageQueue(nn::os::MessageQueueType*);\n\nbool TrySendMessageQueue(MessageQueueType*, u64);\nvoid SendMessageQueue(MessageQueueType*, u64);\nbool TimedSendMessageQueue(MessageQueueType*, u64, nn::TimeSpan);\n\nbool TryReceiveMessageQueue(u64* out, MessageQueueType*);\nvoid ReceiveMessageQueue(u64* out, MessageQueueType*);\nbool TimedReceiveMessageQueue(u64* out, MessageQueueType*, nn::TimeSpan);\n\nbool TryPeekMessageQueue(u64*, MessageQueueType const*);\nvoid PeekMessageQueue(u64*, MessageQueueType const*);\nbool TimedPeekMessageQueue(u64*, MessageQueueType const*);\n\nbool TryJamMessageQueue(nn::os::MessageQueueType*, u64);\nvoid JamMessageQueue(nn::os::MessageQueueType*, u64);\nbool TimedJamMessageQueue(nn::os::MessageQueueType*, u64, nn::TimeSpan);\n\n// CONDITION VARIABLE\nvoid InitializeConditionVariable(ConditionVariableType*);\nvoid FinalizeConditionVariable(ConditionVariableType*);\n\nvoid SignalConditionVariable(ConditionVariableType*);\nvoid BroadcastConditionVariable(ConditionVariableType*);\nvoid WaitConditionVariable(ConditionVariableType*);\nu8 TimedWaitConditionVariable(ConditionVariableType*, nn::os::MutexType*, nn::TimeSpan);\n\n// THREAD\nResult CreateThread(nn::os::ThreadType*, void (*)(void*), void* arg, void* srcStack, u64 stackSize,\n s32 priority, s32 coreNum);\nResult CreateThread(nn::os::ThreadType*, void (*)(void*), void* arg, void* srcStack, u64 stackSize,\n s32 priority);\nvoid DestroyThread(nn::os::ThreadType*);\nvoid StartThread(nn::os::ThreadType*);\nvoid SetThreadName(nn::os::ThreadType*, char const* threadName);\nvoid SetThreadNamePointer(nn::os::ThreadType*, char const*);\nchar* GetThreadNamePointer(nn::os::ThreadType const*);\nnn::os::ThreadType* GetCurrentThread();\nvoid GetCurrentStackInfo(uintptr_t* stack_addr, size_t* stack_size);\ns32 ChangeThreadPriority(nn::os::ThreadType* thread, s32 priority);\ns32 GetThreadPriority(nn::os::ThreadType const* thread);\nu64 GetThreadId(const nn::os::ThreadType* thread);\nvoid YieldThread();\nvoid SuspendThread(nn::os::ThreadType*);\nvoid ResumeThread(nn::os::ThreadType*);\nvoid SleepThread(nn::TimeSpan);\nvoid WaitThread(nn::os::ThreadType*);\nvoid SetThreadCoreMask(nn::os::ThreadType*, int, u64 mask);\n\n// EVENTS\nvoid InitializeEvent(EventType*, bool initiallySignaled, EventClearMode eventClearMode);\nvoid FinalizeEvent(EventType*);\nvoid SignalEvent(EventType*);\nvoid WaitEvent(EventType*);\nbool TryWaitEvent(EventType*);\nbool TimedWaitEvent(EventType*, nn::TimeSpan);\nvoid ClearEvent(EventType*);\n\n// LIGHT EVENTS\nvoid InitializeLightEvent(LightEventType*, bool initiallySignaled, EventClearMode eventClearMode);\nvoid FinalizeLightEvent(LightEventType*);\nvoid SignalLightEvent(LightEventType*);\nvoid WaitLightEvent(LightEventType*);\nbool TimedWaitLightEvent(LightEventType*, nn::TimeSpan);\nvoid ClearLightEvent(LightEventType*);\n\nTimeSpan ConvertToTimeSpan(Tick ticks);\n\n// SEMAPHORES\nvoid InitializeSemaphore(SemaphoreType* semaphore, s32 initial_count, s32 max_count);\nvoid FinalizeSemaphore(SemaphoreType* semaphore);\nvoid AcquireSemaphore(SemaphoreType* semaphore);\nbool TryAcquireSemaphore(SemaphoreType* semaphore);\nvoid ReleaseSemaphore(SemaphoreType* semaphore);\n\n// EXCEPTION HANDLING\ntypedef union {\n u64 x; ///< 64-bit AArch64 register view.\n u32 w; ///< 32-bit AArch64 register view.\n u32 r; ///< AArch32 register view.\n} CpuRegister;\n/// Armv8 NEON register.\n\ntypedef union {\n u128 v; ///< 128-bit vector view.\n double d; ///< 64-bit double-precision view.\n float s; ///< 32-bit single-precision view.\n} FpuRegister;\n\nstruct UserExceptionInfo {\n u32 ErrorDescription; ///< See \\ref ThreadExceptionDesc.\n u32 pad[3];\n\n CpuRegister CpuRegisters[29]; ///< GPRs 0..28. Note: also contains AArch32 registers.\n CpuRegister FP; ///< Frame pointer.\n CpuRegister LR; ///< Link register.\n CpuRegister SP; ///< Stack pointer.\n CpuRegister PC; ///< Program counter (elr_el1).\n\n u64 padding;\n\n FpuRegister FpuRegisters[32]; ///< 32 general-purpose NEON registers.\n\n u32 PState; ///< pstate & 0xFF0FFE20\n u32 AFSR0;\n u32 AFSR1;\n u32 ESR;\n\n CpuRegister FAR; ///< Fault Address Register.\n};\nvoid SetUserExceptionHandler(void (*)(UserExceptionInfo*), void*, ulong, UserExceptionInfo*);\n\n// OTHER\nvoid GenerateRandomBytes(void*, u64);\nnn::os::Tick GetSystemTick();\nnn::os::Tick GetSystemTickFrequency();\nu64 GetThreadAvailableCoreMask();\nvoid SetMemoryHeapSize(u64 size);\n\n// Thread-local storage\nstruct TlsSlot {\n u32 slot;\n};\nResult AllocateTlsSlot(TlsSlot* slot_out, void (*)(u64));\nvoid FreeTlsSlot(TlsSlot slot);\nu64 GetTlsValue(TlsSlot slot);\nvoid SetTlsValue(TlsSlot slot, u64 value);\nu32 GetCurrentCoreNumber();\n\nnamespace detail {\nextern s32 g_CommandLineParameter;\nextern char** g_CommandLineParameterArgv;\n} // namespace detail\n} // namespace os\n} // namespace nn\n# 8 \"/home/larsvi/botw/lib/sead/include/thread/seadCriticalSection.h\" 2\n\n\n\n# 1 \"/home/larsvi/botw/lib/sead/include/heap/seadDisposer.h\" 1\n\n\n\n\n\n\n# 1 \"/home/larsvi/botw/lib/sead/include/container/seadListImpl.h\" 1\n\n\n\n\n\nnamespace sead\n{\nclass Random;\n\nclass ListNode\n{\npublic:\n ListNode* next() const { return mNext; }\n ListNode* prev() const { return mPrev; }\n bool isLinked() const { return mNext || mPrev; }\n\nprivate:\n friend class ListImpl;\n\n void init_() { *this = {}; }\n void insertBack_(ListNode* node);\n void insertFront_(ListNode* node);\n void erase_();\n\n ListNode* mPrev = nullptr;\n ListNode* mNext = nullptr;\n};\n\nclass ListImpl\n{\npublic:\n __attribute__((always_inline)) ListImpl() : mStartEnd(), mCount(0)\n {\n mStartEnd.mNext = &mStartEnd;\n mStartEnd.mPrev = &mStartEnd;\n }\n\n bool isEmpty() const { return mCount == 0; }\n s32 size() const { return mCount; }\n\n void reverse();\n void shuffle();\n void shuffle(Random* random);\n bool checkLinks() const;\n\nprotected:\n using CompareCallbackImpl = int (*)(const void*, const void*);\n\n template <class T, class ComparePredicate>\n void sort(s32 offset, const ComparePredicate& cmp)\n {\n this->mergeSort<T, ComparePredicate>(offset, cmp);\n }\n\n template <class T, class ComparePredicate>\n void mergeSort(s32 offset, const ComparePredicate& cmp)\n {\n this->mergeSortImpl_<T, ComparePredicate>(mStartEnd.mNext, mStartEnd.mPrev, size(), offset,\n cmp);\n }\n\n void pushBack(ListNode* item)\n {\n mStartEnd.insertFront_(item);\n ++mCount;\n }\n\n void pushFront(ListNode* item)\n {\n mStartEnd.insertBack_(item);\n ++mCount;\n }\n\n ListNode* popBack();\n ListNode* popFront();\n\n void insertBefore(ListNode* node, ListNode* node_to_insert)\n {\n node->insertFront_(node_to_insert);\n ++mCount;\n }\n\n void insertAfter(ListNode* node, ListNode* node_to_insert)\n {\n node->insertBack_(node_to_insert);\n ++mCount;\n }\n\n void erase(ListNode* item)\n {\n item->erase_();\n --mCount;\n }\n\n ListNode* front() const { return mCount > 0 ? mStartEnd.mNext : nullptr; }\n ListNode* back() const { return mCount > 0 ? mStartEnd.mPrev : nullptr; }\n ListNode* nth(int n) const;\n s32 indexOf(const ListNode*) const;\n\n void swap(ListNode* n1, ListNode* n2);\n void moveAfter(ListNode* basis, ListNode* n);\n void moveBefore(ListNode* basis, ListNode* n);\n\n ListNode* find(const void* ptr, s32 offset, CompareCallbackImpl cmp) const;\n void uniq(s32 offset, CompareCallbackImpl cmp);\n\n void clear();\n\n // FIXME: this should take an rvalue reference for predicate.\n template <class T, class ComparePredicate>\n static void mergeSortImpl_(ListNode* front, ListNode* back, s32 num, s32 offset,\n const ComparePredicate& predicate);\n\nprotected:\n ListNode mStartEnd;\n s32 mCount;\n};\n\n} // namespace sead\n# 8 \"/home/larsvi/botw/lib/sead/include/heap/seadDisposer.h\" 2\n\nnamespace sead\n{\nclass Heap;\n\nclass IDisposer\n{\npublic:\n enum class HeapNullOption\n {\n // disposer_heap must not be nullptr for this option.\n AlwaysUseSpecifiedHeap = 0,\n UseSpecifiedOrContainHeap = 1,\n DoNotAppendDisposerIfNoHeapSpecified = 2,\n UseSpecifiedOrCurrentHeap = 3,\n };\n\n IDisposer();\n explicit IDisposer(Heap* disposer_heap,\n HeapNullOption option = HeapNullOption::UseSpecifiedOrCurrentHeap);\n virtual ~IDisposer();\n\n static u32 getListNodeOffset() { return __builtin_offsetof(IDisposer, mListNode); }\n\nprotected:\n Heap* getDisposerHeap_() const { return mDisposerHeap; }\n\nprivate:\n friend class Heap;\n\n Heap* mDisposerHeap;\n ListNode mListNode;\n};\n\n} // namespace sead\n# 12 \"/home/larsvi/botw/lib/sead/include/thread/seadCriticalSection.h\" 2\n\nnamespace sead\n{\nclass Heap;\n\nclass CriticalSection : public IDisposer\n{\npublic:\n CriticalSection();\n explicit CriticalSection(Heap* disposer_heap);\n CriticalSection(Heap* disposer_heap, HeapNullOption heap_null_option);\n ~CriticalSection() override;\n\n CriticalSection(const CriticalSection&) = delete;\n CriticalSection& operator=(const CriticalSection&) = delete;\n\n void lock();\n bool tryLock();\n void unlock();\n\n // For compatibility with the standard Lockable concept.\n bool try_lock() { return tryLock(); }\n\n\n\n\n nn::os::MutexType mCriticalSectionInner;\n\n\n\n};\n\n} // namespace sead\n# 9 \"/home/larsvi/botw/lib/sead/include/prim/seadEnum.h\" 2\n\nnamespace sead\n{\nclass EnumUtil\n{\npublic:\n static void parseText_(char** text_ptr, char* text_all, int size);\n\n static CriticalSection* getParseTextCS_();\n static CriticalSection* getInitValueArrayCS_();\n\n static constexpr int countValues(const char* text_all, size_t text_all_len)\n {\n int count = 1;\n for (size_t i = 0; i < text_all_len; ++i)\n {\n if (text_all[i] == ',')\n ++count;\n }\n return count;\n }\n\nprivate:\n static void skipToWordEnd_(char** p_ptr, char** p_next);\n static void skipToWordStart_(char** p_ptr);\n};\n} // namespace sead\n\n/// Define an enum class. Custom enumerator values are *not* supported.\n///\n/// Example:\n///\n/// SEAD_ENUM(CoreId, cMain, cSub1, cSub2)\n///\n# 208 \"/home/larsvi/botw/lib/sead/include/prim/seadEnum.h\"\n/// Define a complex enum class with custom enumerator values with this macro.\n/// You must then use SEAD_ENUM_EX_VALUES and define the enum values **in the same order**.\n///\n/// Example:\n///\n/// SEAD_ENUM_EX(AssetType, Wave, Stream, Unknown)\n/// or SEAD_ENUM_EX(AssetType, Wave = 0, Stream = 1, Unknown = 0xFF)\n///\n/// followed by\n///\n/// SEAD_ENUM_EX_VALUES(AssetType, 0, 1, 0xFF)\n/// or SEAD_ENUM_EX_VALUES(AssetType, Wave, Stream, Unknown)\n///\n/// at namespace scope.\n///\n/// For the common case where enumerators do not require custom values, use SEAD_ENUM.\n///\n# 424 \"/home/larsvi/botw/lib/sead/include/prim/seadEnum.h\"\n/// For use with SEAD_ENUM_EX.\n# 5 \"/home/larsvi/botw/src/KingSystem/Physics/physDefines.h\" 2\n\n# 1 \"/home/larsvi/botw/src/KingSystem/Utils/BitField.h\" 1\n// Copyright 2014 Tony Wasserka\n// All rights reserved.\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are met:\n//\n// * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n// * Redistributions in binary form must reproduce the above copyright\n// notice, this list of conditions and the following disclaimer in the\n// documentation and/or other materials provided with the distribution.\n// * Neither the name of the owner nor the names of its contributors may\n// be used to endorse or promote products derived from this software\n// without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n\n\n\n\n\n\nnamespace ksys::util {\n\n/*\n * Abstract bitfield class\n *\n * Allows endianness-independent access to individual bitfields within some raw\n * integer value. The assembly generated by this class is identical to the\n * usage of raw bitfields, so it's a perfectly fine replacement.\n *\n * For BitField<X,Y,Z>, X is the distance of the bitfield to the LSB of the\n * raw value, Y is the length in bits of the bitfield. Z is an integer type\n * which determines the sign of the bitfield. Z must have the same size as the\n * raw integer.\n *\n *\n * General usage:\n *\n * Create a new union with the raw integer value as a member.\n * Then for each bitfield you want to expose, add a BitField member\n * in the union. The template parameters are the bit offset and the number\n * of desired bits.\n *\n * Changes in the bitfield members will then get reflected in the raw integer\n * value and vice-versa.\n *\n *\n * Sample usage:\n *\n * union SomeRegister\n * {\n * u32 hex;\n *\n * BitField<0,7,u32> first_seven_bits; // unsigned\n * BitField<7,8,u32> next_eight_bits; // unsigned\n * BitField<3,15,s32> some_signed_fields; // signed\n * };\n *\n * This is equivalent to the little-endian specific code:\n *\n * union SomeRegister\n * {\n * u32 hex;\n *\n * struct\n * {\n * u32 first_seven_bits : 7;\n * u32 next_eight_bits : 8;\n * };\n * struct\n * {\n * u32 : 3; // padding\n * s32 some_signed_fields : 15;\n * };\n * };\n *\n *\n * Caveats:\n *\n * 1)\n * BitField provides automatic casting from and to the storage type where\n * appropriate. However, when using non-typesafe functions like printf, an\n * explicit cast must be performed on the BitField object to make sure it gets\n * passed correctly, e.g.:\n * printf(\"Value: %d\", (s32)some_register.some_signed_fields);\n *\n * 2)\n * Not really a caveat, but potentially irritating: This class is used in some\n * packed structures that do not guarantee proper alignment. Therefore we have\n * to use #pragma pack here not to pack the members of the class, but instead\n * to break GCC's assumption that the members of the class are aligned on\n * sizeof(StorageType).\n */\n#pragma pack(1)\ntemplate <std::size_t position, std::size_t bits, typename T,\n // StorageType is T for non-enum types and the underlying type of T if\n // T is an enumeration. Note that T is wrapped within an enable_if in the\n // former case to workaround compile errors which arise when using\n // std::underlying_type<T>::type directly.\n typename StorageType = typename std::conditional_t<\n std::is_enum<T>::value, std::underlying_type<T>, std::enable_if<true, T>>::type>\nstruct BitField {\n // Force default constructor to be created\n // so that we can use this within unions\n constexpr BitField() = default;\n\n // We declare a user-defined copy assignment operator, so the default copy constructor\n // must be defaulted explicitly to avoid a deprecation warning.\n constexpr BitField(const BitField&) = default;\n\n // This constructor might be considered ambiguous:\n // Would it initialize the storage or just the bitfield?\n // Hence, delete it. Use the assignment operator to set bitfield values!\n BitField(T val) = delete;\n\n inline constexpr void Set(T val) {\n storage =\n (storage & ~GetMask()) | ((static_cast<StorageType>(val) << position) & GetMask());\n }\n\n template <auto bits_ = bits, typename = std::enable_if_t<bits_ == 1>>\n inline constexpr void SetBit(bool set) {\n storage = (storage & ~GetMask()) | (set ? GetMask() : 0);\n }\n\n /// @warning This does *not* check whether the value fits within the mask,\n /// so this might overwrite unrelated fields! Using Set() is preferred.\n inline constexpr void SetUnsafe(T val) {\n storage = (storage & ~GetMask()) | (static_cast<StorageType>(val) << position);\n }\n\n /// @warning Same as SetUnsafe, but assumes this bitfield's bits are zero.\n /// This is intended to be called only once to efficiently initialise a bitfield,\n /// and will break very badly if called more than once. Using Set() is preferred.\n inline constexpr void Init(T val) { storage |= static_cast<StorageType>(val) << position; }\n\n inline constexpr BitField& operator=(const BitField& other) {\n Set(other.Value());\n return *this;\n }\n\n inline constexpr BitField& operator=(T val) {\n Set(val);\n return *this;\n }\n\n\n\n\n\n\n\n inline constexpr BitField& operator |=(T val) { *this = Value() | val; return *this; }\n inline constexpr BitField& operator ^=(T val) { *this = Value() ^ val; return *this; }\n inline constexpr BitField& operator &=(T val) { *this = Value() & val; return *this; }\n inline constexpr BitField& operator +=(T val) { *this = Value() + val; return *this; }\n inline constexpr BitField& operator -=(T val) { *this = Value() - val; return *this; }\n inline constexpr BitField& operator *=(T val) { *this = Value() * val; return *this; }\n inline constexpr BitField& operator /=(T val) { *this = Value() / val; return *this; }\n\n\n constexpr T Value() const {\n if constexpr (IsSigned()) {\n const size_t shift_amount = 8 * sizeof(StorageType) - bits;\n return static_cast<T>((storage << (shift_amount - position)) >> shift_amount);\n } else {\n return static_cast<T>((storage & GetMask()) >> position);\n }\n }\n\n constexpr operator T() const { return Value(); } // NOLINT(google-explicit-constructor)\n static constexpr bool IsSigned() { return std::is_signed<T>(); }\n static constexpr std::size_t StartBit() { return position; }\n static constexpr std::size_t NumBits() { return bits; }\n static constexpr StorageType GetMask() {\n return (std::numeric_limits<StorageTypeU>::max() >> (8 * sizeof(StorageType) - bits))\n << position;\n }\n\nprivate:\n // Unsigned version of StorageType\n using StorageTypeU = std::make_unsigned_t<StorageType>;\n\n StorageType storage;\n\n static_assert(bits + position <= 8 * sizeof(StorageType), \"Bitfield out of range\");\n static_assert(sizeof(T) <= sizeof(StorageType), \"T must fit in StorageType\");\n\n // And, you know, just in case people specify something stupid like bits=position=0x80000000\n static_assert(position < 8 * sizeof(StorageType), \"Invalid position\");\n static_assert(bits <= 8 * sizeof(T), \"Invalid number of bits\");\n static_assert(bits > 0, \"Invalid number of bits\");\n};\n#pragma pack()\n\n/// Return the combined mask for all specified BitFields.\ntemplate <typename Storage, typename... BitFields>\nconstexpr Storage getMaskForBitFields() {\n Storage mask{};\n ((mask |= BitFields::GetMask()), ...);\n return mask;\n}\n\n/// Clear several BitFields at once.\n///\n/// This can sometimes produce better codegen compared to setting each BitField to zero.\n/// (This function builds a mask for all the BitFields and clears those bits in one pass.)\ntemplate <typename Storage, typename... BitFields>\nconstexpr void clearBitFields(Storage* storage, const BitFields&... fields) {\n constexpr Storage mask = getMaskForBitFields<Storage, BitFields...>();\n *storage &= ~mask;\n}\n\n/// Set several BitFields at once.\n///\n/// This can sometimes produce better codegen compared to setting each BitField individually.\n/// (This function builds a mask for all the BitFields and clears those bits in one pass,\n/// then ORs in the new values all at once.)\ntemplate <typename Storage, typename... BitFieldAndValuePairs>\nconstexpr void setBitFields(Storage* storage, const BitFieldAndValuePairs&... pairs) {\n constexpr Storage mask =\n getMaskForBitFields<Storage, typename BitFieldAndValuePairs::first_type...>();\n *storage =\n ((static_cast<Storage>(pairs.second) << pairs.first.StartBit()) | ...) | (*storage & ~mask);\n}\n\n} // namespace ksys::util\n# 7 \"/home/larsvi/botw/src/KingSystem/Physics/physDefines.h\" 2\n\nnamespace ksys::phys {\n\nenum class ContactLayerType {\n Entity,\n Sensor,\n Invalid,\n};\n\nconstexpr int NumContactLayerTypes = 2;\n\nclass ContactLayer { struct CvRef { const ContactLayer& asRef() const { return const_cast<const ContactLayer&>(cvref); } bool is_cv; const volatile ContactLayer& cvref; }; public: enum ValueType { EntityObject,EntitySmallObject,EntityGroundObject,EntityPlayer,EntityNPC,EntityRagdoll,EntityWater,EntityAirWall,EntityGround,EntityGroundSmooth,EntityGroundRough,EntityRope,EntityTree,EntityNPC_NoHitPlayer,EntityHitOnlyWater,EntityWallForClimb,EntityHitOnlyGround,EntityQueryCustomReceiver,EntityForbidden18,EntityNoHit,EntityMeshVisualizer,EntityForbidden21,EntityForbidden22,EntityForbidden23,EntityForbidden24,EntityForbidden25,EntityForbidden26,EntityForbidden27,EntityForbidden28,EntityForbidden29,EntityForbidden30,EntityEnd,SensorObject,SensorSmallObject,SensorPlayer,SensorEnemy,SensorNPC,SensorHorse,SensorRope,SensorAttackPlayer,SensorAttackEnemy,SensorChemical,SensorTerror,SensorHitOnlyInDoor,SensorInDoor,SensorReserve13,SensorReserve14,SensorChemicalElement,SensorAttackCommon,SensorQueryOnly,SensorTree,SensorCamera,SensorMeshVisualizer,SensorNoHit,SensorReserve20,SensorCustomReceiver,SensorEnd }; ContactLayer() : mIdx(0) {} ContactLayer(ValueType value) { setRelativeIndex(value); } ContactLayer(int idx) { setRelativeIndex(idx); } ContactLayer(const ContactLayer& other) = default; ContactLayer& operator=(const ContactLayer& other) = default; ContactLayer& operator=(ValueType value) { setRelativeIndex(value); return *this; } volatile ContactLayer& operator=(ValueType value) volatile { setRelativeIndex(value); return *this; } volatile ContactLayer& operator=(CvRef other) volatile { setRelativeIndex(other.is_cv ? other.cvref.mIdx : other.asRef().mIdx); return *this; } bool operator==(const ContactLayer& rhs) const { return mIdx == rhs.mIdx; } bool operator!=(const ContactLayer& rhs) const { return mIdx != rhs.mIdx; } bool operator==(ValueType value) const { return ValueType(mIdx) == value; } bool operator==(ValueType value) const volatile { return ValueType(mIdx) == value; } bool operator!=(ValueType value) const { return ValueType(mIdx) != value; } bool operator!=(ValueType value) const volatile { return ValueType(mIdx) != value; } ValueType value() const { return static_cast<ValueType>(mIdx); } ValueType value() const volatile { return static_cast<ValueType>(mIdx); } operator int() const volatile { return value(); } operator CvRef() const { return {false, *this}; } operator CvRef() const volatile { return {true, *this}; } bool fromText(const sead::SafeString& name) { for (int i = 0; i < size(); ++i) { if (name.isEqual(text(i))) { mIdx = i; return true; } } return false; } const char* text() const { return text(mIdx); } const char* text() const volatile { return text(mIdx); } static const char* text(int idx) { return text_(idx); } int getRelativeIndex() const { return mIdx; } int getRelativeIndex() const volatile { return mIdx; } void setRelativeIndex(int idx) { do { if (false) { static_cast<void>(u32(idx) < u32(size())); sead::system::detail::CheckFormat(\"range over: %d, [%d - %d)\", idx, 0, size()); } } while (0); mIdx = idx; } void setRelativeIndex(int idx) volatile { do { if (false) { static_cast<void>(u32(idx) < u32(size())); sead::system::detail::CheckFormat(\"range over: %d, [%d - %d)\", idx, 0, size()); } } while (0); mIdx = idx; } const char* getTypeText() const { return \"ContactLayer\"; } const char* getTypeText() const volatile { return \"ContactLayer\"; } constexpr static int size() { return cCount; } constexpr static int getSize() { return size(); } constexpr static int getLastIndex() { return size() - 1; } static void initialize() { text(0); } class iterator { public: explicit iterator(int idx) : mIdx(idx) {} bool operator==(const iterator& rhs) const { return mIdx == rhs.mIdx; } bool operator!=(const iterator& rhs) const { return mIdx != rhs.mIdx; } iterator& operator++() { if (mIdx <= getLastIndex()) { ++mIdx; } else { do { if (false) { static_cast<void>(false); sead::system::detail::CheckFormat(\"enum iterator overflow\"); } } while (0); mIdx = size(); } return *this; } iterator& operator--() { --mIdx; return *this; } ContactLayer operator*() const { return ContactLayer(mIdx); } private: int mIdx; }; static iterator begin() { return iterator(0); } static iterator end() { return iterator(size()); } private: static const char* text_(int idx) { if (u32(idx) >= cCount) return nullptr; static char** spTextPtr = nullptr; if (spTextPtr) return spTextPtr[idx]; { sead::ScopedLock<sead::CriticalSection> lock(sead::EnumUtil::getParseTextCS_()); if (!spTextPtr) { static char* sTextPtr[cCount]; static sead::FixedSafeString<cTextAllLen> sTextAll = sead::SafeString(cTextAll); sead::EnumUtil::parseText_(sTextPtr, sTextAll.getBuffer(), cCount); spTextPtr = sTextPtr; } } return spTextPtr[idx]; } static constexpr const char* cTextAll = \"EntityObject,EntitySmallObject,EntityGroundObject,EntityPlayer,EntityNPC,EntityRagdoll,EntityWater,EntityAirWall,EntityGround,EntityGroundSmooth,EntityGroundRough,EntityRope,EntityTree,EntityNPC_NoHitPlayer,EntityHitOnlyWater,EntityWallForClimb,EntityHitOnlyGround,EntityQueryCustomReceiver,EntityForbidden18,EntityNoHit,EntityMeshVisualizer,EntityForbidden21,EntityForbidden22,EntityForbidden23,EntityForbidden24,EntityForbidden25,EntityForbidden26,EntityForbidden27,EntityForbidden28,EntityForbidden29,EntityForbidden30,EntityEnd,SensorObject,SensorSmallObject,SensorPlayer,SensorEnemy,SensorNPC,SensorHorse,SensorRope,SensorAttackPlayer,SensorAttackEnemy,SensorChemical,SensorTerror,SensorHitOnlyInDoor,SensorInDoor,SensorReserve13,SensorReserve14,SensorChemicalElement,SensorAttackCommon,SensorQueryOnly,SensorTree,SensorCamera,SensorMeshVisualizer,SensorNoHit,SensorReserve20,SensorCustomReceiver,SensorEnd\"; static constexpr size_t cTextAllLen = sizeof(\"EntityObject,EntitySmallObject,EntityGroundObject,EntityPlayer,EntityNPC,EntityRagdoll,EntityWater,EntityAirWall,EntityGround,EntityGroundSmooth,EntityGroundRough,EntityRope,EntityTree,EntityNPC_NoHitPlayer,EntityHitOnlyWater,EntityWallForClimb,EntityHitOnlyGround,EntityQueryCustomReceiver,EntityForbidden18,EntityNoHit,EntityMeshVisualizer,EntityForbidden21,EntityForbidden22,EntityForbidden23,EntityForbidden24,EntityForbidden25,EntityForbidden26,EntityForbidden27,EntityForbidden28,EntityForbidden29,EntityForbidden30,EntityEnd,SensorObject,SensorSmallObject,SensorPlayer,SensorEnemy,SensorNPC,SensorHorse,SensorRope,SensorAttackPlayer,SensorAttackEnemy,SensorChemical,SensorTerror,SensorHitOnlyInDoor,SensorInDoor,SensorReserve13,SensorReserve14,SensorChemicalElement,SensorAttackCommon,SensorQueryOnly,SensorTree,SensorCamera,SensorMeshVisualizer,SensorNoHit,SensorReserve20,SensorCustomReceiver,SensorEnd\"); static constexpr int cCount = sead::EnumUtil::countValues(cTextAll, cTextAllLen); int mIdx; };\n# 77 \"/home/larsvi/botw/src/KingSystem/Physics/physDefines.h\"\nconstexpr int MaxNumLayersPerType = 32;\n\nconstexpr auto FirstEntity = ContactLayer::EntityObject;\nconstexpr auto LastEntity = ContactLayer::EntityMeshVisualizer;\n\nconstexpr auto FirstSensor = ContactLayer::SensorObject;\nconstexpr auto LastSensor = ContactLayer::SensorCustomReceiver;\n\n// If the values of the two following constants are changed, most of the BitFields defined\n// in this file will need to be updated.\nconstexpr int NumRegularEntityLayers = ContactLayer::EntityHitOnlyGround - FirstEntity + 1;\nconstexpr int NumRegularSensorLayers = ContactLayer::SensorMeshVisualizer - FirstSensor + 1;\nstatic_assert(NumRegularEntityLayers == 17);\nstatic_assert(NumRegularSensorLayers == 21);\n\nconstexpr bool isEntityGroundLayer(ContactLayer::ValueType layer) {\n return layer == ContactLayer::EntityGround || layer == ContactLayer::EntityGroundSmooth ||\n layer == ContactLayer::EntityGroundRough;\n}\n\nclass Material { struct CvRef { const Material& asRef() const { return const_cast<const Material&>(cvref); } bool is_cv; const volatile Material& cvref; }; public: enum ValueType { Undefined,Soil,Stone,Sand,Metal,WireNet,Grass,Wood,Water,Snow,Ice,Lava,Bog,HeavySand,Cloth,Glass,Bone,Rope,CharControl,Ragdoll,Surfing,GuardianFoot,HeavySnow,Unused0,LaunchPad,Conveyer,Rail,Grudge,Meat,Vegetable,Bomb,MagicBall,Barrier,AirWall,Misc,GrudgeSlow }; Material() : mIdx(0) {} Material(ValueType value) { setRelativeIndex(value); } Material(int idx) { setRelativeIndex(idx); } Material(const Material& other) = default; Material& operator=(const Material& other) = default; Material& operator=(ValueType value) { setRelativeIndex(value); return *this; } volatile Material& operator=(ValueType value) volatile { setRelativeIndex(value); return *this; } volatile Material& operator=(CvRef other) volatile { setRelativeIndex(other.is_cv ? other.cvref.mIdx : other.asRef().mIdx); return *this; } bool operator==(const Material& rhs) const { return mIdx == rhs.mIdx; } bool operator!=(const Material& rhs) const { return mIdx != rhs.mIdx; } bool operator==(ValueType value) const { return ValueType(mIdx) == value; } bool operator==(ValueType value) const volatile { return ValueType(mIdx) == value; } bool operator!=(ValueType value) const { return ValueType(mIdx) != value; } bool operator!=(ValueType value) const volatile { return ValueType(mIdx) != value; } ValueType value() const { return static_cast<ValueType>(mIdx); } ValueType value() const volatile { return static_cast<ValueType>(mIdx); } operator int() const volatile { return value(); } operator CvRef() const { return {false, *this}; } operator CvRef() const volatile { return {true, *this}; } bool fromText(const sead::SafeString& name) { for (int i = 0; i < size(); ++i) { if (name.isEqual(text(i))) { mIdx = i; return true; } } return false; } const char* text() const { return text(mIdx); } const char* text() const volatile { return text(mIdx); } static const char* text(int idx) { return text_(idx); } int getRelativeIndex() const { return mIdx; } int getRelativeIndex() const volatile { return mIdx; } void setRelativeIndex(int idx) { do { if (false) { static_cast<void>(u32(idx) < u32(size())); sead::system::detail::CheckFormat(\"range over: %d, [%d - %d)\", idx, 0, size()); } } while (0); mIdx = idx; } void setRelativeIndex(int idx) volatile { do { if (false) { static_cast<void>(u32(idx) < u32(size())); sead::system::detail::CheckFormat(\"range over: %d, [%d - %d)\", idx, 0, size()); } } while (0); mIdx = idx; } const char* getTypeText() const { return \"Material\"; } const char* getTypeText() const volatile { return \"Material\"; } constexpr static int size() { return cCount; } constexpr static int getSize() { return size(); } constexpr static int getLastIndex() { return size() - 1; } static void initialize() { text(0); } class iterator { public: explicit iterator(int idx) : mIdx(idx) {} bool operator==(const iterator& rhs) const { return mIdx == rhs.mIdx; } bool operator!=(const iterator& rhs) const { return mIdx != rhs.mIdx; } iterator& operator++() { if (mIdx <= getLastIndex()) { ++mIdx; } else { do { if (false) { static_cast<void>(false); sead::system::detail::CheckFormat(\"enum iterator overflow\"); } } while (0); mIdx = size(); } return *this; } iterator& operator--() { --mIdx; return *this; } Material operator*() const { return Material(mIdx); } private: int mIdx; }; static iterator begin() { return iterator(0); } static iterator end() { return iterator(size()); } private: static const char* text_(int idx) { if (u32(idx) >= cCount) return nullptr; static char** spTextPtr = nullptr; if (spTextPtr) return spTextPtr[idx]; { sead::ScopedLock<sead::CriticalSection> lock(sead::EnumUtil::getParseTextCS_()); if (!spTextPtr) { static char* sTextPtr[cCount]; static sead::FixedSafeString<cTextAllLen> sTextAll = sead::SafeString(cTextAll); sead::EnumUtil::parseText_(sTextPtr, sTextAll.getBuffer(), cCount); spTextPtr = sTextPtr; } } return spTextPtr[idx]; } static constexpr const char* cTextAll = \"Undefined,Soil,Stone,Sand,Metal,WireNet,Grass,Wood,Water,Snow,Ice,Lava,Bog,HeavySand,Cloth,Glass,Bone,Rope,CharControl,Ragdoll,Surfing,GuardianFoot,HeavySnow,Unused0,LaunchPad,Conveyer,Rail,Grudge,Meat,Vegetable,Bomb,MagicBall,Barrier,AirWall,Misc,GrudgeSlow\"; static constexpr size_t cTextAllLen = sizeof(\"Undefined,Soil,Stone,Sand,Metal,WireNet,Grass,Wood,Water,Snow,Ice,Lava,Bog,HeavySand,Cloth,Glass,Bone,Rope,CharControl,Ragdoll,Surfing,GuardianFoot,HeavySnow,Unused0,LaunchPad,Conveyer,Rail,Grudge,Meat,Vegetable,Bomb,MagicBall,Barrier,AirWall,Misc,GrudgeSlow\"); static constexpr int cCount = sead::EnumUtil::countValues(cTextAll, cTextAllLen); int mIdx; };\n# 136 \"/home/larsvi/botw/src/KingSystem/Physics/physDefines.h\"\nconstexpr bool isInvalidMaterial(Material::ValueType mat) {\n return mat >= Material::size();\n}\n\nclass GroundHit { struct CvRef { const GroundHit& asRef() const { return const_cast<const GroundHit&>(cvref); } bool is_cv; const volatile GroundHit& cvref; }; public: enum ValueType { Player,Animal,NPC,Camera,AttackHitPlayer,AttackHitEnemy,Arrow,Bomb,Magnet,CameraBody,IK,Grudge,MovingTrolley,LineOfSight,Giant,HitAll,Ignore }; GroundHit() : mIdx(0) {} GroundHit(ValueType value) { setRelativeIndex(value); } GroundHit(int idx) { setRelativeIndex(idx); } GroundHit(const GroundHit& other) = default; GroundHit& operator=(const GroundHit& other) = default; GroundHit& operator=(ValueType value) { setRelativeIndex(value); return *this; } volatile GroundHit& operator=(ValueType value) volatile { setRelativeIndex(value); return *this; } volatile GroundHit& operator=(CvRef other) volatile { setRelativeIndex(other.is_cv ? other.cvref.mIdx : other.asRef().mIdx); return *this; } bool operator==(const GroundHit& rhs) const { return mIdx == rhs.mIdx; } bool operator!=(const GroundHit& rhs) const { return mIdx != rhs.mIdx; } bool operator==(ValueType value) const { return ValueType(mIdx) == value; } bool operator==(ValueType value) const volatile { return ValueType(mIdx) == value; } bool operator!=(ValueType value) const { return ValueType(mIdx) != value; } bool operator!=(ValueType value) const volatile { return ValueType(mIdx) != value; } ValueType value() const { return static_cast<ValueType>(mIdx); } ValueType value() const volatile { return static_cast<ValueType>(mIdx); } operator int() const volatile { return value(); } operator CvRef() const { return {false, *this}; } operator CvRef() const volatile { return {true, *this}; } bool fromText(const sead::SafeString& name) { for (int i = 0; i < size(); ++i) { if (name.isEqual(text(i))) { mIdx = i; return true; } } return false; } const char* text() const { return text(mIdx); } const char* text() const volatile { return text(mIdx); } static const char* text(int idx) { return text_(idx); } int getRelativeIndex() const { return mIdx; } int getRelativeIndex() const volatile { return mIdx; } void setRelativeIndex(int idx) { do { if (false) { static_cast<void>(u32(idx) < u32(size())); sead::system::detail::CheckFormat(\"range over: %d, [%d - %d)\", idx, 0, size()); } } while (0); mIdx = idx; } void setRelativeIndex(int idx) volatile { do { if (false) { static_cast<void>(u32(idx) < u32(size())); sead::system::detail::CheckFormat(\"range over: %d, [%d - %d)\", idx, 0, size()); } } while (0); mIdx = idx; } const char* getTypeText() const { return \"GroundHit\"; } const char* getTypeText() const volatile { return \"GroundHit\"; } constexpr static int size() { return cCount; } constexpr static int getSize() { return size(); } constexpr static int getLastIndex() { return size() - 1; } static void initialize() { text(0); } class iterator { public: explicit iterator(int idx) : mIdx(idx) {} bool operator==(const iterator& rhs) const { return mIdx == rhs.mIdx; } bool operator!=(const iterator& rhs) const { return mIdx != rhs.mIdx; } iterator& operator++() { if (mIdx <= getLastIndex()) { ++mIdx; } else { do { if (false) { static_cast<void>(false); sead::system::detail::CheckFormat(\"enum iterator overflow\"); } } while (0); mIdx = size(); } return *this; } iterator& operator--() { --mIdx; return *this; } GroundHit operator*() const { return GroundHit(mIdx); } private: int mIdx; }; static iterator begin() { return iterator(0); } static iterator end() { return iterator(size()); } private: static const char* text_(int idx) { if (u32(idx) >= cCount) return nullptr; static char** spTextPtr = nullptr; if (spTextPtr) return spTextPtr[idx]; { sead::ScopedLock<sead::CriticalSection> lock(sead::EnumUtil::getParseTextCS_()); if (!spTextPtr) { static char* sTextPtr[cCount]; static sead::FixedSafeString<cTextAllLen> sTextAll = sead::SafeString(cTextAll); sead::EnumUtil::parseText_(sTextPtr, sTextAll.getBuffer(), cCount); spTextPtr = sTextPtr; } } return spTextPtr[idx]; } static constexpr const char* cTextAll = \"Player,Animal,NPC,Camera,AttackHitPlayer,AttackHitEnemy,Arrow,Bomb,Magnet,CameraBody,IK,Grudge,MovingTrolley,LineOfSight,Giant,HitAll,Ignore\"; static constexpr size_t cTextAllLen = sizeof(\"Player,Animal,NPC,Camera,AttackHitPlayer,AttackHitEnemy,Arrow,Bomb,Magnet,CameraBody,IK,Grudge,MovingTrolley,LineOfSight,Giant,HitAll,Ignore\"); static constexpr int cCount = sead::EnumUtil::countValues(cTextAll, cTextAllLen); int mIdx; };\n# 160 \"/home/larsvi/botw/src/KingSystem/Physics/physDefines.h\"\nclass FloorCode { struct CvRef { const FloorCode& asRef() const { return const_cast<const FloorCode&>(cvref); } bool is_cv; const volatile FloorCode& cvref; }; public: enum ValueType { None,Return,FlowStraight,FlowLeft,FlowRight,Slip,NarrowPlace,TopBroadleafTree,TopConiferousTree,Fall,Attach,NoImpulseUpperMove,NoPreventFall }; FloorCode() : mIdx(0) {} FloorCode(ValueType value) { setRelativeIndex(value); } FloorCode(int idx) { setRelativeIndex(idx); } FloorCode(const FloorCode& other) = default; FloorCode& operator=(const FloorCode& other) = default; FloorCode& operator=(ValueType value) { setRelativeIndex(value); return *this; } volatile FloorCode& operator=(ValueType value) volatile { setRelativeIndex(value); return *this; } volatile FloorCode& operator=(CvRef other) volatile { setRelativeIndex(other.is_cv ? other.cvref.mIdx : other.asRef().mIdx); return *this; } bool operator==(const FloorCode& rhs) const { return mIdx == rhs.mIdx; } bool operator!=(const FloorCode& rhs) const { return mIdx != rhs.mIdx; } bool operator==(ValueType value) const { return ValueType(mIdx) == value; } bool operator==(ValueType value) const volatile { return ValueType(mIdx) == value; } bool operator!=(ValueType value) const { return ValueType(mIdx) != value; } bool operator!=(ValueType value) const volatile { return ValueType(mIdx) != value; } ValueType value() const { return static_cast<ValueType>(mIdx); } ValueType value() const volatile { return static_cast<ValueType>(mIdx); } operator int() const volatile { return value(); } operator CvRef() const { return {false, *this}; } operator CvRef() const volatile { return {true, *this}; } bool fromText(const sead::SafeString& name) { for (int i = 0; i < size(); ++i) { if (name.isEqual(text(i))) { mIdx = i; return true; } } return false; } const char* text() const { return text(mIdx); } const char* text() const volatile { return text(mIdx); } static const char* text(int idx) { return text_(idx); } int getRelativeIndex() const { return mIdx; } int getRelativeIndex() const volatile { return mIdx; } void setRelativeIndex(int idx) { do { if (false) { static_cast<void>(u32(idx) < u32(size())); sead::system::detail::CheckFormat(\"range over: %d, [%d - %d)\", idx, 0, size()); } } while (0); mIdx = idx; } void setRelativeIndex(int idx) volatile { do { if (false) { static_cast<void>(u32(idx) < u32(size())); sead::system::detail::CheckFormat(\"range over: %d, [%d - %d)\", idx, 0, size()); } } while (0); mIdx = idx; } const char* getTypeText() const { return \"FloorCode\"; } const char* getTypeText() const volatile { return \"FloorCode\"; } constexpr static int size() { return cCount; } constexpr static int getSize() { return size(); } constexpr static int getLastIndex() { return size() - 1; } static void initialize() { text(0); } class iterator { public: explicit iterator(int idx) : mIdx(idx) {} bool operator==(const iterator& rhs) const { return mIdx == rhs.mIdx; } bool operator!=(const iterator& rhs) const { return mIdx != rhs.mIdx; } iterator& operator++() { if (mIdx <= getLastIndex()) { ++mIdx; } else { do { if (false) { static_cast<void>(false); sead::system::detail::CheckFormat(\"enum iterator overflow\"); } } while (0); mIdx = size(); } return *this; } iterator& operator--() { --mIdx; return *this; } FloorCode operator*() const { return FloorCode(mIdx); } private: int mIdx; }; static iterator begin() { return iterator(0); } static iterator end() { return iterator(size()); } private: static const char* text_(int idx) { if (u32(idx) >= cCount) return nullptr; static char** spTextPtr = nullptr; if (spTextPtr) return spTextPtr[idx]; { sead::ScopedLock<sead::CriticalSection> lock(sead::EnumUtil::getParseTextCS_()); if (!spTextPtr) { static char* sTextPtr[cCount]; static sead::FixedSafeString<cTextAllLen> sTextAll = sead::SafeString(cTextAll); sead::EnumUtil::parseText_(sTextPtr, sTextAll.getBuffer(), cCount); spTextPtr = sTextPtr; } } return spTextPtr[idx]; } static constexpr const char* cTextAll = \"None,Return,FlowStraight,FlowLeft,FlowRight,Slip,NarrowPlace,TopBroadleafTree,TopConiferousTree,Fall,Attach,NoImpulseUpperMove,NoPreventFall\"; static constexpr size_t cTextAllLen = sizeof(\"None,Return,FlowStraight,FlowLeft,FlowRight,Slip,NarrowPlace,TopBroadleafTree,TopConiferousTree,Fall,Attach,NoImpulseUpperMove,NoPreventFall\"); static constexpr int cCount = sead::EnumUtil::countValues(cTextAll, cTextAllLen); int mIdx; };\n# 176 \"/home/larsvi/botw/src/KingSystem/Physics/physDefines.h\"\nclass WallCode { struct CvRef { const WallCode& asRef() const { return const_cast<const WallCode&>(cvref); } bool is_cv; const volatile WallCode& cvref; }; public: enum ValueType { None,NoClimb,Hang,LadderUp,Ladder,Slip,LadderSide,NoSlipRain,NoDashUpAndNoClimb,IceMakerBlock }; WallCode() : mIdx(0) {} WallCode(ValueType value) { setRelativeIndex(value); } WallCode(int idx) { setRelativeIndex(idx); } WallCode(const WallCode& other) = default; WallCode& operator=(const WallCode& other) = default; WallCode& operator=(ValueType value) { setRelativeIndex(value); return *this; } volatile WallCode& operator=(ValueType value) volatile { setRelativeIndex(value); return *this; } volatile WallCode& operator=(CvRef other) volatile { setRelativeIndex(other.is_cv ? other.cvref.mIdx : other.asRef().mIdx); return *this; } bool operator==(const WallCode& rhs) const { return mIdx == rhs.mIdx; } bool operator!=(const WallCode& rhs) const { return mIdx != rhs.mIdx; } bool operator==(ValueType value) const { return ValueType(mIdx) == value; } bool operator==(ValueType value) const volatile { return ValueType(mIdx) == value; } bool operator!=(ValueType value) const { return ValueType(mIdx) != value; } bool operator!=(ValueType value) const volatile { return ValueType(mIdx) != value; } ValueType value() const { return static_cast<ValueType>(mIdx); } ValueType value() const volatile { return static_cast<ValueType>(mIdx); } operator int() const volatile { return value(); } operator CvRef() const { return {false, *this}; } operator CvRef() const volatile { return {true, *this}; } bool fromText(const sead::SafeString& name) { for (int i = 0; i < size(); ++i) { if (name.isEqual(text(i))) { mIdx = i; return true; } } return false; } const char* text() const { return text(mIdx); } const char* text() const volatile { return text(mIdx); } static const char* text(int idx) { return text_(idx); } int getRelativeIndex() const { return mIdx; } int getRelativeIndex() const volatile { return mIdx; } void setRelativeIndex(int idx) { do { if (false) { static_cast<void>(u32(idx) < u32(size())); sead::system::detail::CheckFormat(\"range over: %d, [%d - %d)\", idx, 0, size()); } } while (0); mIdx = idx; } void setRelativeIndex(int idx) volatile { do { if (false) { static_cast<void>(u32(idx) < u32(size())); sead::system::detail::CheckFormat(\"range over: %d, [%d - %d)\", idx, 0, size()); } } while (0); mIdx = idx; } const char* getTypeText() const { return \"WallCode\"; } const char* getTypeText() const volatile { return \"WallCode\"; } constexpr static int size() { return cCount; } constexpr static int getSize() { return size(); } constexpr static int getLastIndex() { return size() - 1; } static void initialize() { text(0); } class iterator { public: explicit iterator(int idx) : mIdx(idx) {} bool operator==(const iterator& rhs) const { return mIdx == rhs.mIdx; } bool operator!=(const iterator& rhs) const { return mIdx != rhs.mIdx; } iterator& operator++() { if (mIdx <= getLastIndex()) { ++mIdx; } else { do { if (false) { static_cast<void>(false); sead::system::detail::CheckFormat(\"enum iterator overflow\"); } } while (0); mIdx = size(); } return *this; } iterator& operator--() { --mIdx; return *this; } WallCode operator*() const { return WallCode(mIdx); } private: int mIdx; }; static iterator begin() { return iterator(0); } static iterator end() { return iterator(size()); } private: static const char* text_(int idx) { if (u32(idx) >= cCount) return nullptr; static char** spTextPtr = nullptr; if (spTextPtr) return spTextPtr[idx]; { sead::ScopedLock<sead::CriticalSection> lock(sead::EnumUtil::getParseTextCS_()); if (!spTextPtr) { static char* sTextPtr[cCount]; static sead::FixedSafeString<cTextAllLen> sTextAll = sead::SafeString(cTextAll); sead::EnumUtil::parseText_(sTextPtr, sTextAll.getBuffer(), cCount); spTextPtr = sTextPtr; } } return spTextPtr[idx]; } static constexpr const char* cTextAll = \"None,NoClimb,Hang,LadderUp,Ladder,Slip,LadderSide,NoSlipRain,NoDashUpAndNoClimb,IceMakerBlock\"; static constexpr size_t cTextAllLen = sizeof(\"None,NoClimb,Hang,LadderUp,Ladder,Slip,LadderSide,NoSlipRain,NoDashUpAndNoClimb,IceMakerBlock\"); static constexpr int cCount = sead::EnumUtil::countValues(cTextAll, cTextAllLen); int mIdx; };\n# 189 \"/home/larsvi/botw/src/KingSystem/Physics/physDefines.h\"\nenum class MotionType {\n Dynamic = 0,\n Fixed = 1,\n Keyframed = 2,\n Unknown = 3,\n Invalid = -1,\n};\n\nenum class GroundCollisionMode {\n /// Ground collision is not handled in any special way.\n Normal = 0,\n /// Any collision with a non-ground layer is ignored.\n IgnoreNonGround = 1,\n /// Any collision with a ground layer is ignored.\n IgnoreGround = 2,\n};\n\nenum class WaterCollisionMode {\n /// Water collision is not handled in any special way.\n Normal = 0,\n /// Any collision with a water layer is ignored.\n IgnoreWater = 1,\n};\n\n/// Collision filter info / collision mask that is used for entity rigid bodies.\n/// https://docs.google.com/spreadsheets/d/e/2PACX-1vQyEL5_Wee3MI23c-nHa4dMPJDVen9TMMcrOUX7Wka9NAH1AW9bkkq7ZJHawJkSzGOqgHUYc-83t4Or/pubhtml\nunion EntityCollisionMask {\n union RegularMask {\n ContactLayer getLayer() const { return int(layer); }\n ContactLayer getLayerSensor() const { return int(layer + FirstSensor); }\n GroundHit getGroundHit() const { return int(ground_hit); }\n\n u32 raw;\n util::BitField<0, 5, u32> layer;\n\n /// Only valid for ragdoll masks.\n util::BitField<5, 5, u32> ragdoll_bone_index;\n /// Only valid for ragdoll masks.\n util::BitField<10, 5, u32> ragdoll_parent_bone_index;\n\n /// Only valid for CustomReceiver masks.\n /// Layers to collide with for EntityQueryCustomReceiver entities.\n util::BitField<5, NumRegularEntityLayers, u32> query_custom_receiver_layer_mask;\n\n /// Only valid for non-CustomReceiver masks.\n util::BitField<16, 10, u32> group_handler_index;\n util::BitField<26, 4, u32> ground_hit;\n };\n\n union GroundHitMask {\n ContactLayer getLayer() const { return int(layer); }\n\n void addGroundHit(GroundHit hit) {\n raw |= (1 << hit) << decltype(ground_hit_types)::StartBit();\n }\n\n u32 raw;\n util::BitField<0, 1, u32> unk;\n util::BitField<8, 16, u32> ground_hit_types;\n util::BitField<23, 1, u32> unk23;\n util::BitField<25, 5, u32> layer;\n };\n\n constexpr explicit EntityCollisionMask(u32 raw_ = 0) : raw(raw_) {}\n constexpr EntityCollisionMask(const EntityCollisionMask&) = default;\n constexpr EntityCollisionMask& operator=(const EntityCollisionMask& m) {\n raw = m.raw;\n return *this;\n }\n\n bool operator==(EntityCollisionMask rhs) const { return raw == rhs.raw; }\n bool operator!=(EntityCollisionMask rhs) const { return raw != rhs.raw; }\n\n static EntityCollisionMask make(ContactLayer layer, GroundHit ground_hit) {\n EntityCollisionMask mask;\n mask.regular.layer.Init(layer);\n mask.regular.ground_hit.Init(ground_hit);\n return mask;\n }\n\n ContactLayer getLayer() const {\n return is_ground_hit_mask ? ground_hit.getLayer() : regular.getLayer();\n }\n\n ContactLayer getLayerSensor() const {\n return is_ground_hit_mask ? ContactLayer(ContactLayer::SensorCustomReceiver) :\n regular.getLayerSensor();\n }\n\n GroundHit getGroundHit() const {\n return is_ground_hit_mask ? GroundHit::HitAll : regular.getGroundHit();\n }\n\n u32 raw;\n RegularMask regular;\n GroundHitMask ground_hit;\n /// Only valid in non-ragdoll, non-CustomReceiver mode.\n util::BitField<5, 2, GroundCollisionMode, u32> ground_col_mode;\n /// Only valid in non-ragdoll, non-CustomReceiver mode.\n util::BitField<7, 1, WaterCollisionMode, u32> water_col_mode;\n /// If this flag is set, then this entity will always collide with ground or water,\n /// regardless of the configured GroundCollisionMode or WaterCollisionMode modes.\n util::BitField<30, 1, bool, u32> is_ragdoll;\n util::BitField<31, 1, bool, u32> is_ground_hit_mask;\n};\nstatic_assert(sizeof(EntityCollisionMask) == sizeof(u32));\n\n/// Collision mask that is used for raycast-based queries against entities.\nunion EntityQueryCollisionMask {\n constexpr explicit EntityQueryCollisionMask(u32 raw_ = 0) : raw(raw_) {}\n constexpr EntityQueryCollisionMask(const EntityQueryCollisionMask&) = default;\n constexpr EntityQueryCollisionMask& operator=(const EntityQueryCollisionMask& m) {\n raw = m.raw;\n return *this;\n }\n constexpr bool operator==(EntityQueryCollisionMask rhs) const { return raw == rhs.raw; }\n constexpr bool operator!=(EntityQueryCollisionMask rhs) const { return raw != rhs.raw; }\n\n util::BitField<0, NumRegularEntityLayers, u32> layer_mask;\n util::BitField<17, 1, u32> unk;\n util::BitField<18, 10, u32> group_handler_index;\n util::BitField<28, 4, GroundHit::ValueType, u32> ground_hit_type;\n u32 raw;\n};\n\nunion SensorCollisionMask {\n struct CustomReceiverTag {};\n\n union Data {\n ContactLayer getLayer() const { return int(layer) + FirstSensor; }\n\n /// The sensor's contact layer.\n /// @note Add FirstSensor to get the actual ContactLayer value.\n util::BitField<0, 5, u32> layer;\n /// Whether `ignored_layer` contains a valid layer.\n util::BitField<5, 1, bool, u32> has_ignored_layer;\n /// Contact layer to ignore during collision detection. Only valid if `has_ignored_layer`.\n /// @note Add FirstSensor to get the actual ContactLayer value.\n util::BitField<6, 5, u32> ignored_layer;\n };\n\n union CustomReceiverData {\n util::BitField<0, NumRegularSensorLayers, u32> layer;\n util::BitField<0, NumRegularSensorLayers, u32> layer_mask;\n };\n\n constexpr SensorCollisionMask() : raw(0) {}\n constexpr explicit SensorCollisionMask(CustomReceiverTag) : raw(0) {\n is_custom_receiver = true;\n }\n constexpr explicit SensorCollisionMask(u32 raw_) : raw(raw_) {}\n constexpr SensorCollisionMask(const SensorCollisionMask&) = default;\n constexpr SensorCollisionMask& operator=(const SensorCollisionMask& m) {\n raw = m.raw;\n return *this;\n }\n\n static SensorCollisionMask make(ContactLayer layer) {\n SensorCollisionMask mask;\n if (layer == ContactLayer::SensorCustomReceiver) {\n mask.is_custom_receiver = true;\n mask.custom_receiver_data.layer.Init(ContactLayer::SensorCustomReceiver - FirstSensor);\n } else {\n mask.is_custom_receiver = false;\n mask.data.layer.Init(layer - FirstSensor);\n }\n return mask;\n }\n\n ContactLayer getLayer() const {\n return is_custom_receiver ? ContactLayer::SensorCustomReceiver : data.getLayer();\n }\n\n u32 raw;\n Data data;\n CustomReceiverData custom_receiver_data;\n util::BitField<21, 10, u32> group_handler_index;\n util::BitField<31, 1, bool, u32> is_custom_receiver;\n};\n\n/// Collision mask that is used for raycast-based queries against sensors.\nunion SensorQueryCollisionMask {\n constexpr explicit SensorQueryCollisionMask(u32 raw_ = 0) : raw(raw_) {}\n constexpr SensorQueryCollisionMask(const SensorQueryCollisionMask&) = default;\n constexpr SensorQueryCollisionMask& operator=(const SensorQueryCollisionMask& m) {\n raw = m.raw;\n return *this;\n }\n constexpr bool operator==(SensorQueryCollisionMask rhs) const { return raw == rhs.raw; }\n constexpr bool operator!=(SensorQueryCollisionMask rhs) const { return raw != rhs.raw; }\n\n util::BitField<0, NumRegularSensorLayers, u32> layer_mask;\n util::BitField<22, 10, u32> group_handler_index;\n u32 raw;\n};\n\nContactLayerType getContactLayerType(ContactLayer layer);\nu32 makeContactLayerMask(ContactLayer layer);\nu32 getContactLayerBase(ContactLayerType type);\nint getContactLayerBaseRelativeValue(ContactLayer layer);\nconst char* contactLayerToText(ContactLayer layer);\nContactLayer contactLayerFromText(const sead::SafeString& text);\n\nconst char* materialToText(Material material);\nMaterial materialFromText(const sead::SafeString& text);\n\nconst char* groundHitToText(GroundHit hit);\nGroundHit groundHitFromText(const sead::SafeString& text);\n\nconst char* floorCodeToText(FloorCode code);\nFloorCode floorCodeFromText(const sead::SafeString& text);\n\nconst char* wallCodeToText(WallCode code);\nWallCode wallCodeFromText(const sead::SafeString& text);\n\nMotionType motionTypeFromText(const sead::SafeString& text);\n\n} // namespace ksys::phys\n# 10 \"/home/larsvi/botw/src/KingSystem/Physics/System/physRayCast.h\" 2\n# 1 \"/home/larsvi/botw/src/KingSystem/Physics/physMaterialMask.h\" 1\n\n\n\n\n\n\n\n\nnamespace ksys::phys {\n\nunion MaterialMaskData {\n // FIXME: incomplete\n class CustomFlag { struct CvRef { const CustomFlag& asRef() const { return const_cast<const CustomFlag&>(cvref); } bool is_cv; const volatile CustomFlag& cvref; }; public: enum ValueType { _0 }; CustomFlag() : mIdx(0) {} CustomFlag(ValueType value) { setRelativeIndex(value); } CustomFlag(int idx) { setRelativeIndex(idx); } CustomFlag(const CustomFlag& other) = default; CustomFlag& operator=(const CustomFlag& other) = default; CustomFlag& operator=(ValueType value) { setRelativeIndex(value); return *this; } volatile CustomFlag& operator=(ValueType value) volatile { setRelativeIndex(value); return *this; } volatile CustomFlag& operator=(CvRef other) volatile { setRelativeIndex(other.is_cv ? other.cvref.mIdx : other.asRef().mIdx); return *this; } bool operator==(const CustomFlag& rhs) const { return mIdx == rhs.mIdx; } bool operator!=(const CustomFlag& rhs) const { return mIdx != rhs.mIdx; } bool operator==(ValueType value) const { return ValueType(mIdx) == value; } bool operator==(ValueType value) const volatile { return ValueType(mIdx) == value; } bool operator!=(ValueType value) const { return ValueType(mIdx) != value; } bool operator!=(ValueType value) const volatile { return ValueType(mIdx) != value; } ValueType value() const { return static_cast<ValueType>(mIdx); } ValueType value() const volatile { return static_cast<ValueType>(mIdx); } operator int() const volatile { return value(); } operator CvRef() const { return {false, *this}; } operator CvRef() const volatile { return {true, *this}; } bool fromText(const sead::SafeString& name) { for (int i = 0; i < size(); ++i) { if (name.isEqual(text(i))) { mIdx = i; return true; } } return false; } const char* text() const { return text(mIdx); } const char* text() const volatile { return text(mIdx); } static const char* text(int idx) { return text_(idx); } int getRelativeIndex() const { return mIdx; } int getRelativeIndex() const volatile { return mIdx; } void setRelativeIndex(int idx) { do { if (false) { static_cast<void>(u32(idx) < u32(size())); sead::system::detail::CheckFormat(\"range over: %d, [%d - %d)\", idx, 0, size()); } } while (0); mIdx = idx; } void setRelativeIndex(int idx) volatile { do { if (false) { static_cast<void>(u32(idx) < u32(size())); sead::system::detail::CheckFormat(\"range over: %d, [%d - %d)\", idx, 0, size()); } } while (0); mIdx = idx; } const char* getTypeText() const { return \"CustomFlag\"; } const char* getTypeText() const volatile { return \"CustomFlag\"; } constexpr static int size() { return cCount; } constexpr static int getSize() { return size(); } constexpr static int getLastIndex() { return size() - 1; } static void initialize() { text(0); } class iterator { public: explicit iterator(int idx) : mIdx(idx) {} bool operator==(const iterator& rhs) const { return mIdx == rhs.mIdx; } bool operator!=(const iterator& rhs) const { return mIdx != rhs.mIdx; } iterator& operator++() { if (mIdx <= getLastIndex()) { ++mIdx; } else { do { if (false) { static_cast<void>(false); sead::system::detail::CheckFormat(\"enum iterator overflow\"); } } while (0); mIdx = size(); } return *this; } iterator& operator--() { --mIdx; return *this; } CustomFlag operator*() const { return CustomFlag(mIdx); } private: int mIdx; }; static iterator begin() { return iterator(0); } static iterator end() { return iterator(size()); } private: static const char* text_(int idx) { if (u32(idx) >= cCount) return nullptr; static char** spTextPtr = nullptr; if (spTextPtr) return spTextPtr[idx]; { sead::ScopedLock<sead::CriticalSection> lock(sead::EnumUtil::getParseTextCS_()); if (!spTextPtr) { static char* sTextPtr[cCount]; static sead::FixedSafeString<cTextAllLen> sTextAll = sead::SafeString(cTextAll); sead::EnumUtil::parseText_(sTextPtr, sTextAll.getBuffer(), cCount); spTextPtr = sTextPtr; } } return spTextPtr[idx]; } static constexpr const char* cTextAll = \"_0\"; static constexpr size_t cTextAllLen = sizeof(\"_0\"); static constexpr int cCount = sead::EnumUtil::countValues(cTextAll, cTextAllLen); int mIdx; };\n\n constexpr explicit MaterialMaskData(u32 raw_ = 0) : raw(raw_) {}\n constexpr MaterialMaskData(const MaterialMaskData&) = default;\n constexpr MaterialMaskData& operator=(const MaterialMaskData& other) {\n raw = other.raw;\n return *this;\n }\n\n static constexpr bool isValidSubMaterialIdx(int idx) {\n return u32(idx) < (1 << decltype(sub_material)::NumBits());\n }\n\n Material getMaterial() const { return int(material.Value()); }\n int getSubMaterialIndex() const { return int(sub_material.Value()); }\n FloorCode getFloorCode() const { return int(floor.Value()); }\n WallCode getWallCode() const { return int(wall.Value()); }\n\n void setFlag31(bool b) {\n if (!b)\n clearFlag31();\n else\n setFlag31();\n }\n void setFlag31() { flag31 = 1; }\n void clearFlag31() { flag31 = 0; }\n\n void setCustomFlag(CustomFlag custom_flag) {\n raw |= 1 << (decltype(custom_flags)::StartBit() + custom_flag);\n }\n\n bool getCustomFlag(CustomFlag custom_flag) const {\n return (raw & 1 << (decltype(custom_flags)::StartBit() + custom_flag)) != 0;\n }\n\n u32 raw;\n util::BitField<0, 6, u32> material;\n util::BitField<6, 4, int, u32> sub_material;\n util::BitField<10, 5, u32> floor;\n util::BitField<15, 5, u32> wall;\n // TODO: rename once we figure out what these flags are\n util::BitField<23, 7, u32> custom_flags;\n util::BitField<30, 1, u32> flag30;\n util::BitField<31, 1, u32> flag31;\n};\nstatic_assert(sizeof(MaterialMaskData) == sizeof(u32));\n\nclass MaterialMask {\npublic:\n MaterialMask();\n explicit MaterialMask(u32 data);\n explicit MaterialMask(u64 havok_user_data) : MaterialMask(static_cast<u32>(havok_user_data)) {}\n MaterialMask(Material mat, FloorCode floor, WallCode wall, bool flag = false);\n MaterialMask(Material mat, const char* submat_name, FloorCode floor, WallCode wall,\n bool flag = false);\n MaterialMask(Material mat, int submat_idx, FloorCode floor, WallCode wall, bool flag = false);\n MaterialMask(const MaterialMask& other) : mData(other.mData) {}\n\n // XXX: this doesn't need to be virtual.\n virtual ~MaterialMask();\n\n MaterialMask& operator=(const MaterialMask& other) {\n set(other.mData);\n return *this;\n }\n\n MaterialMask& operator=(MaterialMaskData data) {\n set(data);\n return *this;\n }\n\n MaterialMaskData& getData() { return mData; }\n const MaterialMaskData& getData() const { return mData; }\n u32 getRawData() const { return mData.raw; }\n\n Material getMaterial() const { return mData.getMaterial(); }\n int getSubMaterialIdx() const { return mData.getSubMaterialIndex(); }\n FloorCode getFloorCode() const { return mData.getFloorCode(); }\n WallCode getWallCode() const { return mData.getWallCode(); }\n\n const char* getMaterialName() const;\n const char* getSubMaterialName() const;\n\n void set(MaterialMaskData data) {\n mData = data;\n mSubMaterialNameCache = nullptr;\n }\n\n void set(u32 data) { set(MaterialMaskData{data}); }\n void reset() { set(0); }\n\n void setMaterial(Material mat);\n\n static int getSubMaterialIdx(Material mat, const sead::SafeString& submat_name);\n static const sead::SafeString& getSubMaterialName(Material mat, int submat_idx);\n static int getNumSubMaterials(Material mat);\n static const sead::SafeString& getSubMaterialName(int mat, int submat_idx);\n\nprivate:\n MaterialMaskData mData{};\n /// Fetching the name of a sub-material from the MaterialTable is an expensive operation,\n /// so it is only done once and the result is cached.\n mutable const char* mSubMaterialNameCache{};\n};\n\n} // namespace ksys::phys\n# 11 \"/home/larsvi/botw/src/KingSystem/Physics/System/physRayCast.h\" 2\n\nclass hkpCollidable;\nclass hkpShape;\nstruct hkpShapeRayCastInput;\nstruct hkpShapeRayCastOutput;\nstruct hkpWorldRayCastInput;\nstruct hkpWorldRayCastOutput;\n\nnamespace ksys::map {\nclass Object;\n}\n\nnamespace ksys::phys {\n\nstruct ActorInfo;\nclass StaticCompoundRigidBodyGroup;\nclass LayerMaskBuilder;\nclass Phantom;\nclass RigidBody;\nclass SystemGroupHandler;\n\nclass RayCast {\n public: static const sead::RuntimeTypeInfo::Interface* getRuntimeTypeInfoStatic() { static const sead::RuntimeTypeInfo::Root typeInfo; return &typeInfo; } static bool checkDerivedRuntimeTypeInfoStatic( const sead::RuntimeTypeInfo::Interface* typeInfo) { const sead::RuntimeTypeInfo::Interface* clsTypeInfo = RayCast::getRuntimeTypeInfoStatic(); return typeInfo == clsTypeInfo; } virtual bool checkDerivedRuntimeTypeInfo(const sead::RuntimeTypeInfo::Interface* typeInfo) const { return checkDerivedRuntimeTypeInfoStatic(typeInfo); } virtual const sead::RuntimeTypeInfo::Interface* getRuntimeTypeInfo() const { return getRuntimeTypeInfoStatic(); }\npublic:\n enum class NormalCheckingMode {\n _0 = 0,\n _1 = 1,\n DoNotCheck = 2,\n };\n\n using RigidBodyHitCallback = sead::IDelegate1<phys::RigidBody*>;\n\n RayCast(SystemGroupHandler* group_handler, GroundHit ground_hit);\n virtual ~RayCast();\n\n virtual void onRigidBodyHit(RigidBody* body) {}\n\n void reset();\n void resetCastResult();\n\n void enableLayer(ContactLayer layer);\n void disableLayer(ContactLayer layer);\n void setLayers(const LayerMaskBuilder& builder);\n bool isLayerEnabled(ContactLayer layer) const;\n\n void setGroundHit(GroundHit ground_hit);\n GroundHit getGroundHit() const;\n\n void setIgnoredGroundHit(GroundHit ground_hit);\n // TODO: rename\n void set9A(bool value);\n\n void setStart(const sead::Vector3f& start);\n void setEnd(const sead::Vector3f& end);\n void setStartAndEnd(const sead::Vector3f& start, const sead::Vector3f& end);\n void setStartAndDisplacement(const sead::Vector3f& start, const sead::Vector3f& displacement);\n void setStartAndDisplacementScaled(const sead::Vector3f& start,\n const sead::Vector3f& displacement,\n float displacement_scale);\n\n /// @warning Only up to 4 groups can be ignored.\n bool addIgnoredGroup(SystemGroupHandler* group_handler);\n void setRigidBody(RigidBody* body);\n\n void setCallback(RigidBodyHitCallback* callback) { mRigidBodyHitCallback = callback; }\n RigidBodyHitCallback* getCallback() const { return mRigidBodyHitCallback; }\n\n bool worldRayCast(ContactLayerType layer_type);\n bool shapeRayCast(RigidBody* rigid_body);\n bool phantomRayCast(Phantom* phantom);\n\n void getHitPosition(sead::Vector3f* position) const;\n bool getHitTriangleNormal(sead::Vector3f* normal, const hkpShape* hit_shape,\n u32 shape_key) const;\n void getHitNormal(sead::Vector3f* normal) const;\n // TODO: rename\n // 0x0000007100fc4844\n void getUnkVectors(sead::Vector3f* unk1, sead::Vector3f* unk2, sead::Vector3f* unk3) const;\n bool getHitTriangleNormal(sead::Vector3f* normal) const;\n\nprotected:\n auto& getLayerMask(ContactLayerType type) { return mLayerMasks[int(type)]; }\n auto& getLayerMask(ContactLayerType type) const { return mLayerMasks[int(type)]; }\n\n void worldRayCastImpl(hkpWorldRayCastOutput* output, ContactLayerType layer_type);\n void shapeRayCastImpl(hkpWorldRayCastOutput* output, RigidBody* body);\n void phantomRayCastImpl(hkpWorldRayCastOutput* output, Phantom* phantom);\n\n void updateStaticCompoundObjectInfo(const hkpWorldRayCastOutput& output);\n\n void fillCastInput(hkpWorldRayCastInput& input, ContactLayerType layer_type);\n void fillCastInput(hkpShapeRayCastInput& input, ContactLayerType layer_type);\n u32 getFilterInfo(ContactLayerType layer_type, u32 layer_mask) const;\n\n void preCast();\n bool postCast(const hkpWorldRayCastOutput& output);\n void updateHitInformation(const hkpWorldRayCastOutput& output);\n\n sead::Vector3f mFrom = sead::Vector3f::zero;\n sead::Vector3f mTo = sead::Vector3f::zero;\n SystemGroupHandler* mGroupHandler{};\n GroundHit mGroundHit{};\n u32 _2c;\n bool mHasHit;\n sead::Vector3f mHitNormal;\n float mHitFraction;\n const hkpCollidable* mHitCollidable;\n u32 mHitShapeKey;\n bool mHasHitSpecifiedRigidBody;\n StaticCompoundRigidBodyGroup* mHitBodyGroup{};\n map::Object* mHitMapObject;\n sead::SafeArray<sead::BitFlag32, NumContactLayerTypes> mLayerMasks{};\n sead::Atomic<u32> _70;\n NormalCheckingMode mNormalCheckingMode;\n MaterialMask mMaterialMask;\n RigidBody* mRigidBody{};\n sead::Atomic<bool> _98;\n bool _99{};\n bool _9a{};\n sead::FixedPtrArray<SystemGroupHandler, 4> mIgnoredGroups;\n RigidBodyHitCallback* mRigidBodyHitCallback{};\n GroundHit mIgnoredGroundHit = GroundHit::Ignore;\n};\n\n} // namespace ksys::phys\n# 2 \"/home/larsvi/botw/src/KingSystem/Physics/System/physRayCast.cpp\" 2\n# 1 \"/home/larsvi/botw/lib/hkStubs/./Havok/Common/Base/hkBase.h\" 1\n\n\n# 1 \"/home/larsvi/botw/lib/hkStubs/./Havok/Common/Base/Types/hkBaseDefs.h\" 1\n# 4 \"/home/larsvi/botw/lib/hkStubs/./Havok/Common/Base/hkBase.h\" 2\n# 1 \"/home/larsvi/botw/lib/hkStubs/./Havok/Common/Base/Types/hkBaseTypes.h\" 1\n\n\n\n\n\n\n\nusing hkFloat32 = float;\nusing hkDouble64 = double;\nusing hkReal = hkFloat32;\n\n\n\n\n\nusing hkChar = char;\nusing hkInt8 = std::int8_t;\nusing hkInt16 = std::int16_t;\nusing hkInt32 = std::int32_t;\nusing hkInt64 = std::int64_t;\n\nusing hkUchar = unsigned char;\nusing hkUint8 = std::uint8_t;\nusing hkUint16 = std::uint16_t;\nusing hkUint32 = std::uint32_t;\nusing hkUint64 = std::uint64_t;\nusing hk_size_t = std::size_t;\nusing hkLong = long;\nusing hkUlong = unsigned long;\n\nusing hkObjectIndex = hkUint16;\nconstexpr hkObjectIndex HK_INVALID_OBJECT_INDEX = 0xffff;\n\nusing hkTime = hkReal;\n\nusing m128 = __attribute((vector_size(16))) float;\nusing m128u = __attribute((vector_size(16))) hkUint32;\n\nclass hkHalf {\npublic:\n hkHalf() {}\n\n explicit hkHalf(const float& f) {\n int t = ((const int*)&f)[0];\n m_value = hkInt16(t >> 16);\n }\n\n hkHalf(const hkHalf&) = default;\n\n hkHalf& operator=(const float& f) {\n int t = ((const int*)&f)[0];\n m_value = hkInt16(t >> 16);\n return *this;\n }\n\n hkHalf& operator=(const hkHalf& o) {\n m_value = o.m_value;\n return *this;\n }\n\n bool operator==(const hkHalf& o) const { return (m_value == o.m_value); }\n\n void store(float* f) const {\n hkUint32* i = (hkUint32*)f;\n i[0] = m_value << 16;\n }\n\n void setZero() { m_value = 0; }\n\n void setOne() { m_value = 0x3F80; }\n\n template <bool Round>\n void set(const float& r) {\n union {\n float f;\n int i;\n } u;\n if constexpr (Round)\n u.f = r * (1.0f + 1.0f / 256.f);\n else\n u.f = r;\n m_value = hkInt16(u.i >> 16);\n }\n\n operator float() const {\n union {\n int i;\n float f;\n } u;\n u.i = (m_value << 16);\n return u.f;\n }\n\n hkInt16 getInt16() const { return m_value; }\n\nprivate:\n hkInt16 m_value;\n};\n\nusing hkBool32 = hkUint32;\nusing hkBoolLL = hkUint64;\n\nclass hkBool {\npublic:\n inline __attribute__((always_inline)) hkBool() = default;\n // NOLINTNEXTLINE(google-explicit-constructor)\n inline __attribute__((always_inline)) constexpr hkBool(bool b) : m_bool(static_cast<char>(b)) {}\n\n inline __attribute__((always_inline)) constexpr explicit operator bool() const { return m_bool != 0; }\n // NOLINTNEXTLINE(google-explicit-constructor)\n inline __attribute__((always_inline)) constexpr operator hkBool32() const { return m_bool != 0; }\n\n inline __attribute__((always_inline)) constexpr hkBool& operator=(bool e) {\n m_bool = static_cast<char>(e);\n return *this;\n }\n\n inline __attribute__((always_inline)) constexpr hkBool operator==(bool e) const { return (m_bool != 0) == e; }\n inline __attribute__((always_inline)) constexpr hkBool operator!=(bool e) const { return (m_bool != 0) != e; }\n\nprivate:\n char m_bool;\n};\n\n/// For storing an enum with a particular storage size when specifying the underlying type of the\n/// enum is not an option.\ntemplate <typename Enum, typename Storage>\nstruct hkEnum {\n inline __attribute__((always_inline)) hkEnum() {}\n\n constexpr hkEnum(Enum value) // NOLINT(google-explicit-constructor)\n : m_storage(static_cast<Storage>(value)) {}\n\n // NOLINTNEXTLINE(google-explicit-constructor)\n constexpr operator Enum() const { return static_cast<Enum>(m_storage); }\n\n constexpr hkEnum& operator=(Enum value) {\n m_storage = static_cast<Storage>(value);\n return *this;\n }\n\n constexpr bool operator==(Enum e) const { return m_storage == static_cast<Storage>(e); }\n constexpr bool operator!=(Enum e) const { return m_storage != static_cast<Storage>(e); }\n\n Storage m_storage;\n};\n\ntemplate <typename, typename Storage>\nclass hkFlags {\npublic:\n inline __attribute__((always_inline)) hkFlags() {}\n inline __attribute__((always_inline)) constexpr explicit hkFlags(Storage s) : m_storage(s) {}\n\n inline __attribute__((always_inline)) constexpr void clear() { m_storage = 0; }\n inline __attribute__((always_inline)) constexpr void clear(Storage mask) { m_storage &= ~mask; }\n inline __attribute__((always_inline)) constexpr void setAll(Storage s) { m_storage = s; }\n\n inline __attribute__((always_inline)) constexpr void operator|=(Storage s) { m_storage |= s; }\n inline __attribute__((always_inline)) constexpr void operator^=(Storage s) { m_storage ^= s; }\n inline __attribute__((always_inline)) constexpr void operator&=(Storage s) { m_storage &= s; }\n\n inline __attribute__((always_inline)) constexpr void setWithMask(Storage s, Storage mask) {\n m_storage = (m_storage & ~mask) | (s & mask);\n }\n\n inline __attribute__((always_inline)) constexpr Storage get() const { return m_storage; }\n inline __attribute__((always_inline)) constexpr bool anyIsSet(Storage mask) const { return (m_storage & mask) != 0; }\n inline __attribute__((always_inline)) constexpr bool noneIsSet(Storage mask) const { return (m_storage & mask) == 0; }\n inline __attribute__((always_inline)) constexpr bool allAreSet(Storage mask) const {\n return (m_storage & mask) == mask;\n }\n\n inline __attribute__((always_inline)) constexpr bool operator==(const hkFlags& other) const {\n return other.m_storage == m_storage;\n }\n inline __attribute__((always_inline)) constexpr bool operator!=(const hkFlags& other) const {\n return other.m_storage != m_storage;\n }\n\nprivate:\n Storage m_storage;\n};\n\nenum hkResultEnum {\n HK_SUCCESS = 0,\n HK_FAILURE = 1,\n};\n\nstruct hkResult {\n inline __attribute__((always_inline)) hkResult() {}\n inline __attribute__((always_inline)) hkResult(hkResultEnum b) { m_enum = b; }\n\n inline __attribute__((always_inline)) hkResult& operator=(hkResultEnum e) {\n m_enum = e;\n return *this;\n }\n\n inline __attribute__((always_inline)) bool operator==(hkResultEnum e) const { return m_enum == e; }\n inline __attribute__((always_inline)) bool operator!=(hkResultEnum e) const { return m_enum != e; }\n\n inline __attribute__((always_inline)) bool isSuccess() const { return m_enum == HK_SUCCESS; }\n\n hkResultEnum m_enum;\n};\n\ninline bool operator==(hkResultEnum e, hkResult r) {\n return r.m_enum == e;\n}\ninline bool operator!=(hkResultEnum e, hkResult r) {\n return r.m_enum != e;\n}\n\nclass hkFinishLoadedObjectFlag {\npublic:\n int m_finishing = 0;\n};\n\n\n\ninline __attribute__((always_inline)) hkLong hkGetByteOffset(const void* base, const void* pntr) {\n return hkLong(pntr) - hkLong(base);\n}\n\ntemplate <typename T>\ninline __attribute__((always_inline)) const T* hkAddByteOffsetConst(const T* base, hkLong offset) {\n return reinterpret_cast<const T*>(reinterpret_cast<hkUlong>(base) + offset);\n}\n\ntemplate <typename T>\nusing hkAddConstPointer =\n std::conditional_t<std::is_pointer_v<T>,\n std::add_pointer_t<std::add_const_t<std::remove_pointer_t<T>>>,\n std::add_const_t<T>>;\n\ntemplate <typename T>\ninline __attribute__((always_inline)) T hkSelectOther(hkAddConstPointer<T> a, T pairA, T pairB) {\n return reinterpret_cast<T>(hkUlong(a) ^ hkUlong(pairA) ^ hkUlong(pairB));\n}\n\nclass hkClass;\n\nstruct hkVariant {\n void* m_object;\n const hkClass* m_class;\n};\n# 5 \"/home/larsvi/botw/lib/hkStubs/./Havok/Common/Base/hkBase.h\" 2\n\n# 1 \"/home/larsvi/botw/lib/hkStubs/./Havok/Common/Base/Memory/Allocator/hkMemoryAllocator.h\" 1\n# 10 \"/home/larsvi/botw/lib/hkStubs/./Havok/Common/Base/Memory/Allocator/hkMemoryAllocator.h\"\nclass hkMemorySnapshot;\n\ntemplate <typename T>\nstruct hkSizeOfTypeOrVoid {\n enum { val = sizeof(T) };\n};\n\ntemplate <>\nstruct hkSizeOfTypeOrVoid<void> {\n enum { val = 1 };\n};\n\nclass hkMemoryAllocator {\npublic:\n inline __attribute__((always_inline)) void* operator new(hk_size_t, void* p) { return p; } inline __attribute__((always_inline)) void operator delete(void*, void*) {} inline __attribute__((always_inline)) void operator delete(void*, hk_size_t) {}\n\n using MemoryWalkCallback = void (*)(void* start, hk_size_t size, bool allocated, int pool,\n void* param);\n\n struct MemoryStatistics {\n static const hkLong INFINITE_SIZE = -1;\n\n hkLong m_allocated = -1;\n hkLong m_inUse = -1;\n hkLong m_peakInUse = -1;\n hkLong m_available = -1;\n hkLong m_totalAvailable = -1;\n hkLong m_largestBlock = -1;\n };\n\n struct ExtendedInterface {\n virtual ~ExtendedInterface() = default;\n\n virtual void garbageCollect() = 0;\n virtual void incrementalGarbageCollect(int numBlocks) = 0;\n virtual hkResult setMemorySoftLimit(hk_size_t maxMemory) = 0;\n virtual hk_size_t getMemorySoftLimit() const = 0;\n virtual bool canAllocTotal(int numBytes) = 0;\n virtual hkResult walkMemory(MemoryWalkCallback callback, void* param) = 0;\n virtual hk_size_t getApproxTotalAllocated() const = 0;\n virtual void setScrubValues(hkUint32 allocValue, hkUint32 freeValue) = 0;\n virtual int addToSnapshot(hkMemorySnapshot& snap, int parentId) = 0;\n };\n\n virtual ~hkMemoryAllocator();\n\n virtual void* blockAlloc(int numBytes) = 0;\n virtual void blockFree(void* p, int numBytes) = 0;\n virtual void* bufAlloc(int& reqNumBytesInOut);\n virtual void bufFree(void* p, int numBytes);\n virtual void* bufRealloc(void* pold, int oldNumBytes, int& reqNumBytesInOut);\n\n virtual void blockAllocBatch(void** ptrsOut, int numPtrs, int blockSize);\n virtual void blockFreeBatch(void** ptrsIn, int numPtrs, int blockSize);\n\n virtual void getMemoryStatistics(MemoryStatistics& u) const = 0;\n virtual int getAllocatedSize(const void* obj, int nbytes) const = 0;\n virtual void resetPeakMemoryStatistics() {}\n\n virtual ExtendedInterface* getExtendedInterface() { return nullptr; }\n\n template <typename TYPE>\n inline TYPE* _bufAlloc(int& reqNumInOut) {\n const int SIZE_ELEM = hkSizeOfTypeOrVoid<TYPE>::val;\n int n = reqNumInOut * SIZE_ELEM;\n void* p = bufAlloc(n);\n reqNumInOut = n / SIZE_ELEM;\n return static_cast<TYPE*>(p);\n }\n\n template <typename TYPE>\n inline void _bufFree(void* p, int numElem) {\n const int SIZE_ELEM = hkSizeOfTypeOrVoid<TYPE>::val;\n bufFree(p, numElem * SIZE_ELEM);\n }\n\n template <typename TYPE>\n inline TYPE* _bufRealloc(void* pold, int oldNum, int& reqNumInOut) {\n const int SIZE_ELEM = hkSizeOfTypeOrVoid<TYPE>::val;\n int n = reqNumInOut * SIZE_ELEM;\n void* p = bufRealloc(pold, oldNum * SIZE_ELEM, n);\n reqNumInOut = n / SIZE_ELEM;\n return static_cast<TYPE*>(p);\n }\n\n template <typename TYPE>\n inline TYPE* _blockAlloc(int n) {\n return static_cast<TYPE*>(blockAlloc(n * hkSizeOfTypeOrVoid<TYPE>::val));\n }\n\n template <typename TYPE>\n inline void _blockFree(TYPE* p, int n) {\n blockFree(p, n * hkSizeOfTypeOrVoid<TYPE>::val);\n }\n\n enum MemoryState {\n MEMORY_STATE_OK,\n MEMORY_STATE_OUT_OF_MEMORY,\n };\n};\n# 7 \"/home/larsvi/botw/lib/hkStubs/./Havok/Common/Base/hkBase.h\" 2\n\n# 1 \"/home/larsvi/botw/lib/hkStubs/./Havok/Common/Base/Object/hkBaseObject.h\" 1\n\n\nclass hkBaseObject {\npublic:\n inline __attribute__((always_inline)) void* operator new(hk_size_t, void* p) { return p; } inline __attribute__((always_inline)) void operator delete(void*, void*) {} inline __attribute__((always_inline)) void operator delete(void*, hk_size_t) {}\n\n inline __attribute__((always_inline)) explicit hkBaseObject(hkFinishLoadedObjectFlag flag) {}\n\n virtual ~hkBaseObject() = default;\n virtual void __first_virtual_table_function__() {} // NOLINT(bugprone-reserved-identifier)\n\nprotected:\n inline __attribute__((always_inline)) hkBaseObject() = default;\n};\n# 9 \"/home/larsvi/botw/lib/hkStubs/./Havok/Common/Base/hkBase.h\" 2\n# 1 \"/home/larsvi/botw/lib/hkStubs/./Havok/Common/Base/Object/hkReferencedObject.h\" 1\n\n\n\n\n\n# 1 \"/home/larsvi/botw/lib/hkStubs/./Havok/Common/Base/Thread/Atomic/hkAtomicPrimitives.h\" 1\n\n\n\n\nnamespace hkAtomic {\n\n/// Weak compare-and-swap.\ntemplate <typename T>\ninline __attribute__((always_inline)) bool compareAndSwap(volatile T* address, const T& oldValue, const T& newValue) {\n T expected = oldValue;\n return __atomic_compare_exchange_n(address, &expected, newValue, false, 5,\n
5);\n}\n\ntemplate <typename T, typename Fn>\ninline __attribute__((always_inline)) T readModifyWrite(volatile T* address, const Fn& getNewValue) {\n T oldVal, newVal;\n do {\n oldVal = *address;\n newVal = getNewValue(oldVal);\n } while (!hkAtomic::compareAndSwap(address, oldVal, newVal));\n return newVal;\n}\n\n} // namespace hkAtomic\n# 7 \"/home/larsvi/botw/lib/hkStubs/./Havok/Common/Base/Object/hkReferencedObject.h\" 2\n\nclass hkClass;\n\nclass hkReferencedObject : public hkBaseObject {\npublic:\n inline hkReferencedObject();\n // NOLINTNEXTLINE(cppcoreguidelines-pro-type-member-init)\n explicit hkReferencedObject(hkFinishLoadedObjectFlag flag) {}\n\n /// Dummy copy constructor and copy assignment operator.\n inline hkReferencedObject(const hkReferencedObject& other);\n inline hkReferencedObject& operator=(const hkReferencedObject& other);\n\n ~hkReferencedObject() override = default;\n\n virtual const hkClass* getClassType() const;\n\n inline int getReferenceCount() const;\n inline void setReferenceCount(int newRefCount);\n inline void addReference() const;\n inline void removeReference() const;\n\n inline int getAllocatedSize() const;\n inline int getMemorySizeAndFlags() const;\n inline void setMemorySizeAndFlags(int newMemSizeAndFlags);\n inline void setMemorySizeFlagsAndReferenceCount(int newMemSizeAndFlags, int newRefCount);\n\nprotected:\n virtual void deleteThisReferencedObject() const;\n\nprivate:\n mutable hkUint32 m_memSizeAndRefCount;\n};\n\ninline hkReferencedObject::hkReferencedObject() : m_memSizeAndRefCount(0xFFFF0001) {}\n\ninline hkReferencedObject::hkReferencedObject(const hkReferencedObject& other)\n : m_memSizeAndRefCount(0xFFFF0001) {}\n\ninline hkReferencedObject& hkReferencedObject::operator=(const hkReferencedObject& other) {\n return *this;\n}\n\ninline int hkReferencedObject::getReferenceCount() const {\n return int(m_memSizeAndRefCount & 0xFFFF);\n}\n\ninline void hkReferencedObject::setReferenceCount(int newRefCount) {\n hkAtomic::readModifyWrite(&m_memSizeAndRefCount, [newRefCount](hkUint32 oldVal) {\n return (oldVal & 0xFFFF0000) | (newRefCount & 0xFFFF);\n });\n}\n\ninline void hkReferencedObject::addReference() const {\n if (getMemorySizeAndFlags() == 0)\n return;\n\n hkAtomic::readModifyWrite(&m_memSizeAndRefCount, [](hkUint32 oldVal) {\n return (oldVal & 0xFFFF0000) | (((oldVal & 0xFFFF) + 1) & 0xFFFF);\n });\n}\n\ninline void hkReferencedObject::removeReference() const {\n if (getMemorySizeAndFlags() == 0)\n return;\n\n auto newVal = hkAtomic::readModifyWrite(&m_memSizeAndRefCount, [](hkUint32 oldVal) {\n return (oldVal & 0xFFFF0000) | (((oldVal & 0xFFFF) - 1) & 0xFFFF);\n });\n\n if ((newVal & 0xFFFF) == 0)\n deleteThisReferencedObject();\n}\n\ninline int hkReferencedObject::getAllocatedSize() const {\n return getMemorySizeAndFlags() & 0x7FFF;\n}\n\ninline int hkReferencedObject::getMemorySizeAndFlags() const {\n return int((m_memSizeAndRefCount >> 16) & 0xFFFF);\n}\n\ninline void hkReferencedObject::setMemorySizeAndFlags(int newMemSizeAndFlags) {\n hkAtomic::readModifyWrite(&m_memSizeAndRefCount, [=](hkUint32 oldVal) {\n return (newMemSizeAndFlags << 16) | (oldVal & 0xFFFF);\n });\n}\n\ninline void hkReferencedObject::setMemorySizeFlagsAndReferenceCount(int newMemSizeAndFlags,\n int newRefCount) {\n const hkUint32 newVal = (newMemSizeAndFlags << 16) | (newRefCount & 0xFFFF);\n hkAtomic::readModifyWrite(&m_memSizeAndRefCount, [=](auto) { return newVal; });\n}\n# 10 \"/home/larsvi/botw/lib/hkStubs/./Havok/Common/Base/hkBase.h\" 2\n# 1 \"/home/larsvi/botw/lib/hkStubs/./Havok/Common/Base/Types/hkRefPtr.h\" 1\n\n\n\n\n\n\n/// Owning reference. Assign to a hkRefPtr as soon as possible.\n/// @warning This will NOT automatically destruct the contained object.\ntemplate <typename T>\nclass hkRefNew {\npublic:\n hkRefNew(T* ptr) : m_ptr(ptr) {} // NOLINT(google-explicit-constructor)\n\n hkRefNew(const hkRefNew&) = delete;\n auto operator=(const hkRefNew&) = delete;\n\n T* release() { return std::exchange(m_ptr, nullptr); }\n\nprivate:\n T* m_ptr;\n};\n\n/// A simple reference counting pointer intended to be used with hkReferencedObjects.\ntemplate <typename T>\nclass hkRefPtr {\npublic:\n /// Default constructor. Initializes the pointer to nullptr.\n inline __attribute__((always_inline)) hkRefPtr();\n /// Copy constructor. Increments the reference count.\n inline __attribute__((always_inline)) hkRefPtr(const hkRefPtr& other);\n inline __attribute__((always_inline)) hkRefPtr(T* ptr); // NOLINT(google-explicit-constructor)\n /// \"Move\" constructor. Steals the reference from ptr.\n inline __attribute__((always_inline)) hkRefPtr(hkRefNew<T> ptr); // NOLINT(google-explicit-constructor)\n\n inline __attribute__((always_inline)) explicit hkRefPtr(hkFinishLoadedObjectFlag);\n\n /// Decrements the reference count.\n inline __attribute__((always_inline)) ~hkRefPtr();\n\n inline __attribute__((always_inline)) hkRefPtr& operator=(const hkRefPtr& other);\n inline __attribute__((always_inline)) hkRefPtr& operator=(T* ptr);\n inline __attribute__((always_inline)) hkRefPtr& operator=(hkRefNew<T> ptr);\n\n inline __attribute__((always_inline)) T* val() const;\n inline __attribute__((always_inline)) T* operator->() const;\n inline __attribute__((always_inline)) operator T*() const; // NOLINT(google-explicit-constructor)\n\n inline __attribute__((always_inline)) void setAndDontIncrementRefCount(T* ptr);\n inline __attribute__((always_inline)) void unsetAndDontDecrementRefCount();\n\nprivate:\n void addReference() const {\n if (m_ptr)\n m_ptr->addReference();\n }\n\n void removeReference() const {\n if (m_ptr)\n m_ptr->removeReference();\n }\n\n T* m_ptr;\n};\n\ntemplate <typename T>\ninline hkRefPtr<T>::hkRefPtr() : m_ptr(nullptr) {}\n\ntemplate <typename T>\ninline hkRefPtr<T>::hkRefPtr(const hkRefPtr& other) {\n other.addReference();\n m_ptr = other.m_ptr;\n}\n\ntemplate <typename T>\ninline hkRefPtr<T>::hkRefPtr(T* ptr) {\n if (ptr)\n ptr->addReference();\n m_ptr = ptr;\n}\n\ntemplate <typename T>\ninline hkRefPtr<T>::hkRefPtr(hkRefNew<T> ptr) : m_ptr(ptr.release()) {}\n\ntemplate <typename T>\ninline hkRefPtr<T>::hkRefPtr(hkFinishLoadedObjectFlag) {}\n\ntemplate <typename T>\ninline hkRefPtr<T>::~hkRefPtr() {\n removeReference();\n m_ptr = nullptr;\n}\n\ntemplate <typename T>\n// NOLINTNEXTLINE(bugprone-unhandled-self-assignment)\ninline hkRefPtr<T>& hkRefPtr<T>::operator=(const hkRefPtr& other) {\n other.addReference();\n removeReference();\n m_ptr = other.m_ptr;\n return *this;\n}\n\ntemplate <typename T>\ninline hkRefPtr<T>& hkRefPtr<T>::operator=(T* ptr) {\n if (ptr)\n ptr->addReference();\n removeReference();\n m_ptr = ptr;\n return *this;\n}\n\ntemplate <typename T>\ninline hkRefPtr<T>& hkRefPtr<T>::operator=(hkRefNew<T> ptr) {\n removeReference();\n m_ptr = ptr.release();\n return *this;\n}\n\ntemplate <typename T>\ninline T* hkRefPtr<T>::val() const {\n return m_ptr;\n}\n\ntemplate <typename T>\ninline T* hkRefPtr<T>::operator->() const {\n return val();\n}\n\ntemplate <typename T>\ninline hkRefPtr<T>::operator T*() const {\n return val();\n}\n\ntemplate <typename T>\ninline void hkRefPtr<T>::setAndDontIncrementRefCount(T* ptr) {\n if (m_ptr && m_ptr != ptr)\n m_ptr->removeReference();\n m_ptr = ptr;\n}\n\ntemplate <typename T>\ninline void hkRefPtr<T>::unsetAndDontDecrementRefCount() {\n m_ptr = nullptr;\n}\n# 11 \"/home/larsvi/botw/lib/hkStubs/./Havok/Common/Base/hkBase.h\" 2\n# 1 \"/home/larsvi/botw/lib/hkStubs/./Havok/Common/Base/Types/hkRefVariant.h\" 1\n\n\n# 1 \"/home/larsvi/botw/lib/hkStubs/./Havok/Common/Base/Memory/Router/hkMemoryRouter.h\" 1\n\n\n# 1 \"/home/larsvi/botw/lib/hkStubs/./Havok/Common/Base/Memory/Allocator/Lifo/hkLifoAllocator.h\" 1\n\n\n\n\nclass hkLifoAllocator : public hkMemoryAllocator {\npublic:\n explicit hkLifoAllocator(int slabSize = 32 * 1024);\n\n void init(hkMemoryAllocator* slabAllocator, hkMemoryAllocator* largeAllocator,\n hkMemoryAllocator* internalAllocator);\n /// Optional: [slabAllocator, largeAllocator, internalAllocator]\n void quit(hkMemoryAllocator* allocators[3] = nullptr);\n\n void* blockAlloc(int numBytes) override;\n\n /// Inline equivalent of blockAlloc\n // TODO: add this if this is actually used by BotW\n inline __attribute__((always_inline)) void* fastBlockAlloc(int numBytes);\n\n void blockFree(void* p, int numBytes) override;\n\n /// Inline equivalent of blockFree\n // TODO: add this if this is actually used by BotW\n inline __attribute__((always_inline)) void fastBlockFree(void* p, int numBytes);\n\n void* bufAlloc(int& reqNumBytesInOut) override;\n void bufFree(void* p, int numBytes) override;\n void* bufRealloc(void* pold, int oldNumBytes, int& reqNumBytesInOut) override;\n\n void getMemoryStatistics(MemoryStatistics& u) const override {}\n int getAllocatedSize(const void* obj, int nbytes) const override { return nbytes; }\n\n bool isEmpty() const;\n int numExternalAllocations() const;\n\nprotected:\n void* allocateFromNewSlab(int nbytes);\n void popNonLifoFrees();\n void slowBlockFree(void*, int numBytesIn);\n void insertNonLifoFree(void* p, int nbytes);\n\n class Implementation;\n\n Implementation* m_impl;\n\n const int m_slabSize;\n\n void* m_cur;\n void* m_end;\n void* m_firstNonLifoEnd;\n\n void* m_cachedEmptySlab;\n\n hkMemoryAllocator* m_slabAllocator;\n hkMemoryAllocator* m_largeAllocator;\n hkMemoryAllocator* m_internalAllocator;\n};\n# 4 \"/home/larsvi/botw/lib/hkStubs/./Havok/Common/Base/Memory/Router/hkMemoryRouter.h\" 2\n\n\n# 1 \"/home/larsvi/botw/lib/hkStubs/./Havok/Common/Base/Thread/Thread/hkThreadLocalData.h\" 1\n\n\n\n\ntemplate <typename T>\nclass hkThreadLocalData {\npublic:\n hkThreadLocalData() { nn::os::AllocateTlsSlot(&m_tls_slot, nullptr); }\n ~hkThreadLocalData() { nn::os::FreeTlsSlot(m_tls_slot); }\n\n T getData() const { return reinterpret_cast<T>(nn::os::GetTlsValue(m_tls_slot)); }\n void setData(T p) { nn::os::SetTlsValue(m_tls_slot, reinterpret_cast<unsigned long>(p)); }\n\nprivate:\n nn::os::TlsSlot m_tls_slot{};\n};\n# 7 \"/home/larsvi/botw/lib/hkStubs/./Havok/Common/Base/Memory/Router/hkMemoryRouter.h\" 2\n\n\nclass hkLifoAllocator;\n\nclass hkOstream;\n\nclass hkMemoryRouter {\npublic:\n using Stack = hkLifoAllocator;\n using Allocator = hkMemoryAllocator;\n\n static void replaceInstance(hkMemoryRouter* m);\n\n static inline hkMemoryRouter& getInstance() { return *getInstancePtr(); }\n static inline hkMemoryRouter* getInstancePtr() { return s_memoryRouter.getData(); }\n\n hkMemoryRouter();\n\n void resetPeakMemoryStatistics();\n\n /// Small thread local allocation in a stack pattern.\n inline Stack& stack() { return m_stack; }\n\n /// Temporary allocation, thread local. Often but not always in a stack pattern.\n inline Allocator& temp() { return *m_temp; }\n inline void setTemp(Allocator* a) { m_temp = a; }\n\n /// Allocation which is likely to persist. Not thread local.\n inline Allocator& heap() { return *m_heap; }\n inline void setHeap(Allocator* a) { m_heap = a; }\n\n /// Allocation which may break the rules. Not thread local.\n inline Allocator& debug() { return *m_debug; }\n inline void setDebug(Allocator* a) { m_debug = a; }\n\n inline Allocator& solver() { return *m_solver; }\n inline void setSolver(Allocator* a) { m_solver = a; }\n\n inline void* getUserData() const { return m_userData; }\n inline void setUserData(void* p) { m_userData = p; }\n\n inline const hkUint32* getRefObjectLocalStore() const { return &m_refObjLocalStore; }\n inline hkUint32* getRefObjectLocalStore() { return &m_refObjLocalStore; }\n\n static void* alignedAlloc(Allocator& b, int nbytes, int align);\n static void alignedFree(Allocator& b, void* p);\n\n static void* easyAlloc(Allocator& b, int nbytes);\n static hk_size_t getEasyAllocSize(Allocator& b, const void* ptr);\n static const void* getEasyAllocStartAddress(Allocator& b, const void* ptr);\n static void easyFree(Allocator& b, void* p);\n\nprotected:\n Stack m_stack;\n\n Allocator* m_temp;\n Allocator* m_heap;\n Allocator* m_debug;\n Allocator* m_solver;\n\n void* m_userData;\n hkUint32 m_refObjLocalStore;\n\n static hkThreadLocalData<hkMemoryRouter*> s_memoryRouter;\n};\n\ntemplate <typename TYPE>\ninline __attribute__((always_inline)) TYPE* hkAllocateChunk(int numberOfObjects) {\n return static_cast<TYPE*>(hkMemoryRouter::getInstance().heap().blockAlloc(\n numberOfObjects * hkSizeOfTypeOrVoid<TYPE>::val));\n}\n\ntemplate <typename TYPE>\ninline __attribute__((always_inline)) void hkDeallocateChunk(TYPE* ptr, int numberOfObjects) {\n hkMemoryRouter::getInstance().heap().blockFree(static_cast<void*>(ptr),\n numberOfObjects * hkSizeOfTypeOrVoid<TYPE>::val);\n}\n# 4 \"/home/larsvi/botw/lib/hkStubs/./Havok/Common/Base/Types/hkRefVariant.h\" 2\n\n\n\n\nclass hkRefVariant : public hkRefPtr<hkReferencedObject> {\npublic:\n inline __attribute__((always_inline)) void* operator new(hk_size_t nbytes) { if constexpr (std::is_base_of_v<hkReferencedObject, hkRefVariant>) { return hkMemoryRouter::getInstance().heap().blockAlloc(static_cast<int>(nbytes)); } else { return hkMemoryRouter::getInstance().heap().blockAlloc(sizeof(hkRefVariant)); } } inline __attribute__((always_inline)) void operator delete(void* p, hk_size_t nbytes) { if constexpr (std::is_base_of_v<hkReferencedObject, hkRefVariant>) { auto* b = static_cast<hkReferencedObject*>(p); hkMemoryRouter::getInstance().heap().blockFree( p, (b->getMemorySizeAndFlags() == 0xffff) ? static_cast<int>(nbytes) : b->getMemorySizeAndFlags()); } else { if (p) hkMemoryRouter::getInstance().heap().blockFree(p, sizeof(hkRefVariant)); } } inline __attribute__((always_inline)) void* operator new(hk_size_t, void* p) { return p; } inline __attribute__((always_inline)) void* operator new[](hk_size_t, void* p) { return p; } inline __attribute__((always_inline)) void operator delete(void*, void*) {} inline __attribute__((always_inline)) void operator delete[](void*, void*) {}\n\n inline __attribute__((always_inline)) hkRefVariant() = default;\n // NOLINTNEXTLINE(google-explicit-constructor)\n inline __attribute__((always_inline)) hkRefVariant(const hkReferencedObject* o);\n inline __attribute__((always_inline)) hkRefVariant(const hkRefVariant& other);\n\n // NOLINTNEXTLINE(google-explicit-constructor)\n hkRefVariant(const hkVariant& v);\n hkRefVariant(void* o, const hkClass* k);\n inline __attribute__((always_inline)) explicit hkRefVariant(hkFinishLoadedObjectFlag f);\n\n inline __attribute__((always_inline)) hkRefVariant& operator=(const hkRefVariant& other);\n inline __attribute__((always_inline)) hkRefVariant& operator=(const hkReferencedObject* o);\n\n void set(void* o, const hkClass* k);\n\n inline __attribute__((always_inline)) operator hkVariant() const; // NOLINT(google-explicit-constructor)\n const hkClass* getClass() const;\n};\n\ninline hkRefVariant::hkRefVariant(const hkReferencedObject* o)\n : hkRefPtr(const_cast<hkReferencedObject*>(o)) {}\n\ninline hkRefVariant::hkRefVariant(const hkRefVariant& other) = default;\n\ninline hkRefVariant::hkRefVariant(hkFinishLoadedObjectFlag f) : hkRefPtr(f) {}\n\ninline hkRefVariant& hkRefVariant::operator=(const hkRefVariant& other) {\n if (this != &other)\n hkRefPtr::operator=(other);\n return *this;\n}\n\ninline hkRefVariant& hkRefVariant::operator=(const hkReferencedObject* o) {\n if (val() != o)\n hkRefPtr::operator=(const_cast<hkReferencedObject*>(o));\n return *this;\n}\n\ninline hkRefVariant::operator hkVariant() const {\n hkVariant v;\n v.m_object = const_cast<hkReferencedObject*>(val());\n v.m_class = getClass();\n return v;\n}\n# 12 \"/home/larsvi/botw/lib/hkStubs/./Havok/Common/Base/hkBase.h\" 2\n# 1 \"/home/larsvi/botw/lib/hkStubs/./Havok/Common/Base/Types/hkUFloat8.h\" 1\n# 10 \"/home/larsvi/botw/lib/hkStubs/./Havok/Common/Base/Types/hkUFloat8.h\"\nclass hkUFloat8 {\npublic:\n enum {\n MAX_VALUE = 256,\n\n // Constants used in compressing / decompressing the values table\n ENCODED_EXPONENT_BITS = 5,\n ENCODED_MANTISSA_BITS = (16 - ENCODED_EXPONENT_BITS),\n ENCODED_EXPONENT_BIAS = 119,\n ENCODED_EXPONENT_MASK = (1 << ENCODED_EXPONENT_BITS) - 1,\n ENCODED_MANTISSA_MASK = (1 << ENCODED_MANTISSA_BITS) - 1,\n\n FLOAT_MANTISSA_BITS = 23,\n FLOAT_MANTISSA_MASK = (1 << FLOAT_MANTISSA_BITS) - 1,\n\n ENCODE_MANTISSA_SHIFT = (FLOAT_MANTISSA_BITS - ENCODED_MANTISSA_BITS),\n DECODE_EXPONENT_BIAS =\n (ENCODED_EXPONENT_BIAS << (FLOAT_MANTISSA_BITS - ENCODE_MANTISSA_SHIFT)),\n };\n\n inline __attribute__((always_inline)) hkUFloat8() {}\n inline __attribute__((always_inline)) hkUFloat8(float f) { *this = f; } // NOLINT(google-explicit-constructor)\n inline __attribute__((always_inline)) hkUFloat8(double d) { *this = d; } // NOLINT(google-explicit-constructor)\n\n hkUFloat8& operator=(const double& dv);\n hkUFloat8& operator=(const float& fv);\n\n inline __attribute__((always_inline)) bool isZero() const { return m_value == 0; }\n inline __attribute__((always_inline)) void setZero() { m_value = 0; }\n\n inline __attribute__((always_inline)) bool isMax() const { return m_value == 255; }\n inline __attribute__((always_inline)) void setMax() { m_value = 255; }\n\n inline __attribute__((always_inline)) hkBool operator==(const hkUFloat8& other) const {\n return m_value == other.m_value;\n }\n\n inline __attribute__((always_inline)) void setArithmeticMean(const hkUFloat8& a, const hkUFloat8& b) {\n m_value = hkUint8((int(a.m_value) + int(b.m_value)) >> 1);\n }\n\n // NOLINTNEXTLINE(google-explicit-constructor)\n inline __attribute__((always_inline)) operator float() const { return decodeFloat(getEncodedFloat(m_value)); }\n\n static inline __attribute__((always_inline)) float decodeFloat(const hkUint16 i) {\n const int intExpo = (i + hkUFloat8::DECODE_EXPONENT_BIAS)\n << hkUFloat8::ENCODE_MANTISSA_SHIFT;\n union {\n const float* f;\n const int* i;\n } f2i;\n f2i.i = &intExpo;\n return i ? *f2i.f : 0.0f;\n }\n\n hkUint8 m_value;\n\nprotected:\n static hkUint16 getEncodedFloat(hkUint8 index);\n};\n# 13 \"/home/larsvi/botw/lib/hkStubs/./Havok/Common/Base/hkBase.h\" 2\n\n# 1 \"/home/larsvi/botw/lib/hkStubs/./Havok/Common/Base/Math/hkMath.h\" 1\n\n\n\n\n// Note: these headers have to be included in a specific order.\n// clang-format off\n\n\n\n# 1 \"/home/larsvi/botw/lib/hkStubs/./Havok/Common/Base/Math/Header/hkMathHeaderConstants.h\" 1\n\n\n#include <cfloat>\n# 34 \"/home/larsvi/botw/lib/hkStubs/./Havok/Common/Base/Math/Header/hkMathHeaderConstants.h\"\nenum hkVectorConstant {\n HK_QUADREAL_BEGIN,\n\n HK_QUADREAL_MINUS1,\n HK_QUADREAL_0,\n HK_QUADREAL_1,\n HK_QUADREAL_2,\n HK_QUADREAL_3,\n HK_QUADREAL_4,\n HK_QUADREAL_5,\n HK_QUADREAL_6,\n HK_QUADREAL_7,\n HK_QUADREAL_8,\n HK_QUADREAL_15,\n HK_QUADREAL_16,\n HK_QUADREAL_255,\n HK_QUADREAL_256,\n HK_QUADREAL_2_POW_23,\n\n HK_QUADREAL_INV_0,\n HK_QUADREAL_INV_1,\n HK_QUADREAL_INV_2,\n HK_QUADREAL_INV_3,\n HK_QUADREAL_INV_4,\n HK_QUADREAL_INV_5,\n HK_QUADREAL_INV_6,\n HK_QUADREAL_INV_7,\n HK_QUADREAL_INV_8,\n HK_QUADREAL_INV_15,\n HK_QUADREAL_INV_127,\n HK_QUADREAL_INV_226,\n HK_QUADREAL_INV_255,\n HK_QUADREAL_1000,\n HK_QUADREAL_0100,\n HK_QUADREAL_0010,\n HK_QUADREAL_0001,\n HK_QUADREAL_MAX,\n HK_QUADREAL_HIGH,\n /// Epsilon.\n HK_QUADREAL_EPS,\n /// Epsilon squared.\n HK_QUADREAL_EPS_SQRD,\n HK_QUADREAL_MIN,\n HK_QUADREAL_MINUS_MAX,\n HK_QUADREAL_MINUS_MIN,\n HK_QUADREAL_m11m11,\n HK_QUADREAL_1m11m1,\n HK_QUADREAL_1010,\n HK_QUADREAL_1100,\n HK_QUADREAL_0011,\n HK_QUADREAL_1248,\n HK_QUADREAL_8421,\n HK_QUADREAL_PACK_HALF,\n HK_QUADREAL_PACK16_UNIT_VEC,\n HK_QUADREAL_UNPACK16_UNIT_VEC,\n HK_QUADREAL_PI,\n HK_QUADREAL_PI_HALF,\n HK_QUADREAL_PI_QUARTER,\n HK_QUADREAL_FOUR_PI_THIRD,\n HK_QUADREAL_TWO_PI,\n HK_QUADREAL_FOUR_PI,\n HK_QUADREAL_DEG2RAD,\n HK_QUADREAL_RAD2DEG,\n\n HK_QUADREAL_END\n};\n\n\n\nextern const m128 g_vectorfConstants[HK_QUADREAL_END];\n# 10 \"/home/larsvi/botw/lib/hkStubs/./Havok/Common/Base/Math/hkMath.h\" 2\n\n// Forward declarations\nclass hkVector4f;\nclass hkVector4fComparison;\nclass hkSimdFloat32;\nclass hkQuaternionf;\nclass hkMatrix3f;\nclass hkRotationf;\nclass hkTransformf;\nclass hkQTransformf;\nclass hkQsTransformf;\nclass hkMatrix4f;\n\n// Type aliases\nusing hkVector4fParameter = const hkVector4f&;\nusing hkVector4fComparisonParameter = const hkVector4fComparison&;\nusing hkSimdFloat32Parameter = const hkSimdFloat32&;\nusing hkQuaternionfParameter = const hkQuaternionf&;\n\n// Headers\n\n# 1 \"/home/larsvi/botw/lib/hkStubs/./Havok/Common/Base/Math/Vector/hkVector4.h\" 1\n\n\n# 1 \"/home/larsvi/botw/lib/hkStubs/./Havok/Common/Base/Math/Vector/hkVector4f.h\" 1\n\n\n# 1 \"/home/larsvi/botw/lib/hkStubs/./Havok/Common/Base/Math/Vector/hkSimdFloat32.h\" 1\n\n\n\n\n# 1 \"/home/larsvi/botw/lib/hkStubs/./Havok/Common/Base/Math/Vector/hkVector4fComparison.h\" 1\n\n\n\n\n\n\n\n#include <arm_neon.h>\n\n\n\nclass hkVector4fComparison {\npublic:\n inline __attribute__((always_inline)) void* operator new(hk_size_t nbytes) { if constexpr (std::is_base_of_v<hkReferencedObject, hkVector4fComparison>) { return hkMemoryRouter::getInstance().heap().blockAlloc(static_cast<int>(nbytes)); } else { return hkMemoryRouter::getInstance().heap().blockAlloc(sizeof(hkVector4fComparison)); } } inline __attribute__((always_inline)) void operator delete(void* p, hk_size_t nbytes) { if constexpr (std::is_base_of_v<hkReferencedObject, hkVector4fComparison>) { auto* b = static_cast<hkReferencedObject*>(p); hkMemoryRouter::getInstance().heap().blockFree( p, (b->getMemorySizeAndFlags() == 0xffff) ? static_cast<int>(nbytes) : b->getMemorySizeAndFlags()); } else { if (p) hkMemoryRouter::getInstance().heap().blockFree(p, sizeof(hkVector4fComparison)); } } inline __attribute__((always_inline)) void* operator new(hk_size_t, void* p) { return p; } inline __attribute__((always_inline)) void* operator new[](hk_size_t, void* p) { return p; } inline __attribute__((always_inline)) void operator delete(void*, void*) {} inline __attribute__((always_inline)) void operator delete[](void*, void*) {}\n\n enum Mask {\n INDEX_W = 3,\n INDEX_Z = 2,\n INDEX_Y = 1,\n INDEX_X = 0,\n\n MASK_NONE = 0x0, // 0000\n MASK_W = (1 << INDEX_W), // 0001\n MASK_Z = (1 << INDEX_Z), // 0010\n MASK_ZW = (MASK_Z | MASK_W), // 0011\n\n MASK_Y = (1 << INDEX_Y), // 0100\n MASK_YW = (MASK_Y | MASK_W), // 0101\n MASK_YZ = (MASK_Y | MASK_Z), // 0110\n MASK_YZW = (MASK_YZ | MASK_W), // 0111\n\n MASK_X = (1 << INDEX_X), // 1000\n MASK_XW = (MASK_X | MASK_W), // 1001\n MASK_XZ = (MASK_X | MASK_Z), // 1010\n MASK_XZW = (MASK_XZ | MASK_W), // 1011\n\n MASK_XY = (MASK_X | MASK_Y), // 1100\n MASK_XYW = (MASK_XY | MASK_W), // 1101\n MASK_XYZ = (MASK_XY | MASK_Z), // 1110\n MASK_XYZW = (MASK_XY | MASK_ZW) // 1111\n };\n\n inline __attribute__((always_inline)) static hkVector4fComparison convert(const m128& x) { return {x}; }\n\n inline __attribute__((always_inline)) void setAnd(hkVector4fComparisonParameter a, hkVector4fComparisonParameter b);\n inline __attribute__((always_inline)) void setAndNot(hkVector4fComparisonParameter a,\n
hkVector4fComparisonParameter b);\n inline __attribute__((always_inline)) void setXor(hkVector4fComparisonParameter a, hkVector4fComparisonParameter b);\n inline __attribute__((always_inline)) void setOr(hkVector4fComparisonParameter a, hkVector4fComparisonParameter b);\n inline __attribute__((always_inline)) void setNot(hkVector4fComparisonParameter a);\n\n inline __attribute__((always_inline)) void setSelect(hkVector4fComparisonParameter comp,\n hkVector4fComparisonParameter trueValue,\n hkVector4fComparisonParameter falseValue);\n\n template <Mask m = Mask::MASK_XYZW>\n inline __attribute__((always_inline)) hkBool32 allAreSet() const;\n inline __attribute__((always_inline)) hkBool32 allAreSet(Mask m) const;\n\n template <Mask M = Mask::MASK_XYZW>\n inline __attribute__((always_inline)) hkBool32 anyIsSet() const;\n inline __attribute__((always_inline)) hkBool32 anyIsSet(Mask m) const;\n\n m128u m_mask;\n};\n# 6 \"/home/larsvi/botw/lib/hkStubs/./Havok/Common/Base/Math/Vector/hkSimdFloat32.h\" 2\n\n\n\n\n\n\n\n\nclass hkSimdFloat32 {\npublic:\n\n using Storage = __attribute__((vector_size(2 * sizeof(float)))) float;\n\n\n\n\n // NOLINTNEXTLINE(cppcoreguidelines-pro-type-member-init,modernize-use-equals-default)\n hkSimdFloat32() {}\n // NOLINTNEXTLINE(google-explicit-constructor)\n hkSimdFloat32(const Storage& x) { m_real = x; }\n\n\n // NOLINTNEXTLINE(google-explicit-constructor)\n hkSimdFloat32(const float& x) { m_real = vdup_n_f32(x); }\n\n\n\n\n hkFloat32 val() const { return m_real[0]; }\n operator float() const { return val(); } // NOLINT(google-explicit-constructor)\n\n template <int Constant>\n inline __attribute__((always_inline)) static hkSimdFloat32 getConstant();\n\n inline __attribute__((always_inline)) hkSimdFloat32 operator-() const;\n inline __attribute__((always_inline)) hkSimdFloat32 operator+(hkSimdFloat32Parameter r) const;\n inline __attribute__((always_inline)) hkSimdFloat32 operator-(hkSimdFloat32Parameter r) const;\n inline __attribute__((always_inline)) hkSimdFloat32 operator*(hkSimdFloat32Parameter r) const;\n inline __attribute__((always_inline)) hkSimdFloat32 operator/(hkSimdFloat32Parameter r) const;\n\n inline __attribute__((always_inline)) void add(hkSimdFloat32Parameter a);\n inline __attribute__((always_inline)) void sub(hkSimdFloat32Parameter a);\n inline __attribute__((always_inline)) void mul(hkSimdFloat32Parameter a);\n inline __attribute__((always_inline)) void div(hkSimdFloat32Parameter a);\n inline __attribute__((always_inline)) void addMul(hkSimdFloat32Parameter a, hkSimdFloat32Parameter b);\n inline __attribute__((always_inline)) void subMul(hkSimdFloat32Parameter a, hkSimdFloat32Parameter b);\n\n inline __attribute__((always_inline)) void setAdd(hkSimdFloat32Parameter a, hkSimdFloat32Parameter b);\n inline __attribute__((always_inline)) void setSub(hkSimdFloat32Parameter a, hkSimdFloat32Parameter b);\n inline __attribute__((always_inline)) void setMul(hkSimdFloat32Parameter a, hkSimdFloat32Parameter b);\n inline __attribute__((always_inline)) void setDiv(hkSimdFloat32Parameter a, hkSimdFloat32Parameter b);\n inline __attribute__((always_inline)) void setAddMul(hkSimdFloat32Parameter a, hkSimdFloat32Parameter b,\n hkSimdFloat32Parameter c);\n inline __attribute__((always_inline)) void setSubMul(hkSimdFloat32Parameter a, hkSimdFloat32Parameter b,\n hkSimdFloat32Parameter c);\n\n void setAbs(hkSimdFloat32Parameter x);\n\n inline __attribute__((always_inline)) void setReciprocal(hkSimdFloat32Parameter a);\n inline __attribute__((always_inline)) hkSimdFloat32 reciprocal() const;\n /// Returns the square root (or zero if the value is negative).\n inline __attribute__((always_inline)) hkSimdFloat32 sqrt() const;\n /// Returns the square root. Does not check if the value is negative.\n inline __attribute__((always_inline)) hkSimdFloat32 sqrtUnsafe() const;\n /// Return the inverse square root (or zero if the value is negative or zero).\n inline __attribute__((always_inline)) hkSimdFloat32 sqrtInverse() const;\n /// Return the inverse square root. Does not check if the value is negative or zero.\n inline __attribute__((always_inline)) hkSimdFloat32 sqrtInverseUnsafe() const;\n\n inline __attribute__((always_inline)) hkBool32 isLess(hkSimdFloat32Parameter a) const;\n inline __attribute__((always_inline)) hkBool32 isLessEqual(hkSimdFloat32Parameter a) const;\n inline __attribute__((always_inline)) hkBool32 isGreater(hkSimdFloat32Parameter a) const;\n inline __attribute__((always_inline)) hkBool32 isGreaterEqual(hkSimdFloat32Parameter a) const;\n inline __attribute__((always_inline)) hkBool32 isEqual(hkSimdFloat32Parameter a) const;\n inline __attribute__((always_inline)) hkBool32 isNotEqual(hkSimdFloat32Parameter a) const;\n inline __attribute__((always_inline)) hkBool32 isLessZero() const;\n inline __attribute__((always_inline)) hkBool32 isLessEqualZero() const;\n inline __attribute__((always_inline)) hkBool32 isGreaterZero() const;\n inline __attribute__((always_inline)) hkBool32 isGreaterEqualZero() const;\n inline __attribute__((always_inline)) hkBool32 isEqualZero() const;\n inline __attribute__((always_inline)) hkBool32 isNotEqualZero() const;\n\n inline __attribute__((always_inline)) hkVector4fComparison less(hkSimdFloat32Parameter a) const;\n inline __attribute__((always_inline)) hkVector4fComparison lessEqual(hkSimdFloat32Parameter a) const;\n inline __attribute__((always_inline)) hkVector4fComparison greater(hkSimdFloat32Parameter a) const;\n inline __attribute__((always_inline)) hkVector4fComparison greaterEqual(hkSimdFloat32Parameter a) const;\n inline __attribute__((always_inline)) hkVector4fComparison equal(hkSimdFloat32Parameter a) const;\n inline __attribute__((always_inline)) hkVector4fComparison notEqual(hkSimdFloat32Parameter a) const;\n inline __attribute__((always_inline)) hkVector4fComparison lessZero() const;\n inline __attribute__((always_inline)) hkVector4fComparison lessEqualZero() const;\n inline __attribute__((always_inline)) hkVector4fComparison greaterZero() const;\n inline __attribute__((always_inline)) hkVector4fComparison greaterEqualZero() const;\n inline __attribute__((always_inline)) hkVector4fComparison equalZero() const;\n inline __attribute__((always_inline)) hkVector4fComparison notEqualZero() const;\n\n inline __attribute__((always_inline)) m128 toQuad() const;\n inline __attribute__((always_inline)) void load(const float* out);\n inline __attribute__((always_inline)) void store(float* out) const;\n\n Storage m_real;\n\nprivate:\n static hkVector4fComparison toComparison(const Storage& v) {\n\n return hkVector4fComparison::convert(vcombine_f32(v, v));\n\n\n\n }\n};\n\ntemplate <int Constant>\ninline hkSimdFloat32 hkSimdFloat32::getConstant() {\n\n return vget_low_f32(g_vectorfConstants[Constant]);\n\n\n\n}\n\ninline hkSimdFloat32 hkSimdFloat32::operator-() const {\n return -m_real;\n}\n\ninline hkSimdFloat32 hkSimdFloat32::operator+(hkSimdFloat32Parameter r) const {\n return m_real + r.m_real;\n}\n\ninline hkSimdFloat32 hkSimdFloat32::operator-(hkSimdFloat32Parameter r) const {\n return m_real - r.m_real;\n}\n\ninline hkSimdFloat32 hkSimdFloat32::operator*(hkSimdFloat32Parameter r) const {\n return m_real * r.m_real;\n}\n\ninline hkSimdFloat32 hkSimdFloat32::operator/(hkSimdFloat32Parameter r) const {\n return m_real / r.m_real;\n}\n\ninline void hkSimdFloat32::add(hkSimdFloat32Parameter a) {\n setAdd(*this, a);\n}\n\ninline void hkSimdFloat32::sub(hkSimdFloat32Parameter a) {\n setSub(*this, a);\n}\n\ninline void hkSimdFloat32::mul(hkSimdFloat32Parameter a) {\n setMul(*this, a);\n}\n\ninline void hkSimdFloat32::div(hkSimdFloat32Parameter a) {\n setDiv(*this, a);\n}\n\ninline void hkSimdFloat32::addMul(hkSimdFloat32Parameter a, hkSimdFloat32Parameter b) {\n setAddMul(*this, a, b);\n}\n\ninline void hkSimdFloat32::subMul(hkSimdFloat32Parameter a, hkSimdFloat32Parameter b) {\n setSubMul(*this, a, b);\n}\n\ninline void hkSimdFloat32::setAdd(hkSimdFloat32Parameter a, hkSimdFloat32Parameter b) {\n m_real = a.m_real + b.m_real;\n}\n\ninline void hkSimdFloat32::setSub(hkSimdFloat32Parameter a, hkSimdFloat32Parameter b) {\n m_real = a.m_real - b.m_real;\n}\n\ninline void hkSimdFloat32::setMul(hkSimdFloat32Parameter a, hkSimdFloat32Parameter b) {\n m_real = a.m_real * b.m_real;\n}\n\ninline void hkSimdFloat32::setDiv(hkSimdFloat32Parameter a, hkSimdFloat32Parameter b) {\n m_real = a.m_real / b.m_real;\n}\n\ninline void hkSimdFloat32::setAddMul(hkSimdFloat32Parameter a, hkSimdFloat32Parameter b,\n
hkSimdFloat32Parameter c) {\n m_real = a.m_real + b.m_real * c.m_real;\n}\n\ninline void hkSimdFloat32::setSubMul(hkSimdFloat32Parameter a, hkSimdFloat32Parameter b,\n
hkSimdFloat32Parameter c) {\n m_real = a.m_real - b.m_real * c.m_real;\n}\n\ninline void hkSimdFloat32::setAbs(hkSimdFloat32Parameter x) {\n\n m_real = vabs_f32(m_real);\n\n\n\n\n}\n\ninline void hkSimdFloat32::setReciprocal(hkSimdFloat32Parameter a) {\n\n auto r0 = vrecpe_f32(a.m_real);\n auto r1 = vmul_f32(r0, vrecps_f32(a.m_real, r0));\n auto r2 = vmul_f32(r1, vrecps_f32(a.m_real, r1));\n m_real = r2;\n\n\n\n\n}\n\ninline hkSimdFloat32 hkSimdFloat32::reciprocal() const {\n hkSimdFloat32 r;\n r.setReciprocal(*this);\n return r;\n}\n\ninline hkSimdFloat32 hkSimdFloat32::sqrt() const {\n\n const auto leqZero = vclez_f32(m_real);\n const auto inv = sqrtInverseUnsafe().m_real;\n const auto r = m_real * inv;\n return vbic_u32(r, leqZero);\n\n\n\n\n\n\n}\n\ninline hkSimdFloat32 hkSimdFloat32::sqrtUnsafe() const {\n\n const auto inv = sqrtInverseUnsafe();\n return m_real * inv.m_real;\n\n\n\n\n\n\n}\n\ninline hkSimdFloat32 hkSimdFloat32::sqrtInverse() const {\n\n const auto leqZero = vclez_f32(m_real);\n const auto inv = sqrtInverseUnsafe().m_real;\n return vbic_u32(inv, leqZero);\n\n\n\n\n\n\n}\n\ninline hkSimdFloat32 hkSimdFloat32::sqrtInverseUnsafe() const {\n\n auto r0 = vrsqrte_f32(m_real);\n r0 = vrsqrts_f32(m_real, r0 * r0) * r0;\n r0 = vrsqrts_f32(m_real, r0 * r0) * r0;\n return r0;\n\n\n\n\n\n\n}\n\ninline hkBool32 hkSimdFloat32::isLess(hkSimdFloat32Parameter a) const {\n auto cmp = m_real < a.m_real;\n return cmp[0];\n}\n\ninline hkBool32 hkSimdFloat32::isLessEqual(hkSimdFloat32Parameter a) const {\n auto cmp = m_real <= a.m_real;\n return cmp[0];\n}\n\ninline hkBool32 hkSimdFloat32::isGreater(hkSimdFloat32Parameter a) const {\n auto cmp = m_real > a.m_real;\n return cmp[0];\n}\n\ninline hkBool32 hkSimdFloat32::isGreaterEqual(hkSimdFloat32Parameter a) const {\n auto cmp = m_real >= a.m_real;\n return cmp[0];\n}\n\ninline hkBool32 hkSimdFloat32::isEqual(hkSimdFloat32Parameter a) const {\n auto cmp = m_real == a.m_real;\n return cmp[0];\n}\n\ninline hkBool32 hkSimdFloat32::isNotEqual(hkSimdFloat32Parameter a) const {\n auto cmp = m_real != a.m_real;\n return cmp[0];\n}\n\ninline hkBool32 hkSimdFloat32::isLessZero() const {\n auto cmp = m_real < 0.0;\n return cmp[0];\n}\n\ninline hkBool32 hkSimdFloat32::isLessEqualZero() const {\n auto cmp = m_real <= 0.0;\n return cmp[0];\n}\n\ninline hkBool32 hkSimdFloat32::isGreaterZero() const {\n auto cmp = m_real > 0.0;\n return cmp[0];\n}\n\ninline hkBool32 hkSimdFloat32::isGreaterEqualZero() const {\n auto cmp = m_real >= 0.0;\n return cmp[0];\n}\n\ninline hkBool32 hkSimdFloat32::isEqualZero() const {\n auto cmp = m_real == 0.0;\n return cmp[0];\n}\n\ninline hkBool32 hkSimdFloat32::isNotEqualZero() const {\n auto cmp = m_real != 0.0;\n return cmp[0];\n}\n\ninline hkVector4fComparison hkSimdFloat32::less(hkSimdFloat32Parameter a) const {\n auto cmp = m_real < a.m_real;\n return toComparison(cmp);\n}\n\ninline hkVector4fComparison hkSimdFloat32::lessEqual(hkSimdFloat32Parameter a) const {\n auto cmp = m_real <= a.m_real;\n return toComparison(cmp);\n}\n\ninline hkVector4fComparison hkSimdFloat32::greater(hkSimdFloat32Parameter a) const {\n auto cmp = m_real > a.m_real;\n return toComparison(cmp);\n}\n\ninline hkVector4fComparison hkSimdFloat32::greaterEqual(hkSimdFloat32Parameter a) const {\n auto cmp = m_real >= a.m_real;\n return toComparison(cmp);\n}\n\ninline hkVector4fComparison hkSimdFloat32::equal(hkSimdFloat32Parameter a) const {\n auto cmp = m_real == a.m_real;\n return toComparison(cmp);\n}\n\ninline hkVector4fComparison hkSimdFloat32::notEqual(hkSimdFloat32Parameter a) const {\n auto cmp = m_real != a.m_real;\n return toComparison(cmp);\n}\n\ninline hkVector4fComparison hkSimdFloat32::lessZero() const {\n auto cmp = m_real < 0.0;\n return toComparison(cmp);\n}\n\ninline hkVector4fComparison hkSimdFloat32::lessEqualZero() const {\n auto cmp = m_real <= 0.0;\n return toComparison(cmp);\n}\n\ninline hkVector4fComparison hkSimdFloat32::greaterZero() const {\n auto cmp = m_real > 0.0;\n return toComparison(cmp);\n}\n\ninline hkVector4fComparison hkSimdFloat32::greaterEqualZero() const {\n auto cmp = m_real >= 0.0;\n return toComparison(cmp);\n}\n\ninline hkVector4fComparison hkSimdFloat32::equalZero() const {\n auto cmp = m_real == 0.0;\n return toComparison(cmp);\n}\n\ninline hkVector4fComparison hkSimdFloat32::notEqualZero() const {\n auto cmp = m_real != 0.0;\n return toComparison(cmp);\n}\n\ninline m128 hkSimdFloat32::toQuad() const {\n\n return vcombine_f32(m_real, m_real);\n\n\n\n}\n\ninline void hkSimdFloat32::load(const float* out) {\n\n m_real = __extension__ ({ float32x2_t __ret; __ret = (float32x2_t) __builtin_neon_vld1_dup_v(out, 9); __ret; });\n\n\n\n}\n\ninline void hkSimdFloat32::store(float* out) const {\n\n __extension__ ({ float32x2_t __s1 = m_real; __builtin_neon_vst1_lane_v(out, (int8x8_t)__s1, 0, 9); });\n\n\n\n}\n# 4 \"/home/larsvi/botw/lib/hkStubs/./Havok/Common/Base/Math/Vector/hkVector4f.h\" 2\n\n\n\n\n\n\n\n\nclass hkVector4f {\npublic:\n inline __attribute__((always_inline)) void* operator new(hk_size_t nbytes) { if constexpr (std::is_base_of_v<hkReferencedObject, hkVector4f>) { return hkMemoryRouter::getInstance().heap().blockAlloc(static_cast<int>(nbytes)); } else { return hkMemoryRouter::getInstance().heap().blockAlloc(sizeof(hkVector4f)); } } inline __attribute__((always_inline)) void operator delete(void* p, hk_size_t nbytes) { if constexpr (std::is_base_of_v<hkReferencedObject, hkVector4f>) { auto* b = static_cast<hkReferencedObject*>(p); hkMemoryRouter::getInstance().heap().blockFree( p, (b->getMemorySizeAndFlags() == 0xffff) ? static_cast<int>(nbytes) : b->getMemorySizeAndFlags()); } else { if (p) hkMemoryRouter::getInstance().heap().blockFree(p, sizeof(hkVector4f)); } } inline __attribute__((always_inline)) void* operator new(hk_size_t, void* p) { return p; } inline __attribute__((always_inline)) void* operator new[](hk_size_t, void* p) { return p; } inline __attribute__((always_inline)) void operator delete(void*, void*) {} inline __attribute__((always_inline)) void operator delete[](void*, void*) {}\n\n // NOLINTNEXTLINE(cppcoreguidelines-pro-type-member-init,modernize-use-equals-default)\n inline __attribute__((always_inline)) hkVector4f() {}\n inline __attribute__((always_inline)) hkVector4f(hkFloat32 x, hkFloat32 y, hkFloat32 z, hkFloat32 w = 0);\n inline __attribute__((always_inline)) hkVector4f(const hkVector4f& other);\n inline __attribute__((always_inline)) hkVector4f& operator=(hkVector4fParameter other);\n\n // ========== Vector initialization\n\n inline __attribute__((always_inline)) void set(hkFloat32 x, hkFloat32 y, hkFloat32 z, hkFloat32 w = 0);\n inline __attribute__((always_inline)) void setXYZ(hkVector4fParameter xyz);\n inline __attribute__((always_inline)) void setXYZ_W(hkVector4fParameter xyz, hkSimdFloat32Parameter w);\n inline __attribute__((always_inline)) void setAll(hkFloat32 x);\n inline __attribute__((always_inline)) void setAll(hkSimdFloat32Parameter x);\n inline __attribute__((always_inline)) void setZero();\n template <int I>\n inline __attribute__((always_inline)) void zeroComponent();\n inline __attribute__((always_inline)) void zeroComponent(int i);\n\n // ========== Vector operations\n\n inline __attribute__((always_inline)) void add(hkVector4fParameter a);\n inline __attribute__((always_inline)) void sub(hkVector4fParameter a);\n inline __attribute__((always_inline)) void mul(hkVector4fParameter a);\n inline __attribute__((always_inline)) void div(hkVector4fParameter a);\n\n inline __attribute__((always_inline)) void setAdd(hkVector4fParameter a, hkVector4fParameter b);\n inline __attribute__((always_inline)) void setSub(hkVector4fParameter a, hkVector4fParameter b);\n inline __attribute__((always_inline)) void setMul(hkVector4fParameter a, hkVector4fParameter b);\n inline __attribute__((always_inline)) void setDiv(hkVector4fParameter a, hkVector4fParameter b);\n\n inline __attribute__((always_inline)) void add(hkSimdFloat32Parameter a);\n inline __attribute__((always_inline)) void sub(hkSimdFloat32Parameter a);\n inline __attribute__((always_inline)) void mul(hkSimdFloat32Parameter a);\n inline __attribute__((always_inline)) void setMul(hkVector4fParameter a, hkSimdFloat32Parameter r);\n inline __attribute__((always_inline)) void setMul(hkSimdFloat32Parameter r, hkVector4fParameter a);\n inline __attribute__((always_inline)) void setAdd(hkVector4fParameter a, hkSimdFloat32Parameter b);\n inline __attribute__((always_inline)) void setSub(hkVector4fParameter a, hkSimdFloat32Parameter b);\n\n inline __attribute__((always_inline)) void setReciprocal(hkVector4fParameter a);\n inline __attribute__((always_inline)) void setSqrt(hkVector4fParameter a);\n inline __attribute__((always_inline)) void setSqrtInverse(hkVector4fParameter a);\n\n inline __attribute__((always_inline)) void addMul(hkVector4fParameter a, hkVector4fParameter b);\n inline __attribute__((always_inline)) void subMul(hkVector4fParameter a, hkVector4fParameter b);\n\n inline __attribute__((always_inline)) void setAddMul(hkVector4fParameter a, hkVector4fParameter b,\n hkVector4fParameter c);\n inline __attribute__((always_inline)) void setSubMul(hkVector4fParameter a, hkVector4fParameter b,\n hkVector4fParameter c);\n\n inline __attribute__((always_inline)) void addMul(hkVector4fParameter a, hkSimdFloat32Parameter r);\n inline __attribute__((always_inline)) void addMul(hkSimdFloat32Parameter r, hkVector4fParameter a);\n inline __attribute__((always_inline)) void subMul(hkVector4fParameter a, hkSimdFloat32Parameter r);\n inline __attribute__((always_inline)) void subMul(hkSimdFloat32Parameter r, hkVector4fParameter a);\n\n inline __attribute__((always_inline)) void setAddMul(hkVector4fParameter a, hkVector4fParameter b,\n
hkSimdFloat32Parameter r);\n inline __attribute__((always_inline)) void setSubMul(hkVector4fParameter a, hkVector4fParameter b,\n hkSimdFloat32Parameter r);\n\n inline __attribute__((always_inline)) void setCross(hkVector4fParameter a, hkVector4fParameter b);\n inline __attribute__((always_inline)) void setInterpolate(hkVector4fParameter v0, hkVector4fParameter v1,\n hkSimdFloat32Parameter t);\n\n // ========== Comparisons\n\n inline __attribute__((always_inline)) hkVector4fComparison less(hkVector4fParameter a) const;\n inline __attribute__((always_inline)) hkVector4fComparison lessEqual(hkVector4fParameter a) const;\n inline __attribute__((always_inline)) hkVector4fComparison greater(hkVector4fParameter a) const;\n inline __attribute__((always_inline)) hkVector4fComparison greaterEqual(hkVector4fParameter a) const;\n inline __attribute__((always_inline)) hkVector4fComparison equal(hkVector4fParameter a) const;\n inline __attribute__((always_inline)) hkVector4fComparison notEqual(hkVector4fParameter a) const;\n inline __attribute__((always_inline)) hkVector4fComparison lessZero() const;\n inline __attribute__((always_inline)) hkVector4fComparison lessEqualZero() const;\n inline __attribute__((always_inline)) hkVector4fComparison greaterZero() const;\n inline __attribute__((always_inline)) hkVector4fComparison greaterEqualZero() const;\n inline __attribute__((always_inline)) hkVector4fComparison equalZero() const;\n inline __attribute__((always_inline)) hkVector4fComparison notEqualZero() const;\n\n /// Whether the first N components of this vector are within `epsilon`\n /// of the corresponding components in `v`.\n template <int N>\n inline __attribute__((always_inline)) hkBool32 allEqual(hkVector4fParameter rhs,\n hkSimdFloat32Parameter epsilon) const;\n\n // ========== Sign, comparisons, clamping\n\n inline __attribute__((always_inline)) void setAbs(hkVector4fParameter a);\n template <int N>\n inline __attribute__((always_inline)) void setNeg(hkVector4fParameter a);\n\n /// v[i] = mask[i] ? -a[i] : a[i]\n inline __attribute__((always_inline)) void setFlipSign(hkVector4fParameter a, hkVector4fComparisonParameter mask);\n /// v[i] = signs[i] < 0 ? -a[i] : a[i]\n inline __attribute__((always_inline)) void setFlipSign(hkVector4fParameter a, hkVector4fParameter signs);\n /// v[i] = sign < 0 ? -a[i] : a[i]\n inline __attribute__((always_inline)) void setFlipSign(hkVector4fParameter a, hkSimdFloat32Parameter sign);\n\n /// Whether the sign bit is set. (True for -0.0.)\n inline __attribute__((always_inline)) hkVector4fComparison signBitSet() const;\n /// Whether the sign bit is cleared.\n inline __attribute__((always_inline)) hkVector4fComparison signBitClear() const;\n\n // ========== Matrix operations (out-of-line)\n\n void setRotatedDir(const hkMatrix3f& a, hkVector4fParameter b);\n void setRotatedInverseDir(const hkMatrix3f& a, hkVector4fParameter b);\n void setTransformedPos(const hkTransformf& a, const hkVector4f& pos);\n void setTransformedInversePos(const hkTransformf& a, hkVector4fParameter b);\n\n void setRotatedDir(hkQuaternionfParameter quat, hkVector4fParameter direction);\n void setRotatedInverseDir(hkQuaternionfParameter quat, hkVector4fParameter direction);\n void setTransformedPos(const hkQsTransformf& a, hkVector4fParameter b);\n void setTransformedInversePos(const hkQsTransformf& a, hkVector4fParameter b);\n\n void setTransformedPos(const hkQTransformf& a, hkVector4fParameter b);\n void setTransformedInversePos(const hkQTransformf& a, hkVector4fParameter b);\n\n // ========== Matrix operations (inline)\n\n inline __attribute__((always_inline)) void _setRotatedDir(const hkMatrix3f& a, hkVector4fParameter b);\n inline __attribute__((always_inline)) void _setRotatedDir(hkQuaternionfParameter quat, hkVector4fParameter vec);\n inline __attribute__((always_inline)) void _setRotatedInverseDir(hkQuaternionfParameter quat,\n
hkVector4fParameter vec);\n inline __attribute__((always_inline)) void _setTransformedPos(const hkTransformf& a, hkVector4fParameter b);\n\n // ========== Length and normalization\n\n template <int N>\n inline __attribute__((always_inline)) hkSimdFloat32 dot(hkVector4fParameter a) const;\n\n template <int N>\n inline __attribute__((always_inline)) void setDot(hkVector4fParameter a, hkVector4fParameter b);\n\n /// Get the length of this vector as if it had N components.\n template <int N>\n inline __attribute__((always_inline)) hkSimdFloat32 length() const;\n\n /// Get the squared length (|v|^2) of this vector as if it had N components.\n template <int N>\n inline __attribute__((always_inline)) hkSimdFloat32 lengthSquared() const;\n\n /// Get the inverse length (1/|v|) of this vector as if it had N components.\n template <int N>\n inline __attribute__((always_inline)) hkSimdFloat32 lengthInverse() const;\n\n /// Get the inverse length (1/|v|) of this vector as if it had N components.\n /// Does not check for negative sqrt values or divide-by-zero.\n template <int N>\n inline __attribute__((always_inline)) hkSimdFloat32 lengthInverseUnsafe() const;\n\n /// Normalize this vector as if it had N components.\n template <int N>\n inline __attribute__((always_inline)) void normalize();\n\n /// Normalize this vector as if it had N components.\n /// Does not check for negative sqrt values or divide-by-zero.\n template <int N>\n inline __attribute__((always_inline)) void normalizeUnsafe();\n\n // ========== Misc\n\n /// Dot product of this vector and (a.x, a.y, a.z, 1).\n hkSimdFloat32 dot4xyz1(hkVector4fParameter a) const;\n\n // ========== Component access\n\n hkFloat32& operator()(int i) { return reinterpret_cast<float*>(&v)[i]; }\n hkFloat32& operator[](int i) { return reinterpret_cast<float*>(&v)[i]; }\n const hkFloat32& operator()(int i) const { return reinterpret_cast<const float*>(&v)[i]; }\n const hkFloat32& operator[](int i) const { return reinterpret_cast<const float*>(&v)[i]; }\n\n template <int I>\n inline __attribute__((always_inline)) hkSimdFloat32 getComponent() const {\n return v[I];\n }\n hkSimdFloat32 getComponent(int i) const { return v[i]; }\n hkSimdFloat32 getX() const { return getComponent<0>(); }\n hkSimdFloat32 getY() const { return getComponent<1>(); }\n hkSimdFloat32 getZ() const { return getComponent<2>(); }\n hkSimdFloat32 getW() const { return getComponent<3>(); }\n template <int I>\n inline __attribute__((always_inline)) void setComponent(hkSimdFloat32Parameter val) {\n v[I] = val;\n }\n void setComponent(int i, hkSimdFloat32Parameter val) { v[i] = val; }\n void setX(hkSimdFloat32Parameter val) { setComponent(0, val); }\n void setY(hkSimdFloat32Parameter val) { setComponent(1, val); }\n void setZ(hkSimdFloat32Parameter val) { setComponent(2, val); }\n void setW(hkSimdFloat32Parameter val) { setComponent(3, val); }\n\n inline __attribute__((always_inline)) void setInt24W(int value);\n inline __attribute__((always_inline)) int getInt24W() const;\n\n // ========== Load/store\n\n template <int Constant>\n inline __attribute__((always_inline)) static const hkVector4f& getConstant();\n\n inline __attribute__((always_inline)) static hkVector4f zero() {\n hkVector4f u;\n u.setZero();\n return u;\n }\n\n /// Load N floats from in.\n template <int N>\n void load(const hkFloat32* in);\n\n /// Store N floats to out.\n template <int N>\n void store(hkFloat32* out) const;\n\n m128 v;\n};\n# 4 \"/home/larsvi/botw/lib/hkStubs/./Havok/Common/Base/Math/Vector/hkVector4.h\" 2\n\nusing hkVector4 = hkVector4f;\nusing hkVector4Parameter = const hkVector4f&;\n# 31 \"/home/larsvi/botw/lib/hkStubs/./Havok/Common/Base/Math/hkMath.h\" 2\n# 1 \"/home/larsvi/botw/lib/hkStubs/./Havok/Common/Base/Math/Vector/hkVector4Comparison.h\" 1\n\n\n\n\nusing hkVector4Comparison = hkVector4fComparison;\nusing hkVector4ComparisonParameter = const hkVector4Comparison&;\n# 32 \"/home/larsvi/botw/lib/hkStubs/./Havok/Common/Base/Math/hkMath.h\" 2\n# 1 \"/home/larsvi/botw/lib/hkStubs/./Havok/Common/Base/Math/Vector/hkSimdReal.h\" 1\n\n\n\n\nusing hkSimdReal = hkSimdFloat32;\nusing hkSimdRealParameter = const hkSimdReal&;\n# 33 \"/home/larsvi/botw/lib/hkStubs/./Havok/Common/Base/Math/hkMath.h\" 2\n# 1 \"/home/larsvi/botw/lib/hkStubs/./Havok/Common/Base/Math/Quaternion/hkQuaternion.h\" 1\n\n\n# 1 \"/home/larsvi/botw/lib/hkStubs/./Havok/Common/Base/Math/Quaternion/hkQuaternionf.h\" 1\n\n\nclass hkQuaternionf {\npublic:\n hkQuaternionf() {} // NOLINT(modernize-use-equals-default)\n inline __attribute__((always_inline)) hkQuaternionf(const hkQuaternionf&) = default;\n inline __attribute__((always_inline)) hkQuaternionf(hkFloat32 ix, hkFloat32 iy, hkFloat32 iz, hkFloat32 r);\n inline __attribute__((always_inline)) void set(hkFloat32 ix, hkFloat32 iy, hkFloat32 iz, hkFloat32 r);\n\n inline __attribute__((always_inline)) hkQuaternionf& operator=(const hkQuaternionf& q);\n\n inline __attribute__((always_inline)) const hkFloat32& operator()(int i) const;\n template <int I>\n inline __attribute__((always_inline)) hkSimdFloat32 getComponent() const;\n inline __attribute__((always_inline)) hkFloat32 getReal() const;\n inline __attribute__((always_inline)) hkSimdFloat32 getRealPart() const;\n inline __attribute__((always_inline)) const hkVector4f& getImag() const;\n\n inline __attribute__((always_inline)) hkBool32 hasValidAxis() const;\n /// @warning This should only be called if hasValidAxis() is true.\n inline __attribute__((always_inline)) void getAxis(hkVector4f& axis) const;\n inline __attribute__((always_inline)) hkFloat32 getAngle() const;\n hkSimdFloat32 getAngleSr() const;\n\n /// self = self * q\n inline __attribute__((always_inline)) void mul(hkQuaternionfParameter q);\n /// self = r * q\n inline __attribute__((always_inline)) void setMul(hkQuaternionfParameter r, hkQuaternionfParameter q);\n /// self = r * q^-1\n inline __attribute__((always_inline)) void setMulInverse(hkQuaternionfParameter r, hkQuaternionfParameter q);\n /// self = r^-1 * q\n inline __attribute__((always_inline)) void setInverseMul(hkQuaternionfParameter r, hkQuaternionfParameter q);\n\n inline __attribute__((always_inline)) void setInverse(hkQuaternionfParameter q);\n\n inline __attribute__((always_inline)) void normalize();\n\n inline __attribute__((always_inline)) static const hkQuaternionf& getIdentity();\n inline __attribute__((always_inline)) void setIdentity();\n\n hkVector4f m_vec;\n};\n# 4 \"/home/larsvi/botw/lib/hkStubs/./Havok/Common/Base/Math/Quaternion/hkQuaternion.h\" 2\n\nusing hkQuaternion = hkQuaternionf;\n# 34 \"/home/larsvi/botw/lib/hkStubs/./Havok/Common/Base/Math/hkMath.h\" 2\n# 1 \"/home/larsvi/botw/lib/hkStubs/./Havok/Common/Base/Math/Matrix/hkMatrix3.h\" 1\n\n\n# 1 \"/home/larsvi/botw/lib/hkStubs/./Havok/Common/Base/Math/Matrix/hkMatrix3f.h\" 1\n\n\nclass hkMatrix3f {\npublic:\n hkMatrix3f() {} // NOLINT(modernize-use-equals-default)\n\n inline __attribute__((always_inline)) hkMatrix3f(const hkMatrix3f& other);\n inline __attribute__((always_inline)) hkMatrix3f& operator=(const hkMatrix3f& other);\n\n inline __attribute__((always_inline)) hkFloat32& operator()(int row, int col);\n inline __attribute__((always_inline)) const hkFloat32& operator()(int row, int col) const;\n template <int Row, int Col>\n inline __attribute__((always_inline)) hkSimdFloat32 get() const;\n template <int Row, int Col>\n inline __attribute__((always_inline)) void set(hkSimdFloat32Parameter s);\n\n inline __attribute__((always_inline)) hkVector4f& getColumn(int i);\n inline __attribute__((always_inline)) const hkVector4f& getColumn(int i) const;\n template <int I>\n inline __attribute__((always_inline)) const hkVector4f& getColumn() const;\n\n inline __attribute__((always_inline)) void getRows(hkVector4f& r0, hkVector4f& r1, hkVector4f& r2) const;\n\n inline __attribute__((always_inline)) void setZero();\n inline __attribute__((always_inline)) void setIdentity();\n\n void setMul(const hkMatrix3f& a, const hkMatrix3f& b);\n inline __attribute__((always_inline)) void _setMul(const hkMatrix3f& a, const hkMatrix3f& b);\n void mul(const hkMatrix3f& a);\n\n hkVector4f m_col0;\n hkVector4f m_col1;\n hkVector4f m_col2;\n};\n# 4 \"/home/larsvi/botw/lib/hkStubs/./Havok/Common/Base/Math/Matrix/hkMatrix3.h\" 2\n\nusing hkMatrix3 = hkMatrix3f;\n# 35 \"/home/larsvi/botw/lib/hkStubs/./Havok/Common/Base/Math/hkMath.h\" 2\n# 1 \"/home/larsvi/botw/lib/hkStubs/./Havok/Common/Base/Math/Matrix/hkRotation.h\" 1\n\n\n# 1 \"/home/larsvi/botw/lib/hkStubs/./Havok/Common/Base/Math/Matrix/hkRotationf.h\" 1\n\n\nclass hkRotationf : public hkMatrix3f {\npublic:\n void set(hkQuaternionfParameter q);\n\n void setAxisAngle(hkVector4fParameter axis, hkFloat32 angle);\n void setAxisAngle(hkVector4fParameter axis, hkSimdFloat32Parameter angle);\n\n bool isOrthonormal(hkFloat32 epsilon = hkFloat32(1e-5f)) const;\n\n bool isOk() const;\n void renormalize();\n};\n# 4 \"/home/larsvi/botw/lib/hkStubs/./Havok/Common/Base/Math/Matrix/hkRotation.h\" 2\n\nusing hkRotation = hkRotationf;\n# 36 \"/home/larsvi/botw/lib/hkStubs/./Havok/Common/Base/Math/hkMath.h\" 2\n# 1 \"/home/larsvi/botw/lib/hkStubs/./Havok/Common/Base/Math/Matrix/hkTransform.h\" 1\n\n\n# 1 \"/home/larsvi/botw/lib/hkStubs/./Havok/Common/Base/Math/Matrix/hkTransformf.h\" 1\n\n\nclass hkTransformf {\npublic:\n inline __attribute__((always_inline)) hkTransformf() = default;\n inline __attribute__((always_inline)) hkTransformf(const hkTransformf& other);\n inline __attribute__((always_inline)) hkTransformf(const hkRotationf& r, hkVector4fParameter t);\n inline __attribute__((always_inline)) hkTransformf(hkQuaternionfParameter r, hkVector4fParameter t);\n\n hkTransformf& operator=(const hkTransformf& other) = default;\n\n hkRotationf& getRotation() { return m_rotation; }\n const hkRotationf& getRotation() const { return m_rotation; }\n\n hkVector4f& getTranslation() { return m_translation; }\n const hkVector4f& getTranslation() const { return m_translation; }\n\n inline __attribute__((always_inline)) void set(const hkRotationf& r, hkVector4fParameter t);\n inline __attribute__((always_inline)) void set(hkQuaternionfParameter q, hkVector4fParameter t);\n\n inline __attribute__((always_inline)) static const hkTransformf& getIdentity();\n inline __attribute__((always_inline)) void setIdentity();\n\n hkRotationf m_rotation;\n hkVector4f m_translation;\n};\n\ninline hkTransformf::hkTransformf(const hkTransformf& other) {\n const auto col0 = other.m_rotation.m_col0;\n const auto col1 = other.m_rotation.m_col1;\n const auto col2 = other.m_rotation.m_col2;\n const auto col3 = other.m_translation;\n m_rotation.m_col0 = col0;\n m_rotation.m_col1 = col1;\n m_rotation.m_col2 = col2;\n m_translation = col3;\n}\n\ninline hkTransformf::hkTransformf(const hkRotationf& r, const hkVector4f& t)\n : m_rotation(r), m_translation(t) {}\n\ninline hkTransformf::hkTransformf(hkQuaternionfParameter r, const hkVector4f& t)\n : m_translation(t) {\n m_rotation.set(r);\n}\n\ninline void hkTransformf::set(const hkRotationf& r, const hkVector4f& t) {\n m_rotation = r;\n m_translation = t;\n}\n\ninline void hkTransformf::set(const hkQuaternionf& q, const hkVector4f& t) {\n m_rotation.set(q);\n m_translation = t;\n}\n\ninline const hkTransformf& hkTransformf::getIdentity() {\n return reinterpret_cast<const hkTransformf&>(g_vectorfConstants[HK_QUADREAL_1000]);\n}\n\ninline void hkTransformf::setIdentity() {\n m_rotation.setIdentity();\n m_translation.setZero();\n}\n# 4 \"/home/larsvi/botw/lib/hkStubs/./Havok/Common/Base/Math/Matrix/hkTransform.h\" 2\n\nusing hkTransform = hkTransformf;\n# 37 \"/home/larsvi/botw/lib/hkStubs/./Havok/Common/Base/Math/hkMath.h\" 2\n# 1 \"/home/larsvi/botw/lib/hkStubs/./Havok/Common/Base/Math/QsTransform/hkQsTransform.h\" 1\n\n\n# 1 \"/home/larsvi/botw/lib/hkStubs/./Havok/Common/Base/Math/QsTransform/hkQsTransformf.h\" 1\n\n\nclass hkQsTransformf {\npublic:\n // Initialisation tags.\n enum class IdentityInitializer {};\n enum class ZeroInitializer {};\n\n inline __attribute__((always_inline)) hkQsTransformf() = default;\n\n // NOLINTNEXTLINE(google-explicit-constructor)\n inline __attribute__((always_inline)) hkQsTransformf(IdentityInitializer init);\n\n // NOLINTNEXTLINE(google-explicit-constructor)\n inline __attribute__((always_inline)) hkQsTransformf(ZeroInitializer init);\n\n inline __attribute__((always_inline)) hkQsTransformf(hkVector4fParameter translation, hkQuaternionfParameter rotation,\n hkVector4fParameter scale);\n\n inline __attribute__((always_inline)) hkQsTransformf(hkVector4fParameter translation,\n hkQuaternionfParameter rotation);\n\n inline __attribute__((always_inline)) hkQsTransformf(const hkQsTransformf& other);\n hkQsTransformf& operator=(const hkQsTransformf&) = default;\n\n inline __attribute__((always_inline)) const hkVector4f& getTranslation() const;\n inline __attribute__((always_inline)) const hkQuaternionf& getRotation() const;\n inline __attribute__((always_inline)) const hkVector4f& getScale() const;\n\n inline __attribute__((always_inline)) void setIdentity();\n inline __attribute__((always_inline)) void setZero();\n\n void setFromTransformNoScale(const hkTransformf& transform);\n void copyToTransformNoScale(hkTransformf& transformOut) const;\n void setFromTransform(const hkTransformf& transform);\n void setFromTransform(const hkQTransformf& qt);\n void copyToTransform(hkTransformf& transformOut) const;\n\n inline __attribute__((always_inline)) void set(hkVector4fParameter translation, hkQuaternionfParameter rotation,\n hkVector4fParameter scale);\n\n inline __attribute__((always_inline)) void set(hkVector4fParameter translation, hkQuaternionfParameter rotation);\n\n inline __attribute__((always_inline)) void setInverse(const hkQsTransformf& t);\n\n inline __attribute__((always_inline)) void setMul(const hkQsTransformf& t1, const hkQsTransformf& t2);\n\n inline __attribute__((always_inline)) void setMulScaled(const hkQsTransformf& t1, const hkQsTransformf& t2);\n\n /// this = t1^-1 * t2\n inline __attribute__((always_inline)) void setMulInverseMul(const hkQsTransformf& t1, const hkQsTransformf& t2);\n\n /// this = t1 * t2^-1\n inline __attribute__((always_inline)) void setMulMulInverse(const hkQsTransformf& t1, const hkQsTransformf& t2);\n\n /// this *= b\n inline __attribute__((always_inline)) void setMulEq(const hkQsTransformf& b);\n\n bool isOk(hkFloat32 epsilon = hkFloat32(1e-3f)) const;\n\n void fastRenormalize();\n\n hkVector4f m_translation;\n hkQuaternionf m_rotation;\n hkVector4f m_scale;\n};\n# 4 \"/home/larsvi/botw/lib/hkStubs/./Havok/Common/Base/Math/QsTransform/hkQsTransform.h\" 2\n\nusing hkQsTransform = hkQsTransformf;\n# 38 \"/home/larsvi/botw/lib/hkStubs/./Havok/Common/Base/Math/hkMath.h\" 2\n# 1 \"/home/larsvi/botw/lib/hkStubs/./Havok/Common/Base/Math/Matrix/hkMatrix4.h\" 1\n\n\n# 1 \"/home/larsvi/botw/lib/hkStubs/./Havok/Common/Base/Math/Matrix/hkMatrix4f.h\" 1\n\n\nclass hkMatrix4f {\npublic:\n hkVector4f m_col0;\n hkVector4f m_col1;\n hkVector4f m_col2;\n hkVector4f m_col3;\n};\n# 4 \"/home/larsvi/botw/lib/hkStubs/./Havok/Common/Base/Math/Matrix/hkMatrix4.h\" 2\n\nusing hkMatrix4 = hkMatrix4f;\n# 39 \"/home/larsvi/botw/lib/hkStubs/./Havok/Common/Base/Math/hkMath.h\" 2\n\n// Implementations\n\n# 1 \"/home/larsvi/botw/lib/hkStubs/./Havok/Common/Base/Math/Vector/hkVector4f.inl\" 1\n# 10 \"/home/larsvi/botw/lib/hkStubs/./Havok/Common/Base/Math/Vector/hkVector4f.inl\"\n// NOLINTNEXTLINE(cppcoreguidelines-pro-type-member-init)\ninline hkVector4f::hkVector4f(hkFloat32 x, hkFloat32 y, hkFloat32 z, hkFloat32 w) {\n set(x, y, z, w);\n}\n\ninline hkVector4f::hkVector4f(const hkVector4f& other) {\n v = other.v;\n}\n\ninline hkVector4f& hkVector4f::operator=(hkVector4fParameter other) {\n v = other.v;\n return *this;\n}\n\ninline void hkVector4f::set(hkFloat32 x, hkFloat32 y, hkFloat32 z, hkFloat32 w) {\n\n // Annoyingly, v = {x, y, z, w} and vcombine_f32({x, y}, {z, w}) lead to different codegen.\n // It is unclear why Havok decided to split the load in two parts.\n v = vcombine_f32(float32x2_t{x, y}, float32x2_t{z, w});\n\n\n\n}\n\ninline void hkVector4f::setXYZ(hkVector4fParameter xyz) {\n\n v = __extension__ ({ float32_t __s0 = __extension__ ({ float32x4_t __s0 = v; float32_t __ret; __ret = (float32_t) __builtin_neon_vgetq_lane_f32((int8x16_t)__s0, 3); __ret; }); float32x4_t __s1 = xyz.v; float32x4_t __ret; __ret = (float32x4_t) __builtin_neon_vsetq_lane_f32(__s0, (int8x16_t)__s1, 3); __ret; });\n\n\n\n\n\n}\n\ninline void hkVector4f::setXYZ_W(hkVector4fParameter xyz, hkSimdFloat32Parameter w) {\n\n v = __extension__ ({ float32_t __s0 = w; float32x4_t __s1 = xyz.v; float32x4_t __ret; __ret = (float32x4_t) __builtin_neon_vsetq_lane_f32(__s0, (int8x16_t)__s1, 3); __ret; });\n\n\n\n\n\n}\n\ninline void hkVector4f::setAll(hkReal x) {\n v = {x, x, x, x};\n}\n\ninline void hkVector4f::setAll(hkSimdFloat32Parameter x) {\n v = x.toQuad();\n}\n\ninline void hkVector4f::setZero() {\n setAll(0);\n}\n\ntemplate <int I>\ninline void hkVector4f::zeroComponent() {\n v[I] = 0;\n}\n\ninline void hkVector4f::zeroComponent(int i) {\n v[i] = 0;\n}\n\ninline void hkVector4f::add(hkVector4fParameter a) {\n setAdd(*this, a);\n}\n\ninline void hkVector4f::sub(hkVector4fParameter a) {\n setSub(*this, a);\n}\n\ninline void hkVector4f::mul(hkVector4fParameter a) {\n setMul(*this, a);\n}\n\ninline void hkVector4f::div(hkVector4fParameter a) {\n setDiv(*this, a);\n}\n\ninline void hkVector4f::setAdd(hkVector4fParameter a, hkVector4fParameter b) {\n v = a.v + b.v;\n}\n\ninline void hkVector4f::setSub(hkVector4fParameter a, hkVector4fParameter b) {\n v = a.v - b.v;\n}\n\ninline void hkVector4f::setMul(hkVector4fParameter a, hkVector4fParameter b) {\n v = a.v * b.v;\n}\n\ninline void hkVector4f::setDiv(hkVector4fParameter a, hkVector4fParameter b) {\n v = a.v / b.v;\n}\n\ninline void hkVector4f::add(hkSimdFloat32Parameter a) {\n setAdd(*this, a);\n}\n\ninline void hkVector4f::sub(hkSimdFloat32Parameter a) {\n setSub(*this, a);\n}\n\ninline void hkVector4f::mul(hkSimdFloat32Parameter a) {\n setMul(*this, a);\n}\n\ninline void hkVector4f::setMul(hkVector4fParameter a, hkSimdFloat32Parameter r) {\n v = a.v * r.toQuad();\n}\n\ninline void hkVector4f::setMul(hkSimdFloat32Parameter r, hkVector4fParameter a) {\n setMul(a, r);\n}\n\ninline void hkVector4f::setAdd(hkVector4fParameter a, hkSimdFloat32Parameter b) {\n v = a.v + b.toQuad();\n}\n\ninline void hkVector4f::setSub(hkVector4fParameter a, hkSimdFloat32Parameter b) {\n v = a.v - b.toQuad();\n}\n\ninline void hkVector4f::setReciprocal(hkVector4fParameter a) {\n\n auto result = vrecpeq_f32(a.v);\n result *= vrecpsq_f32(a.v, result);\n result *= vrecpsq_f32(a.v, result);\n v = result;\n\n\n\n\n}\n\ninline void hkVector4f::setSqrt(hkVector4fParameter a) {\n\n v = vsqrtq_f32(a.v);\n\n\n\n\n}\n\ninline void hkVector4f::setSqrtInverse(hkVector4fParameter a) {\n\n v = vrsqrteq_f32(a.v);\n\n\n\n\n}\n\ninline void hkVector4f::addMul(hkVector4fParameter a, hkVector4fParameter b) {\n setAddMul(*this, a, b);\n}\n\ninline void hkVector4f::subMul(hkVector4fParameter a, hkVector4fParameter b) {\n setSubMul(*this, a, b);\n}\n\ninline void hkVector4f::setAddMul(hkVector4fParameter a, hkVector4fParameter b,\n hkVector4fParameter c) {\n v = a.v + b.v * c.v;\n}\n\ninline void hkVector4f::setSubMul(hkVector4fParameter a, hkVector4fParameter b,\n hkVector4fParameter c) {\n v = a.v - b.v * c.v;\n}\n\ninline void hkVector4f::addMul(hkVector4fParameter a, hkSimdFloat32Parameter r) {\n setAddMul(*this, a, r);\n}\n\ninline void hkVector4f::addMul(hkSimdFloat32Parameter r, hkVector4fParameter a) {\n addMul(a, r);\n}\n\ninline void hkVector4f::subMul(hkVector4fParameter a, hkSimdFloat32Parameter r) {\n setSubMul(*this, a, r);\n}\n\ninline void hkVector4f::subMul(hkSimdFloat32Parameter r, hkVector4fParameter a) {\n subMul(a, r);\n}\n\ninline void hkVector4f::setAddMul(hkVector4fParameter a, hkVector4fParameter b,\n hkSimdFloat32Parameter r) {\n v = a.v + r.toQuad() * b.v;\n}\n\ninline void hkVector4f::setSubMul(hkVector4fParameter a, hkVector4fParameter b,\n hkSimdFloat32Parameter r) {\n v = a.v - r.toQuad() * b.v;\n}\n\ninline void hkVector4f::setCross(hkVector4fParameter a, hkVector4fParameter b) {\n // \tz = a[0] * b[1] - b[0] * a[1]\n //\tx = a[1] * b[2] - b[1] * a[2]\n //\ty = a[2] * b[0] - b[2] * a[0]\n // ---- ---- ---- ----\n // 1 2 3 4\n\n // Shuffle a and b to get the column vectors 2 and 4\n const auto a_yzwx = __extension__ ({ float32x4_t __s0 = a.v; float32x4_t __s1 = a.v; float32x4_t __ret; __ret = (float32x4_t) __builtin_neon_vextq_v((int8x16_t)__s0, (int8x16_t)__s1, 1, 41); __ret; });\n const auto b_yzwx = __extension__ ({ float32x4_t __s0 = b.v; float32x4_t __s1 = b.v; float32x4_t __ret; __ret = (float32x4_t) __builtin_neon_vextq_v((int8x16_t)__s0, (int8x16_t)__s1, 1, 41); __ret; });\n const auto a_yz = vget_low_f32(a_yzwx);\n const auto b_yz = vget_low_f32(b_yzwx);\n const auto a_wx = vget_high_f32(a_yzwx);\n const auto b_wx = vget_high_f32(b_yzwx);\n const auto a_xw = vrev64_f32(a_wx);\n const auto b_xw = vrev64_f32(b_wx);\n const auto a_yzxw = vcombine_f32(a_yz, a_xw);\n const auto b_yzxw = vcombine_f32(b_yz, b_xw);\n const auto cross = (a.v * b_yzxw) - (a_yzxw * b.v);\n // Shuffle `cross` back to the correct order (zxyw -> xyzw)\n const auto cross_yzwx = __extension__ ({ float32x4_t __s0 = cross; float32x4_t __s1 = cross; float32x4_t __ret; __ret = (float32x4_t) __builtin_neon_vextq_v((int8x16_t)__s0, (int8x16_t)__s1, 1, 41); __ret; });\n const auto c_xy = vget_low_f32(cross);\n const auto c_yz = vget_low_f32(cross_yzwx);\n v = vcombine_f32(c_yz, c_xy);\n\n\n\n\n\n\n}\n\ninline void hkVector4f::setInterpolate(hkVector4fParameter v0, hkVector4fParameter v1,\n hkSimdFloat32Parameter t) {\n // v = v0 + t * (v1 - v0)\n hkVector4f diff;\n diff.setSub(v1, v0);\n setAddMul(v0, diff, t);\n}\n\ninline hkVector4fComparison hkVector4f::less(hkVector4fParameter a) const {\n return hkVector4fComparison::convert(v < a.v);\n}\n\ninline hkVector4fComparison hkVector4f::lessEqual(hkVector4fParameter a) const {\n return hkVector4fComparison::convert(v <= a.v);\n}\n\ninline hkVector4fComparison hkVector4f::greater(hkVector4fParameter a) const {\n return hkVector4fComparison::convert(v > a.v);\n}\n\ninline hkVector4fComparison hkVector4f::greaterEqual(hkVector4fParameter a) const {\n return hkVector4fComparison::convert(v >= a.v);\n}\n\ninline hkVector4fComparison hkVector4f::equal(hkVector4fParameter a) const {\n return hkVector4fComparison::convert(v == a.v);\n}\n\ninline hkVector4fComparison hkVector4f::notEqual(hkVector4fParameter a) const {\n return hkVector4fComparison::convert(v != a.v);\n}\n\ninline hkVector4fComparison hkVector4f::lessZero() const {\n return hkVector4fComparison::convert(v < m128());\n}\n\ninline hkVector4fComparison hkVector4f::lessEqualZero() const {\n return hkVector4fComparison::convert(v <= m128());\n}\n\ninline hkVector4fComparison hkVector4f::greaterZero() const {\n return hkVector4fComparison::convert(v > m128());\n}\n\ninline hkVector4fComparison hkVector4f::greaterEqualZero() const {\n return hkVector4fComparison::convert(v >= m128());\n}\n\ninline hkVector4fComparison hkVector4f::equalZero() const {\n return hkVector4fComparison::convert(v == m128());\n}\n\ninline hkVector4fComparison hkVector4f::notEqualZero() const {\n return hkVector4fComparison::convert(v != m128());\n}\n\ntemplate <int N>\ninline hkBool32 hkVector4f::allEqual(hkVector4fParameter rhs,\n hkSimdFloat32Parameter epsilon) const {\n static_assert(1 <= N && N <= 4, \"invalid N\");\n\n if constexpr (N == 1) {\n hkSimdFloat32 t = getX() - rhs.getX();\n t.setAbs(t);\n return t <= epsilon;\n\n } else {\n hkVector4f diff;\n diff.setSub(*this, rhs);\n diff.setAbs(diff);\n hkVector4f epsilon_v;\n epsilon_v.setAll(epsilon);\n\n constexpr auto mask = static_cast<hkVector4fComparison::Mask>([] {\n int mask = 0;\n for (int i = 0; i < N; ++i)\n mask |= 1 << i;\n return mask;\n }());\n return diff.lessEqual(epsilon_v).allAreSet<mask>();\n }\n}\n\ninline void hkVector4f::setAbs(hkVector4fParameter a) {\n\n v = vabsq_f32(a.v);\n\n\n\n\n}\n\ntemplate <int N>\ninline void hkVector4f::setNeg(hkVector4fParameter a) {\n static_assert(1 <= N && N <= 4, \"invalid N\");\n\n\n switch (N) {\n case 1: {\n auto xy = vget_low_f32(a.v);\n v = __extension__ ({ float32_t __s0 = __extension__ ({ float32x2_t __s0 = vneg_f32(xy); float32_t __ret; __ret = (float32_t) __builtin_neon_vget_lane_f32((int8x8_t)__s0, 0); __ret; }); float32x4_t __s1 = a.v; float32x4_t __ret; __ret = (float32x4_t) __builtin_neon_vsetq_lane_f32(__s0, (int8x16_t)__s1, 0); __ret; });\n break;\n }\n case 2: {\n auto xy = vget_low_f32(a.v);\n auto zw = vget_high_f32(a.v);\n v = vcombine_f32(vneg_f32(xy), zw);\n break;\n }\n case 3: {\n auto zw = vget_high_f32(a.v);\n v = vnegq_f32(a.v);\n v = __extension__ ({ float32_t __s0 = __extension__ ({ float32x2_t __s0 = zw; float32_t __ret; __ret = (float32_t) __builtin_neon_vget_lane_f32((int8x8_t)__s0, 1); __ret; }); float32x4_t __s1 = v; float32x4_t __ret; __ret = (float32x4_t) __builtin_neon_vsetq_lane_f32(__s0, (int8x16_t)__s1, 3); __ret; });\n break;\n }\n case 4:\n v = vnegq_f32(a.v);\n break;\n default:\n break;\n }\n\n\n\n\n}\n\ninline void hkVector4f::setFlipSign(hkVector4fParameter a, hkVector4fComparisonParameter mask) {\n static constexpr m128u signbits = {0x80000000, 0x80000000, 0x80000000, 0x80000000};\n v = m128u(a.v) ^ (mask.m_mask & signbits);\n}\n\ninline void hkVector4f::setFlipSign(hkVector4fParameter a, hkVector4fParameter signs) {\n static constexpr m128u signbits = {0x80000000, 0x80000000, 0x80000000, 0x80000000};\n v = m128u(a.v) ^ (m128u(signs.v) & signbits);\n}\n\ninline void hkVector4f::setFlipSign(hkVector4fParameter a, hkSimdFloat32Parameter sign) {\n setFlipSign(a, hkVector4fComparison::convert(sign.toQuad()));\n}\n\ninline hkVector4fComparison hkVector4f::signBitSet() const {\n static constexpr m128u signbits = {0x80000000, 0x80000000, 0x80000000, 0x80000000};\n return hkVector4fComparison::convert((m128u(v) & signbits) != m128u());\n}\n\ninline hkVector4fComparison hkVector4f::signBitClear() const {\n static constexpr m128u signbits = {0x80000000, 0x80000000, 0x80000000, 0x80000000};\n return hkVector4fComparison::convert((m128u(v) & signbits) == m128u());\n}\n\ninline void hkVector4f::_setRotatedDir(const hkMatrix3f& a, hkVector4fParameter b) {\n\n const auto c0 = a.m_col0.v;\n const auto c1 = a.m_col1.v;\n const auto c2 = a.m_col2.v;\n auto col0 = __extension__ ({ float32x4_t __s0 = c0; float32x4_t __s1 = b.v; float32x4_t __ret; __ret = __s0 * __builtin_shufflevector(__s1, __s1, 0, 0, 0, 0); __ret; });\n auto col1 = __extension__ ({ float32x4_t __s0 = c1; float32x4_t __s1 = b.v; float32x4_t __ret; __ret = __s0 * __builtin_shufflevector(__s1, __s1, 1, 1, 1, 1); __ret; });\n auto col2 = __extension__ ({ float32x4_t __s0 = c2; float32x4_t __s1 = b.v; float32x4_t __ret; __ret = __s0 * __builtin_shufflevector(__s1, __s1, 2, 2, 2, 2); __ret; });\n v = col0 + col1 + col2;\n\n\n\n\n\n}\n\ninline void hkVector4f::_setRotatedDir(hkQuaternionfParameter quat, hkVector4fParameter vec) {\n // Rodrigues' rotation formula\n\n const auto& u = quat.getImag();\n const hkSimdFloat32 s = quat.getRealPart();\n\n hkVector4f result;\n result.setMul(vec, s * s - hkSimdFloat32::getConstant<HK_QUADREAL_INV_2>());\n result.addMul(u, u.dot<3>(vec));\n\n hkVector4f cross;\n cross.setCross(u, vec);\n result.addMul(cross, s);\n\n setAdd(result, result);\n}\n\ninline void hkVector4f::_setRotatedInverseDir(hkQuaternionfParameter quat,\n
hkVector4fParameter vec) {\n const auto& u = quat.getImag();\n const hkSimdFloat32 s = quat.getRealPart();\n\n hkVector4f result;\n result.setMul(vec, s * s - hkSimdFloat32::getConstant<HK_QUADREAL_INV_2>());\n result.addMul(u, u.dot<3>(vec));\n\n hkVector4f cross;\n cross.setCross(vec, u);\n result.addMul(cross, s);\n\n setAdd(result, result);\n}\n\ninline void hkVector4f::_setTransformedPos(const hkTransformf& a, hkVector4fParameter b) {\n hkVector4f t;\n t._setRotatedDir(a.getRotation(), b);\n setAdd(t, a.getTranslation());\n}\n\n\ntemplate <int N>\ninline __attribute__((always_inline)) hkSimdFloat32 hkVector4f::dot(hkVector4fParameter a) const {\n if constexpr (N == 2) {\n float32x4_t x2 = v * a.v;\n float32x2_t low = vget_low_f32(x2);\n float32x2_t xy = vpadd_f32(low, low);\n return xy;\n } else if constexpr (N == 3 || N == 4) {\n float32x4_t x2 = v * a.v;\n float32x2_t low = vget_low_f32(x2);\n float32x2_t high = vget_high_f32(x2);\n if constexpr (N == 3)\n high = __extension__ ({ float32_t __s0 = 0; float32x2_t __s1 = high; float32x2_t __ret; __ret = (float32x2_t) __builtin_neon_vset_lane_f32(__s0, (int8x8_t)__s1, 1); __ret; });\n float32x2_t xy_zw = vpadd_f32(low, high);\n float32x2_t xyzw = vpadd_f32(xy_zw, xy_zw);\n return xyzw;\n } else {\n static_assert(2 <= N && N <= 4, \"invalid N\");\n }\n}\n# 479 \"/home/larsvi/botw/lib/hkStubs/./Havok/Common/Base/Math/Vector/hkVector4f.inl\"\ntemplate <int N>\ninline void hkVector4f::setDot(hkVector4fParameter a, hkVector4fParameter b) {\n setAll(a.dot<N>(b));\n}\n\ntemplate <int N>\ninline hkSimdFloat32 hkVector4f::length() const {\n return lengthSquared<N>().sqrt();\n}\n\ntemplate <int N>\ninline hkSimdFloat32 hkVector4f::lengthSquared() const {\n return dot<N>(*this);\n}\n\ntemplate <int N>\ninline hkSimdFloat32 hkVector4f::lengthInverse() const {\n const hkSimdFloat32 len = lengthSquared<N>();\n return len.sqrtInverse();\n}\n\ntemplate <int N>\ninline hkSimdFloat32 hkVector4f::lengthInverseUnsafe() const {\n const hkSimdFloat32 len = lengthSquared<N>();\n return len.sqrtInverseUnsafe();\n}\n\ntemplate <int N>\ninline void hkVector4f::normalize() {\n mul(lengthInverse<N>());\n}\n\ntemplate <int N>\ninline void hkVector4f::normalizeUnsafe() {\n mul(lengthInverseUnsafe<N>());\n}\n\ninline hkSimdFloat32 hkVector4f::dot4xyz1(hkVector4fParameter a) const {\n\n float32x4_t x2 = v * a.v;\n float32x2_t low = vget_low_f32(x2);\n float32x2_t high = vget_high_f32(x2);\n high = __extension__ ({ float32_t __s0 = __extension__ ({ float32x4_t __s0 = v; float32_t __ret; __ret = (float32_t) __builtin_neon_vgetq_lane_f32((int8x16_t)__s0, 3); __ret; }); float32x2_t __s1 = high; float32x2_t __ret; __ret = (float32x2_t) __builtin_neon_vset_lane_f32(__s0, (int8x8_t)__s1, 1); __ret; });\n float32x2_t xy_zw = vpadd_f32(low, high);\n float32x2_t xyzw = vpadd_f32(xy_zw, xy_zw);\n return xyzw;\n\n\n\n}\n\ninline void hkVector4f::setInt24W(int value) {\n reinterpret_cast<hkInt32*>(&v)[3] = hkInt32(value) | 0x3f000000;\n}\n\ninline int hkVector4f::getInt24W() const {\n return reinterpret_cast<const hkInt32*>(&v)[3] & ~0x3f000000;\n}\n\ntemplate <int Constant>\ninline const hkVector4f& hkVector4f::getConstant() {\n return reinterpret_cast<const hkVector4f&>(g_vectorfConstants[Constant]);\n}\n\ntemplate <int N>\ninline void hkVector4f::load(const hkFloat32* in) {\n static_assert(1 <= N && N <= 4, \"invalid N\");\n\n switch (N) {\n case 1:\n v = __extension__ ({ float32x4_t __ret; __ret = (float32x4_t) __builtin_neon_vld1q_dup_v(in, 41); __ret; });\n break;\n case 2: {\n auto xy = __extension__ ({ float32x2_t __ret; __ret = (float32x2_t) __builtin_neon_vld1_v(in, 9); __ret; });\n v = vcombine_f32(xy, xy);\n break;\n }\n case 3: {\n auto xy = __extension__ ({ float32x2_t __ret; __ret = (float32x2_t) __builtin_neon_vld1_v(in, 9); __ret; });\n auto zz = __extension__ ({ float32x2_t __ret; __ret = (float32x2_t) __builtin_neon_vld1_dup_v(in + 2, 9); __ret; });\n v = vcombine_f32(xy, zz);\n break;\n }\n case 4:\n v = __extension__ ({ float32x4_t __ret; __ret = (float32x4_t) __builtin_neon_vld1q_v(in, 41); __ret; });\n break;\n default:\n break;\n }\n\n\n\n\n}\n\ntemplate <int N>\ninline void hkVector4f::store(hkFloat32* out) const {\n static_assert(1 <= N && N <= 4, \"invalid N\");\n\n switch (N) {\n case 1:\n __extension__ ({ float32x4_t __s1 = v; __builtin_neon_vst1q_lane_v(out, (int8x16_t)__s1, 0, 41); });\n break;\n case 2:\n __extension__ ({ float32x2_t __s1 = vget_low_f32(v); __builtin_neon_vst1_v(out, (int8x8_t)__s1, 9); });\n break;\n case 3:\n __extension__ ({ float32x2_t __s1 = vget_low_f32(v); __builtin_neon_vst1_v(out, (int8x8_t)__s1, 9); });\n __extension__ ({ float32x4_t __s1 = v; __builtin_neon_vst1q_lane_v(out + 2, (int8x16_t)__s1, 2, 41); });\n break;\n case 4:\n __extension__ ({ float32x4_t __s1 = v; __builtin_neon_vst1q_v(out, (int8x16_t)__s1, 41); });\n break;\n default:\n break;\n }\n\n\n\n\n}\n# 42 \"/home/larsvi/botw/lib/hkStubs/./Havok/Common/Base/Math/hkMath.h\" 2\n# 1 \"/home/larsvi/botw/lib/hkStubs/./Havok/Common/Base/Math/Vector/hkVector4fComparison.inl\" 1\n\n\ninline void hkVector4fComparison::setAnd(hkVector4fComparisonParameter a,\n hkVector4fComparisonParameter b) {\n m_mask = a.m_mask & b.m_mask;\n}\n\ninline void hkVector4fComparison::setAndNot(hkVector4fComparisonParameter a,\n hkVector4fComparisonParameter b) {\n m_mask = a.m_mask & ~b.m_mask;\n}\n\ninline void hkVector4fComparison::setXor(hkVector4fComparisonParameter a,\n hkVector4fComparisonParameter b) {\n m_mask = a.m_mask ^ b.m_mask;\n}\n\ninline void hkVector4fComparison::setOr(hkVector4fComparisonParameter a,\n hkVector4fComparisonParameter b) {\n m_mask = a.m_mask | b.m_mask;\n}\n\ninline void hkVector4fComparison::setNot(hkVector4fComparisonParameter a) {\n m_mask = ~a.m_mask;\n}\n\ninline void hkVector4fComparison::setSelect(hkVector4fComparisonParameter comp,\n
hkVector4fComparisonParameter trueValue,\n hkVector4fComparisonParameter falseValue) {\n\n m_mask = vbslq_u32(comp.m_mask, trueValue.m_mask, falseValue.m_mask);\n\n\n\n}\n\ntemplate <hkVector4fComparison::Mask m>\ninline hkBool32 hkVector4fComparison::allAreSet() const {\n return ((m & MASK_X) == 0 || m_mask[0] != 0) && ((m & MASK_Y) == 0 || m_mask[1] != 0) &&\n ((m & MASK_Z) == 0 || m_mask[2] != 0) && ((m & MASK_W) == 0 || m_mask[3] != 0);\n}\n\ninline hkBool32 hkVector4fComparison::allAreSet(hkVector4fComparison::Mask m) const {\n return ((m & MASK_X) == 0 || m_mask[0] != 0) && ((m & MASK_Y) == 0 || m_mask[1] != 0) &&\n ((m & MASK_Z) == 0 || m_mask[2] != 0) && ((m & MASK_W) == 0 || m_mask[3] != 0);\n}\n\ntemplate <hkVector4fComparison::Mask m>\ninline hkBool32 hkVector4fComparison::anyIsSet() const {\n return ((m & MASK_X) != 0 && m_mask[0] != 0) || ((m & MASK_Y) != 0 && m_mask[1] != 0) ||\n ((m & MASK_Z) != 0 && m_mask[2] != 0) || ((m & MASK_W) != 0 && m_mask[3] != 0);\n}\n\ninline hkBool32 hkVector4fComparison::anyIsSet(Mask m) const {\n return ((m & MASK_X) != 0 && m_mask[0] != 0) || ((m & MASK_Y) != 0 && m_mask[1] != 0) ||\n ((m & MASK_Z) != 0 && m_mask[2] != 0) || ((m & MASK_W) != 0 && m_mask[3] != 0);\n}\n# 43 \"/home/larsvi/botw/lib/hkStubs/./Havok/Common/Base/Math/hkMath.h\" 2\n# 1 \"/home/larsvi/botw/lib/hkStubs/./Havok/Common/Base/Math/Quaternion/hkQuaternionf.inl\" 1\n\n\ninline hkQuaternionf::hkQuaternionf(hkFloat32 ix, hkFloat32 iy, hkFloat32 iz, hkFloat32 r) {\n set(ix, iy, iz, r);\n}\n\ninline void hkQuaternionf::set(hkFloat32 ix, hkFloat32 iy, hkFloat32 iz, hkFloat32 r) {\n m_vec.set(ix, iy, iz, r);\n}\n\ninline hkQuaternionf& hkQuaternionf::operator=(const hkQuaternionf& q) {\n m_vec = q.m_vec;\n return *this;\n}\n\ninline const hkFloat32& hkQuaternionf::operator()(int i) const {\n return m_vec(i);\n}\n\ntemplate <int I>\ninline hkSimdFloat32 hkQuaternionf::getComponent() const {\n return m_vec.getComponent<I>();\n}\n\ninline hkFloat32 hkQuaternionf::getReal() const {\n return m_vec(3);\n}\n\ninline hkSimdFloat32 hkQuaternionf::getRealPart() const {\n return m_vec.getW();\n}\n\ninline const hkVector4f& hkQuaternionf::getImag() const {\n return m_vec;\n}\n\ninline hkBool32 hkQuaternionf::hasValidAxis() const {\n return m_vec.lengthSquared<3>().isGreater(hkSimdFloat32::getConstant<HK_QUADREAL_EPS_SQRD>());\n}\n\nvoid hkQuaternionf::getAxis(hkVector4f& axis) const {\n hkVector4f result = getImag();\n result.normalize<3>();\n axis.setFlipSign(result, getRealPart().lessZero());\n}\n\ninline hkFloat32 hkQuaternionf::getAngle() const {\n return getAngleSr().val();\n}\n\ninline void hkQuaternionf::mul(hkQuaternionfParameter q) {\n setMul(*this, q);\n}\n\ninline void hkQuaternionf::setMul(hkQuaternionfParameter r, hkQuaternionfParameter q) {\n const auto rImag = r.getImag();\n const auto qImag = q.getImag();\n const auto rReal = r.getRealPart();\n const auto qReal = q.getRealPart();\n\n hkVector4f vec;\n vec.setCross(rImag, qImag);\n vec.addMul(rReal, qImag);\n vec.addMul(qReal, rImag);\n m_vec.setXYZ_W(vec, (rReal * qReal) - rImag.dot<3>(qImag));\n}\n\ninline void hkQuaternionf::setMulInverse(hkQuaternionfParameter r, hkQuaternionfParameter q) {\n const auto rImag = r.getImag();\n const auto qImag = q.getImag();\n\n hkVector4f vec;\n vec.setCross(qImag, rImag);\n vec.subMul(r.getRealPart(), qImag);\n vec.addMul(q.getRealPart(), rImag);\n m_vec.setXYZ_W(vec, rImag.dot<4>(qImag));\n}\n\ninline void hkQuaternionf::setInverseMul(hkQuaternionfParameter r, hkQuaternionfParameter q) {\n const auto rImag = r.getImag();\n const auto qImag = q.getImag();\n\n hkVector4f vec;\n vec.setCross(qImag, rImag);\n vec.addMul(r.getRealPart(), qImag);\n vec.subMul(q.getRealPart(), rImag);\n m_vec.setXYZ_W(vec, rImag.dot<4>(qImag));\n}\n\ninline void hkQuaternionf::setInverse(const hkQuaternionf& q) {\n m_vec.setNeg<3>(q.getImag());\n}\n\ninline void hkQuaternionf::normalize() {\n m_vec.normalizeUnsafe<4>();\n}\n\ninline const hkQuaternionf& hkQuaternionf::getIdentity() {\n return reinterpret_cast<const hkQuaternionf&>(g_vectorfConstants[HK_QUADREAL_0001]);\n}\n\ninline void hkQuaternionf::setIdentity() {\n m_vec = hkVector4f::getConstant<HK_QUADREAL_0001>();\n}\n# 44 \"/home/larsvi/botw/lib/hkStubs/./Havok/Common/Base/Math/hkMath.h\" 2\n# 1 \"/home/larsvi/botw/lib/hkStubs/./Havok/Common/Base/Math/Matrix/hkMatrix3f.inl\" 1\ninline hkMatrix3f::hkMatrix3f(const hkMatrix3f& other) {\n m_col0 = other.getColumn<0>();\n m_col1 = other.getColumn<1>();\n m_col2 = other.getColumn<2>();\n}\n\ninline hkMatrix3f& hkMatrix3f::operator=(const hkMatrix3f& other) {\n m_col0 = other.getColumn<0>();\n m_col1 = other.getColumn<1>();\n m_col2 = other.getColumn<2>();\n return *this;\n}\n\ninline hkFloat32& hkMatrix3f::operator()(int row, int col) {\n return getColumn(col)(row);\n}\n\ninline const hkFloat32& hkMatrix3f::operator()(int row, int col) const {\n return getColumn(col)(row);\n}\n\ntemplate <int Row, int Col>\ninline hkSimdFloat32 hkMatrix3f::get() const {\n return getColumn<Col>().template getComponent<Row>();\n}\n\ntemplate <int Row, int Col>\ninline void hkMatrix3f::set(hkSimdFloat32Parameter s) {\n getColumn<Col>().template setComponent<Row>(s);\n}\n\ninline hkVector4f& hkMatrix3f::getColumn(int i) {\n return (&m_col0)[i];\n}\n\ninline const hkVector4f& hkMatrix3f::getColumn(int i) const {\n return (&m_col0)[i];\n}\n\ntemplate <int I>\ninline const hkVector4f& hkMatrix3f::getColumn() const {\n return (&m_col0)[I];\n}\n\ninline void hkMatrix3f::getRows(hkVector4f& r0, hkVector4f& r1, hkVector4f& r2) const {\n hkVector4f c0;\n c0.set(m_col0(0), m_col1(0), m_col2(0));\n hkVector4f c1;\n c1.set(m_col0(1), m_col1(1), m_col2(1));\n hkVector4f c2;\n c2.set(m_col0(2), m_col1(2), m_col2(2));\n\n r0 = c0;\n r1 = c1;\n r2 = c2;\n}\n\ninline void hkMatrix3f::setZero() {\n m_col0.setZero();\n m_col1.setZero();\n m_col2.setZero();\n}\n\ninline void hkMatrix3f::setIdentity() {\n hkMatrix3f* __restrict d = this;\n d->m_col0 = hkVector4f::getConstant<HK_QUADREAL_1000>();\n d->m_col1 = hkVector4f::getConstant<HK_QUADREAL_0100>();\n d->m_col2 = hkVector4f::getConstant<HK_QUADREAL_0010>();\n}\n\ninline void hkMatrix3f::_setMul(const hkMatrix3f& a, const hkMatrix3f& b) {\n m_col0._setRotatedDir(a, b.getColumn<0>());\n m_col1._setRotatedDir(a, b.getColumn<1>());\n m_col2._setRotatedDir(a, b.getColumn<2>());\n}\n# 45 \"/home/larsvi/botw/lib/hkStubs/./Havok/Common/Base/Math/hkMath.h\" 2\n# 1 \"/home/larsvi/botw/lib/hkStubs/./Havok/Common/Base/Math/QsTransform/hkQsTransformf.inl\" 1\n\n\ninline hkQsTransformf::hkQsTransformf(IdentityInitializer) {\n setIdentity();\n}\n\ninline hkQsTransformf::hkQsTransformf(ZeroInitializer) {\n setZero();\n}\n\ninline hkQsTransformf::hkQsTransformf(hkVector4fParameter translation,\n hkQuaternionfParameter rotation, hkVector4fParameter scale)\n : m_translation(translation), m_rotation(rotation), m_scale(scale) {}\n\ninline hkQsTransformf::hkQsTransformf(hkVector4fParameter translation,\n hkQuaternionfParameter rotation)\n : m_translation(translation), m_rotation(rotation) {\n m_scale = hkVector4f::getConstant<HK_QUADREAL_1>();\n}\n\ninline hkQsTransformf::hkQsTransformf(const hkQsTransformf& other) {\n m_translation = other.m_translation;\n m_rotation = other.m_rotation;\n m_scale = other.m_scale;\n}\n\ninline const hkVector4f& hkQsTransformf::getTranslation() const {\n return m_translation;\n}\n\ninline const hkQuaternionf& hkQsTransformf::getRotation() const {\n return m_rotation;\n}\n\ninline const hkVector4f& hkQsTransformf::getScale() const {\n return m_scale;\n}\n\ninline void hkQsTransformf::setIdentity() {\n m_translation.setZero();\n m_rotation.setIdentity();\n m_scale = hkVector4f::getConstant<HK_QUADREAL_1>();\n}\n\ninline void hkQsTransformf::setZero() {\n m_translation.setZero();\n m_rotation.m_vec.setZero();\n m_scale.setZero();\n}\n\ninline void hkQsTransformf::set(hkVector4fParameter translation, hkQuaternionfParameter rotation,\n hkVector4fParameter scale) {\n m_translation = translation;\n m_rotation = rotation;\n m_scale = scale;\n}\n\ninline void hkQsTransformf::set(hkVector4fParameter translation, hkQuaternionfParameter rotation) {\n m_translation = translation;\n m_rotation = rotation;\n m_scale = hkVector4f::getConstant<HK_QUADREAL_1>();\n}\n\ninline void hkQsTransformf::setInverse(const hkQsTransformf& t) {\n m_translation.setRotatedInverseDir(t.m_rotation, t.m_translation);\n m_translation.setNeg<4>(m_translation);\n m_rotation.setInverse(t.m_rotation);\n\n m_scale.setReciprocal(t.m_scale);\n\n m_scale.zeroComponent<3>();\n}\n\ninline void hkQsTransformf::setMul(const hkQsTransformf& t1, const hkQsTransformf& t2) {\n hkVector4f extraTrans;\n extraTrans._setRotatedDir(t1.m_rotation, t2.m_translation);\n m_translation.setAdd(t1.m_translation, extraTrans);\n m_rotation.setMul(t1.m_rotation, t2.m_rotation);\n\n m_scale.setMul(t1.m_scale, t2.m_scale);\n}\n\ninline void hkQsTransformf::setMulInverseMul(const hkQsTransformf& t1, const hkQsTransformf& t2) {\n hkQsTransformf inv;\n inv.setInverse(t1);\n setMul(inv, t2);\n}\n\ninline void hkQsTransformf::setMulMulInverse(const hkQsTransformf& t1, const hkQsTransformf& t2) {\n hkQsTransformf inv;\n inv.setInverse(t2);\n setMul(t1, inv);\n}\n\ninline void hkQsTransformf::setMulEq(const hkQsTransformf& b) {\n setMul(*this, b);\n}\n\ninline void hkQsTransformf::fastRenormalize() {\n m_rotation.normalize();\n}\n# 46 \"/home/larsvi/botw/lib/hkStubs/./Havok/Common/Base/Math/hkMath.h\" 2\n\n// clang-format on\n\nnamespace hkMath {\n\ntemplate <typename T1, typename T2>\ninline __attribute__((always_inline)) T1 max2(T1 x, T2 y) {\n return x > static_cast<T1>(y) ? x : static_cast<T1>(y);\n}\n\ninline __attribute__((always_inline)) int hkToIntFast(hkFloat32 r) {\n return int(r);\n}\n\ninline __attribute__((always_inline)) hkBool32 intInRange(int value, int lowInclusive, int highExclusive) {\n return (lowInclusive <= value) & (value < highExclusive);\n}\n\n} // namespace hkMath\n# 15 \"/home/larsvi/botw/lib/hkStubs/./Havok/Common/Base/hkBase.h\" 2\n\n\n\n# 1 \"/home/larsvi/botw/lib/hkStubs/./Havok/Common/Base/Container/Array/hkArray.h\" 1\n\n\n# 1 \"/home/larsvi/botw/lib/hkStubs/./Havok/Common/Base/Container/Array/hkArrayUtil.h\" 1\n\n\n\n\n\nclass hkArrayUtil {\npublic:\n template <typename T>\n static inline __attribute__((always_inline)) void construct(T* t, int n);\n\n template <typename T>\n static inline __attribute__((always_inline)) void constructWithCopy(T* t, int n, const T& tcopy);\n\n template <typename T>\n static inline __attribute__((always_inline)) void constructWithArray(T* t, int n, const T* tcopy);\n\n template <typename T>\n static inline __attribute__((always_inline)) void destruct(T* t, int n);\n\n static hkResult _reserve(hkMemoryAllocator& a, void*, int reqElem, int sizeElem);\n static void _reserveMore(hkMemoryAllocator& a, void* array, int sizeElem);\n static void _reduce(hkMemoryAllocator& a, void* array, int sizeElem, char* inplaceMem,\n int requestedCapacity);\n};\n\ntemplate <typename T>\ninline void hkArrayUtil::construct(T* t, int n) {\n for (int i = 0; i < n; ++i) {\n ::new (static_cast<void*>(t + i)) T;\n }\n}\n\ntemplate <typename T>\ninline void hkArrayUtil::constructWithCopy(T* t, int n, const T& tcopy) {\n for (int i = 0; i < n; ++i) {\n ::new (static_cast<void*>(t + i)) T(tcopy);\n }\n}\n\ntemplate <typename T>\ninline void hkArrayUtil::constructWithArray(T* t, int n, const T* tcopy) {\n for (int i = 0; i < n; ++i) {\n ::new (static_cast<void*>(t + i)) T(tcopy[i]);\n }\n}\n\ntemplate <typename T>\ninline void hkArrayUtil::destruct(T* t, int n) {\n for (int i = n - 1; i >= 0; --i) {\n static_cast<T*>(t)[i].~T();\n }\n}\n# 4 \"/home/larsvi/botw/lib/hkStubs/./Havok/Common/Base/Container/Array/hkArray.h\" 2\n# 1 \"/home/larsvi/botw/lib/hkStubs/./Havok/Common/Base/Container/hkContainerAllocators.h\" 1\n\n\n\n\n\nstruct hkContainerHeapAllocator {\n inline __attribute__((always_inline)) void* operator new(hk_size_t nbytes) { if constexpr (std::is_base_of_v<hkReferencedObject, hkContainerHeapAllocator>) { return hkMemoryRouter::getInstance().heap().blockAlloc(static_cast<int>(nbytes)); } else { return hkMemoryRouter::getInstance().heap().blockAlloc(sizeof(hkContainerHeapAllocator)); } } inline __attribute__((always_inline)) void operator delete(void* p, hk_size_t nbytes) { if constexpr (std::is_base_of_v<hkReferencedObject, hkContainerHeapAllocator>) { auto* b = static_cast<hkReferencedObject*>(p); hkMemoryRouter::getInstance().heap().blockFree( p, (b->getMemorySizeAndFlags() == 0xffff) ? static_cast<int>(nbytes) : b->getMemorySizeAndFlags()); } else { if (p) hkMemoryRouter::getInstance().heap().blockFree(p, sizeof(hkContainerHeapAllocator)); } } inline __attribute__((always_inline)) void* operator new(hk_size_t, void* p) { return p; } inline __attribute__((always_inline)) void* operator new[](hk_size_t, void* p) { return p; } inline __attribute__((always_inline)) void operator delete(void*, void*) {} inline __attribute__((always_inline)) void operator delete[](void*, void*) {}\n\n struct Allocator : hkMemoryAllocator {\n inline __attribute__((always_inline)) void* operator new(hk_size_t nbytes) { if constexpr (std::is_base_of_v<hkReferencedObject, Allocator>) { return hkMemoryRouter::getInstance().heap().blockAlloc(static_cast<int>(nbytes)); } else { return hkMemoryRouter::getInstance().heap().blockAlloc(sizeof(Allocator)); } } inline __attribute__((always_inline)) void operator delete(void* p, hk_size_t nbytes) { if constexpr (std::is_base_of_v<hkReferencedObject, Allocator>) { auto* b = static_cast<hkReferencedObject*>(p); hkMemoryRouter::getInstance().heap().blockFree( p, (b->getMemorySizeAndFlags() == 0xffff) ? static_cast<int>(nbytes) : b->getMemorySizeAndFlags()); } else { if (p) hkMemoryRouter::getInstance().heap().blockFree(p, sizeof(Allocator)); } } inline __attribute__((always_inline)) void* operator new(hk_size_t, void* p) { return p; } inline __attribute__((always_inline)) void* operator new[](hk_size_t, void* p) { return p; } inline __attribute__((always_inline)) void operator delete(void*, void*) {} inline __attribute__((always_inline)) void operator delete[](void*, void*) {}\n\n void* blockAlloc(int numBytes) override;\n void blockFree(void* p, int numBytes) override;\n void* bufAlloc(int& reqNumBytesInOut) override;\n void bufFree(void* p, int numBytes) override;\n void* bufRealloc(void* pold, int oldNumBytes, int& reqNumBytesInOut) override;\n void getMemoryStatistics(MemoryStatistics& u) const override;\n int getAllocatedSize(const void* obj, int nbytes) const override;\n };\n\n static Allocator s_alloc;\n static hkMemoryAllocator& get() { return s_alloc; }\n};\n# 5 \"/home/larsvi/botw/lib/hkStubs/./Havok/Common/Base/Container/Array/hkArray.h\" 2\n# 1 \"/home/larsvi/botw/lib/hkStubs/./Havok/Common/Base/Memory/Util/hkMemUtil.h\" 1\n\n\n\n\nnamespace hkMemUtil {\n\ntemplate <unsigned int NBYTES>\nstruct TypeFromAlign;\n\ntemplate <>\nstruct TypeFromAlign<1> {\n using type = char;\n};\n\ntemplate <>\nstruct TypeFromAlign<2> {\n using type = hkInt16;\n};\n\ntemplate <>\nstruct TypeFromAlign<4> {\n using type = hkInt32;\n};\n\ntemplate <>\nstruct TypeFromAlign<8> {\n using type = hkInt64;\n};\n\ntemplate <unsigned int NBYTES>\nstruct TypeFromAlign : public TypeFromAlign<NBYTES / 2> {};\n\ntemplate <unsigned int ELEMENTSIZE, unsigned int ELEMENTALIGN>\ninline __attribute__((always_inline)) void memCpyOneAligned(void* dst, const void* src);\n\ntemplate <unsigned int ELEMENTALIGN>\ninline __attribute__((always_inline)) void memCpy(void* dst, const void* src, int nbytes);\n\nvoid memCpy(void* dst, const void* src, int nbytes);\nvoid memCpyBackwards(void* dst, const void* src, int nbytes);\nvoid memMove(void* dst, const void* src, int nbytes);\nvoid memSet(void* dst, int c, int n);\n\ntemplate <unsigned int ELEMENTSIZE, unsigned int ELEMENTALIGN>\ninline void memCpyOneAligned(void* dst, const void* src) {\n using CopyType = typename TypeFromAlign<ELEMENTALIGN>::type;\n unsigned int i = 0;\n do {\n static_cast<CopyType*>(dst)[i] = static_cast<const CopyType*>(src)[i];\n } while (++i < ELEMENTSIZE / sizeof(CopyType));\n}\n\ntemplate <unsigned int ELEMENTALIGN>\ninline void memCpy(void* dst, const void* src, int nbytes) {\n using CopyType = typename TypeFromAlign<ELEMENTALIGN>::type;\n for (int i = 0, j = 0; i < nbytes; i += sizeof(CopyType), ++j) {\n static_cast<CopyType*>(dst)[j] = static_cast<const CopyType*>(src)[j];\n }\n}\n\n} // namespace hkMemUtil\n# 6 \"/home/larsvi/botw/lib/hkStubs/./Havok/Common/Base/Container/Array/hkArray.h\" 2\n\n\n\n\n/// Base class for hkArray (a std::vector-like container).\ntemplate <typename T>\nclass hkArrayBase {\npublic:\n inline __attribute__((always_inline)) void* operator new(hk_size_t nbytes) { if constexpr (std::is_base_of_v<hkReferencedObject, hkArrayBase<T> >) { return hkMemoryRouter::getInstance().heap().blockAlloc(static_cast<int>(nbytes)); } else { return hkMemoryRouter::getInstance().heap().blockAlloc(sizeof(hkArrayBase<T>)); } } inline __attribute__((always_inline)) void operator delete(void* p, hk_size_t nbytes) { if constexpr (std::is_base_of_v<hkReferencedObject, hkArrayBase<T> >) { auto* b = static_cast<hkReferencedObject*>(p); hkMemoryRouter::getInstance().heap().blockFree( p, (b->getMemorySizeAndFlags() == 0xffff) ? static_cast<int>(nbytes) : b->getMemorySizeAndFlags()); } else { if (p) hkMemoryRouter::getInstance().heap().blockFree(p, sizeof(hkArrayBase<T>)); } } inline __attribute__((always_inline)) void* operator new(hk_size_t, void* p) { return p; } inline __attribute__((always_inline)) void* operator new[](hk_size_t, void* p) { return p; } inline __attribute__((always_inline)) void operator delete(void*, void*) {} inline __attribute__((always_inline)) void operator delete[](void*, void*) {}\n\n enum : unsigned int {\n CAPACITY_MASK = 0x3FFFFFFF,\n FLAG_MASK = 0xC0000000,\n DONT_DEALLOCATE_FLAG = 0x80000000,\n };\n\n inline __attribute__((always_inline)) hkArrayBase();\n // NOLINTNEXTLINE(cppcoreguidelines-pro-type-member-init)\n explicit hkArrayBase(hkFinishLoadedObjectFlag f) {}\n inline __attribute__((always_inline)) hkArrayBase(T* buffer, int size, int capacity);\n\n inline __attribute__((always_inline)) ~hkArrayBase();\n\n hkArrayBase(const hkArrayBase&) = delete;\n auto operator=(const hkArrayBase&) = delete;\n\n inline __attribute__((always_inline)) int getSize() const;\n inline __attribute__((always_inline)) int size() const;\n inline __attribute__((always_inline)) int getCapacity() const;\n inline __attribute__((always_inline)) int getCapacityAndFlags() const;\n inline __attribute__((always_inline)) hkBool isEmpty() const;\n\n inline __attribute__((always_inline)) T* data() { return m_data; }\n inline __attribute__((always_inline)) const T* data() const { return m_data; }\n\n inline __attribute__((always_inline)) T& operator[](int i);\n inline __attribute__((always_inline)) const T& operator[](int i) const;\n\n inline __attribute__((always_inline)) T& back();\n inline __attribute__((always_inline)) const T& back() const;\n\n inline __attribute__((always_inline)) void clear();\n inline __attribute__((always_inline)) void _clearAndDeallocate(hkMemoryAllocator& allocator);\n inline __attribute__((always_inline)) void removeAt(int index);\n inline __attribute__((always_inline)) void removeAtAndCopy(int index);\n inline __attribute__((always_inline)) void removeAtAndCopy(int index, int numToRemove);\n\n inline __attribute__((always_inline)) int indexOf(const T& t, int start = 0, int end = -1) const;\n inline __attribute__((always_inline)) int lastIndexOf(const T& t) const;\n\n inline __attribute__((always_inline)) void popBack(int numElemsToRemove = 1);\n inline __attribute__((always_inline)) void _pushBack(hkMemoryAllocator& alloc, const T& e);\n inline __attribute__((always_inline)) void pushBackUnchecked(const T& e);\n inline __attribute__((always_inline)) hkBool tryPushBack(const T& t);\n\n inline __attribute__((always_inline)) hkResult _reserve(hkMemoryAllocator& alloc, int n);\n inline __attribute__((always_inline)) hkResult _reserveExactly(hkMemoryAllocator& alloc, int n);\n\n inline __attribute__((always_inline)) void _setSize(hkMemoryAllocator& alloc, int size);\n inline __attribute__((always_inline)) void _setSize(hkMemoryAllocator& alloc, int n, const T& fill);\n inline __attribute__((always_inline)) hkResult _trySetSize(hkMemoryAllocator& alloc, int size);\n inline __attribute__((always_inline)) void setSizeUnchecked(int size);\n\n inline __attribute__((always_inline)) T& _expandOne(hkMemoryAllocator& alloc);\n inline __attribute__((always_inline)) T* _expandBy(hkMemoryAllocator& alloc, int n);\n inline __attribute__((always_inline)) T* expandByUnchecked(int n);\n inline __attribute__((always_inline)) T* _expandAt(hkMemoryAllocator& alloc, int index, int numToInsert);\n\n void _insertAt(hkMemoryAllocator& alloc, int i, const T* a, int numElems);\n void _insertAt(hkMemoryAllocator& alloc, int i, const T& t);\n\n void _append(hkMemoryAllocator& alloc, const T* a, int numElems);\n void _spliceInto(hkMemoryAllocator& alloc, int i, int ndel, const T* p, int numElems);\n\n inline __attribute__((always_inline)) void removeAllAndCopy(const T& t);\n\n using iterator = T*;\n using const_iterator = const T*;\n\n inline __attribute__((always_inline)) iterator begin();\n inline __attribute__((always_inline)) iterator end();\n inline __attribute__((always_inline)) const_iterator begin() const;\n inline __attribute__((always_inline)) const_iterator end() const;\n\n static inline __attribute__((always_inline)) void copy(T* dst, const T* src, int n);\n\n inline __attribute__((always_inline)) void setDataAutoFree(T* ptr, int size, int capacity);\n inline __attribute__((always_inline)) void setDataUserFree(T* ptr, int size, int capacity);\n inline __attribute__((always_inline)) void _setDataUnchecked(T* ptr, int size, int capacityAndFlags);\n inline __attribute__((always_inline)) void _optimizeCapacity(hkMemoryAllocator& alloc, int numFreeElemsLeft,\n hkBool32 shrinkExact = false);\n\nprotected:\n inline __attribute__((always_inline)) hkArrayBase<T>& copyFromArray(hkMemoryAllocator& allocator,\n const hkArrayBase<T>& src);\n\n T* m_data;\n int m_size;\n int m_capacityAndFlags;\n};\n\n/// A dynamically resizable array, similar to std::vector.\n// FIXME: incomplete\ntemplate <typename T, typename Allocator = hkContainerHeapAllocator>\nclass hkArray : public hkArrayBase<T> {\npublic:\n using AllocatorType = Allocator;\n\n inline __attribute__((always_inline)) hkArray() = default;\n inline __attribute__((always_inline)) hkArray(T* buffer, int size, int capacity)\n : hkArrayBase<T>(buffer, size, capacity) {}\n explicit hkArray(hkFinishLoadedObjectFlag f) : hkArrayBase<T>(f) {}\n\n inline __attribute__((always_inline)) ~hkArray() { clearAndDeallocate(); }\n\n inline __attribute__((always_inline)) hkArray& operator=(const hkArrayBase<T>& other);\n inline __attribute__((always_inline)) hkArray& operator=(const hkArray& other);\n\n inline __attribute__((always_inline)) void clearAndDeallocate();\n inline __attribute__((always_inline)) void pushBack(const T& e);\n inline __attribute__((always_inline)) hkResult reserve(int size);\n inline __attribute__((always_inline)) hkResult reserveExactly(int size);\n inline __attribute__((always_inline)) void setSize(int size);\n inline __attribute__((always_inline)) void setSize(int size, const T& fill);\n\nprotected:\n inline __attribute__((always_inline)) hkArray(const hkArray& other);\n};\n\ntemplate <typename T, unsigned N, typename Allocator = hkContainerHeapAllocator>\nclass hkInplaceArray : public hkArray<T, Allocator> {\npublic:\n inline __attribute__((always_inline)) void* operator new(hk_size_t nbytes) { if constexpr (std::is_base_of_v<hkReferencedObject, hkInplaceArray>) { return hkMemoryRouter::getInstance().heap().blockAlloc(static_cast<int>(nbytes)); } else { return hkMemoryRouter::getInstance().heap().blockAlloc(sizeof(hkInplaceArray)); } } inline __attribute__((always_inline)) void operator delete(void* p, hk_size_t nbytes) { if constexpr (std::is_base_of_v<hkReferencedObject, hkInplaceArray>) { auto* b = static_cast<hkReferencedObject*>(p); hkMemoryRouter::getInstance().heap().blockFree( p, (b->getMemorySizeAndFlags() == 0xffff) ? static_cast<int>(nbytes) : b->getMemorySizeAndFlags()); } else { if (p) hkMemoryRouter::getInstance().heap().blockFree(p, sizeof(hkInplaceArray)); } } inline __attribute__((always_inline)) void* operator new(hk_size_t, void* p) { return p; } inline __attribute__((always_inline)) void* operator new[](hk_size_t, void* p) { return p; } inline __attribute__((always_inline)) void operator delete(void*, void*) {} inline __attribute__((always_inline)) void operator delete[](void*, void*) {}\n\n inline __attribute__((always_inline)) explicit hkInplaceArray(int size = 0);\n inline __attribute__((always_inline)) hkInplaceArray(const hkInplaceArray& other);\n explicit hkInplaceArray(hkFinishLoadedObjectFlag f) : hkArray<T, Allocator>(f) {}\n inline __attribute__((always_inline)) ~hkInplaceArray() = default;\n\n using hkArray<T, Allocator>::operator=;\n\n inline __attribute__((always_inline)) void optimizeCapacity(int numFreeElemsLeft, hkBool32 shrinkExact = false);\n\n inline __attribute__((always_inline)) hkBool wasReallocated() const;\n\n inline __attribute__((always_inline)) int stillInplaceUsingMask() const;\n\n T m_storage[N];\n};\n\ntemplate <typename T>\ninline hkArrayBase<T>::hkArrayBase()\n : m_data(nullptr), m_size(0), m_capacityAndFlags(DONT_DEALLOCATE_FLAG) {}\n\ntemplate <typename T>\ninline hkArrayBase<T>::hkArrayBase(T* buffer, int size, int capacity)\n : m_data(buffer), m_size(size), m_capacityAndFlags(capacity | DONT_DEALLOCATE_FLAG) {}\n\ntemplate <typename T>\ninline hkArrayBase<T>::~hkArrayBase() = default;\n\ntemplate <typename T>\ninline int hkArrayBase<T>::getSize() const {\n return m_size;\n}\n\ntemplate <typename T>\ninline int hkArrayBase<T>::size() const {\n return getSize();\n}\n\ntemplate <typename T>\ninline int hkArrayBase<T>::getCapacity() const {\n return m_capacityAndFlags & static_cast<int>(CAPACITY_MASK);\n}\n\ntemplate <typename T>\ninline int hkArrayBase<T>::getCapacityAndFlags() const {\n return m_capacityAndFlags;\n}\n\ntemplate <typename T>\ninline hkBool hkArrayBase<T>::isEmpty() const {\n return m_size == 0;\n}\n\ntemplate <typename T>\ninline T& hkArrayBase<T>::operator[](int i) {\n return m_data[i];\n}\n\ntemplate <typename T>\ninline const T& hkArrayBase<T>::operator[](int i) const {\n return m_data[i];\n}\n\ntemplate <typename T>\ninline T& hkArrayBase<T>::back() {\n return m_data[m_size - 1];\n}\n\ntemplate <typename T>\ninline const T& hkArrayBase<T>::back() const {\n return m_data[m_size - 1];\n}\n\ntemplate <typename T>\ninline void hkArrayBase<T>::clear() {\n hkArrayUtil::destruct(m_data, m_size);\n m_size = 0;\n}\n\ntemplate <typename T>\ninline void hkArrayBase<T>::_clearAndDeallocate(hkMemoryAllocator& allocator) {\n clear();\n if ((m_capacityAndFlags & DONT_DEALLOCATE_FLAG) == 0) {\n const int SIZE_ELEM = hkSizeOfTypeOrVoid<T>::val;\n int numBytes = getCapacity() * SIZE_ELEM;\n void* storage = const_cast<std::remove_const_t<T>*>(m_data);\n allocator.bufFree(storage, numBytes);\n }\n m_data = nullptr;\n m_capacityAndFlags = DONT_DEALLOCATE_FLAG;\n}\n\ntemplate <typename T>\ninline void hkArrayBase<T>::removeAt(int index) {\n hkArrayUtil::destruct(&m_data[index], 1);\n m_size--;\n if (m_size != index)\n hkMemUtil::memCpyOneAligned<sizeof(T), alignof(T)>(m_data + index, m_data + m_size);\n}\n\ntemplate <typename T>\ninline void hkArrayBase<T>::removeAtAndCopy(int index) {\n removeAtAndCopy(index, 1);\n}\n\ntemplate <typename T>\ninline void hkArrayBase<T>::removeAtAndCopy(int index, int numToRemove) {\n hkArrayUtil::destruct(m_data + index, numToRemove);\n m_size -= numToRemove;\n hkMemUtil::memCpy<alignof(T)>(m_data + index, m_data + index + numToRemove,\n (m_size - index) * sizeof(T));\n}\n\ntemplate <typename T>\ninline int hkArrayBase<T>::indexOf(const T& t, int start, int end) const {\n if (end < 0)\n end = m_size;\n\n for (int i = start; i < end; ++i) {\n if (m_data[i] == t)\n return i;\n }\n return -1;\n}\n\ntemplate <typename T>\ninline void hkArrayBase<T>::popBack(int numElemsToRemove) {\n hkArrayUtil::destruct(m_data + m_size - numElemsToRemove, numElemsToRemove);\n m_size -= numElemsToRemove;\n}\n\ntemplate <typename T>\ninline void hkArrayBase<T>::_pushBack(hkMemoryAllocator& alloc, const T& e) {\n if (m_size == getCapacity()) {\n hkArrayUtil::_reserveMore(alloc, this, sizeof(T));\n }\n pushBackUnchecked(e);\n}\n\ntemplate <typename T>\ninline void hkArrayBase<T>::pushBackUnchecked(const T& e) {\n hkArrayUtil::constructWithCopy<T>(m_data + m_size, 1, e);\n m_size++;\n}\n\ntemplate <typename T>\ninline hkBool hkArrayBase<T>::tryPushBack(const T& t) {\n if (m_size < getCapacity()) {\n hkArrayUtil::constructWithCopy(m_data + m_size, 1, t);\n m_size++;\n return true;\n }\n return false;\n}\n\ntemplate <typename T>\ninline hkResult hkArrayBase<T>::_reserve(hkMemoryAllocator& alloc, int n) {\n const int capacity = getCapacity();\n if (capacity < n) {\n int newCapacity = 2 * capacity;\n int newSize = n < newCapacity ? newCapacity : n;\n return hkArrayUtil::_reserve(alloc, this, newSize, sizeof(T));\n }\n return HK_SUCCESS;\n}\n\ntemplate <typename T>\ninline hkResult hkArrayBase<T>::_reserveExactly(hkMemoryAllocator& alloc, int n) {\n if (getCapacity() < n)\n return hkArrayUtil::_reserve(alloc, this, n, sizeof(T));\n return HK_SUCCESS;\n}\n\ntemplate <typename T>\ninline void hkArrayBase<T>::_setSize(hkMemoryAllocator& alloc, int n) {\n _reserve(alloc, n);\n hkArrayUtil::destruct(m_data + n, m_size - n);\n hkArrayUtil::construct(m_data + m_size, n - m_size);\n m_size = n;\n}\n\ntemplate <typename T>\ninline void hkArrayBase<T>::_setSize(hkMemoryAllocator& alloc, int n, const T& fill) {\n _reserve(alloc, n);\n hkArrayUtil::destruct(m_data + n, m_size - n);\n hkArrayUtil::constructWithCopy(m_data + m_size, n - m_size, fill);\n m_size = n;\n}\n\ntemplate <typename T>\ninline typename hkArrayBase<T>::iterator hkArrayBase<T>::begin() {\n return m_data;\n}\n\ntemplate <typename T>\ninline typename hkArrayBase<T>::iterator hkArrayBase<T>::end() {\n return m_data + m_size;\n}\n\ntemplate <typename T>\ninline typename hkArrayBase<T>::const_iterator hkArrayBase<T>::begin() const {\n return m_data;\n}\n\ntemplate <typename T>\ninline typename hkArrayBase<T>::const_iterator hkArrayBase<T>::end() const {\n return m_data + m_size;\n}\n\ntemplate <typename T>\ninline void hkArrayBase<T>::copy(T* dst, const T* src, int n) {\n for (int i = 0; i < n; ++i) {\n dst[i] = src[i];\n }\n}\n\ntemplate <typename T>\ninline void hkArrayBase<T>::_setDataUnchecked(T* ptr, int size, int capacityAndFlags) {\n m_data = ptr;\n m_size = size;\n m_capacityAndFlags = capacityAndFlags;\n}\n\ntemplate <typename T>\ninline void hkArrayBase<T>::setDataAutoFree(T* ptr, int size, int capacity) {\n static_assert(std::is_pod_v<T>, \"T must be a POD type\");\n _setDataUnchecked(ptr, size, capacity);\n}\n\ntemplate <typename T>\ninline void hkArrayBase<T>::setDataUserFree(T* ptr, int size, int capacity) {\n static_assert(std::is_pod_v<T>, \"T must be a POD type\");\n _setDataUnchecked(ptr, size, capacity | DONT_DEALLOCATE_FLAG);\n}\n\ntemplate <typename T>\ninline hkArrayBase<T>& hkArrayBase<T>::copyFromArray(hkMemoryAllocator& allocator,\n const hkArrayBase<T>& src) {\n if constexpr (std::is_pod_v<T>) {\n if (getCapacity() < src.getSize()) {\n if ((m_capacityAndFlags & DONT_DEALLOCATE_FLAG) == 0) {\n allocator._bufFree<T>(m_data, getCapacity());\n }\n
int n = src.getSize();\n m_data = allocator._bufAlloc<T>(n);\n m_capacityAndFlags = n;\n }\n m_size = src.getSize();\n copy(m_data, src.m_data, m_size);\n\n } else {\n const int oldSize = m_size;\n const int newSize = src.getSize();\n const int copiedSize = newSize > oldSize ? oldSize : newSize;\n\n _reserve(allocator, newSize);\n hkArrayUtil::destruct(m_data + newSize, oldSize - newSize);\n copy(m_data, src.m_data, copiedSize);\n hkArrayUtil::constructWithArray(m_data + copiedSize, newSize - copiedSize,\n
src.m_data + copiedSize);\n m_size = newSize;\n }\n return *this;\n}\n\ntemplate <typename T, typename Allocator>\ninline hkArray<T, Allocator>& hkArray<T, Allocator>::operator=(const hkArrayBase<T>& a) {\n this->copyFromArray(Allocator().get(), a);\n return *this;\n}\n\ntemplate <typename T, typename Allocator>\ninline hkArray<T, Allocator>& hkArray<T, Allocator>::operator=(const hkArray& a) {\n this->copyFromArray(Allocator().get(), a);\n return *this;\n}\n\ntemplate <typename T, typename Allocator>\ninline void hkArray<T, Allocator>::clearAndDeallocate() {\n this->_clearAndDeallocate(AllocatorType().get());\n}\n\ntemplate <typename T, typename Allocator>\ninline void hkArray<T, Allocator>::pushBack(const T& e) {\n this->_pushBack(AllocatorType().get(), e);\n}\n\ntemplate <typename T, typename Allocator>\ninline void hkArray<T, Allocator>::setSize(int size) {\n this->_setSize(AllocatorType().get(), size);\n}\n\ntemplate <typename T, typename Allocator>\ninline void hkArray<T, Allocator>::setSize(int size, const T& fill) {\n this->_setSize(AllocatorType().get(), size, fill);\n}\n\ntemplate <typename T, typename Allocator>\ninline hkResult hkArray<T, Allocator>::reserve(int size) {\n return this->_reserve(AllocatorType().get(), size);\n}\n\ntemplate <typename T, typename Allocator>\ninline hkResult hkArray<T, Allocator>::reserveExactly(int size) {\n return this->_reserveExactly(AllocatorType().get(), size);\n}\n\ntemplate <typename T, unsigned N, typename Allocator>\ninline hkInplaceArray<T, N, Allocator>::hkInplaceArray(int size)\n : hkArray<T, Allocator>(m_storage, size, N) {}\n\ntemplate <typename T, unsigned N, typename Allocator>\ninline hkInplaceArray<T, N, Allocator>::hkInplaceArray(const hkInplaceArray& other)\n : hkArray<T, Allocator>(m_storage, 0, N) {\n *this = other;\n}\n\ntemplate <typename T, unsigned N, typename Allocator>\ninline hkBool hkInplaceArray<T, N, Allocator>::wasReallocated() const {\n return this->m_data != m_storage;\n}\n\ntemplate <typename T, unsigned N, typename Allocator>\ninline int hkInplaceArray<T, N, Allocator>::stillInplaceUsingMask() const {\n return hkArray<T, Allocator>::m_capacityAndFlags & hkArrayBase<T>::DONT_DEALLOCATE_FLAG;\n}\n# 19 \"/home/larsvi/botw/lib/hkStubs/./Havok/Common/Base/hkBase.h\" 2\n# 1 \"/home/larsvi/botw/lib/hkStubs/./Havok/Common/Base/Container/Array/hkSmallArray.h\" 1\n\n\n\n\n\n\ntemplate <typename T>\nclass hkSmallArray {\npublic:\n inline __attribute__((always_inline)) void* operator new(hk_size_t nbytes) { if constexpr (std::is_base_of_v<hkReferencedObject, hkSmallArray>) { return hkMemoryRouter::getInstance().heap().blockAlloc(static_cast<int>(nbytes)); } else { return hkMemoryRouter::getInstance().heap().blockAlloc(sizeof(hkSmallArray)); } } inline __attribute__((always_inline)) void operator delete(void* p, hk_size_t nbytes) { if constexpr (std::is_base_of_v<hkReferencedObject, hkSmallArray>) { auto* b = static_cast<hkReferencedObject*>(p); hkMemoryRouter::getInstance().heap().blockFree( p, (b->getMemorySizeAndFlags() == 0xffff) ? static_cast<int>(nbytes) : b->getMemorySizeAndFlags()); } else { if (p) hkMemoryRouter::getInstance().heap().blockFree(p, sizeof(hkSmallArray)); } } inline __attribute__((always_inline)) void* operator new(hk_size_t, void* p) { return p; } inline __attribute__((always_inline)) void* operator new[](hk_size_t, void* p) { return p; } inline __attribute__((always_inline)) void operator delete(void*, void*) {} inline __attribute__((always_inline)) void operator delete[](void*, void*) {}\n\n enum : int {\n CAPACITY_MASK = hkUint16(0x3fff),\n FLAG_MASK = hkUint16(0xC000),\n DONT_DEALLOCATE_FLAG = hkUint16(0x8000),\n LOCKED_FLAG = hkUint16(0x4000),\n };\n\n inline __attribute__((always_inline)) hkSmallArray();\n // NOLINTNEXTLINE(cppcoreguidelines-pro-type-member-init)\n explicit hkSmallArray(hkFinishLoadedObjectFlag f) {}\n\n hkSmallArray(const hkSmallArray&) = delete;\n auto operator=(const hkSmallArray&) = delete;\n\n inline __attribute__((always_inline)) ~hkSmallArray();\n\n inline __attribute__((always_inline)) int getSize() const;\n inline __attribute__((always_inline)) int getCapacity() const;\n\n inline __attribute__((always_inline)) T& operator[](int i);\n inline __attribute__((always_inline)) const T& operator[](int i) const;\n\nprotected:\n void releaseMemory();\n\n T* m_data;\n hkUint16 m_size;\n hkUint16 m_capacityAndFlags;\n};\n\ntemplate <typename T>\ninline hkSmallArray<T>::hkSmallArray()\n : m_data(nullptr), m_size(0), m_capacityAndFlags(DONT_DEALLOCATE_FLAG) {}\n\ntemplate <typename T>\ninline hkSmallArray<T>::~hkSmallArray() {\n releaseMemory();\n}\n\ntemplate <typename T>\ninline int hkSmallArray<T>::getSize() const {\n return m_size;\n}\n\ntemplate <typename T>\ninline int hkSmallArray<T>::getCapacity() const {\n return m_capacityAndFlags & CAPACITY_MASK;\n}\n\ntemplate <typename T>\ninline T& hkSmallArray<T>::operator[](int i) {\n return m_data[i];\n}\n\ntemplate <typename T>\ninline const T& hkSmallArray<T>::operator[](int i) const {\n return m_data[i];\n}\n\ntemplate <typename T>\ninline void hkSmallArray<T>::releaseMemory() {\n if ((m_capacityAndFlags & DONT_DEALLOCATE_FLAG) == 0)\n hkDeallocateChunk(m_data, getCapacity());\n}\n# 20 \"/home/larsvi/botw/lib/hkStubs/./Havok/Common/Base/hkBase.h\" 2\n# 1 \"/home/larsvi/botw/lib/hkStubs/./Havok/Common/Base/Container/String/hkStringPtr.h\" 1\n\n\n# 1 \"/home/larsvi/botw/lib/hkStubs/./Havok/Common/Base/Container/String/hkString.h\" 1\n\n\n\n\n\nnamespace hkString {\n\nint strCmp(const char* s1, const char* s2);\nhkBool beginsWith(const char* str, const char* prefix);\nhkBool endsWith(const char* str, const char* suffix);\n\n} // namespace hkString\n# 4 \"/home/larsvi/botw/lib/hkStubs/./Havok/Common/Base/Container/String/hkStringPtr.h\" 2\n\n\nclass hkStringPtr {\npublic:\n inline __attribute__((always_inline)) void* operator new(hk_size_t nbytes) { if constexpr (std::is_base_of_v<hkReferencedObject, hkStringPtr>) { return hkMemoryRouter::getInstance().heap().blockAlloc(static_cast<int>(nbytes)); } else { return hkMemoryRouter::getInstance().heap().blockAlloc(sizeof(hkStringPtr)); } } inline __attribute__((always_inline)) void operator delete(void* p, hk_size_t nbytes) { if constexpr (std::is_base_of_v<hkReferencedObject, hkStringPtr>) { auto* b = static_cast<hkReferencedObject*>(p); hkMemoryRouter::getInstance().heap().blockFree( p, (b->getMemorySizeAndFlags() == 0xffff) ? static_cast<int>(nbytes) : b->getMemorySizeAndFlags()); } else { if (p) hkMemoryRouter::getInstance().heap().blockFree(p, sizeof(hkStringPtr)); } } inline __attribute__((always_inline)) void* operator new(hk_size_t, void* p) { return p; } inline __attribute__((always_inline)) void* operator new[](hk_size_t, void* p) { return p; } inline __attribute__((always_inline)) void operator delete(void*, void*) {} inline __attribute__((always_inline)) void operator delete[](void*, void*) {}\n\n enum StringFlags {\n OWNED_FLAG = 0x1,\n };\n\n hkStringPtr();\n hkStringPtr(const char* string); // NOLINT(google-explicit-constructor)\n hkStringPtr(const char* string, int len);\n hkStringPtr(const hkStringPtr& strRef);\n explicit hkStringPtr(hkFinishLoadedObjectFlag f);\n\n ~hkStringPtr();\n\n inline const char* cString() const;\n inline operator const char*() const; // NOLINT(google-explicit-constructor)\n\n hkStringPtr& operator=(const char* s);\n hkStringPtr& operator=(const hkStringPtr& s);\n\n int getLength() const;\n\n inline char operator[](int idx) const;\n\n void printf(const char* fmt, ...);\n void set(const char* s, int len = -1);\n void setPointerAligned(const char* s);\n\n inline hkBool32 operator==(const char* s) const;\n inline hkBool32 operator!=(const char* s) const;\n inline hkBool32 startsWith(const char* s) const;\n inline hkBool32 endsWith(const char* s) const;\n inline int compareTo(const char* rhs) const;\n\nprivate:\n const char* m_stringAndFlag;\n};\n\ninline const char* hkStringPtr::cString() const {\n return reinterpret_cast<const char*>(uintptr_t(m_stringAndFlag) & ~OWNED_FLAG);\n}\n\ninline hkStringPtr::operator const char*() const {\n return cString();\n}\n\ninline char hkStringPtr::operator[](int idx) const {\n return cString()[idx];\n}\n\ninline hkBool32 hkStringPtr::operator==(const char* s) const {\n return compareTo(s) == 0;\n}\n\ninline hkBool32 hkStringPtr::operator!=(const char* s) const {\n return compareTo(s) != 0;\n}\n\ninline hkBool32 hkStringPtr::startsWith(const char* s) const {\n return hkString::beginsWith(cString(), s);\n}\n\ninline hkBool32 hkStringPtr::endsWith(const char* s) const {\n return hkString::endsWith(cString(), s);\n}\n\ninline int hkStringPtr::compareTo(const char* rhs) const {\n const char* lhs = cString();\n if (lhs && rhs)\n return hkString::strCmp(lhs, rhs);\n if (lhs != nullptr)\n return 1;\n if (rhs != nullptr)\n return -1;\n return 0;\n}\n# 21 \"/home/larsvi/botw/lib/hkStubs/./Havok/Common/Base/hkBase.h\" 2\n# 3 \"/home/larsvi/botw/src/KingSystem/Physics/System/physRayCast.cpp\" 2\n# 1 \"/home/larsvi/botw/lib/hkStubs/./Havok/Physics2012/Collide/Agent/Collidable/hkpCdBody.h\" 1\n\n\n\n# 1 \"/home/larsvi/botw/lib/hkStubs/./Havok/Physics2012/Collide/Shape/hkpShape.h\" 1\n\n\n\n# 1 \"/home/larsvi/botw/lib/hkStubs/./Havok/Physics2012/Collide/Shape/hkpShapeBase.h\" 1\n\n\n\n# 1 \"/home/larsvi/botw/lib/hkStubs/./Havok/Geometry/Collide/Shapes/hkcdShape.h\" 1\n\n\n\n\nstruct hkcdShapeType {\n inline __attribute__((always_inline)) void* operator new(hk_size_t nbytes) { if constexpr (std::is_base_of_v<hkReferencedObject, hkcdShapeType>) { return hkMemoryRouter::getInstance().heap().blockAlloc(static_cast<int>(nbytes)); } else { return hkMemoryRouter::getInstance().heap().blockAlloc(sizeof(hkcdShapeType)); } } inline __attribute__((always_inline)) void operator delete(void* p, hk_size_t nbytes) { if constexpr (std::is_base_of_v<hkReferencedObject, hkcdShapeType>) { auto* b = static_cast<hkReferencedObject*>(p); hkMemoryRouter::getInstance().heap().blockFree( p, (b->getMemorySizeAndFlags() == 0xffff) ? static_cast<int>(nbytes) : b->getMemorySizeAndFlags()); } else { if (p) hkMemoryRouter::getInstance().heap().blockFree(p, sizeof(hkcdShapeType)); } } inline __attribute__((always_inline)) void* operator new(hk_size_t, void* p) { return p; } inline __attribute__((always_inline)) void* operator new[](hk_size_t, void* p) { return p; } inline __attribute__((always_inline)) void operator delete(void*, void*) {} inline __attribute__((always_inline)) void operator delete[](void*, void*) {}\n\n enum ShapeTypeEnum {\n SPHERE = 0, ///< hkpSphereShape type.\n CYLINDER = 1, ///< hkpCylinderShape type.\n TRIANGLE = 2, ///< hkpTriangleShape type.\n BOX = 3, ///< hkpBoxShape type.\n CAPSULE = 4, ///< hkpCapsuleShape type.\n CONVEX_VERTICES = 5, ///< hkpConvexVerticesShape type.\n TRI_SAMPLED_HEIGHT_FIELD_COLLECTION = 6, ///< hkpTriSampledHeightFieldCollection type.\n TRI_SAMPLED_HEIGHT_FIELD_BV_TREE = 7, ///< hkpTriSampledHeightFieldBvTreeShape type.\n LIST = 8, ///< hkpListShape type.\n MOPP = 9, ///< hkpMoppBvTreeShape type.\n CONVEX_TRANSLATE = 10, ///< hkpConvexTranslateShape type.\n CONVEX_TRANSFORM = 11, ///< hkpConvexTransformShape type.\n SAMPLED_HEIGHT_FIELD = 12, ///< hkpSampledHeightFieldShape type.\n EXTENDED_MESH = 13, ///< hkpExtendedMeshShape type.\n TRANSFORM = 14, ///< hkpTransformShape type.\n COMPRESSED_MESH = 15, ///< hkpCompressedMeshShape type.\n STATIC_COMPOUND = 16, ///< hkpStaticCompoundShape type.\n BV_COMPRESSED_MESH = 17, ///< hkpBvCompressedMeshShape type.\n /// All shapes which inherit from hkpShapeCollection have this as an alternate type.\n COLLECTION = 18,\n USER0 = 19, ///< Custom user type.\n USER1 = 20, ///< Custom user type.\n USER2 = 21, ///< Custom user type.\n /// All shapes which inherit from hkpBvTreeShape have this as an alternate type.\n BV_TREE = 22,\n /// All shapes which inherit from hkpConvexShape have this as an alternate type.\n CONVEX = 23,\n CONVEX_PIECE = 24, ///< DEPRECATED - hkpConvexPieceShape type.\n MULTI_SPHERE = 25, ///< DEPRECATED - hkpMultiSphereShape type.\n CONVEX_LIST = 26, ///< DEPRECATED - hkpConvexListShape.\n TRIANGLE_COLLECTION = 27, ///< A shape collection which only returns triangles as child\n ///< shapes, e.g., hkpMeshShape.\n HEIGHT_FIELD = 28, ///< hkpHeightFieldShape type.\n SPHERE_REP = 29, ///< hkpSphereRepShape type.\n BV = 30, ///< hkpBvShape type.\n PLANE = 31, ///< hkpPlaneShape type.\n PHANTOM_CALLBACK = 32, ///< hkpPhantomCallbackShape type.\n MULTI_RAY = 33, ///< hkpMultiRayShape type.\n INVALID = 34, ///< Invalid shape\n\n FIRST_SHAPE_TYPE = SPHERE, ///< The first real shape.\n MAX_SPU_SHAPE_TYPE = USER2 + 1, ///< Last SPU support shape type.\n MAX_PPU_SHAPE_TYPE = INVALID + 1, ///< The end of the shape type list.\n ALL_SHAPE_TYPES = -1, ///< All shapes flag, used by the hkpCollisionDispatcher.\n };\n};\n\nstruct hkcdShapeDispatchType {\n inline __attribute__((always_inline)) void* operator new(hk_size_t nbytes) { if constexpr (std::is_base_of_v<hkReferencedObject, hkcdShapeDispatchType>) { return hkMemoryRouter::getInstance().heap().blockAlloc(static_cast<int>(nbytes)); } else { return hkMemoryRouter::getInstance().heap().blockAlloc(sizeof(hkcdShapeDispatchType)); } } inline __attribute__((always_inline)) void operator delete(void* p, hk_size_t nbytes) { if constexpr (std::is_base_of_v<hkReferencedObject, hkcdShapeDispatchType>) { auto* b = static_cast<hkReferencedObject*>(p); hkMemoryRouter::getInstance().heap().blockFree( p, (b->getMemorySizeAndFlags() == 0xffff) ? static_cast<int>(nbytes) : b->getMemorySizeAndFlags()); } else { if (p) hkMemoryRouter::getInstance().heap().blockFree(p, sizeof(hkcdShapeDispatchType)); } } inline __attribute__((always_inline)) void* operator new(hk_size_t, void* p) { return p; } inline __attribute__((always_inline)) void* operator new[](hk_size_t, void* p) { return p; } inline __attribute__((always_inline)) void operator delete(void*, void*) {} inline __attribute__((always_inline)) void operator delete[](void*, void*) {}\n\n enum ShapeDispatchTypeEnum {\n CONVEX_IMPLICIT,\n CONVEX,\n HEIGHT_FIELD,\n COMPOSITE,\n USER,\n NUM_DISPATCH_TYPES,\n };\n};\n\nstruct hkcdShapeInfoCodecType {\n inline __attribute__((always_inline)) void* operator new(hk_size_t nbytes) { if constexpr (std::is_base_of_v<hkReferencedObject, hkcdShapeInfoCodecType>) { return hkMemoryRouter::getInstance().heap().blockAlloc(static_cast<int>(nbytes)); } else { return hkMemoryRouter::getInstance().heap().blockAlloc(sizeof(hkcdShapeInfoCodecType)); } } inline __attribute__((always_inline)) void operator delete(void* p, hk_size_t nbytes) { if constexpr (std::is_base_of_v<hkReferencedObject, hkcdShapeInfoCodecType>) { auto* b = static_cast<hkReferencedObject*>(p); hkMemoryRouter::getInstance().heap().blockFree( p, (b->getMemorySizeAndFlags() == 0xffff) ? static_cast<int>(nbytes) : b->getMemorySizeAndFlags()); } else { if (p) hkMemoryRouter::getInstance().heap().blockFree(p, sizeof(hkcdShapeInfoCodecType)); } } inline __attribute__((always_inline)) void* operator new(hk_size_t, void* p) { return p; } inline __attribute__((always_inline)) void* operator new[](hk_size_t, void* p) { return p; } inline __attribute__((always_inline)) void operator delete(void*, void*) {} inline __attribute__((always_inline)) void operator delete[](void*, void*) {}\n\n enum ShapeInfoCodecTypeEnum {\n NULL_CODEC = 0,\n UFM358 = 1,\n MAX_NUM_CODECS = 16,\n };\n};\n\nclass hkcdShape : public hkReferencedObject {\npublic:\n inline __attribute__((always_inline)) void* operator new(hk_size_t nbytes) { if constexpr (std::is_base_of_v<hkReferencedObject, hkcdShape>) { return hkMemoryRouter::getInstance().heap().blockAlloc(static_cast<int>(nbytes)); } else { return hkMemoryRouter::getInstance().heap().blockAlloc(sizeof(hkcdShape)); } } inline __attribute__((always_inline)) void operator delete(void* p, hk_size_t nbytes) { if constexpr (std::is_base_of_v<hkReferencedObject, hkcdShape>) { auto* b = static_cast<hkReferencedObject*>(p); hkMemoryRouter::getInstance().heap().blockFree( p, (b->getMemorySizeAndFlags() == 0xffff) ? static_cast<int>(nbytes) : b->getMemorySizeAndFlags()); } else { if (p) hkMemoryRouter::getInstance().heap().blockFree(p, sizeof(hkcdShape)); } } inline __attribute__((always_inline)) void* operator new(hk_size_t, void* p) { return p; } inline __attribute__((always_inline)) void* operator new[](hk_size_t, void* p) { return p; } inline __attribute__((always_inline)) void operator delete(void*, void*) {} inline __attribute__((always_inline)) void operator delete[](void*, void*) {}\n\n using ShapeType = hkcdShapeType::ShapeTypeEnum;\n using DispatchType = hkcdShapeDispatchType::ShapeDispatchTypeEnum;\n using ShapeInfoCodecType = hkcdShapeInfoCodecType::ShapeInfoCodecTypeEnum;\n\n inline __attribute__((always_inline)) hkcdShape() = default;\n inline __attribute__((always_inline)) explicit hkcdShape(ShapeType shapeType)\n : m_type(shapeType), m_dispatchType(hkcdShapeDispatchType::USER), m_bitsPerKey(0),\n m_shapeInfoCodecType(hkcdShapeInfoCodecType::NULL_CODEC) {}\n\n explicit hkcdShape(hkFinishLoadedObjectFlag flag);\n\n inline __attribute__((always_inline)) hkcdShape::ShapeType getType() const { return m_type; }\n inline __attribute__((always_inline)) void setType(ShapeType newType) { m_type = newType; }\n\n hkEnum<ShapeType, hkUint8> m_type;\n hkEnum<DispatchType, hkUint8> m_dispatchType;\n hkUint8 m_bitsPerKey;\n hkEnum<ShapeInfoCodecType, hkUint8> m_shapeInfoCodecType;\n};\n# 5 \"/home/larsvi/botw/lib/hkStubs/./Havok/Physics2012/Collide/Shape/hkpShapeBase.h\" 2\n\nusing hkpVertexId = hkUint16;\nusing hkpShapeKey = hkUint32;\n\nclass hkAabb;\nclass hkSphere;\nclass hkcdVertex;\nclass hkpCdBody;\nclass hkpRayHitCollector;\nstruct hkpShapeRayBundleCastInput;\nstruct hkpShapeRayBundleCastOutput;\nstruct hkpShapeRayCastInput;\nstruct hkpShapeRayCastOutput;\n\n/// Base interface for all physics shapes.\nclass hkpShapeBase : public hkcdShape {\npublic:\n inline __attribute__((always_inline)) void* operator new(hk_size_t nbytes) { if constexpr (std::is_base_of_v<hkReferencedObject, hkpShapeBase>) { return hkMemoryRouter::getInstance().heap().blockAlloc(static_cast<int>(nbytes)); } else { return hkMemoryRouter::getInstance().heap().blockAlloc(sizeof(hkpShapeBase)); } } inline __attribute__((always_inline)) void operator delete(void* p, hk_size_t nbytes) { if constexpr (std::is_base_of_v<hkReferencedObject, hkpShapeBase>) { auto* b = static_cast<hkReferencedObject*>(p); hkMemoryRouter::getInstance().heap().blockFree( p, (b->getMemorySizeAndFlags() == 0xffff) ? static_cast<int>(nbytes) : b->getMemorySizeAndFlags()); } else { if (p) hkMemoryRouter::getInstance().heap().blockFree(p, sizeof(hkpShapeBase)); } } inline __attribute__((always_inline)) void* operator new(hk_size_t, void* p) { return p; } inline __attribute__((always_inline)) void* operator new[](hk_size_t, void* p) { return p; } inline __attribute__((always_inline)) void operator delete(void*, void*) {} inline __attribute__((always_inline)) void operator delete[](void*, void*) {}\n enum { THIS_SHAPE_TYPE = (hkcdShapeType::INVALID) };\n\n inline __attribute__((always_inline)) hkpShapeBase() = default;\n inline __attribute__((always_inline)) explicit hkpShapeBase(ShapeType type) : hkcdShape(type) {}\n explicit hkpShapeBase(hkFinishLoadedObjectFlag flag);\n\n /// Returns true if the shape is a hkpConvexShape.\n virtual bool isConvex() const { return false; }\n\n /// Returns true if the shape is a hkpBvTreeShape.\n inline __attribute__((always_inline)) bool isBvTree() const;\n\n /// Returns true if the shape is a hkpShapeCollection.\n inline __attribute__((always_inline)) bool isCollection() const;\n\n virtual void getAabb(const hkTransform& localToWorld, hkReal tolerance, hkAabb& aabbOut) const;\n\n virtual hkBool castRay(const hkpShapeRayCastInput& input, hkpShapeRayCastOutput& output) const;\n\n virtual void castRayWithCollector(const hkpShapeRayCastInput& input, const hkpCdBody& cdBody,\n
hkpRayHitCollector& collector) const;\n\n virtual hkVector4Comparison castRayBundle(const hkpShapeRayBundleCastInput& input,\n hkpShapeRayBundleCastOutput& output,\n hkVector4ComparisonParameter mask) const;\n\n virtual void getSupportingVertex(hkVector4Parameter direction,\n
hkcdVertex& supportingVertexOut) const;\n\n virtual void convertVertexIdsToVertices(const hkpVertexId* ids, int numIds,\n hkcdVertex* vertexArrayOut) const;\n\n virtual void getCentre(hkVector4& centreOut) const;\n\n virtual int getNumCollisionSpheres() const;\n\n virtual const hkSphere* getCollisionSpheres(hkSphere* sphereBuffer) const;\n\n virtual int weldContactPoint(hkpVertexId* featurePoints, hkUint8& numFeaturePoints,\n hkVector4& contactPointWs, const hkTransform* thisObjTransform,\n const class hkpConvexShape* collidingConvexShape,\n const hkTransform* collidingTransform,\n hkVector4& separatingNormalInOut) const;\n};\n\ninline bool hkpShapeBase::isBvTree() const {\n switch (m_type) {\n case hkcdShapeType::BV_TREE:\n case hkcdShapeType::MOPP:\n case hkcdShapeType::STATIC_COMPOUND:\n case hkcdShapeType::BV_COMPRESSED_MESH:\n case hkcdShapeType::TRI_SAMPLED_HEIGHT_FIELD_BV_TREE:\n return true;\n default:\n return false;\n }\n}\n\ninline bool hkpShapeBase::isCollection() const {\n switch (m_type) {\n case hkcdShapeType::COLLECTION:\n case hkcdShapeType::LIST:\n case hkcdShapeType::EXTENDED_MESH:\n case hkcdShapeType::TRI_SAMPLED_HEIGHT_FIELD_COLLECTION:\n return true;\n default:\n return false;\n }\n}\n# 5 \"/home/larsvi/botw/lib/hkStubs/./Havok/Physics2012/Collide/Shape/hkpShape.h\" 2\n\n\n\n\nclass hkpShapeContainer;\n\nclass hkpShape : public hkpShapeBase {\npublic:\n inline __attribute__((always_inline)) void* operator new(hk_size_t nbytes) { if constexpr (std::is_base_of_v<hkReferencedObject, hkpShape>) { return hkMemoryRouter::getInstance().heap().blockAlloc(static_cast<int>(nbytes)); } else { return hkMemoryRouter::getInstance().heap().blockAlloc(sizeof(hkpShape)); } } inline __attribute__((always_inline)) void operator delete(void* p, hk_size_t nbytes) { if constexpr (std::is_base_of_v<hkReferencedObject, hkpShape>) { auto* b = static_cast<hkReferencedObject*>(p); hkMemoryRouter::getInstance().heap().blockFree( p, (b->getMemorySizeAndFlags() == 0xffff) ? static_cast<int>(nbytes) : b->getMemorySizeAndFlags()); } else { if (p) hkMemoryRouter::getInstance().heap().blockFree(p, sizeof(hkpShape)); } } inline __attribute__((always_inline)) void* operator new(hk_size_t, void* p) { return p; } inline __attribute__((always_inline)) void* operator new[](hk_size_t, void* p) { return p; } inline __attribute__((always_inline)) void operator delete(void*, void*) {} inline __attribute__((always_inline)) void operator delete[](void*, void*) {}\n enum { THIS_SHAPE_TYPE = (hkcdShapeType::INVALID) };\n\n struct CalcSizeForSpuInput;\n\n inline __attribute__((always_inline)) hkpShape() = default;\n inline __attribute__((always_inline)) explicit hkpShape(ShapeType type) : hkpShapeBase(type), m_userData(0) {}\n explicit hkpShape(hkFinishLoadedObjectFlag flag);\n\n virtual const hkpShapeContainer* getContainer() const { return nullptr; }\n virtual hkReal getMaximumProjection(const hkVector4& direction) const;\n virtual int calcSizeForSpu(const CalcSizeForSpuInput& input, int spuBufferSizeLeft) const;\n inline hkUlong getUserData() const { return m_userData; }\n inline void setUserData(hkUlong data) { m_userData = data; }\n\n hkVector4Comparison castRayBundle(const hkpShapeRayBundleCastInput& input,\n hkpShapeRayBundleCastOutput& output,\n hkVector4ComparisonParameter mask) const override;\n\n hkUlong m_userData;\n};\n\nclass hkpShapeKeyPair {\npublic:\n inline __attribute__((always_inline)) void* operator new(hk_size_t nbytes) { if constexpr (std::is_base_of_v<hkReferencedObject, hkpShapeKeyPair>) { return hkMemoryRouter::getInstance().heap().blockAlloc(static_cast<int>(nbytes)); } else { return hkMemoryRouter::getInstance().heap().blockAlloc(sizeof(hkpShapeKeyPair)); } } inline __attribute__((always_inline)) void operator delete(void* p, hk_size_t nbytes) { if constexpr (std::is_base_of_v<hkReferencedObject, hkpShapeKeyPair>) { auto* b = static_cast<hkReferencedObject*>(p); hkMemoryRouter::getInstance().heap().blockFree( p, (b->getMemorySizeAndFlags() == 0xffff) ? static_cast<int>(nbytes) : b->getMemorySizeAndFlags()); } else { if (p) hkMemoryRouter::getInstance().heap().blockFree(p, sizeof(hkpShapeKeyPair)); } } inline __attribute__((always_inline)) void* operator new(hk_size_t, void* p) { return p; } inline __attribute__((always_inline)) void* operator new[](hk_size_t, void* p) { return p; } inline __attribute__((always_inline)) void operator delete(void*, void*) {} inline __attribute__((always_inline)) void operator delete[](void*, void*) {}\n\n hkpShapeKey m_shapeKeyA;\n hkpShapeKey m_shapeKeyB;\n\n inline __attribute__((always_inline)) bool operator==(const hkpShapeKeyPair& p1) const {\n return m_shapeKeyB == p1.m_shapeKeyB && m_shapeKeyA == p1.m_shapeKeyA;\n }\n\n inline __attribute__((always_inline)) bool operator<(const hkpShapeKeyPair& p1) const {\n return (m_shapeKeyA < p1.m_shapeKeyA) ||\n (m_shapeKeyA == p1.m_shapeKeyA && m_shapeKeyB < p1.m_shapeKeyB);\n }\n};\n\nclass hkpShapeModifier {\npublic:\n virtual ~hkpShapeModifier() = default;\n virtual void modifyShape(hkpShape* shapeInOut) = 0;\n};\n# 5 \"/home/larsvi/botw/lib/hkStubs/./Havok/Physics2012/Collide/Agent/Collidable/hkpCdBody.h\" 2\n\nclass hkMotionState;\nclass hkpCollidable;\n\nclass hkpCdBody {\npublic:\n inline __attribute__((always_inline)) void* operator new(hk_size_t nbytes) { if constexpr (std::is_base_of_v<hkReferencedObject, hkpCdBody>) { return hkMemoryRouter::getInstance().heap().blockAlloc(static_cast<int>(nbytes)); } else { return hkMemoryRouter::getInstance().heap().blockAlloc(sizeof(hkpCdBody)); } } inline __attribute__((always_inline)) void operator delete(void* p, hk_size_t nbytes) { if constexpr (std::is_base_of_v<hkReferencedObject, hkpCdBody>) { auto* b = static_cast<hkReferencedObject*>(p); hkMemoryRouter::getInstance().heap().blockFree( p, (b->getMemorySizeAndFlags() == 0xffff) ? static_cast<int>(nbytes) : b->getMemorySizeAndFlags()); } else { if (p) hkMemoryRouter::getInstance().heap().blockFree(p, sizeof(hkpCdBody)); } } inline __attribute__((always_inline)) void* operator new(hk_size_t, void* p) { return p; } inline __attribute__((always_inline)) void* operator new[](hk_size_t, void* p) { return p; } inline __attribute__((always_inline)) void operator delete(void*, void*) {} inline __attribute__((always_inline)) void operator delete[](void*, void*) {}\n friend class hkpCollidable;\n\n inline __attribute__((always_inline)) hkpCdBody() {}\n\n inline __attribute__((always_inline)) hkpCdBody(const hkpShape* shape, const hkMotionState* motionState);\n inline __attribute__((always_inline)) hkpCdBody(const hkpShape* shape, const hkTransform* t);\n\n inline __attribute__((always_inline)) hkpCdBody(const hkpCdBody& body) = delete;\n\n inline __attribute__((always_inline)) const hkTransform& getTransform() const;\n inline __attribute__((always_inline)) const hkpShape* getShape() const;\n inline __attribute__((always_inline)) const hkpCollidable* getRootCollidable() const;\n inline __attribute__((always_inline)) hkpShapeKey getShapeKey() const;\n inline __attribute__((always_inline)) hkpShapeKey getTopLevelShapeKey() const;\n inline __attribute__((always_inline)) const hkpCdBody* getParent() const;\n\n // Internal functions, for collision agents.\n explicit inline __attribute__((always_inline)) hkpCdBody(const hkpCdBody* parent);\n inline __attribute__((always_inline)) hkpCdBody(const hkpCdBody* parent, const hkMotionState* ms);\n inline __attribute__((always_inline)) hkpCdBody(const hkpCdBody* parent, const hkTransform* t);\n inline __attribute__((always_inline)) void setShape(const hkpShape* shape, hkpShapeKey key);\n inline __attribute__((always_inline)) const hkMotionState* getMotionState() const;\n inline __attribute__((always_inline)) void setMotionState(const hkMotionState* state);\n inline __attribute__((always_inline)) void setTransform(const hkTransform* t);\n\n const hkpShape* m_shape;\n hkpShapeKey m_shapeKey;\n\nprivate:\n // hkTransform or hkMotionState.\n const void* m_motion;\n\npublic:\n const hkpCdBody* m_parent;\n};\n\ninline hkpCdBody::hkpCdBody(const hkpShape* shape, const hkMotionState* motionState) {\n m_shape = shape;\n setMotionState(motionState);\n m_parent = nullptr;\n m_shapeKey = 0xffffffff;\n}\n\ninline hkpCdBody::hkpCdBody(const hkpShape* shape, const hkTransform* t) {\n m_shape = shape;\n setTransform(t);\n m_parent = nullptr;\n m_shapeKey = 0xffffffff;\n}\n\ninline const hkTransform& hkpCdBody::getTransform() const {\n return *static_cast<const hkTransform*>(m_motion);\n}\n\ninline const hkpShape* hkpCdBody::getShape() const {\n return m_shape;\n}\n\ninline const hkpCollidable* hkpCdBody::getRootCollidable() const {\n const hkpCdBody* body = this;\n while (body->m_parent) {\n body = body->m_parent;\n }\n return reinterpret_cast<const hkpCollidable*>(body);\n}\n\ninline hkpShapeKey hkpCdBody::getShapeKey() const {\n return m_shapeKey;\n}\n\ninline hkpShapeKey hkpCdBody::getTopLevelShapeKey() const {\n const hkpCdBody* body = this;\n const hkpCdBody* top = body;\n while (body->m_parent) {\n top = body;\n body = body->m_parent;\n }\n return top->m_shapeKey;\n}\n\ninline const hkpCdBody* hkpCdBody::getParent() const {\n return m_parent;\n}\n\ninline hkpCdBody::hkpCdBody(const hkpCdBody* parent) {\n m_parent = parent;\n m_motion = parent->m_motion;\n}\n\ninline hkpCdBody::hkpCdBody(const hkpCdBody* parent, const hkMotionState* ms) {\n m_parent = parent;\n setMotionState(ms);\n}\n\ninline hkpCdBody::hkpCdBody(const hkpCdBody* parent, const hkTransform* t) {\n m_parent = parent;\n setTransform(t);\n}\n\ninline void hkpCdBody::setShape(const hkpShape* shape, hkpShapeKey key) {\n m_shape = shape;\n m_shapeKey = key;\n}\n\ninline const hkMotionState* hkpCdBody::getMotionState() const {\n return static_cast<const hkMotionState*>(m_motion);\n}\n\ninline void hkpCdBody::setMotionState(const hkMotionState* state) {\n m_motion = state;\n}\n\ninline void hkpCdBody::setTransform(const hkTransform* t) {\n m_motion = t;\n}\n# 4 \"/home/larsvi/botw/src/KingSystem/Physics/System/physRayCast.cpp\" 2\n# 1 \"/home/larsvi/botw/lib/hkStubs/./Havok/Physics2012/Collide/Agent/Collidable/hkpCollidable.h\" 1\n\n\n\n# 1 \"/home/larsvi/botw/lib/hkStubs/./Havok/Physics2012/Collide/BroadPhase/hkpTypedBroadPhaseHandle.h\" 1\n\n\n# 1 \"/home/larsvi/botw/lib/hkStubs/./Havok/Physics2012/Collide/Agent/Collidable/hkpCollidableQualityType.h\" 1\n\n\nenum hkpCollidableQualityType : int {\n HK_COLLIDABLE_QUALITY_INVALID = -1,\n HK_COLLIDABLE_QUALITY_FIXED = 0,\n HK_COLLIDABLE_QUALITY_KEYFRAMED,\n HK_COLLIDABLE_QUALITY_DEBRIS,\n HK_COLLIDABLE_QUALITY_DEBRIS_SIMPLE_TOI,\n HK_COLLIDABLE_QUALITY_MOVING,\n HK_COLLIDABLE_QUALITY_CRITICAL,\n HK_COLLIDABLE_QUALITY_BULLET,\n HK_COLLIDABLE_QUALITY_USER,\n HK_COLLIDABLE_QUALITY_CHARACTER,\n HK_COLLIDABLE_QUALITY_KEYFRAMED_REPORTING,\n HK_COLLIDABLE_QUALITY_MAX\n};\n# 4 \"/home/larsvi/botw/lib/hkStubs/./Havok/Physics2012/Collide/BroadPhase/hkpTypedBroadPhaseHandle.h\" 2\n# 1 \"/home/larsvi/botw/lib/hkStubs/./Havok/Physics2012/Collide/BroadPhase/hkpBroadPhaseHandle.h\" 1\n\n\n\n\nclass hkpBroadPhaseHandle {\npublic:\n inline __attribute__((always_inline)) void* operator new(hk_size_t nbytes) { if constexpr (std::is_base_of_v<hkReferencedObject, hkpBroadPhaseHandle>) { return hkMemoryRouter::getInstance().heap().blockAlloc(static_cast<int>(nbytes)); } else { return hkMemoryRouter::getInstance().heap().blockAlloc(sizeof(hkpBroadPhaseHandle)); } } inline __attribute__((always_inline)) void operator delete(void* p, hk_size_t nbytes) { if constexpr (std::is_base_of_v<hkReferencedObject, hkpBroadPhaseHandle>) { auto* b = static_cast<hkReferencedObject*>(p); hkMemoryRouter::getInstance().heap().blockFree( p, (b->getMemorySizeAndFlags() == 0xffff) ? static_cast<int>(nbytes) : b->getMemorySizeAndFlags()); } else { if (p) hkMemoryRouter::getInstance().heap().blockFree(p, sizeof(hkpBroadPhaseHandle)); } } inline __attribute__((always_inline)) void* operator new(hk_size_t, void* p) { return p; } inline __attribute__((always_inline)) void* operator new[](hk_size_t, void* p) { return p; } inline __attribute__((always_inline)) void operator delete(void*, void*) {} inline __attribute__((always_inline)) void operator delete[](void*, void*) {}\n\n hkpBroadPhaseHandle() : m_id(0) {}\n explicit hkpBroadPhaseHandle(hkFinishLoadedObjectFlag flag) {}\n\n hkUint32 m_id;\n};\n# 5 \"/home/larsvi/botw/lib/hkStubs/./Havok/Physics2012/Collide/BroadPhase/hkpTypedBroadPhaseHandle.h\" 2\n\nclass hkpTypedBroadPhaseHandle : public hkpBroadPhaseHandle {\npublic:\n inline __attribute__((always_inline)) void* operator new(hk_size_t nbytes) { if constexpr (std::is_base_of_v<hkReferencedObject, hkpTypedBroadPhaseHandle>) { return hkMemoryRouter::getInstance().heap().blockAlloc(static_cast<int>(nbytes)); } else { return hkMemoryRouter::getInstance().heap().blockAlloc(sizeof(hkpTypedBroadPhaseHandle)); } } inline __attribute__((always_inline)) void operator delete(void* p, hk_size_t nbytes) { if constexpr (std::is_base_of_v<hkReferencedObject, hkpTypedBroadPhaseHandle>) { auto* b = static_cast<hkReferencedObject*>(p); hkMemoryRouter::getInstance().heap().blockFree( p, (b->getMemorySizeAndFlags() == 0xffff) ? static_cast<int>(nbytes) : b->getMemorySizeAndFlags()); } else { if (p) hkMemoryRouter::getInstance().heap().blockFree(p, sizeof(hkpTypedBroadPhaseHandle)); } } inline __attribute__((always_inline)) void* operator new(hk_size_t, void* p) { return p; } inline __attribute__((always_inline)) void* operator new[](hk_size_t, void* p) { return p; } inline __attribute__((always_inline)) void operator delete(void*, void*) {} inline __attribute__((always_inline)) void operator delete[](void*, void*) {}\n\n explicit hkpTypedBroadPhaseHandle(hkFinishLoadedObjectFlag flag) : hkpBroadPhaseHandle(flag) {}\n\n inline __attribute__((always_inline)) explicit hkpTypedBroadPhaseHandle(int type);\n inline __attribute__((always_inline)) hkpTypedBroadPhaseHandle(void* owner, int type);\n\n /// See hkpWorldObject::BroadPhaseType.\n inline __attribute__((always_inline)) int getType() const;\n inline __attribute__((always_inline)) void* getOwner() const;\n inline __attribute__((always_inline)) void setOwner(void* o);\n\nprotected:\n friend class hkpBroadPhaseBorder;\n\n inline void setType(int type);\n\n static constexpr int OFFSET_INVALID = 127;\n hkInt8 m_type;\n hkInt8 m_ownerOffset;\n\npublic:\n hkInt8 m_objectQualityType;\n hkUint32 m_collisionFilterInfo;\n};\n\ninline hkpTypedBroadPhaseHandle::hkpTypedBroadPhaseHandle(int type) {\n m_type = static_cast<hkInt8>(type);\n m_collisionFilterInfo = 0;\n m_objectQualityType = HK_COLLIDABLE_QUALITY_INVALID;\n m_ownerOffset = OFFSET_INVALID;\n}\n\ninline hkpTypedBroadPhaseHandle::hkpTypedBroadPhaseHandle(void* owner, int type) {\n m_type = static_cast<hkInt8>(type);\n m_collisionFilterInfo = 0;\n m_objectQualityType = HK_COLLIDABLE_QUALITY_INVALID;\n setOwner(owner);\n}\n\ninline int hkpTypedBroadPhaseHandle::getType() const {\n return m_type;\n}\n\ninline void* hkpTypedBroadPhaseHandle::getOwner() const {\n return const_cast<char*>(reinterpret_cast<const char*>(this) + m_ownerOffset);\n}\n\ninline void hkpTypedBroadPhaseHandle::setOwner(void* o) {\n auto offset = int(hkGetByteOffset(this, o));\n m_ownerOffset = static_cast<hkInt8>(offset);\n}\n\ninline void hkpTypedBroadPhaseHandle::setType(int type) {\n m_type = static_cast<hkInt8>(type);\n}\n# 5 \"/home/larsvi/botw/lib/hkStubs/./Havok/Physics2012/Collide/Agent/Collidable/hkpCollidable.h\" 2\n\nclass hkAabbUint32;\n\nclass hkpCollidable : public hkpCdBody {\npublic:\n inline __attribute__((always_inline)) void* operator new(hk_size_t nbytes) { if constexpr (std::is_base_of_v<hkReferencedObject, hkpCollidable>) { return hkMemoryRouter::getInstance().heap().blockAlloc(static_cast<int>(nbytes)); } else { return hkMemoryRouter::getInstance().heap().blockAlloc(sizeof(hkpCollidable)); } } inline __attribute__((always_inline)) void operator delete(void* p, hk_size_t nbytes) { if constexpr (std::is_base_of_v<hkReferencedObject, hkpCollidable>) { auto* b = static_cast<hkReferencedObject*>(p); hkMemoryRouter::getInstance().heap().blockFree( p, (b->getMemorySizeAndFlags() == 0xffff) ? static_cast<int>(nbytes) : b->getMemorySizeAndFlags()); } else { if (p) hkMemoryRouter::getInstance().heap().blockFree(p, sizeof(hkpCollidable)); } } inline __attribute__((always_inline)) void* operator new(hk_size_t, void* p) { return p; } inline __attribute__((always_inline)) void* operator new[](hk_size_t, void* p) { return p; } inline __attribute__((always_inline)) void operator delete(void*, void*) {} inline __attribute__((always_inline)) void operator delete[](void*, void*) {}\n\n struct BoundingVolumeData {\n inline __attribute__((always_inline)) void* operator new(hk_size_t nbytes) { if constexpr (std::is_base_of_v<hkReferencedObject, hkpCollidable::BoundingVolumeData>) { return hkMemoryRouter::getInstance().heap().blockAlloc(static_cast<int>(nbytes)); } else { return hkMemoryRouter::getInstance().heap().blockAlloc(sizeof(hkpCollidable::BoundingVolumeData)); } } inline __attribute__((always_inline)) void operator delete(void* p, hk_size_t nbytes) { if constexpr (std::is_base_of_v<hkReferencedObject, hkpCollidable::BoundingVolumeData>) { auto* b = static_cast<hkReferencedObject*>(p); hkMemoryRouter::getInstance().heap().blockFree( p, (b->getMemorySizeAndFlags() == 0xffff) ? static_cast<int>(nbytes) : b->getMemorySizeAndFlags()); } else { if (p) hkMemoryRouter::getInstance().heap().blockFree(p, sizeof(hkpCollidable::BoundingVolumeData)); } } inline __attribute__((always_inline)) void* operator new(hk_size_t, void* p) { return p; } inline __attribute__((always_inline)) void* operator new[](hk_size_t, void* p) { return p; } inline __attribute__((always_inline)) void operator delete(void*, void*) {} inline __attribute__((always_inline)) void operator delete[](void*, void*) {}\n\n BoundingVolumeData();\n explicit inline BoundingVolumeData(hkFinishLoadedObjectFlag flag);\n\n inline __attribute__((always_inline)) bool hasAllocations() const;\n void deallocate();\n void allocate(int numChildShapes);\n\n inline __attribute__((always_inline)) void invalidate() {\n m_min[0] = 1;\n m_max[0] = 0;\n }\n inline __attribute__((always_inline)) bool isValid() const { return m_min[0] <= m_max[0]; }\n\n hkUint32 m_min[3];\n hkUint8 m_expansionMin[3];\n hkUint8 m_expansionShift;\n hkUint32 m_max[3];\n hkUint8 m_expansionMax[3];\n hkUint8 m_padding;\n hkUint16 m_numChildShapeAabbs;\n hkUint16 m_capacityChildShapeAabbs;\n hkAabbUint32* m_childShapeAabbs;\n hkpShapeKey* m_childShapeKeys;\n };\n\n enum ForceCollideOntoPpuReasons {\n FORCE_PPU_USER_REQUEST = 1,\n FORCE_PPU_SHAPE_REQUEST = 2,\n FORCE_PPU_MODIFIER_REQUEST = 4,\n FORCE_PPU_SHAPE_UNCHECKED = 8,\n };\n\n explicit hkpCollidable(hkFinishLoadedObjectFlag flag);\n inline hkpCollidable(const hkpShape* shape, const hkTransform* t, int type = 0);\n inline hkpCollidable(const hkpShape* shape, const hkMotionState* ms, int type = 0);\n inline ~hkpCollidable();\n\n inline void setShape(const hkpShape* shape);\n\n inline void* getOwner() const;\n inline void setOwner(void* owner);\n\n inline hkpCollidableQualityType getQualityType() const;\n inline void setQualityType(hkpCollidableQualityType type);\n\n inline hkReal getAllowedPenetrationDepth() const;\n inline void setAllowedPenetrationDepth(hkReal val);\n\n inline hkUint32 getCollisionFilterInfo() const;\n inline void setCollisionFilterInfo(hkUint32 info);\n\n /// @see hkpWorldObject::BroadPhaseType\n inline int getType() const;\n\nprotected:\n hkInt8 m_ownerOffset;\n\npublic:\n hkUint8 m_forceCollideOntoPpu;\n hkUint16 m_shapeSizeOnSpu;\n hkpTypedBroadPhaseHandle m_broadPhaseHandle;\n BoundingVolumeData m_boundingVolumeData;\n hkReal m_allowedPenetrationDepth;\n};\n\ninline hkpCollidable::hkpCollidable(hkFinishLoadedObjectFlag flag)\n : m_broadPhaseHandle(flag), m_boundingVolumeData(flag) {\n if (flag.m_finishing) {\n m_broadPhaseHandle.setOwner(this);\n }\n}\n\ninline hkpCollidable::hkpCollidable(const hkpShape* shape, const hkTransform* t, int type)\n : hkpCdBody(shape, t), m_ownerOffset(0), m_broadPhaseHandle(type),\n m_allowedPenetrationDepth(hkReal(-1)) {\n m_broadPhaseHandle.setOwner(this);\n m_forceCollideOntoPpu = hkpCollidable::FORCE_PPU_SHAPE_UNCHECKED;\n m_shapeSizeOnSpu = 0;\n}\n\ninline hkpCollidable::hkpCollidable(const hkpShape* shape, const hkMotionState* ms, int type)\n : hkpCdBody(shape, ms), m_ownerOffset(0), m_broadPhaseHandle(type),\n m_allowedPenetrationDepth(hkReal(-1)) {\n m_broadPhaseHandle.setOwner(this);\n m_forceCollideOntoPpu = hkpCollidable::FORCE_PPU_SHAPE_UNCHECKED;\n m_shapeSizeOnSpu = 0;\n}\n\ninline hkpCollidable::~hkpCollidable() {}\n\ninline void hkpCollidable::setShape(const hkpShape* shape) {\n m_shape = shape;\n}\n\ninline void* hkpCollidable::getOwner() const {\n return const_cast<char*>(reinterpret_cast<const char*>(this) + m_ownerOffset);\n}\n\ninline void hkpCollidable::setOwner(void* owner) {\n auto ownerOffset = int(hkGetByteOffset(this, owner));\n m_ownerOffset = static_cast<hkInt8>(ownerOffset);\n}\n\ninline hkpCollidableQualityType hkpCollidable::getQualityType() const {\n return hkpCollidableQualityType(m_broadPhaseHandle.m_objectQualityType);\n}\n\ninline void hkpCollidable::setQualityType(hkpCollidableQualityType type) {\n m_broadPhaseHandle.m_objectQualityType = type;\n}\n\ninline hkReal hkpCollidable::getAllowedPenetrationDepth() const {\n return m_allowedPenetrationDepth;\n}\n\ninline void hkpCollidable::setAllowedPenetrationDepth(hkReal val) {\n m_allowedPenetrationDepth = val;\n}\n\ninline hkUint32 hkpCollidable::getCollisionFilterInfo() const {\n return m_broadPhaseHandle.m_collisionFilterInfo;\n}\n\ninline void hkpCollidable::setCollisionFilterInfo(hkUint32 info) {\n m_broadPhaseHandle.m_collisionFilterInfo = info;\n}\n\ninline int hkpCollidable::getType() const {\n return m_broadPhaseHandle.getType();\n}\n\ninline hkpCollidable::BoundingVolumeData::BoundingVolumeData(hkFinishLoadedObjectFlag flag) {\n if (flag.m_finishing) {\n m_numChildShapeAabbs = 0;\n m_capacityChildShapeAabbs = 0;\n m_childShapeAabbs = nullptr;\n m_childShapeKeys = nullptr;\n invalidate();\n }\n}\n\ninline bool hkpCollidable::BoundingVolumeData::hasAllocations() const {\n return m_childShapeAabbs != nullptr;\n}\n# 5 \"/home/larsvi/botw/src/KingSystem/Physics/System/physRayCast.cpp\" 2\n# 1 \"/home/larsvi/botw/lib/hkStubs/./Havok/Physics2012/Collide/Query/CastUtil/hkpWorldRayCastInput.h\" 1\n\n\n\n\nstruct hkpWorldRayCastInput {\n inline __attribute__((always_inline)) void* operator new(hk_size_t nbytes) { if constexpr (std::is_base_of_v<hkReferencedObject, hkpWorldRayCastInput>) { return hkMemoryRouter::getInstance().heap().blockAlloc(static_cast<int>(nbytes)); } else { return hkMemoryRouter::getInstance().heap().blockAlloc(sizeof(hkpWorldRayCastInput)); } } inline __attribute__((always_inline)) void operator delete(void* p, hk_size_t nbytes) { if constexpr (std::is_base_of_v<hkReferencedObject, hkpWorldRayCastInput>) { auto* b = static_cast<hkReferencedObject*>(p); hkMemoryRouter::getInstance().heap().blockFree( p, (b->getMemorySizeAndFlags() == 0xffff) ? static_cast<int>(nbytes) : b->getMemorySizeAndFlags()); } else { if (p) hkMemoryRouter::getInstance().heap().blockFree(p, sizeof(hkpWorldRayCastInput)); } } inline __attribute__((always_inline)) void* operator new(hk_size_t, void* p) { return p; } inline __attribute__((always_inline)) void* operator new[](hk_size_t, void* p) { return p; } inline __attribute__((always_inline)) void operator delete(void*, void*) {} inline __attribute__((always_inline)) void operator delete[](void*, void*) {}\n\n hkVector4 m_from;\n hkVector4 m_to;\n hkBool m_enableShapeCollectionFilter = false;\n hkUint32 m_filterInfo = 0;\n hkUlong m_userData = 0;\n};\n# 6 \"/home/larsvi/botw/src/KingSystem/Physics/System/physRayCast.cpp\" 2\n# 1 \"/home/larsvi/botw/lib/hkStubs/./Havok/Physics2012/Collide/Query/CastUtil/hkpWorldRayCastOutput.h\" 1\n\n\n# 1 \"/home/larsvi/botw/lib/hkStubs/./Havok/Physics2012/Collide/Shape/Query/hkpShapeRayCastOutput.h\" 1\n\n\n# 1 \"/home/larsvi/botw/lib/hkStubs/./Havok/Physics2012/Collide/Shape/Query/hkpShapeRayCastCollectorOutput.h\" 1\n\n\n\n\nstruct hkpShapeRayCastCollectorOutput {\n inline __attribute__((always_inline)) void* operator new(hk_size_t nbytes) { if constexpr (std::is_base_of_v<hkReferencedObject, hkpShapeRayCastCollectorOutput>) { return hkMemoryRouter::getInstance().heap().blockAlloc(static_cast<int>(nbytes)); } else { return hkMemoryRouter::getInstance().heap().blockAlloc(sizeof(hkpShapeRayCastCollectorOutput)); } } inline __attribute__((always_inline)) void operator delete(void* p, hk_size_t nbytes) { if constexpr (std::is_base_of_v<hkReferencedObject, hkpShapeRayCastCollectorOutput>) { auto* b = static_cast<hkReferencedObject*>(p); hkMemoryRouter::getInstance().heap().blockFree( p, (b->getMemorySizeAndFlags() == 0xffff) ? static_cast<int>(nbytes) : b->getMemorySizeAndFlags()); } else { if (p) hkMemoryRouter::getInstance().heap().blockFree(p, sizeof(hkpShapeRayCastCollectorOutput)); } } inline __attribute__((always_inline)) void* operator new(hk_size_t, void* p) { return p; } inline __attribute__((always_inline)) void* operator new[](hk_size_t, void* p) { return p; } inline __attribute__((always_inline)) void operator delete(void*, void*) {} inline __attribute__((always_inline)) void operator delete[](void*, void*) {}\n\n inline hkpShapeRayCastCollectorOutput();\n\n inline hkBool hasHit() const;\n\n inline void reset();\n\n hkVector4 m_normal;\n hkReal m_hitFraction;\n int m_extraInfo;\n int m_pad[2];\n};\n\ninline hkpShapeRayCastCollectorOutput::hkpShapeRayCastCollectorOutput() {\n reset();\n}\n\ninline hkBool hkpShapeRayCastCollectorOutput::hasHit() const {\n return m_hitFraction < 1.0f;\n}\n\ninline void hkpShapeRayCastCollectorOutput::reset() {\n m_hitFraction = 1.0f;\n m_extraInfo = -1;\n}\n# 4 \"/home/larsvi/botw/lib/hkStubs/./Havok/Physics2012/Collide/Shape/Query/hkpShapeRayCastOutput.h\" 2\n\n\n\nstruct hkpShapeRayCastOutput : public hkpShapeRayCastCollectorOutput {\n inline __attribute__((always_inline)) void* operator new(hk_size_t nbytes) { if constexpr (std::is_base_of_v<hkReferencedObject, hkpShapeRayCastOutput>) { return hkMemoryRouter::getInstance().heap().blockAlloc(static_cast<int>(nbytes)); } else { return hkMemoryRouter::getInstance().heap().blockAlloc(sizeof(hkpShapeRayCastOutput)); } } inline __attribute__((always_inline)) void operator delete(void* p, hk_size_t nbytes) { if constexpr (std::is_base_of_v<hkReferencedObject, hkpShapeRayCastOutput>) { auto* b = static_cast<hkReferencedObject*>(p); hkMemoryRouter::getInstance().heap().blockFree( p, (b->getMemorySizeAndFlags() == 0xffff) ? static_cast<int>(nbytes) : b->getMemorySizeAndFlags()); } else { if (p) hkMemoryRouter::getInstance().heap().blockFree(p, sizeof(hkpShapeRayCastOutput)); } } inline __attribute__((always_inline)) void* operator new(hk_size_t, void* p) { return p; } inline __attribute__((always_inline)) void* operator new[](hk_size_t, void* p) { return p; } inline __attribute__((always_inline)) void operator delete(void*, void*) {} inline __attribute__((always_inline)) void operator delete[](void*, void*) {}\n\n static constexpr int MAX_HIERARCHY_DEPTH = 8;\n\n inline __attribute__((always_inline)) hkpShapeRayCastOutput();\n\n inline __attribute__((always_inline)) void changeLevel(int delta);\n inline __attribute__((always_inline)) void setKey(hkpShapeKey key);\n inline __attribute__((always_inline)) int getLevel() const;\n\n inline __attribute__((always_inline)) void reset();\n\n hkpShapeKey m_shapeKeys[MAX_HIERARCHY_DEPTH];\n\nprivate:\n inline __attribute__((always_inline)) void _reset();\n\n int m_shapeKeyIndex;\n};\n\ninline hkpShapeRayCastOutput::hkpShapeRayCastOutput() {\n _reset();\n}\n\ninline void hkpShapeRayCastOutput::changeLevel(int delta) {\n m_shapeKeyIndex += delta;\n}\n\ninline void hkpShapeRayCastOutput::setKey(hkpShapeKey key) {\n m_shapeKeys[m_shapeKeyIndex] = key;\n}\n\ninline int hkpShapeRayCastOutput::getLevel() const {\n return m_shapeKeyIndex;\n}\n\ninline void hkpShapeRayCastOutput::reset() {\n hkpShapeRayCastCollectorOutput::reset();\n _reset();\n}\n\ninline void hkpShapeRayCastOutput::_reset() {\n m_shapeKeyIndex = 0;\n m_shapeKeys[0] = 0xffffffff;\n}\n# 4 \"/home/larsvi/botw/lib/hkStubs/./Havok/Physics2012/Collide/Query/CastUtil/hkpWorldRayCastOutput.h\" 2\n\nclass hkpCollidable;\n\nstruct hkpWorldRayCastOutput : public hkpShapeRayCastOutput {\n inline __attribute__((always_inline)) void* operator new(hk_size_t nbytes) { if constexpr (std::is_base_of_v<hkReferencedObject, hkpWorldRayCastOutput>) { return hkMemoryRouter::getInstance().heap().blockAlloc(static_cast<int>(nbytes)); } else { return hkMemoryRouter::getInstance().heap().blockAlloc(sizeof(hkpWorldRayCastOutput)); } } inline __attribute__((always_inline)) void operator delete(void* p, hk_size_t nbytes) { if constexpr (std::is_base_of_v<hkReferencedObject, hkpWorldRayCastOutput>) { auto* b = static_cast<hkReferencedObject*>(p); hkMemoryRouter::getInstance().heap().blockFree( p, (b->getMemorySizeAndFlags() == 0xffff) ? static_cast<int>(nbytes) : b->getMemorySizeAndFlags()); } else { if (p) hkMemoryRouter::getInstance().heap().blockFree(p, sizeof(hkpWorldRayCastOutput)); } } inline __attribute__((always_inline)) void* operator new(hk_size_t, void* p) { return p; } inline __attribute__((always_inline)) void* operator new[](hk_size_t, void* p) { return p; } inline __attribute__((always_inline)) void operator delete(void*, void*) {} inline __attribute__((always_inline)) void operator delete[](void*, void*) {}\n\n inline hkBool hasHit() const;\n\n inline hkBool operator<(const hkpWorldRayCastOutput& b) const;\n\n inline void reset();\n\n const hkpCollidable* m_rootCollidable = nullptr;\n};\n\ninline hkBool hkpWorldRayCastOutput::hasHit() const {\n return m_rootCollidable != nullptr;\n}\n\ninline hkBool hkpWorldRayCastOutput::operator<(const hkpWorldRayCastOutput& b) const {\n return m_hitFraction < b.m_hitFraction;\n}\n\ninline void hkpWorldRayCastOutput::reset() {\n m_rootCollidable = nullptr;\n hkpShapeRayCastOutput::reset();\n}\n# 7 \"/home/larsvi/botw/src/KingSystem/Physics/System/physRayCast.cpp\" 2\n# 1 \"/home/larsvi/botw/lib/hkStubs/./Havok/Physics2012/Collide/Query/hkpRayHitCollector.h\" 1\n\n\n\n\n\nclass hkpCdBody;\nstruct hkpShapeRayCastCollectorOutput;\n\nclass hkpRayHitCollector {\npublic:\n inline hkpRayHitCollector();\n\n virtual void addRayHit(const hkpCdBody& cdBody,\n const hkpShapeRayCastCollectorOutput& hitInfo) = 0;\n\n inline void reset();\n\n virtual ~hkpRayHitCollector() = default;\n\n static int shapeKeysFromCdBody(hkpShapeKey* buf, int maxKeys, const hkpCdBody& body);\n\n hkReal m_earlyOutHitFraction;\n};\n\ninline hkpRayHitCollector::hkpRayHitCollector() {\n reset();\n}\n\ninline void hkpRayHitCollector::reset() {\n m_earlyOutHitFraction = 1.f;\n}\n# 8 \"/home/larsvi/botw/src/KingSystem/Physics/System/physRayCast.cpp\" 2\n# 1 \"/home/larsvi/botw/lib/hkStubs/./Havok/Physics2012/Collide/Shape/Convex/Triangle/hkpTriangleShape.h\" 1\n\n\n# 1 \"/home/larsvi/botw/lib/hkStubs/./Havok/Physics2012/Collide/Shape/Convex/hkpConvexShape.h\" 1\n\n\n\n# 1 \"/home/larsvi/botw/lib/hkStubs/./Havok/Physics2012/Collide/Shape/HeightField/hkpSphereRepShape.h\" 1\n\n\n\n\n\nclass hkpSphereRepShape : public hkpShape {\npublic:\n inline __attribute__((always_inline)) void* operator new(hk_size_t nbytes) { if constexpr (std::is_base_of_v<hkReferencedObject, hkpSphereRepShape>) { return hkMemoryRouter::getInstance().heap().blockAlloc(static_cast<int>(nbytes)); } else { return hkMemoryRouter::getInstance().heap().blockAlloc(sizeof(hkpSphereRepShape)); } } inline __attribute__((always_inline)) void operator delete(void* p, hk_size_t nbytes) { if constexpr (std::is_base_of_v<hkReferencedObject, hkpSphereRepShape>) { auto* b = static_cast<hkReferencedObject*>(p); hkMemoryRouter::getInstance().heap().blockFree( p, (b->getMemorySizeAndFlags() == 0xffff) ? static_cast<int>(nbytes) : b->getMemorySizeAndFlags()); } else { if (p) hkMemoryRouter::getInstance().heap().blockFree(p, sizeof(hkpSphereRepShape)); } } inline __attribute__((always_inline)) void* operator new(hk_size_t, void* p) { return p; } inline __attribute__((always_inline)) void* operator new[](hk_size_t, void* p) { return p; } inline __attribute__((always_inline)) void operator delete(void*, void*) {} inline __attribute__((always_inline)) void operator delete[](void*, void*) {}\n enum { THIS_SHAPE_TYPE = (hkcdShapeType::SPHERE_REP) };\n\n inline __attribute__((always_inline)) hkpSphereRepShape() = default;\n explicit hkpSphereRepShape(ShapeType type) : hkpShape(type) {}\n explicit hkpSphereRepShape(hkFinishLoadedObjectFlag flag) : hkpShape(flag) {\n setType((hkcdShape::ShapeType) hkpSphereRepShape::THIS_SHAPE_TYPE);\n }\n};\n# 5 \"/home/larsvi/botw/lib/hkStubs/./Havok/Physics2012/Collide/Shape/Convex/hkpConvexShape.h\" 2\n\n# 1 \"/home/larsvi/botw/lib/hkStubs/./Havok/Physics2012/Collide/Shape/hkpShapeContainer.h\" 1\n\n\n\n\n# 1 \"/home/larsvi/botw/lib/hkStubs/./Havok/Physics2012/Collide/Shape/hkpShapeBuffer.h\" 1\n\n\nconstexpr int HK_SHAPE_BUFFER_SIZE = 512;\n\nstruct hkpShapeBufferStorage {\n alignas(16) char m_storage[HK_SHAPE_BUFFER_SIZE];\n\n template <typename T>\n operator T*() { // NOLINT(google-explicit-constructor)\n return reinterpret_cast<T*>(m_storage);\n }\n};\n\nusing hkpShapeBuffer = hkpShapeBufferStorage;\n# 6 \"/home/larsvi/botw/lib/hkStubs/./Havok/Physics2012/Collide/Shape/hkpShapeContainer.h\" 2\n\nclass hkpShapeContainer {\npublic:\n inline __attribute__((always_inline)) void* operator new(hk_size_t nbytes) { if constexpr (std::is_base_of_v<hkReferencedObject, hkpShapeContainer>) { return hkMemoryRouter::getInstance().heap().blockAlloc(static_cast<int>(nbytes)); } else { return hkMemoryRouter::getInstance().heap().blockAlloc(sizeof(hkpShapeContainer)); } } inline __attribute__((always_inline)) void operator delete(void* p, hk_size_t nbytes) { if constexpr (std::is_base_of_v<hkReferencedObject, hkpShapeContainer>) { auto* b = static_cast<hkReferencedObject*>(p); hkMemoryRouter::getInstance().heap().blockFree( p, (b->getMemorySizeAndFlags() == 0xffff) ? static_cast<int>(nbytes) : b->getMemorySizeAndFlags()); } else { if (p) hkMemoryRouter::getInstance().heap().blockFree(p, sizeof(hkpShapeContainer)); } } inline __attribute__((always_inline)) void* operator new(hk_size_t, void* p) { return p; } inline __attribute__((always_inline)) void* operator new[](hk_size_t, void* p) { return p; } inline __attribute__((always_inline)) void operator delete(void*, void*) {} inline __attribute__((always_inline)) void operator delete[](void*, void*) {}\n\n enum ReferencePolicy {\n REFERENCE_POLICY_IGNORE,\n REFERENCE_POLICY_INCREMENT,\n };\n\n virtual ~hkpShapeContainer() = default;\n\n virtual int getNumChildShapes() const;\n\n virtual hkpShapeKey getFirstKey() const = 0;\n virtual hkpShapeKey getNextKey(hkpShapeKey oldKey) const = 0;\n virtual hkUint32 getCollisionFilterInfo(hkpShapeKey key) const;\n virtual const hkpShape* getChildShape(hkpShapeKey key, hkpShapeBuffer& buffer) const = 0;\n virtual bool isWeldingEnabled() const { return true; }\n};\n\nclass hkpSingleShapeContainer : public hkpShapeContainer {\npublic:\n explicit hkpSingleShapeContainer(const hkpShape* s,\n ReferencePolicy ref = REFERENCE_POLICY_INCREMENT)\n : m_childShape(s) {\n if (ref == REFERENCE_POLICY_INCREMENT) {\n m_childShape->addReference();\n }\n }\n\n inline __attribute__((always_inline)) void* operator new(hk_size_t nbytes) { if constexpr (std::is_base_of_v<hkReferencedObject, hkpSingleShapeContainer>) { return hkMemoryRouter::getInstance().heap().blockAlloc(static_cast<int>(nbytes)); } else { return hkMemoryRouter::getInstance().heap().blockAlloc(sizeof(hkpSingleShapeContainer)); } } inline __attribute__((always_inline)) void operator delete(void* p, hk_size_t nbytes) { if constexpr (std::is_base_of_v<hkReferencedObject, hkpSingleShapeContainer>) { auto* b = static_cast<hkReferencedObject*>(p); hkMemoryRouter::getInstance().heap().blockFree( p, (b->getMemorySizeAndFlags() == 0xffff) ? static_cast<int>(nbytes) : b->getMemorySizeAndFlags()); } else { if (p) hkMemoryRouter::getInstance().heap().blockFree(p, sizeof(hkpSingleShapeContainer)); } } inline __attribute__((always_inline)) void* operator new(hk_size_t, void* p) { return p; } inline __attribute__((always_inline)) void* operator new[](hk_size_t, void* p) { return p; } inline __attribute__((always_inline)) void operator delete(void*, void*) {} inline __attribute__((always_inline)) void operator delete[](void*, void*) {}\n\n hkpSingleShapeContainer() {}\n explicit hkpSingleShapeContainer(hkFinishLoadedObjectFlag) {}\n\n ~hkpSingleShapeContainer() override {\n if (m_childShape) {\n m_childShape->removeReference();\n }\n }\n\n int getNumChildShapes() const override { return 1; }\n hkpShapeKey getFirstKey() const override { return 0; }\n hkpShapeKey getNextKey(hkpShapeKey oldKey) const override { return 0xffffffff; }\n const hkpShape* getChildShape(hkpShapeKey key, hkpShapeBuffer& buffer) const override;\n\n const hkpShape* getChild() const { return m_childShape; }\n const hkpShape* operator->() const { return m_childShape; }\n\nprotected:\n const hkpShape* m_childShape;\n};\n# 7 \"/home/larsvi/botw/lib/hkStubs/./Havok/Physics2012/Collide/Shape/Convex/hkpConvexShape.h\" 2\n\nextern hkReal hkConvexShapeDefaultRadius;\n\nclass hkpConvexShape : public hkpSphereRepShape {\npublic:\n inline __attribute__((always_inline)) void* operator new(hk_size_t nbytes) { if constexpr (std::is_base_of_v<hkReferencedObject, hkpConvexShape>) { return hkMemoryRouter::getInstance().heap().blockAlloc(static_cast<int>(nbytes)); } else { return hkMemoryRouter::getInstance().heap().blockAlloc(sizeof(hkpConvexShape)); } } inline __attribute__((always_inline)) void operator delete(void* p, hk_size_t nbytes) { if constexpr (std::is_base_of_v<hkReferencedObject, hkpConvexShape>) { auto* b = static_cast<hkReferencedObject*>(p); hkMemoryRouter::getInstance().heap().blockFree( p, (b->getMemorySizeAndFlags() == 0xffff) ? static_cast<int>(nbytes) : b->getMemorySizeAndFlags()); } else { if (p) hkMemoryRouter::getInstance().heap().blockFree(p, sizeof(hkpConvexShape)); } } inline __attribute__((always_inline)) void* operator new(hk_size_t, void* p) { return p; } inline __attribute__((always_inline)) void* operator new[](hk_size_t, void* p) { return p; } inline __attribute__((always_inline)) void operator delete(void*, void*) {} inline __attribute__((always_inline)) void operator delete[](void*, void*) {}\n enum { THIS_SHAPE_TYPE = (hkcdShapeType::CONVEX) };\n\n using VertexId = hkpVertexId;\n\n enum WeldResult {\n WELD_RESULT_REJECT_CONTACT_POINT,\n WELD_RESULT_ACCEPT_CONTACT_POINT_MODIFIED,\n WELD_RESULT_ACCEPT_CONTACT_POINT_UNMODIFIED\n };\n\n inline __attribute__((always_inline)) hkpConvexShape() = default;\n hkpConvexShape(hkFinishLoadedObjectFlag flag);\n\n void getCentre(hkVector4& centreOut) const override;\n int weldContactPoint(hkpVertexId* featurePoints, hkUint8& numFeaturePoints,\n hkVector4& contactPointWs, const hkTransform* thisObjTransform,\n
const hkpConvexShape* collidingShape,\n const hkTransform* collidingTransform,\n hkVector4& separatingNormalInOut) const override;\n void castRayWithCollector(const hkpShapeRayCastInput& input, const hkpCdBody& cdBody,\n hkpRayHitCollector& collector) const override;\n virtual void getFirstVertex(hkVector4& v) const = 0;\n bool isConvex() const override { return true; }\n hkReal getMaximumProjection(const hkVector4& direction) const override;\n virtual int getSize() const { return 0; }\n\n inline const hkReal& getRadius() const;\n inline void setRadius(hkReal radius);\n inline void setRadiusUnchecked(hkReal radius);\n\nprotected:\n inline hkpConvexShape(ShapeType type, hkReal radius) : hkpSphereRepShape(type) {\n m_radius = radius;\n }\n\n hkReal m_radius;\n};\n\nclass hkpConvexTransformShapeBase : public hkpConvexShape {\npublic:\n inline __attribute__((always_inline)) void* operator new(hk_size_t nbytes) { if constexpr (std::is_base_of_v<hkReferencedObject, hkpConvexTransformShapeBase>) { return hkMemoryRouter::getInstance().heap().blockAlloc(static_cast<int>(nbytes)); } else { return hkMemoryRouter::getInstance().heap().blockAlloc(sizeof(hkpConvexTransformShapeBase)); } } inline __attribute__((always_inline)) void operator delete(void* p, hk_size_t nbytes) { if constexpr (std::is_base_of_v<hkReferencedObject, hkpConvexTransformShapeBase>) { auto* b = static_cast<hkReferencedObject*>(p); hkMemoryRouter::getInstance().heap().blockFree( p, (b->getMemorySizeAndFlags() == 0xffff) ? static_cast<int>(nbytes) : b->getMemorySizeAndFlags()); } else { if (p) hkMemoryRouter::getInstance().heap().blockFree(p, sizeof(hkpConvexTransformShapeBase)); } } inline __attribute__((always_inline)) void* operator new(hk_size_t, void* p) { return p; } inline __attribute__((always_inline)) void* operator new[](hk_size_t, void* p) { return p; } inline __attribute__((always_inline)) void operator delete(void*, void*) {} inline __attribute__((always_inline)) void operator delete[](void*, void*) {}\n static const hkClass& staticClass();\n\npublic:\n hkpConvexTransformShapeBase() {}\n\n explicit hkpConvexTransformShapeBase(hkFinishLoadedObjectFlag flag)\n : hkpConvexShape(flag), m_childShape(flag) {}\n\nprotected:\n hkpConvexTransformShapeBase(ShapeType type, hkReal radius, const hkpConvexShape* childShape,\n hkpShapeContainer::ReferencePolicy ref);\n void getChildShapeFromPpu(int thisShapeSize) const;\n\n hkpSingleShapeContainer m_childShape;\n mutable int m_childShapeSizeForSpu;\n};\n\ninline const hkReal& hkpConvexShape::getRadius() const {\n return m_radius;\n}\n\ninline void hkpConvexShape::setRadius(hkReal radius) {\n setRadiusUnchecked(radius);\n}\n\ninline void hkpConvexShape::setRadiusUnchecked(hkReal radius) {\n m_radius = radius;\n}\n# 4 \"/home/larsvi/botw/lib/hkStubs/./Havok/Physics2012/Collide/Shape/Convex/Triangle/hkpTriangleShape.h\" 2\n# 1 \"/home/larsvi/botw/lib/hkStubs/./Havok/Physics2012/Collide/Util/Welding/hkpWeldingUtility.h\" 1\n\n\n\n\n// FIXME: incomplete\nclass hkpWeldingUtility {\npublic:\n inline __attribute__((always_inline)) void* operator new(hk_size_t nbytes) { if constexpr (std::is_base_of_v<hkReferencedObject, hkpWeldingUtility>) { return hkMemoryRouter::getInstance().heap().blockAlloc(static_cast<int>(nbytes)); } else { return hkMemoryRouter::getInstance().heap().blockAlloc(sizeof(hkpWeldingUtility)); } } inline __attribute__((always_inline)) void operator delete(void* p, hk_size_t nbytes) { if constexpr (std::is_base_of_v<hkReferencedObject, hkpWeldingUtility>) { auto* b = static_cast<hkReferencedObject*>(p); hkMemoryRouter::getInstance().heap().blockFree( p, (b->getMemorySizeAndFlags() == 0xffff) ? static_cast<int>(nbytes) : b->getMemorySizeAndFlags()); } else { if (p) hkMemoryRouter::getInstance().heap().blockFree(p, sizeof(hkpWeldingUtility)); } } inline __attribute__((always_inline)) void* operator new(hk_size_t, void* p) { return p; } inline __attribute__((always_inline)) void* operator new[](hk_size_t, void* p) { return p; } inline __attribute__((always_inline)) void operator delete(void*, void*) {} inline __attribute__((always_inline)) void operator delete[](void*, void*) {}\n\n enum WeldingType {\n WELDING_TYPE_ANTICLOCKWISE = 0,\n WELDING_TYPE_CLOCKWISE = 4,\n WELDING_TYPE_TWO_SIDED = 5,\n WELDING_TYPE_NONE = 6,\n };\n\n enum SectorType {\n ACCEPT_0 = 1,\n SNAP_0 = 0,\n REJECT = 2,\n SNAP_1 = 4,\n ACCEPT_1 = 3,\n };\n};\n# 5 \"/home/larsvi/botw/lib/hkStubs/./Havok/Physics2012/Collide/Shape/Convex/Triangle/hkpTriangleShape.h\" 2\n\nclass hkpTriangleShape : public hkpConvexShape {\npublic:\n inline __attribute__((always_inline)) void* operator new(hk_size_t nbytes) { if constexpr (std::is_base_of_v<hkReferencedObject, hkpTriangleShape>) { return hkMemoryRouter::getInstance().heap().blockAlloc(static_cast<int>(nbytes)); } else { return hkMemoryRouter::getInstance().heap().blockAlloc(sizeof(hkpTriangleShape)); } } inline __attribute__((always_inline)) void operator delete(void* p, hk_size_t nbytes) { if constexpr (std::is_base_of_v<hkReferencedObject, hkpTriangleShape>) { auto* b = static_cast<hkReferencedObject*>(p); hkMemoryRouter::getInstance().heap().blockFree( p, (b->getMemorySizeAndFlags() == 0xffff) ? static_cast<int>(nbytes) : b->getMemorySizeAndFlags()); } else { if (p) hkMemoryRouter::getInstance().heap().blockFree(p, sizeof(hkpTriangleShape)); } } inline __attribute__((always_inline)) void* operator new(hk_size_t, void* p) { return p; } inline __attribute__((always_inline)) void* operator new[](hk_size_t, void* p) { return p; } inline __attribute__((always_inline)) void operator delete(void*, void*) {} inline __attribute__((always_inline)) void operator delete[](void*, void*) {}\n static const hkClass& staticClass();\n enum { THIS_SHAPE_TYPE = (hkcdShapeType::TRIANGLE) };\n\npublic:\n explicit hkpTriangleShape(hkFinishLoadedObjectFlag flag);\n\n inline __attribute__((always_inline)) explicit hkpTriangleShape(\n hkReal radius = hkConvexShapeDefaultRadius, hkUint16 weldingInfo = 0,\n hkpWeldingUtility::WeldingType type = hkpWeldingUtility::WELDING_TYPE_NONE);\n\n inline __attribute__((always_inline)) hkpTriangleShape(const hkVector4& v0, const hkVector4& v1, const hkVector4& v2,\n hkReal radius = hkConvexShapeDefaultRadius);\n\n inline __attribute__((always_inline)) const hkVector4* getVertices() const;\n inline __attribute__((always_inline)) hkVector4& getVertex(int i);\n inline __attribute__((always_inline)) const hkVector4& getVertex(int i) const;\n template <int I>\n inline __attribute__((always_inline)) const hkVector4& getVertex() const;\n\n inline __attribute__((always_inline)) void setVertex(int i, const hkVector4& vertex);\n template <int I>\n inline __attribute__((always_inline)) void setVertex(hkVector4Parameter vertex);\n\n inline __attribute__((always_inline)) hkUint16 getWeldingInfo() const;\n inline __attribute__((always_inline)) void setWeldingInfo(hkUint16 info);\n inline __attribute__((always_inline)) hkpWeldingUtility::WeldingType getWeldingType() const;\n inline __attribute__((always_inline)) void setWeldingType(hkpWeldingUtility::WeldingType type);\n\n inline __attribute__((always_inline)) bool isExtruded() const;\n inline __attribute__((always_inline)) const hkVector4& getExtrusion() const;\n inline __attribute__((always_inline)) void setExtrusion(const hkVector4& extrusion);\n\n void getSupportingVertex(hkVector4Parameter direction,\n hkcdVertex& supportingVertexOut) const override;\n\n void convertVertexIdsToVertices(const hkpVertexId* ids, int numIds,\n hkcdVertex* verticesOut) const override;\n\n int weldContactPoint(hkpVertexId* featurePoints, hkUint8& numFeaturePoints,\n
hkVector4& contactPointWs, const hkTransform* thisObjTransform,\n const hkpConvexShape* collidingShape,\n const hkTransform* collidingTransform,\n
hkVector4& separatingNormalInOut) const override;\n\n void getCentre(hkVector4& centreOut) const override;\n\n inline __attribute__((always_inline)) int getNumCollisionSpheres() const override;\n\n const hkSphere* getCollisionSpheres(hkSphere* sphereBuffer) const override;\n\n void getAabb(const hkTransform& localToWorld, hkReal tolerance, hkAabb& out) const override;\n\n hkBool castRay(const hkpShapeRayCastInput& input,\n hkpShapeRayCastOutput& results) const override;\n\n hkVector4Comparison castRayBundle(const hkpShapeRayBundleCastInput& input,\n
hkpShapeRayBundleCastOutput& results,\n hkVector4ComparisonParameter mask) const override;\n\n void getFirstVertex(hkVector4& v) const override;\n\nprotected:\n hkUint16 m_weldingInfo;\n hkEnum<hkpWeldingUtility::WeldingType, hkUint8> m_weldingType;\n hkUint8 m_isExtruded;\n\n hkVector4 m_vertexA;\n hkVector4 m_vertexB;\n hkVector4 m_vertexC;\n\n hkVector4 m_extrusion;\n};\n\ninline hkpTriangleShape::hkpTriangleShape(hkReal radius, hkUint16 weldingInfo,\n hkpWeldingUtility::WeldingType type)\n : hkpConvexShape((hkcdShape::ShapeType) hkpTriangleShape::THIS_SHAPE_TYPE, radius) {\n setWeldingInfo(weldingInfo);\n setWeldingType(type);\n m_extrusion.setZero();\n m_isExtruded = 0;\n}\n\ninline hkpTriangleShape::hkpTriangleShape(const hkVector4& v0, const hkVector4& v1,\n const hkVector4& v2, hkReal radius)\n : hkpConvexShape((hkcdShape::ShapeType) hkpTriangleShape::THIS_SHAPE_TYPE, radius) {\n m_vertexA = v0;\n m_vertexB = v1;\n m_vertexC = v2;\n\n setWeldingInfo(0);\n setWeldingType(hkpWeldingUtility::WELDING_TYPE_NONE);\n m_extrusion.setZero();\n m_isExtruded = 0;\n}\n\ninline const hkVector4* hkpTriangleShape::getVertices() const {\n return &m_vertexA;\n}\n\ninline hkVector4& hkpTriangleShape::getVertex(int i) {\n return (&m_vertexA)[i];\n}\n\ninline const hkVector4& hkpTriangleShape::getVertex(int i) const {\n return (&m_vertexA)[i];\n}\n\ntemplate <int I>\ninline const hkVector4& hkpTriangleShape::getVertex() const {\n return (&m_vertexA)[I];\n}\n\ninline void hkpTriangleShape::setVertex(int i, const hkVector4& vertex) {\n getVertex(i) = vertex;\n}\n\ntemplate <int I>\ninline void hkpTriangleShape::setVertex(const hkVector4f& vertex) {\n (&m_vertexA)[I] = vertex;\n}\n\ninline hkUint16 hkpTriangleShape::getWeldingInfo() const {\n return m_weldingInfo;\n}\n\ninline void hkpTriangleShape::setWeldingInfo(hkUint16 info) {\n m_weldingInfo = info;\n}\n\ninline hkpWeldingUtility::WeldingType hkpTriangleShape::getWeldingType() const {\n return m_weldingType;\n}\n\ninline void hkpTriangleShape::setWeldingType(hkpWeldingUtility::WeldingType type) {\n m_weldingType = type;\n}\n\ninline bool hkpTriangleShape::isExtruded() const {\n return m_isExtruded;\n}\n\ninline const hkVector4& hkpTriangleShape::getExtrusion() const {\n return m_extrusion;\n}\n\ninline void hkpTriangleShape::setExtrusion(const hkVector4& extrusion) {\n m_extrusion = extrusion;\n}\n\ninline int hkpTriangleShape::getNumCollisionSpheres() const {\n return 3 + 3 * m_isExtruded;\n}\n# 9 \"/home/larsvi/botw/src/KingSystem/Physics/System/physRayCast.cpp\" 2\n# 1 \"/home/larsvi/botw/lib/hkStubs/./Havok/Physics2012/Collide/Shape/Query/hkpShapeRayCastInput.h\" 1\n\n\n\n\nclass hkpCollidable;\nclass hkpRayShapeCollectionFilter;\n\nstruct hkpShapeRayCastInput {\n inline __attribute__((always_inline)) void* operator new(hk_size_t nbytes) { if constexpr (std::is_base_of_v<hkReferencedObject, hkpShapeRayCastInput>) { return hkMemoryRouter::getInstance().heap().blockAlloc(static_cast<int>(nbytes)); } else { return hkMemoryRouter::getInstance().heap().blockAlloc(sizeof(hkpShapeRayCastInput)); } } inline __attribute__((always_inline)) void operator delete(void* p, hk_size_t nbytes) { if constexpr (std::is_base_of_v<hkReferencedObject, hkpShapeRayCastInput>) { auto* b = static_cast<hkReferencedObject*>(p); hkMemoryRouter::getInstance().heap().blockFree( p, (b->getMemorySizeAndFlags() == 0xffff) ? static_cast<int>(nbytes) : b->getMemorySizeAndFlags()); } else { if (p) hkMemoryRouter::getInstance().heap().blockFree(p, sizeof(hkpShapeRayCastInput)); } } inline __attribute__((always_inline)) void* operator new(hk_size_t, void* p) { return p; } inline __attribute__((always_inline)) void* operator new[](hk_size_t, void* p) { return p; } inline __attribute__((always_inline)) void operator delete(void*, void*) {} inline __attribute__((always_inline)) void operator delete[](void*, void*) {}\n\n hkVector4 m_from;\n hkVector4 m_to;\n hkUint32 m_filterInfo = 0;\n const hkpRayShapeCollectionFilter* m_rayShapeCollectionFilter = nullptr;\n const hkpCollidable* m_collidable = nullptr;\n hkUlong m_userData = 0;\n};\n# 10 \"/home/larsvi/botw/src/KingSystem/Physics/System/physRayCast.cpp\" 2\n# 1 \"/home/larsvi/botw/lib/hkStubs/./Havok/Physics2012/Dynamics/Entity/hkpRigidBody.h\" 1\n\n\n# 1 \"/home/larsvi/botw/lib/hkStubs/./Havok/Physics2012/Dynamics/Entity/hkpEntity.h\" 1\n\n\n\n# 1 \"/home/larsvi/botw/lib/hkStubs/./Havok/Physics2012/Dynamics/Common/hkpMaterial.h\" 1\n\n\n\n\n\nclass hkpMaterial {\npublic:\n inline __attribute__((always_inline)) void* operator new(hk_size_t nbytes) { if constexpr (std::is_base_of_v<hkReferencedObject, hkpMaterial>) { return hkMemoryRouter::getInstance().heap().blockAlloc(static_cast<int>(nbytes)); } else { return hkMemoryRouter::getInstance().heap().blockAlloc(sizeof(hkpMaterial)); } } inline __attribute__((always_inline)) void operator delete(void* p, hk_size_t nbytes) { if constexpr (std::is_base_of_v<hkReferencedObject, hkpMaterial>) { auto* b = static_cast<hkReferencedObject*>(p); hkMemoryRouter::getInstance().heap().blockFree( p, (b->getMemorySizeAndFlags() == 0xffff) ? static_cast<int>(nbytes) : b->getMemorySizeAndFlags()); } else { if (p) hkMemoryRouter::getInstance().heap().blockFree(p, sizeof(hkpMaterial)); } } inline __attribute__((always_inline)) void* operator new(hk_size_t, void* p) { return p; } inline __attribute__((always_inline)) void* operator new[](hk_size_t, void* p) { return p; } inline __attribute__((always_inline)) void operator delete(void*, void*) {} inline __attribute__((always_inline)) void operator delete[](void*, void*) {}\n static const hkClass& staticClass();\n\n enum ResponseType {\n RESPONSE_INVALID,\n RESPONSE_SIMPLE_CONTACT,\n RESPONSE_REPORTING,\n RESPONSE_NONE,\n RESPONSE_MAX_ID\n };\n\n inline hkpMaterial();\n explicit hkpMaterial(hkFinishLoadedObjectFlag flag) {}\n\n inline hkReal getFriction() const;\n inline void setFriction(hkReal newFriction);\n static inline hkReal getCombinedFriction(hkReal frictionA, hkReal frictionB);\n\n inline hkReal getRestitution() const;\n inline void setRestitution(hkReal newRestitution);\n static inline hkReal getCombinedRestitution(hkReal restitutionA, hkReal restitutionB);\n\n inline hkReal getRollingFrictionMultiplier() const;\n inline void setRollingFrictionMultiplier(hkReal newRollingFrictionMultiplier);\n static inline hkReal getCombinedRollingFrictionMultiplier(hkReal multiplierA,\n hkReal multiplierB);\n\n inline enum hkpMaterial::ResponseType getResponseType() const;\n inline void setResponseType(enum hkpMaterial::ResponseType t);\n\nprivate:\n hkEnum<ResponseType, hkInt8> m_responseType;\n hkHalf m_rollingFrictionMultiplier;\n hkReal m_friction;\n hkReal m_restitution;\n};\n\ninline hkpMaterial::hkpMaterial() : m_friction(0.5), m_restitution(0.4) {\n m_rollingFrictionMultiplier.setZero();\n}\n\ninline hkReal hkpMaterial::getFriction() const {\n return m_friction;\n}\n\ninline void hkpMaterial::setFriction(hkReal newFriction) {\n m_friction = newFriction;\n}\n\ninline hkReal hkpMaterial::getCombinedFriction(hkReal frictionA, hkReal frictionB) {\n return std::sqrt(frictionA * frictionB);\n}\n\ninline hkReal hkpMaterial::getRestitution() const {\n return m_restitution;\n}\n\ninline void hkpMaterial::setRestitution(hkReal newRestitution) {\n m_restitution = newRestitution;\n}\n\ninline hkReal hkpMaterial::getCombinedRestitution(hkReal restitutionA, hkReal restitutionB) {\n return std::sqrt(restitutionA * restitutionB);\n}\n\ninline hkReal hkpMaterial::getRollingFrictionMultiplier() const {\n return m_rollingFrictionMultiplier;\n}\n\ninline void hkpMaterial::setRollingFrictionMultiplier(hkReal newRollingFrictionMultiplier) {\n m_rollingFrictionMultiplier = newRollingFrictionMultiplier;\n}\n\ninline hkReal hkpMaterial::getCombinedRollingFrictionMultiplier(hkReal multiplierA,\n
hkReal multiplierB) {\n return std::sqrt(multiplierA * multiplierB);\n}\n\ninline hkpMaterial::ResponseType hkpMaterial::getResponseType() const {\n return m_responseType;\n}\n\ninline void hkpMaterial::setResponseType(hkpMaterial::ResponseType t) {\n m_responseType = t;\n}\n# 5 \"/home/larsvi/botw/lib/hkStubs/./Havok/Physics2012/Dynamics/Entity/hkpEntity.h\" 2\n# 1 \"/home/larsvi/botw/lib/hkStubs/./Havok/Physics2012/Dynamics/Motion/Rigid/hkpKeyframedRigidMotion.h\" 1\n\n\n\n# 1 \"/home/larsvi/botw/lib/hkStubs/./Havok/Physics2012/Dynamics/Motion/hkpMotion.h\" 1\n\n\n# 1 \"/home/larsvi/botw/lib/hkStubs/./Havok/Common/Base/Types/Physics/MotionState/hkMotionState.h\" 1\n\n\n# 1 \"/home/larsvi/botw/lib/hkStubs/./Havok/Common/Base/Math/SweptTransform/hkSweptTransform.h\" 1\n\n\n# 1 \"/home/larsvi/botw/lib/hkStubs/./Havok/Common/Base/Math/SweptTransform/hkSweptTransformf.h\" 1\n\n\n\n\nclass hkSweptTransformf {\npublic:\n hkSweptTransformf() {}\n\n inline __attribute__((always_inline)) hkTime getBaseTime() const;\n inline __attribute__((always_inline)) hkSimdFloat32 getBaseTimeSr() const;\n\n inline __attribute__((always_inline)) hkFloat32 getInvDeltaTime() const;\n inline __attribute__((always_inline)) hkSimdFloat32 getInvDeltaTimeSr() const;\n\n hkVector4f m_centerOfMass0;\n hkVector4f m_centerOfMass1;\n hkQuaternionf m_rotation0;\n hkQuaternionf m_rotation1;\n hkVector4f m_centerOfMassLocal;\n};\n\ninline hkTime hkSweptTransformf::getBaseTime() const {\n return static_cast<hkTime>(m_centerOfMass0(3));\n}\n\ninline hkSimdFloat32 hkSweptTransformf::getBaseTimeSr() const {\n return m_centerOfMass0.getComponent<3>();\n}\n\ninline hkFloat32 hkSweptTransformf::getInvDeltaTime() const {\n return m_centerOfMass1(3);\n}\n\ninline hkSimdFloat32 hkSweptTransformf::getInvDeltaTimeSr() const {\n return m_centerOfMass1.getComponent<3>();\n}\n# 4 \"/home/larsvi/botw/lib/hkStubs/./Havok/Common/Base/Math/SweptTransform/hkSweptTransform.h\" 2\n\nusing hkSweptTransform = hkSweptTransformf;\n# 4 \"/home/larsvi/botw/lib/hkStubs/./Havok/Common/Base/Types/Physics/MotionState/hkMotionState.h\" 2\n\n\nclass hkMotionState {\npublic:\n inline __attribute__((always_inline)) void* operator new(hk_size_t nbytes) { if constexpr (std::is_base_of_v<hkReferencedObject, hkMotionState>) { return hkMemoryRouter::getInstance().heap().blockAlloc(static_cast<int>(nbytes)); } else { return hkMemoryRouter::getInstance().heap().blockAlloc(sizeof(hkMotionState)); } } inline __attribute__((always_inline)) void operator delete(void* p, hk_size_t nbytes) { if constexpr (std::is_base_of_v<hkReferencedObject, hkMotionState>) { auto* b = static_cast<hkReferencedObject*>(p); hkMemoryRouter::getInstance().heap().blockFree( p, (b->getMemorySizeAndFlags() == 0xffff) ? static_cast<int>(nbytes) : b->getMemorySizeAndFlags()); } else { if (p) hkMemoryRouter::getInstance().heap().blockFree(p, sizeof(hkMotionState)); } } inline __attribute__((always_inline)) void* operator new(hk_size_t, void* p) { return p; } inline __attribute__((always_inline)) void* operator new[](hk_size_t, void* p) { return p; } inline __attribute__((always_inline)) void operator delete(void*, void*) {} inline __attribute__((always_inline)) void operator delete[](void*, void*) {}\n static const hkClass& staticClass();\n\n inline hkMotionState();\n\n void initMotionState(const hkVector4& position, const hkQuaternion& rotation);\n\n inline hkTransform& getTransform();\n inline const hkTransform& getTransform() const;\n\n inline hkSweptTransform& getSweptTransform();\n inline const hkSweptTransform& getSweptTransform() const;\n\nprotected:\n hkTransform m_transform;\n hkSweptTransform m_sweptTransform;\n\npublic:\n hkVector4 m_deltaAngle;\n hkReal m_objectRadius;\n hkHalf m_linearDamping;\n hkHalf m_angularDamping;\n hkHalf m_timeFactor;\n hkUFloat8 m_maxLinearVelocity;\n hkUFloat8 m_maxAngularVelocity;\n hkUint8 m_deactivationClass;\n};\n\ninline hkMotionState::hkMotionState() = default;\n\ninline hkTransform& hkMotionState::getTransform() {\n return m_transform;\n}\n\ninline const hkTransform& hkMotionState::getTransform() const {\n return m_transform;\n}\n\ninline hkSweptTransform& hkMotionState::getSweptTransform() {\n return m_sweptTransform;\n}\n\ninline const hkSweptTransform& hkMotionState::getSweptTransform() const {\n return m_sweptTransform;\n}\n# 4 \"/home/larsvi/botw/lib/hkStubs/./Havok/Physics2012/Dynamics/Motion/hkpMotion.h\" 2\n\n\nclass hkpMaxSizeMotion;\n\nclass hkpMotion : public hkReferencedObject {\npublic:\n inline __attribute__((always_inline)) void* operator new(hk_size_t nbytes) { if constexpr (std::is_base_of_v<hkReferencedObject, hkpMotion>) { return hkMemoryRouter::getInstance().heap().blockAlloc(static_cast<int>(nbytes)); } else { return hkMemoryRouter::getInstance().heap().blockAlloc(sizeof(hkpMotion)); } } inline __attribute__((always_inline)) void operator delete(void* p, hk_size_t nbytes) { if constexpr (std::is_base_of_v<hkReferencedObject, hkpMotion>) { auto* b = static_cast<hkReferencedObject*>(p); hkMemoryRouter::getInstance().heap().blockFree( p, (b->getMemorySizeAndFlags() == 0xffff) ? static_cast<int>(nbytes) : b->getMemorySizeAndFlags()); } else { if (p) hkMemoryRouter::getInstance().heap().blockFree(p, sizeof(hkpMotion)); } } inline __attribute__((always_inline)) void* operator new(hk_size_t, void* p) { return p; } inline __attribute__((always_inline)) void* operator new[](hk_size_t, void* p) { return p; } inline __attribute__((always_inline)) void operator delete(void*, void*) {} inline __attribute__((always_inline)) void operator delete[](void*, void*) {}\n static const hkClass& staticClass();\n\n enum MotionType {\n MOTION_INVALID,\n MOTION_DYNAMIC,\n MOTION_SPHERE_INERTIA,\n MOTION_BOX_INERTIA,\n MOTION_KEYFRAMED,\n MOTION_FIXED,\n MOTION_THIN_BOX_INERTIA,\n MOTION_CHARACTER,\n MOTION_MAX_ID\n };\n\n enum { NUM_INACTIVE_FRAMES_TO_DEACTIVATE = 5 };\n\n hkpMotion();\n hkpMotion(const hkVector4& position, const hkQuaternion& rotation,\n bool wantDeactivation = false);\n explicit hkpMotion(hkFinishLoadedObjectFlag flag) : hkReferencedObject(flag) {\n if (flag.m_finishing) {\n m_gravityFactor.setOne();\n }\n }\n\n inline MotionType getType() const { return m_type; }\n\n hkReal getMass() const;\n virtual void setMass(hkReal m);\n virtual void setMass(hkSimdRealParameter m);\n\n inline hkSimdReal getMassInv() const;\n virtual void setMassInv(hkReal mInv);\n virtual void setMassInv(hkSimdRealParameter mInv);\n\n virtual void getInertiaLocal(hkMatrix3& inertiaOut) const = 0;\n virtual void getInertiaWorld(hkMatrix3& inertiaOut) const = 0;\n virtual void setInertiaLocal(const hkMatrix3& inertia) = 0;\n virtual void setInertiaInvLocal(const hkMatrix3& inertiaInv) = 0;\n virtual void getInertiaInvLocal(hkMatrix3& inertiaInvOut) const = 0;\n virtual void getInertiaInvWorld(hkMatrix3& inertiaInvOut) const = 0;\n virtual void setCenterOfMassInLocal(const hkVector4& centerOfMass);\n inline const hkVector4& getCenterOfMassLocal() const;\n inline const hkVector4& getCenterOfMassInWorld() const;\n\n inline hkMotionState* getMotionState();\n inline const hkMotionState* getMotionState() const;\n\n inline const hkVector4& getPosition() const;\n virtual void setPosition(const hkVector4& position);\n\n inline const hkQuaternion& getRotation() const;\n virtual void setRotation(const hkQuaternion& rotation);\n\n virtual void setPositionAndRotation(const hkVector4& position, const hkQuaternion& rotation);\n\n inline const hkTransform& getTransform() const;\n virtual void setTransform(const hkTransform& transform);\n void approxTransformAt(hkTime time, hkTransform& transformOut);\n\n inline const hkVector4& getLinearVelocity() const;\n virtual void setLinearVelocity(const hkVector4& newVel);\n inline const hkVector4& getAngularVelocity() const;\n virtual void setAngularVelocity(const hkVector4& newVel);\n inline void getPointVelocity(const hkVector4& p, hkVector4& vecOut) const;\n virtual void getProjectedPointVelocity(const hkVector4& p, const hkVector4& normal,\n hkReal& velOut, hkReal& invVirtMassOut) const = 0;\n virtual void getProjectedPointVelocitySimd(const hkVector4& p, const hkVector4& normal,\n hkSimdReal& velOut,\n hkSimdReal& invVirtMassOut) const = 0;\n\n virtual void applyLinearImpulse(const hkVector4& imp);\n virtual void applyPointImpulse(const hkVector4& imp, const hkVector4& p) = 0;\n virtual void applyAngularImpulse(const hkVector4& imp) = 0;\n\n virtual void applyForce(hkReal deltaTime, const hkVector4& force) = 0;\n virtual void applyForce(hkReal deltaTime, const hkVector4& force, const hkVector4& p) = 0;\n virtual void applyTorque(hkReal deltaTime, const hkVector4& torque) = 0;\n\n inline hkReal getLinearDamping() const;\n inline void setLinearDamping(hkReal d);\n inline hkReal getAngularDamping() const;\n inline void setAngularDamping(hkReal d);\n inline hkReal getTimeFactor() const;\n inline void setTimeFactor(hkReal f);\n\n inline hkReal getGravityFactor() const;\n inline void setGravityFactor(hkReal gravityFactor);\n\n inline int getDeactivationClass() const;\n void setDeactivationClass(int deactivationClass);\n inline void enableDeactivation(bool value, int randomNumber = 0, int worldFlag0 = 0,\n int worldFlag1 = 0, int worldDeactivationIntegrateCounter = 0);\n inline bool isDeactivationEnabled() const;\n void requestDeactivation();\n\n virtual void getMotionStateAndVelocitiesAndDeactivationType(hkpMotion* motionOut);\n inline int getNumInactiveFrames(int select) const;\n inline int getNumInactiveFramesMt(int select,\n int worldDeactivationNumInactiveFramesSelectFlag) const;\n inline void setWorldSelectFlagsNeg(int worldFlag0, int worldFlag1,\n int worldDeactivationIntegrateCounter);\n inline void incrementNumInactiveFramesMt(int select,\n int worldDeactivationNumInactiveFramesSelectFlag);\n inline void zeroNumInactiveFramesMt(int select,\n int worldDeactivationNumInactiveFramesSelectFlag);\n\nprivate:\n void init(const hkVector4& position, const hkQuaternion& rotation,\n bool wantDeactivation = false);\n\npublic:\n hkEnum<MotionType, hkUint8> m_type;\n hkUint8 m_deactivationIntegrateCounter;\n hkUint16 m_deactivationNumInactiveFrames[2];\n hkMotionState m_motionState;\n hkVector4 m_inertiaAndMassInv;\n hkVector4 m_linearVelocity;\n hkVector4 m_angularVelocity;\n hkVector4 m_deactivationRefPosition[2];\n hkUint32 m_deactivationRefOrientation[2];\n hkpMaxSizeMotion* m_savedMotion;\n hkUint16 m_savedQualityTypeIndex;\n hkHalf m_gravityFactor;\n};\nclass hkpRigidMotion : public hkpMotion {\npublic:\n inline __attribute__((always_inline)) void* operator new(hk_size_t nbytes) { if constexpr (std::is_base_of_v<hkReferencedObject, hkpRigidMotion>) { return hkMemoryRouter::getInstance().heap().blockAlloc(static_cast<int>(nbytes)); } else { return hkMemoryRouter::getInstance().heap().blockAlloc(sizeof(hkpRigidMotion)); } } inline __attribute__((always_inline)) void operator delete(void* p, hk_size_t nbytes) { if constexpr (std::is_base_of_v<hkReferencedObject, hkpRigidMotion>) { auto* b = static_cast<hkReferencedObject*>(p); hkMemoryRouter::getInstance().heap().blockFree( p, (b->getMemorySizeAndFlags() == 0xffff) ? static_cast<int>(nbytes) : b->getMemorySizeAndFlags()); } else { if (p) hkMemoryRouter::getInstance().heap().blockFree(p, sizeof(hkpRigidMotion)); } } inline __attribute__((always_inline)) void* operator new(hk_size_t, void* p) { return p; } inline __attribute__((always_inline)) void* operator new[](hk_size_t, void* p) { return p; } inline __attribute__((always_inline)) void operator delete(void*, void*) {} inline __attribute__((always_inline)) void operator delete[](void*, void*) {}\n\n explicit hkpRigidMotion(hkFinishLoadedObjectFlag flag) : hkpMotion(flag) {}\n};\n\ninline hkSimdReal hkpMotion::getMassInv() const {\n return m_inertiaAndMassInv.getW();\n}\n\ninline const hkVector4& hkpMotion::getCenterOfMassLocal() const {\n return m_motionState.getSweptTransform().m_centerOfMassLocal;\n}\n\ninline const hkVector4& hkpMotion::getCenterOfMassInWorld() const {\n return m_motionState.getSweptTransform().m_centerOfMass1;\n}\n\ninline hkMotionState* hkpMotion::getMotionState() {\n return &m_motionState;\n}\n\ninline const hkMotionState* hkpMotion::getMotionState() const {\n return &m_motionState;\n}\n\ninline const hkVector4& hkpMotion::getPosition() const {\n return getTransform().getTranslation();\n}\n\ninline const hkQuaternion& hkpMotion::getRotation() const {\n return m_motionState.getSweptTransform().m_rotation1;\n}\n\ninline const hkTransform& hkpMotion::getTransform() const {\n return m_motionState.getTransform();\n}\n\ninline const hkVector4& hkpMotion::getLinearVelocity() const {\n return m_linearVelocity;\n}\n\ninline const hkVector4& hkpMotion::getAngularVelocity() const {\n return m_angularVelocity;\n}\n\ninline void hkpMotion::getPointVelocity(const hkVector4& p, hkVector4& vecOut) const {\n hkVector4 relPos;\n relPos.setSub(p, getCenterOfMassInWorld());\n vecOut.setCross(m_angularVelocity, relPos);\n vecOut.add(m_linearVelocity);\n}\n\ninline hkReal hkpMotion::getLinearDamping() const {\n return m_motionState.m_linearDamping;\n}\n\ninline void hkpMotion::setLinearDamping(hkReal d) {\n m_motionState.m_linearDamping.set<true>(d);\n}\n\ninline hkReal hkpMotion::getAngularDamping() const {\n return m_motionState.m_angularDamping;\n}\n\ninline void hkpMotion::setAngularDamping(hkReal d) {\n m_motionState.m_angularDamping.set<true>(d);\n}\n\ninline hkReal hkpMotion::getTimeFactor() const {\n return m_motionState.m_timeFactor;\n}\n\ninline void hkpMotion::setTimeFactor(hkReal f) {\n m_motionState.m_timeFactor.set<true>(f);\n}\n\ninline hkReal hkpMotion::getGravityFactor() const {\n return m_gravityFactor;\n}\n\ninline void hkpMotion::setGravityFactor(hkReal gravityFactor) {\n m_gravityFactor.set<true>(gravityFactor);\n}\n\ninline int hkpMotion::getDeactivationClass() const {\n return m_motionState.m_deactivationClass;\n}\n\ninline void hkpMotion::enableDeactivation(bool value, int randomNumber, int worldFlag0,\n int worldFlag1, int worldDeactivationIntegrateCounter) {\n if (value) {\n m_deactivationIntegrateCounter = hkUint8(0xf & randomNumber);\n setWorldSelectFlagsNeg(worldFlag0, worldFlag1, worldDeactivationIntegrateCounter);\n } else {\n m_deactivationIntegrateCounter = 0xff;\n for (auto& frame : m_deactivationNumInactiveFrames)\n frame = 0;\n }\n}\n\ninline bool hkpMotion::isDeactivationEnabled() const {\n return m_deactivationIntegrateCounter != 0xff;\n}\n\ninline int hkpMotion::getNumInactiveFrames(int select) const {\n return m_deactivationNumInactiveFrames[select] & 0x7f;\n}\n\ninline int\nhkpMotion::getNumInactiveFramesMt(int select,\n
int worldDeactivationNumInactiveFramesSelectFlag) const {\n int dc = m_deactivationNumInactiveFrames[select];\n int motionDeactivationFlag = dc >> 14;\n if (worldDeactivationNumInactiveFramesSelectFlag != motionDeactivationFlag)\n return dc & 0x7f;\n return (dc >> 7) & 0x7f;\n}\n\ninline void hkpMotion::setWorldSelectFlagsNeg(int worldFlag0, int worldFlag1,\n
int worldDeactivationIntegrateCounter) {\n if (static_cast<unsigned int>(worldDeactivationIntegrateCounter) % 4 <\n static_cast<unsigned int>(m_deactivationIntegrateCounter) % 4) {\n worldFlag0 = ~worldFlag0 << 14;\n } else {\n worldFlag0 <<= 14;\n }\n\n if (worldDeactivationIntegrateCounter < m_deactivationIntegrateCounter) {\n worldFlag1 = ~worldFlag1 << 14;\n } else {\n worldFlag1 <<= 14;\n }\n\n m_deactivationNumInactiveFrames[0] =\n hkUint16((m_deactivationNumInactiveFrames[0] & 0x3fff) | worldFlag0);\n m_deactivationNumInactiveFrames[1] =\n hkUint16((m_deactivationNumInactiveFrames[1] & 0x3fff) | worldFlag1);\n}\n\ninline void\nhkpMotion::incrementNumInactiveFramesMt(int select,\n int worldDeactivationNumInactiveFramesSelectFlag) {\n int dc = m_deactivationNumInactiveFrames[select] & 0x7f;\n int newdc = dc + 1 - (dc >> 6);\n dc = newdc | (dc << 7) | (worldDeactivationNumInactiveFramesSelectFlag << 14);\n m_deactivationNumInactiveFrames[select] = hkUint16(dc);\n}\n\ninline void hkpMotion::zeroNumInactiveFramesMt(int select,\n int worldDeactivationNumInactiveFramesSelectFlag) {\n int dc = m_deactivationNumInactiveFrames[select] & 0x7f;\n dc = (dc << 7) | (worldDeactivationNumInactiveFramesSelectFlag << 14);\n m_deactivationNumInactiveFrames[select] = hkUint16(dc);\n}\n# 5 \"/home/larsvi/botw/lib/hkStubs/./Havok/Physics2012/Dynamics/Motion/Rigid/hkpKeyframedRigidMotion.h\" 2\n\nclass hkpKeyframedRigidMotion : public hkpMotion {\npublic:\n inline __attribute__((always_inline)) void* operator new(hk_size_t nbytes) { if constexpr (std::is_base_of_v<hkReferencedObject, hkpKeyframedRigidMotion>) { return hkMemoryRouter::getInstance().heap().blockAlloc(static_cast<int>(nbytes)); } else { return hkMemoryRouter::getInstance().heap().blockAlloc(sizeof(hkpKeyframedRigidMotion)); } } inline __attribute__((always_inline)) void operator delete(void* p, hk_size_t nbytes) { if constexpr (std::is_base_of_v<hkReferencedObject, hkpKeyframedRigidMotion>) { auto* b = static_cast<hkReferencedObject*>(p); hkMemoryRouter::getInstance().heap().blockFree( p, (b->getMemorySizeAndFlags() == 0xffff) ? static_cast<int>(nbytes) : b->getMemorySizeAndFlags()); } else { if (p) hkMemoryRouter::getInstance().heap().blockFree(p, sizeof(hkpKeyframedRigidMotion)); } } inline __attribute__((always_inline)) void* operator new(hk_size_t, void* p) { return p; } inline __attribute__((always_inline)) void* operator new[](hk_size_t, void* p) { return p; } inline __attribute__((always_inline)) void operator delete(void*, void*) {} inline __attribute__((always_inline)) void operator delete[](void*, void*) {}\n static const hkClass& staticClass();\n\n hkpKeyframedRigidMotion(const hkVector4& position, const hkQuaternion& rotation);\n explicit hkpKeyframedRigidMotion(hkFinishLoadedObjectFlag flag) : hkpMotion(flag) {}\n ~hkpKeyframedRigidMotion() override;\n\n void setMass(hkReal m) override;\n void setMass(hkSimdRealParameter m) override;\n\n void setMassInv(hkReal mInv) override;\n void setMassInv(hkSimdRealParameter mInv) override;\n\n void getInertiaLocal(hkMatrix3& inertia) const override;\n void setInertiaLocal(const hkMatrix3& inertia) override;\n void getInertiaWorld(hkMatrix3& inertiaOut) const override;\n void setInertiaInvLocal(const hkMatrix3& inertiaInv) override;\n void getInertiaInvLocal(hkMatrix3& inertiaInv) const override;\n void getInertiaInvWorld(hkMatrix3& inertiaInvOut) const override;\n\n void getProjectedPointVelocity(const hkVector4& p, const hkVector4& normal, hkReal& velOut,\n hkReal& invVirtMassOut) const override;\n void getProjectedPointVelocitySimd(const hkVector4& p, const hkVector4& normal,\n
hkSimdReal& velOut,\n hkSimdReal& invVirtMassOut) const override;\n\n void applyLinearImpulse(const hkVector4& imp) override;\n void applyPointImpulse(const hkVector4& imp, const hkVector4& p) override;\n void applyAngularImpulse(const hkVector4& imp) override;\n\n void applyForce(const hkReal deltaTime, const hkVector4& force) override;\n void applyForce(const hkReal deltaTime, const hkVector4& force, const hkVector4& p) override;\n void applyTorque(const hkReal deltaTime, const hkVector4& torque) override;\n\n virtual void setStepPosition(hkReal position, hkReal timestep);\n virtual void setStoredMotion(hkpMaxSizeMotion* savedMotion);\n\nprotected:\n hkpKeyframedRigidMotion() : hkpMotion() { m_savedMotion = nullptr; }\n};\n\nclass hkpMaxSizeMotion : public hkpKeyframedRigidMotion {\npublic:\n inline __attribute__((always_inline)) void* operator new(hk_size_t nbytes) { if constexpr (std::is_base_of_v<hkReferencedObject, hkpMaxSizeMotion>) { return hkMemoryRouter::getInstance().heap().blockAlloc(static_cast<int>(nbytes)); } else { return hkMemoryRouter::getInstance().heap().blockAlloc(sizeof(hkpMaxSizeMotion)); } } inline __attribute__((always_inline)) void operator delete(void* p, hk_size_t nbytes) { if constexpr (std::is_base_of_v<hkReferencedObject, hkpMaxSizeMotion>) { auto* b = static_cast<hkReferencedObject*>(p); hkMemoryRouter::getInstance().heap().blockFree( p, (b->getMemorySizeAndFlags() == 0xffff) ? static_cast<int>(nbytes) : b->getMemorySizeAndFlags()); } else { if (p) hkMemoryRouter::getInstance().heap().blockFree(p, sizeof(hkpMaxSizeMotion)); } } inline __attribute__((always_inline)) void* operator new(hk_size_t, void* p) { return p; } inline __attribute__((always_inline)) void* operator new[](hk_size_t, void* p) { return p; } inline __attribute__((always_inline)) void operator delete(void*, void*) {} inline __attribute__((always_inline)) void operator delete[](void*, void*) {}\n static const hkClass& staticClass();\n\n hkpMaxSizeMotion() : hkpKeyframedRigidMotion() {}\n explicit hkpMaxSizeMotion(hkFinishLoadedObjectFlag flag) : hkpKeyframedRigidMotion(flag) {}\n\n hkpMaxSizeMotion(const hkpMaxSizeMotion&) = delete;\n auto operator=(const hkpMaxSizeMotion&) = delete;\n};\n# 6 \"/home/larsvi/botw/lib/hkStubs/./Havok/Physics2012/Dynamics/Entity/hkpEntity.h\" 2\n# 1 \"/home/larsvi/botw/lib/hkStubs/./Havok/Physics2012/Dynamics/World/hkpWorldObject.h\" 1\n\n\n# 1 \"/home/larsvi/botw/lib/hkStubs/./Havok/Common/Base/DebugUtil/MultiThreadCheck/hkMultiThreadCheck.h\" 1\n\n\n# 1 \"/home/larsvi/botw/lib/hkStubs/./Havok/Common/Base/System/StackTracer/hkStackTracer.h\" 1\n\n\nclass hkStackTracer {\npublic:\n class CallTree;\n\n hkStackTracer();\n virtual ~hkStackTracer();\n};\n# 4 \"/home/larsvi/botw/lib/hkStubs/./Havok/Common/Base/DebugUtil/MultiThreadCheck/hkMultiThreadCheck.h\" 2\n\n\nclass hkCriticalSection;\n\nclass hkMultiThreadCheck {\npublic:\n inline __attribute__((always_inline)) void* operator new(hk_size_t nbytes) { if constexpr (std::is_base_of_v<hkReferencedObject, hkMultiThreadCheck>) { return hkMemoryRouter::getInstance().heap().blockAlloc(static_cast<int>(nbytes)); } else { return hkMemoryRouter::getInstance().heap().blockAlloc(sizeof(hkMultiThreadCheck)); } } inline __attribute__((always_inline)) void operator delete(void* p, hk_size_t nbytes) { if constexpr (std::is_base_of_v<hkReferencedObject, hkMultiThreadCheck>) { auto* b = static_cast<hkReferencedObject*>(p); hkMemoryRouter::getInstance().heap().blockFree( p, (b->getMemorySizeAndFlags() == 0xffff) ? static_cast<int>(nbytes) : b->getMemorySizeAndFlags()); } else { if (p) hkMemoryRouter::getInstance().heap().blockFree(p, sizeof(hkMultiThreadCheck)); } } inline __attribute__((always_inline)) void* operator new(hk_size_t, void* p) { return p; } inline __attribute__((always_inline)) void* operator new[](hk_size_t, void* p) { return p; } inline __attribute__((always_inline)) void operator delete(void*, void*) {} inline __attribute__((always_inline)) void operator delete[](void*, void*) {}\n static const hkClass& staticClass();\n\n enum AccessType {\n HK_ACCESS_IGNORE = 0,\n HK_ACCESS_RO = 1,\n HK_ACCESS_RW = 2,\n };\n\n enum ReadMode {\n THIS_OBJECT_ONLY,\n RECURSIVE,\n };\n\n enum : hkUint32 {\n MARKED_RO = 0xffffffe1, // and all children\n MARKED_RO_SELF_ONLY = 0xffffffc1,\n UNMARKED = 0xfffffff1\n };\n\n inline __attribute__((always_inline)) hkMultiThreadCheck();\n\n inline __attribute__((always_inline)) void init();\n\n inline __attribute__((always_inline)) void markForRead(ReadMode mode = RECURSIVE) {}\n inline __attribute__((always_inline)) void markForWrite() {}\n inline __attribute__((always_inline)) bool isMarkedForWrite() { return true; }\n inline __attribute__((always_inline)) bool isMarkedForReadRecursive() { return true; }\n inline __attribute__((always_inline)) void unmarkForRead() {}\n inline __attribute__((always_inline)) void unmarkForWrite() {}\n\n hkUint32 m_threadId;\n static hkStackTracer s_stackTracer;\n static hkStackTracer::CallTree* s_stackTree;\n int m_stackTraceId;\n hkUint16 m_markCount;\n static hkCriticalSection* m_criticalSection;\n static void globalCriticalSectionLock();\n static void globalCriticalSectionUnlock();\n\nprotected:\n hkUint16 m_markBitStack;\n};\n\ninline hkMultiThreadCheck::hkMultiThreadCheck() : m_threadId(UNMARKED), m_markCount(0x8000) {}\n\ninline void hkMultiThreadCheck::init() {\n m_threadId = UNMARKED;\n m_markCount = 0x8000;\n}\n# 4 \"/home/larsvi/botw/lib/hkStubs/./Havok/Physics2012/Dynamics/World/hkpWorldObject.h\" 2\n\n# 1 \"/home/larsvi/botw/lib/hkStubs/./Havok/Physics2012/Collide/Agent3/Machine/Nn/hkpLinkedCollidable.h\" 1\n\n\n\n\n\nstruct hkpAgentNnEntry;\n\nclass hkpLinkedCollidable : public hkpCollidable {\npublic:\n inline __attribute__((always_inline)) void* operator new(hk_size_t nbytes) { if constexpr (std::is_base_of_v<hkReferencedObject, hkpLinkedCollidable>) { return hkMemoryRouter::getInstance().heap().blockAlloc(static_cast<int>(nbytes)); } else { return hkMemoryRouter::getInstance().heap().blockAlloc(sizeof(hkpLinkedCollidable)); } } inline __attribute__((always_inline)) void operator delete(void* p, hk_size_t nbytes) { if constexpr (std::is_base_of_v<hkReferencedObject, hkpLinkedCollidable>) { auto* b = static_cast<hkReferencedObject*>(p); hkMemoryRouter::getInstance().heap().blockFree( p, (b->getMemorySizeAndFlags() == 0xffff) ? static_cast<int>(nbytes) : b->getMemorySizeAndFlags()); } else { if (p) hkMemoryRouter::getInstance().heap().blockFree(p, sizeof(hkpLinkedCollidable)); } } inline __attribute__((always_inline)) void* operator new(hk_size_t, void* p) { return p; } inline __attribute__((always_inline)) void* operator new[](hk_size_t, void* p) { return p; } inline __attribute__((always_inline)) void operator delete(void*, void*) {} inline __attribute__((always_inline)) void operator delete[](void*, void*) {}\n static const hkClass& staticClass();\n\n struct CollisionEntry {\n inline __attribute__((always_inline)) void* operator new(hk_size_t nbytes) { if constexpr (std::is_base_of_v<hkReferencedObject, CollisionEntry>) { return hkMemoryRouter::getInstance().heap().blockAlloc(static_cast<int>(nbytes)); } else { return hkMemoryRouter::getInstance().heap().blockAlloc(sizeof(CollisionEntry)); } } inline __attribute__((always_inline)) void operator delete(void* p, hk_size_t nbytes) { if constexpr (std::is_base_of_v<hkReferencedObject, CollisionEntry>) { auto* b = static_cast<hkReferencedObject*>(p); hkMemoryRouter::getInstance().heap().blockFree( p, (b->getMemorySizeAndFlags() == 0xffff) ? static_cast<int>(nbytes) : b->getMemorySizeAndFlags()); } else { if (p) hkMemoryRouter::getInstance().heap().blockFree(p, sizeof(CollisionEntry)); } } inline __attribute__((always_inline)) void* operator new(hk_size_t, void* p) { return p; } inline __attribute__((always_inline)) void* operator new[](hk_size_t, void* p) { return p; } inline __attribute__((always_inline)) void operator delete(void*, void*) {} inline __attribute__((always_inline)) void operator delete[](void*, void*) {}\n\n hkpAgentNnEntry* m_agentEntry;\n hkpLinkedCollidable* m_partner;\n };\n\n inline hkpLinkedCollidable(const hkpShape* shape, const hkMotionState* ms, int type = 0);\n explicit hkpLinkedCollidable(hkFinishLoadedObjectFlag flag) : hkpCollidable(flag) {}\n inline ~hkpLinkedCollidable();\n\n void getCollisionEntriesSorted(hkArray<CollisionEntry>& entries) const;\n\n hkArray<CollisionEntry>& getCollisionEntriesDeterministicUnchecked();\n const hkArray<CollisionEntry>& getCollisionEntriesDeterministicUnchecked() const;\n\n hkArray<CollisionEntry>& getCollisionEntriesNonDeterministic();\n const hkArray<CollisionEntry>& getCollisionEntriesNonDeterministic() const;\n\n void sortEntries();\n\nprotected:\n hkArray<CollisionEntry> m_collisionEntries;\n};\n\ninline hkpLinkedCollidable::hkpLinkedCollidable(const hkpShape* shape, const hkMotionState* ms,\n int type)\n : hkpCollidable(shape, ms, type) {}\n\ninline hkpLinkedCollidable::~hkpLinkedCollidable() = default;\n\ninline hkArray<hkpLinkedCollidable::CollisionEntry>&\nhkpLinkedCollidable::getCollisionEntriesNonDeterministic() {\n return m_collisionEntries;\n}\n\ninline const hkArray<hkpLinkedCollidable::CollisionEntry>&\nhkpLinkedCollidable::getCollisionEntriesNonDeterministic() const {\n return m_collisionEntries;\n}\n# 6 \"/home/larsvi/botw/lib/hkStubs/./Havok/Physics2012/Dynamics/World/hkpWorldObject.h\" 2\n# 1 \"/home/larsvi/botw/lib/hkStubs/./Havok/Physics2012/Dynamics/Common/hkpProperty.h\" 1\n\n\n# 1 \"/home/larsvi/botw/lib/hkStubs/./Havok/Common/Base/Types/Properties/hkSimpleProperty.h\" 1\n\n\n\n\nstruct hkSimplePropertyValue {\n inline __attribute__((always_inline)) void* operator new(hk_size_t nbytes) { if constexpr (std::is_base_of_v<hkReferencedObject, hkSimplePropertyValue>) { return hkMemoryRouter::getInstance().heap().blockAlloc(static_cast<int>(nbytes)); } else { return hkMemoryRouter::getInstance().heap().blockAlloc(sizeof(hkSimplePropertyValue)); } } inline __attribute__((always_inline)) void operator delete(void* p, hk_size_t nbytes) { if constexpr (std::is_base_of_v<hkReferencedObject, hkSimplePropertyValue>) { auto* b = static_cast<hkReferencedObject*>(p); hkMemoryRouter::getInstance().heap().blockFree( p, (b->getMemorySizeAndFlags() == 0xffff) ? static_cast<int>(nbytes) : b->getMemorySizeAndFlags()); } else { if (p) hkMemoryRouter::getInstance().heap().blockFree(p, sizeof(hkSimplePropertyValue)); } } inline __attribute__((always_inline)) void* operator new(hk_size_t, void* p) { return p; } inline __attribute__((always_inline)) void* operator new[](hk_size_t, void* p) { return p; } inline __attribute__((always_inline)) void operator delete(void*, void*) {} inline __attribute__((always_inline)) void operator delete[](void*, void*) {}\n static const hkClass& staticClass();\n\n hkUint64 m_data;\n\n inline hkSimplePropertyValue() = default;\n inline hkSimplePropertyValue(int i); // NOLINT(google-explicit-constructor)\n inline hkSimplePropertyValue(hkUint32 i); // NOLINT(google-explicit-constructor)\n inline hkSimplePropertyValue(hkUint64 i); // NOLINT(google-explicit-constructor)\n inline hkSimplePropertyValue(hkReal r); // NOLINT(google-explicit-constructor)\n inline hkSimplePropertyValue(void* p); // NOLINT(google-explicit-constructor)\n\n inline void setInt(int i);\n inline void setUint64(hkUint64 i);\n inline void setReal(hkReal r);\n inline void setPtr(void* p);\n\n inline int getInt() const;\n inline hkUint64 getUint64() const;\n inline hkReal getReal() const;\n inline void* getPtr() const;\n};\n\nclass hkSimpleProperty {\npublic:\n inline __attribute__((always_inline)) void* operator new(hk_size_t nbytes) { if constexpr (std::is_base_of_v<hkReferencedObject, hkSimpleProperty>) { return hkMemoryRouter::getInstance().heap().blockAlloc(static_cast<int>(nbytes)); } else { return hkMemoryRouter::getInstance().heap().blockAlloc(sizeof(hkSimpleProperty)); } } inline __attribute__((always_inline)) void operator delete(void* p, hk_size_t nbytes) { if constexpr (std::is_base_of_v<hkReferencedObject, hkSimpleProperty>) { auto* b = static_cast<hkReferencedObject*>(p); hkMemoryRouter::getInstance().heap().blockFree( p, (b->getMemorySizeAndFlags() == 0xffff) ? static_cast<int>(nbytes) : b->getMemorySizeAndFlags()); } else { if (p) hkMemoryRouter::getInstance().heap().blockFree(p, sizeof(hkSimpleProperty)); } } inline __attribute__((always_inline)) void* operator new(hk_size_t, void* p) { return p; } inline __attribute__((always_inline)) void* operator new[](hk_size_t, void* p) { return p; } inline __attribute__((always_inline)) void operator delete(void*, void*) {} inline __attribute__((always_inline)) void operator delete[](void*, void*) {}\n static const hkClass& staticClass();\n\n inline hkSimpleProperty();\n inline hkSimpleProperty(hkUint32 key, hkSimplePropertyValue value);\n explicit hkSimpleProperty(hkFinishLoadedObjectFlag flag) {}\n\n static void mapStringToKey(const char* string, hkUint32& keyOut);\n\n hkUint32 m_key;\n hkUint32 m_alignmentPadding;\n hkSimplePropertyValue m_value;\n};\n\ninline void hkSimplePropertyValue::setInt(const int i) {\n m_data = i;\n}\n\ninline void hkSimplePropertyValue::setUint64(hkUint64 i) {\n m_data = i;\n}\n\ninline void hkSimplePropertyValue::setReal(const hkReal r) {\n union {\n hkReal r;\n\n\n\n hkUint32 u;\n\n } u;\n u.r = r;\n m_data = u.u;\n}\n\ninline void hkSimplePropertyValue::setPtr(void* p) {\n m_data = reinterpret_cast<hkUlong>(p);\n}\n\ninline hkSimplePropertyValue::hkSimplePropertyValue(const int i) {\n setInt(i);\n}\n\ninline hkSimplePropertyValue::hkSimplePropertyValue(const hkUint32 i) {\n setInt(static_cast<int>(i));\n}\n\ninline hkSimplePropertyValue::hkSimplePropertyValue(const hkUint64 i) {\n setUint64(i);\n}\n\ninline hkSimplePropertyValue::hkSimplePropertyValue(const hkReal r) {\n setReal(r);\n}\n\ninline hkSimplePropertyValue::hkSimplePropertyValue(void* p) {\n setPtr(p);\n}\n\ninline int hkSimplePropertyValue::getInt() const {\n return static_cast<int>(m_data);\n}\n\ninline hkUint64 hkSimplePropertyValue::getUint64() const {\n return m_data;\n}\n\ninline hkReal hkSimplePropertyValue::getReal() const {\n union {\n hkReal r;\n\n\n\n hkUint32 u;\n\n } u;\n u.u = m_data;\n return u.r;\n}\n\ninline void* hkSimplePropertyValue::getPtr() const {\n return reinterpret_cast<void*>(static_cast<hkUlong>(m_data));\n}\n\ninline hkSimpleProperty::hkSimpleProperty() = default;\n\ninline hkSimpleProperty::hkSimpleProperty(hkUint32 key, hkSimplePropertyValue value)\n : m_key(key), m_value(value) {}\n# 4 \"/home/larsvi/botw/lib/hkStubs/./Havok/Physics2012/Dynamics/Common/hkpProperty.h\" 2\n\nusing hkpPropertyValue = hkSimplePropertyValue;\nusing hkpProperty = hkSimpleProperty;\n# 7 \"/home/larsvi/botw/lib/hkStubs/./Havok/Physics2012/Dynamics/World/hkpWorldObject.h\" 2\n\nclass hkpShapeModifier;\nclass hkpWorld;\n\nnamespace hkWorldOperation {\nenum Result {\n POSTPONED,\n DONE,\n};\n} // namespace hkWorldOperation\n\nclass hkpWorldObject : public hkReferencedObject {\npublic:\n inline __attribute__((always_inline)) void* operator new(hk_size_t nbytes) { if constexpr (std::is_base_of_v<hkReferencedObject, hkpWorldObject>) { return hkMemoryRouter::getInstance().heap().blockAlloc(static_cast<int>(nbytes)); } else { return hkMemoryRouter::getInstance().heap().blockAlloc(sizeof(hkpWorldObject)); } } inline __attribute__((always_inline)) void operator delete(void* p, hk_size_t nbytes) { if constexpr (std::is_base_of_v<hkReferencedObject, hkpWorldObject>) { auto* b = static_cast<hkReferencedObject*>(p); hkMemoryRouter::getInstance().heap().blockFree( p, (b->getMemorySizeAndFlags() == 0xffff) ? static_cast<int>(nbytes) : b->getMemorySizeAndFlags()); } else { if (p) hkMemoryRouter::getInstance().heap().blockFree(p, sizeof(hkpWorldObject)); } } inline __attribute__((always_inline)) void* operator new(hk_size_t, void* p) { return p; } inline __attribute__((always_inline)) void* operator new[](hk_size_t, void* p) { return p; } inline __attribute__((always_inline)) void operator delete(void*, void*) {} inline __attribute__((always_inline)) void operator delete[](void*, void*) {}\n static const hkClass& staticClass();\n\n enum BroadPhaseType {\n BROAD_PHASE_INVALID,\n /// hkpEntity\n BROAD_PHASE_ENTITY,\n /// hkpPhantom\n BROAD_PHASE_PHANTOM,\n /// hkpBroadPhaseBorder's objects (AABB phantoms)\n BROAD_PHASE_BORDER,\n BROAD_PHASE_MAX_ID\n };\n\n enum MtChecks {\n MULTI_THREADING_CHECKS_ENABLE,\n MULTI_THREADING_CHECKS_IGNORE,\n };\n\n explicit hkpWorldObject(hkFinishLoadedObjectFlag flag);\n\n void addProperty(hkUint32 key, hkpPropertyValue value);\n hkpPropertyValue removeProperty(hkUint32 key);\n void setProperty(hkUint32 key, hkpPropertyValue value);\n void editProperty(hkUint32 key, hkpPropertyValue value,\n MtChecks mtCheck = MULTI_THREADING_CHECKS_ENABLE);\n inline hkpPropertyValue getProperty(hkUint32 key,\n MtChecks mtCheck = MULTI_THREADING_CHECKS_ENABLE) const;\n inline bool hasProperty(hkUint32 key, MtChecks mtCheck = MULTI_THREADING_CHECKS_ENABLE) const;\n void lockProperty(hkUint32 key);\n void unlockProperty(hkUint32 key);\n inline void clearAndDeallocateProperties();\n\n inline hkpCollidable* getCollidableRw();\n inline const hkpCollidable* getCollidable() const;\n inline hkpLinkedCollidable* getLinkedCollidable();\n inline const hkpLinkedCollidable* getLinkedCollidable() const;\n inline const hkpLinkedCollidable* getCollidableMtUnchecked() const;\n\n inline hkBool isAddedToWorld() const;\n inline hkpWorld* getWorld() const;\n\n inline hkUlong getUserData() const;\n inline void setUserData(hkUlong data);\n\n inline const char* getName() const;\n inline void setName(const char* name);\n\n virtual hkWorldOperation::Result setShape(const hkpShape* shape);\n virtual hkWorldOperation::Result updateShape(hkpShapeModifier* shapeModifier);\n\n inline hkMultiThreadCheck& getMultiThreadCheck();\n inline void markForRead();\n inline void markForWrite();\n void markForWriteImpl();\n inline void unmarkForRead();\n inline void unmarkForWrite();\n\n void checkReadWrite();\n void checkReadOnly() const;\n\n inline ~hkpWorldObject() override;\n\n virtual class hkMotionState* getMotionState() = 0;\n\n inline void copyProperties(const hkpWorldObject* otherObj);\n\nprotected:\n friend class hkpWorld;\n friend class hkpWorldOperationUtil;\n inline void setWorld(hkpWorld* world);\n\n hkpWorldObject(const hkpShape* shape, BroadPhaseType type);\n\n hkpWorld* m_world;\n hkUlong m_userData;\n hkpLinkedCollidable m_collidable;\n hkMultiThreadCheck m_multiThreadCheck;\n hkStringPtr m_name;\n\npublic:\n hkArray<hkpProperty> m_properties;\n};\n\ninline hkpWorldObject* hkpGetWorldObject(const hkpCollidable* collidable) {\n return reinterpret_cast<hkpWorldObject*>(const_cast<void*>(collidable->getOwner()));\n}\n\ninline hkpPropertyValue hkpWorldObject::getProperty(hkUint32 key, hkpWorldObject::MtChecks) const {\n for (int i = 0; i < m_properties.getSize(); ++i) {\n if (m_properties[i].m_key == key) {\n return m_properties[i].m_value;\n }\n }\n return 0;\n}\n\ninline bool hkpWorldObject::hasProperty(hkUint32 key, hkpWorldObject::MtChecks) const {\n for (int i = 0; i < m_properties.getSize(); ++i) {\n if (m_properties[i].m_key == key) {\n return true;\n }\n }\n return false;\n}\n\ninline void hkpWorldObject::clearAndDeallocateProperties() {\n m_properties.clearAndDeallocate();\n}\n\ninline hkpCollidable* hkpWorldObject::getCollidableRw() {\n return &m_collidable;\n}\n\ninline const hkpCollidable* hkpWorldObject::getCollidable() const {\n return &m_collidable;\n}\n\ninline hkpLinkedCollidable* hkpWorldObject::getLinkedCollidable() {\n return &m_collidable;\n}\n\ninline const hkpLinkedCollidable* hkpWorldObject::getLinkedCollidable() const {\n return &m_collidable;\n}\n\ninline const hkpLinkedCollidable* hkpWorldObject::getCollidableMtUnchecked() const {\n return &m_collidable;\n}\n\ninline hkBool hkpWorldObject::isAddedToWorld() const {\n return m_world != nullptr;\n}\n\ninline hkpWorld* hkpWorldObject::getWorld() const {\n return m_world;\n}\n\ninline hkUlong hkpWorldObject::getUserData() const {\n return m_userData;\n}\n\ninline void hkpWorldObject::setUserData(hkUlong data) {\n m_userData = data;\n}\n\ninline const char* hkpWorldObject::getName() const {\n return m_name;\n}\n\ninline void hkpWorldObject::setName(const char* name) {\n m_name = name;\n}\n\ninline hkMultiThreadCheck& hkpWorldObject::getMultiThreadCheck() {\n return m_multiThreadCheck;\n}\n\ninline void hkpWorldObject::markForRead() {\n getMultiThreadCheck().markForRead();\n}\n\ninline void hkpWorldObject::markForWrite() {\n getMultiThreadCheck().markForWrite();\n}\n\ninline void hkpWorldObject::unmarkForRead() {\n getMultiThreadCheck().unmarkForRead();\n}\n\ninline void hkpWorldObject::unmarkForWrite() {\n getMultiThreadCheck().unmarkForWrite();\n}\n\ninline hkpWorldObject::~hkpWorldObject() {\n if (m_collidable.getShape()) {\n m_collidable.getShape()->removeReference();\n }\n}\n\ninline void hkpWorldObject::copyProperties(const hkpWorldObject* otherObj) {\n m_properties = otherObj->m_properties;\n}\n\ninline void hkpWorldObject::setWorld(hkpWorld* world) {\n m_world = world;\n}\n# 7 \"/home/larsvi/botw/lib/hkStubs/./Havok/Physics2012/Dynamics/Entity/hkpEntity.h\" 2\n\nstruct hkConstraintInternal;\nclass hkLocalFrame;\nclass hkSpuCollisionCallbackUtil;\nclass hkpAction;\nclass hkpBreakableBody;\nclass hkpConstraintInstance;\nclass hkpContactListener;\nclass hkpDynamicsContactMgr;\nclass hkpEntityActivationListener;\nclass hkpEntityListener;\nclass hkpSimulationIsland;\n\nclass hkpEntity : public hkpWorldObject {\npublic:\n inline __attribute__((always_inline)) void* operator new(hk_size_t nbytes) { if constexpr (std::is_base_of_v<hkReferencedObject, hkpEntity>) { return hkMemoryRouter::getInstance().heap().blockAlloc(static_cast<int>(nbytes)); } else { return hkMemoryRouter::getInstance().heap().blockAlloc(sizeof(hkpEntity)); } } inline __attribute__((always_inline)) void operator delete(void* p, hk_size_t nbytes) { if constexpr (std::is_base_of_v<hkReferencedObject, hkpEntity>) { auto* b = static_cast<hkReferencedObject*>(p); hkMemoryRouter::getInstance().heap().blockFree( p, (b->getMemorySizeAndFlags() == 0xffff) ? static_cast<int>(nbytes) : b->getMemorySizeAndFlags()); } else { if (p) hkMemoryRouter::getInstance().heap().blockFree(p, sizeof(hkpEntity)); } } inline __attribute__((always_inline)) void* operator new(hk_size_t, void* p) { return p; } inline __attribute__((always_inline)) void* operator new[](hk_size_t, void* p) { return p; } inline __attribute__((always_inline)) void operator delete(void*, void*) {} inline __attribute__((always_inline)) void operator delete[](void*, void*) {}\n static const hkClass& staticClass();\n\n enum SpuCollisionCallbackEventFilter {\n SPU_SEND_NONE = 0x00,\n SPU_SEND_CONTACT_POINT_ADDED = 0x01,\n SPU_SEND_CONTACT_POINT_PROCESS = 0x02,\n SPU_SEND_CONTACT_POINT_REMOVED = 0x04,\n SPU_SEND_CONTACT_POINT_ADDED_OR_PROCESS =\n SPU_SEND_CONTACT_POINT_ADDED | SPU_SEND_CONTACT_POINT_PROCESS,\n };\n\n class SmallArraySerializeOverrideType {\n public:\n inline __attribute__((always_inline)) void* operator new(hk_size_t nbytes) { if constexpr (std::is_base_of_v<hkReferencedObject, SmallArraySerializeOverrideType>) { return hkMemoryRouter::getInstance().heap().blockAlloc(static_cast<int>(nbytes)); } else { return hkMemoryRouter::getInstance().heap().blockAlloc(sizeof(SmallArraySerializeOverrideType)); } } inline __attribute__((always_inline)) void operator delete(void* p, hk_size_t nbytes) { if constexpr (std::is_base_of_v<hkReferencedObject, SmallArraySerializeOverrideType>) { auto* b = static_cast<hkReferencedObject*>(p); hkMemoryRouter::getInstance().heap().blockFree( p, (b->getMemorySizeAndFlags() == 0xffff) ? static_cast<int>(nbytes) : b->getMemorySizeAndFlags()); } else { if (p) hkMemoryRouter::getInstance().heap().blockFree(p, sizeof(SmallArraySerializeOverrideType)); } } inline __attribute__((always_inline)) void* operator new(hk_size_t, void* p) { return p; } inline __attribute__((always_inline)) void* operator new[](hk_size_t, void* p) { return p; } inline __attribute__((always_inline)) void operator delete(void*, void*) {} inline __attribute__((always_inline)) void operator delete[](void*, void*) {}\n static const hkClass& staticClass();\n\n void* m_data;\n hkUint16 m_size;\n hkUint16 m_capacityAndFlags;\n };\n\n struct SpuCollisionCallback {\n inline __attribute__((always_inline)) void* operator new(hk_size_t nbytes) { if constexpr (std::is_base_of_v<hkReferencedObject, hkpEntity::SpuCollisionCallback>) { return hkMemoryRouter::getInstance().heap().blockAlloc(static_cast<int>(nbytes)); } else { return hkMemoryRouter::getInstance().heap().blockAlloc(sizeof(hkpEntity::SpuCollisionCallback)); } } inline __attribute__((always_inline)) void operator delete(void* p, hk_size_t nbytes) { if constexpr (std::is_base_of_v<hkReferencedObject, hkpEntity::SpuCollisionCallback>) { auto* b = static_cast<hkReferencedObject*>(p); hkMemoryRouter::getInstance().heap().blockFree( p, (b->getMemorySizeAndFlags() == 0xffff) ? static_cast<int>(nbytes) : b->getMemorySizeAndFlags()); } else { if (p) hkMemoryRouter::getInstance().heap().blockFree(p, sizeof(hkpEntity::SpuCollisionCallback)); } } inline __attribute__((always_inline)) void* operator new(hk_size_t, void* p) { return p; } inline __attribute__((always_inline)) void* operator new[](hk_size_t, void* p) { return p; } inline __attribute__((always_inline)) void operator delete(void*, void*) {} inline __attribute__((always_inline)) void operator delete[](void*, void*) {}\n static const hkClass& staticClass();\n\n SpuCollisionCallback()\n : m_util(nullptr), m_capacity(0),\n m_eventFilter(SPU_SEND_CONTACT_POINT_ADDED_OR_PROCESS), m_userFilter(0x01) {}\n // NOLINTNEXTLINE(cppcoreguidelines-pro-type-member-init)\n explicit SpuCollisionCallback(hkFinishLoadedObjectFlag flag) {}\n\n hkSpuCollisionCallbackUtil* m_util;\n hkUint16 m_capacity;\n hkUint8 m_eventFilter;\n hkUint8 m_userFilter;\n };\n\n struct ExtendedListeners {\n inline __attribute__((always_inline)) void* operator new(hk_size_t nbytes) { if constexpr (std::is_base_of_v<hkReferencedObject, ExtendedListeners>) { return hkMemoryRouter::getInstance().heap().blockAlloc(static_cast<int>(nbytes)); } else { return hkMemoryRouter::getInstance().heap().blockAlloc(sizeof(ExtendedListeners)); } } inline __attribute__((always_inline)) void operator delete(void* p, hk_size_t nbytes) { if constexpr (std::is_base_of_v<hkReferencedObject, ExtendedListeners>) { auto* b = static_cast<hkReferencedObject*>(p); hkMemoryRouter::getInstance().heap().blockFree( p, (b->getMemorySizeAndFlags() == 0xffff) ? static_cast<int>(nbytes) : b->getMemorySizeAndFlags()); } else { if (p) hkMemoryRouter::getInstance().heap().blockFree(p, sizeof(ExtendedListeners)); } } inline __attribute__((always_inline)) void* operator new(hk_size_t, void* p) { return p; } inline __attribute__((always_inline)) void* operator new[](hk_size_t, void* p) { return p; } inline __attribute__((always_inline)) void operator delete(void*, void*) {} inline __attribute__((always_inline)) void operator delete[](void*, void*) {}\n static const hkClass& staticClass();\n\n hkSmallArray<hkpEntityActivationListener*> m_activationListeners;\n hkSmallArray<hkpEntityListener*> m_entityListeners;\n };\n\n explicit hkpEntity(hkFinishLoadedObjectFlag flag);\n ~hkpEntity() override;\n\n void addEntityListener(hkpEntityListener* el);\n void removeEntityListener(hkpEntityListener* el);\n\n void addEntityActivationListener(hkpEntityActivationListener* el);\n void removeEntityActivationListener(hkpEntityActivationListener* el);\n\n void addContactListener(hkpContactListener* cl);\n void removeContactListener(hkpContactListener* cl);\n\n inline const hkSmallArray<hkpEntityListener*>& getEntityListeners() const;\n inline const hkSmallArray<hkpEntityActivationListener*>& getEntityActivationListeners() const;\n inline const hkSmallArray<hkpContactListener*>& getContactListeners() const;\n inline bool areContactListenersAdded() const;\n\n inline hkUint16 getContactPointCallbackDelay() const;\n inline void setContactPointCallbackDelay(hkUint16 delay);\n\n inline hkpMaterial& getMaterial();\n inline const hkpMaterial& getMaterial() const;\n\n inline hkBool isFixed() const;\n inline hkBool isFixedOrKeyframed() const;\n inline hkUint32 getUid() const;\n\n hkpDynamicsContactMgr* findContactMgrTo(const hkpEntity* entity) const;\n\n hkpBreakableBody* getBreakableBody() const;\n\n void activate();\n void requestDeactivation();\n void deactivate();\n void activateAsCriticalOperation();\n void requestDeactivationAsCriticalOperation();\n void deactivateAsCriticalOperation();\n hkBool isActive() const;\n\n inline int getNumActions() const;\n inline hkpAction* getAction(int i);\n\n int getNumConstraints() const;\n hkpConstraintInstance* getConstraint(int i);\n void getAllConstraints(hkArray<hkpConstraintInstance*>& constraints);\n const hkpConstraintInstance* getConstraint(int i) const;\n inline const hkSmallArray<struct hkConstraintInternal>& getConstraintMasters() const;\n inline hkSmallArray<struct hkConstraintInternal>& getConstraintMastersRw();\n inline const hkArray<class hkpConstraintInstance*>& getConstraintSlaves() const;\n\n void sortConstraintsSlavesDeterministically();\n\n void setCachedShapeData(const hkpWorld* world, const hkpShape* shape);\n\n void updateCachedAabb();\n\nprotected:\n const hkSmallArray<struct hkConstraintInternal>& getConstraintMastersImpl() const;\n hkSmallArray<struct hkConstraintInternal>& getConstraintMastersRwImpl();\n const hkArray<class hkpConstraintInstance*>& getConstraintSlavesImpl() const;\n\n explicit hkpEntity(const hkpShape* shape);\n\npublic:\n inline hkpMotion* getMotion();\n inline hkpSimulationIsland* getSimulationIsland() const;\n\n virtual void deallocateInternalArrays();\n hkMotionState* getMotionState() override { return nullptr; }\n\n hkpMaterial m_material;\n void* m_limitContactImpulseUtilAndFlag;\n hkReal m_damageMultiplier;\n hkpBreakableBody* m_breakableBody;\n hkUint32 m_solverData;\n hkObjectIndex m_storageIndex;\n hkUint16 m_contactPointCallbackDelay;\n hkSmallArray<hkConstraintInternal> m_constraintsMaster;\n hkArray<hkpConstraintInstance*> m_constraintsSlave;\n hkArray<hkUint8> m_constraintRuntime;\n hkpSimulationIsland* m_simulationIsland;\n hkInt8 m_autoRemoveLevel;\n hkUint8 m_numShapeKeysInContactPointProperties;\n hkUint8 m_responseModifierFlags;\n hkUint32 m_uid;\n SpuCollisionCallback m_spuCollisionCallback;\n hkpMaxSizeMotion m_motion;\n hkSmallArray<hkpContactListener*> m_contactListeners;\n hkSmallArray<hkpAction*> m_actions;\n hkRefPtr<hkLocalFrame> m_localFrame;\n mutable ExtendedListeners* m_extendedListeners;\n hkUint32 m_npData;\n};\n\ninline const hkSmallArray<hkpEntityListener*>& hkpEntity::getEntityListeners() const {\n if (!m_extendedListeners)\n m_extendedListeners = new ExtendedListeners;\n return m_extendedListeners->m_entityListeners;\n}\n\ninline const hkSmallArray<hkpEntityActivationListener*>&\nhkpEntity::getEntityActivationListeners() const {\n if (!m_extendedListeners)\n m_extendedListeners = new ExtendedListeners;\n return m_extendedListeners->m_activationListeners;\n}\n\ninline const hkSmallArray<hkpContactListener*>& hkpEntity::getContactListeners() const {\n return m_contactListeners;\n}\n\ninline bool hkpEntity::areContactListenersAdded() const {\n return m_contactListeners.getSize() > 0;\n}\n\ninline hkUint16 hkpEntity::getContactPointCallbackDelay() const {\n return m_contactPointCallbackDelay;\n}\n\ninline void hkpEntity::setContactPointCallbackDelay(hkUint16 delay) {\n m_contactPointCallbackDelay = delay;\n}\n\ninline hkpMaterial& hkpEntity::getMaterial() {\n return m_material;\n}\n\ninline const hkpMaterial& hkpEntity::getMaterial() const {\n return m_material;\n}\n\ninline hkBool hkpEntity::isFixed() const {\n return m_motion.getType() == hkpMotion::MOTION_FIXED;\n}\n\ninline hkBool hkpEntity::isFixedOrKeyframed() const {\n return isFixed() || m_motion.getType() == hkpMotion::MOTION_KEYFRAMED;\n}\n\ninline hkUint32 hkpEntity::getUid() const {\n return m_uid;\n}\n\ninline hkpBreakableBody* hkpEntity::getBreakableBody() const {\n return m_breakableBody;\n}\n\ninline const hkSmallArray<struct hkConstraintInternal>& hkpEntity::getConstraintMasters() const {\n return getConstraintMastersImpl();\n}\n\ninline hkSmallArray<struct hkConstraintInternal>& hkpEntity::getConstraintMastersRw() {\n return getConstraintMastersRwImpl();\n}\n\ninline const hkArray<class hkpConstraintInstance*>& hkpEntity::getConstraintSlaves() const {\n return getConstraintSlavesImpl();\n}\n\ninline hkpMotion* hkpEntity::getMotion() {\n return &m_motion;\n}\n\ninline hkpSimulationIsland* hkpEntity::getSimulationIsland() const {\n return m_simulationIsland;\n}\n\ninline hkpAction* hkpEntity::getAction(int i) {\n return m_actions[i];\n}\n\ninline int hkpEntity::getNumActions() const {\n return m_actions.getSize();\n}\n# 4 \"/home/larsvi/botw/lib/hkStubs/./Havok/Physics2012/Dynamics/Entity/hkpRigidBody.h\" 2\n# 1 \"/home/larsvi/botw/lib/hkStubs/./Havok/Physics2012/Dynamics/World/hkpWorld.h\" 1\n\n\n\n# 1 \"/home/larsvi/botw/lib/hkStubs/./Havok/Common/Base/Types/Physics/hkStepInfo.h\" 1\n\n\n\n\nclass hkStepInfo {\npublic:\n inline __attribute__((always_inline)) void* operator new(hk_size_t nbytes) { if constexpr (std::is_base_of_v<hkReferencedObject, hkStepInfo>) { return hkMemoryRouter::getInstance().heap().blockAlloc(static_cast<int>(nbytes)); } else { return hkMemoryRouter::getInstance().heap().blockAlloc(sizeof(hkStepInfo)); } } inline __attribute__((always_inline)) void operator delete(void* p, hk_size_t nbytes) { if constexpr (std::is_base_of_v<hkReferencedObject, hkStepInfo>) { auto* b = static_cast<hkReferencedObject*>(p); hkMemoryRouter::getInstance().heap().blockFree( p, (b->getMemorySizeAndFlags() == 0xffff) ? static_cast<int>(nbytes) : b->getMemorySizeAndFlags()); } else { if (p) hkMemoryRouter::getInstance().heap().blockFree(p, sizeof(hkStepInfo)); } } inline __attribute__((always_inline)) void* operator new(hk_size_t, void* p) { return p; } inline __attribute__((always_inline)) void* operator new[](hk_size_t, void* p) { return p; } inline __attribute__((always_inline)) void operator delete(void*, void*) {} inline __attribute__((always_inline)) void operator delete[](void*, void*) {}\n\n hkStepInfo() {}\n hkStepInfo(hkTime startTime, hkTime endTime) { set(startTime, endTime); }\n\n void set(hkTime startTime, hkTime endTime) {\n m_startTime = startTime;\n m_endTime = endTime;\n m_deltaTime = endTime - startTime;\n m_invDeltaTime = m_deltaTime == 0.0f ? 0.0f : 1.0f / m_deltaTime;\n }\n\npublic:\n alignas(16) hkTime m_startTime;\n hkTime m_endTime;\n hkReal m_deltaTime;\n hkReal m_invDeltaTime;\n};\n# 5 \"/home/larsvi/botw/lib/hkStubs/./Havok/Physics2012/Dynamics/World/hkpWorld.h\" 2\n\n# 1 \"/home/larsvi/botw/lib/hkStubs/./Havok/Physics/ConstraintSolver/Solve/hkpSolverInfo.h\" 1\n\n\n\n\nstruct hkpSolverInfo {\n inline __attribute__((always_inline)) void* operator new(hk_size_t nbytes) { if constexpr (std::is_base_of_v<hkReferencedObject, hkpSolverInfo>) { return hkMemoryRouter::getInstance().heap().blockAlloc(static_cast<int>(nbytes)); } else { return hkMemoryRouter::getInstance().heap().blockAlloc(sizeof(hkpSolverInfo)); } } inline __attribute__((always_inline)) void operator delete(void* p, hk_size_t nbytes) { if constexpr (std::is_base_of_v<hkReferencedObject, hkpSolverInfo>) { auto* b = static_cast<hkReferencedObject*>(p); hkMemoryRouter::getInstance().heap().blockFree( p, (b->getMemorySizeAndFlags() == 0xffff) ? static_cast<int>(nbytes) : b->getMemorySizeAndFlags()); } else { if (p) hkMemoryRouter::getInstance().heap().blockFree(p, sizeof(hkpSolverInfo)); } } inline __attribute__((always_inline)) void* operator new(hk_size_t, void* p) { return p; } inline __attribute__((always_inline)) void* operator new[](hk_size_t, void* p) { return p; } inline __attribute__((always_inline)) void operator delete(void*, void*) {} inline __attribute__((always_inline)) void operator delete[](void*, void*) {}\n\n enum DeactivationClass {\n DEACTIVATION_CLASS_INVALID,\n DEACTIVATION_CLASS_OFF,\n DEACTIVATION_CLASS_LOW,\n DEACTIVATION_CLASS_MEDIUM,\n DEACTIVATION_CLASS_HIGH,\n DEACTIVATION_CLASS_AGGRESSIVE,\n DEACTIVATION_CLASSES_END\n };\n\n struct DeactivationInfo {\n inline __attribute__((always_inline)) void* operator new(hk_size_t nbytes) { if constexpr (std::is_base_of_v<hkReferencedObject, DeactivationInfo>) { return hkMemoryRouter::getInstance().heap().blockAlloc(static_cast<int>(nbytes)); } else { return hkMemoryRouter::getInstance().heap().blockAlloc(sizeof(DeactivationInfo)); } } inline __attribute__((always_inline)) void operator delete(void* p, hk_size_t nbytes) { if constexpr (std::is_base_of_v<hkReferencedObject, DeactivationInfo>) { auto* b = static_cast<hkReferencedObject*>(p); hkMemoryRouter::getInstance().heap().blockFree( p, (b->getMemorySizeAndFlags() == 0xffff) ? static_cast<int>(nbytes) : b->getMemorySizeAndFlags()); } else { if (p) hkMemoryRouter::getInstance().heap().blockFree(p, sizeof(DeactivationInfo)); } } inline __attribute__((always_inline)) void* operator new(hk_size_t, void* p) { return p; } inline __attribute__((always_inline)) void* operator new[](hk_size_t, void* p) { return p; } inline __attribute__((always_inline)) void operator delete(void*, void*) {} inline __attribute__((always_inline)) void operator delete[](void*, void*) {}\n\n hkReal m_linearVelocityThresholdInv;\n hkReal m_angularVelocityThresholdInv;\n hkReal m_slowObjectVelocityMultiplier;\n hkReal m_relativeSleepVelocityThreshold;\n hkReal m_maxDistSqrd[2];\n hkReal m_maxRotSqrd[2];\n };\n\n alignas(16) hkReal m_padding;\n hkReal m_tau;\n hkReal m_damping;\n hkReal m_frictionTau;\n\n hkVector4 m_globalAccelerationPerSubStep;\n hkVector4 m_globalAccelerationPerStep;\n\n hkVector4 m_integrateVelocityFactor;\n hkVector4 m_invIntegrateVelocityFactor;\n\n hkReal m_dampDivTau;\n hkReal m_tauDivDamp;\n hkReal m_dampDivFrictionTau;\n hkReal m_frictionTauDivDamp;\n hkReal m_contactRestingVelocity;\n DeactivationInfo m_deactivationInfo[DEACTIVATION_CLASSES_END];\n\n hkReal m_deltaTime;\n hkReal m_invDeltaTime;\n int m_numSteps;\n int m_numMicroSteps;\n hkReal m_invNumMicroSteps;\n hkReal m_invNumSteps;\n\n hkBool m_forceCoherentConstraintOrderingInSolver;\n\n hkUint8 m_deactivationNumInactiveFramesSelectFlag[2];\n hkUint8 m_deactivationIntegrateCounter;\n\n hkReal m_maxConstraintViolationSqrd;\n};\n# 7 \"/home/larsvi/botw/lib/hkStubs/./Havok/Physics2012/Dynamics/World/hkpWorld.h\" 2\n# 1 \"/home/larsvi/botw/lib/hkStubs/./Havok/Physics2012/Dynamics/World/hkpWorldCinfo.h\" 1\n\n\n# 1 \"/home/larsvi/botw/lib/hkStubs/./Havok/Common/Base/Types/Geometry/Aabb/hkAabb.h\" 1\n\n\n\n\n/// Axis aligned bounding box\n// FIXME: incomplete\nclass hkAabb {\npublic:\n inline __attribute__((always_inline)) void* operator new(hk_size_t nbytes) { if constexpr (std::is_base_of_v<hkReferencedObject, hkAabb>) { return hkMemoryRouter::getInstance().heap().blockAlloc(static_cast<int>(nbytes)); } else { return hkMemoryRouter::getInstance().heap().blockAlloc(sizeof(hkAabb)); } } inline __attribute__((always_inline)) void operator delete(void* p, hk_size_t nbytes) { if constexpr (std::is_base_of_v<hkReferencedObject, hkAabb>) { auto* b = static_cast<hkReferencedObject*>(p); hkMemoryRouter::getInstance().heap().blockFree( p, (b->getMemorySizeAndFlags() == 0xffff) ? static_cast<int>(nbytes) : b->getMemorySizeAndFlags()); } else { if (p) hkMemoryRouter::getInstance().heap().blockFree(p, sizeof(hkAabb)); } } inline __attribute__((always_inline)) void* operator new(hk_size_t, void* p) { return p; } inline __attribute__((always_inline)) void* operator new[](hk_size_t, void* p) { return p; } inline __attribute__((always_inline)) void operator delete(void*, void*) {} inline __attribute__((always_inline)) void operator delete[](void*, void*) {}\n\n hkAabb() {}\n inline __attribute__((always_inline)) hkAabb(const hkVector4& min, const hkVector4& max) : m_min(min), m_max(max) {}\n\n inline __attribute__((always_inline)) void getExtents(hkVector4& e) const;\n inline __attribute__((always_inline)) void getCenter(hkVector4& center) const;\n\n hkVector4 m_min;\n hkVector4 m_max;\n};\n\ninline void hkAabb::getExtents(hkVector4& e) const {\n e.setSub(m_max, m_min);\n}\n\ninline void hkAabb::getCenter(hkVector4& center) const {\n hkVector4 s;\n s.setAdd(m_min, m_max);\n center.setMul(s, hkSimdReal::getConstant<HK_QUADREAL_INV_2>());\n}\n# 4 \"/home/larsvi/botw/lib/hkStubs/./Havok/Physics2012/Dynamics/World/hkpWorldCinfo.h\" 2\n\n# 1 \"/home/larsvi/botw/lib/hkStubs/./Havok/Physics2012/Collide/Filter/hkpCollisionFilter.h\" 1\n\n\n\n\n\n# 1 \"/home/larsvi/botw/lib/hkStubs/./Havok/Physics2012/Collide/Filter/hkpCollidableCollidableFilter.h\" 1\n\n\n\n\nclass hkpCollidable;\n\nclass hkpCollidableCollidableFilter {\npublic:\n virtual ~hkpCollidableCollidableFilter() = default;\n\n /// Whether the two objects can collide.\n virtual hkBool isCollisionEnabled(const hkpCollidable& a, const hkpCollidable& b) const = 0;\n};\n# 7 \"/home/larsvi/botw/lib/hkStubs/./Havok/Physics2012/Collide/Filter/hkpCollisionFilter.h\" 2\n# 1 \"/home/larsvi/botw/lib/hkStubs/./Havok/Physics2012/Collide/Filter/hkpRayCollidableFilter.h\" 1\n\n\n\n\nclass hkpCollidable;\nstruct hkpWorldRayCastInput;\n\nclass hkpRayCollidableFilter {\npublic:\n virtual ~hkpRayCollidableFilter() = default;\n\n virtual hkBool isCollisionEnabled(const hkpWorldRayCastInput& a,\n
const hkpCollidable& collidableB) const = 0;\n};\n# 8 \"/home/larsvi/botw/lib/hkStubs/./Havok/Physics2012/Collide/Filter/hkpCollisionFilter.h\" 2\n# 1 \"/home/larsvi/botw/lib/hkStubs/./Havok/Physics2012/Collide/Filter/hkpShapeCollectionFilter.h\" 1\n\n\n\n\n\nclass hkAabb;\nclass hkpBvTreeShape;\nclass hkpCdBody;\nstruct hkpCollisionInput;\nclass hkpShapeContainer;\n\nclass hkpShapeCollectionFilter {\npublic:\n virtual hkBool isCollisionEnabled(const hkpCollisionInput& input, const hkpCdBody& bodyA,\n const hkpCdBody& collectionBodyB,\n
const hkpShapeContainer& containerShapeB,\n hkpShapeKey keyB) const = 0;\n\n virtual hkBool isCollisionEnabled(const hkpCollisionInput& input,\n
const hkpCdBody& collectionBodyA,\n const hkpCdBody& collectionBodyB,\n const hkpShapeContainer& containerShapeA,\n const hkpShapeContainer& containerShapeB, hkpShapeKey keyA,\n hkpShapeKey keyB) const = 0;\n\n virtual int numShapeKeyHitsLimitBreached(const hkpCollisionInput& input, const hkpCdBody& bodyA,\n const hkpCdBody& bodyB,\n const hkpBvTreeShape* bvTreeShapeB, hkAabb& aabb,\n hkpShapeKey* shapeKeysInOut,\n int shapeKeysCapacity) const = 0;\n\n virtual ~hkpShapeCollectionFilter() = default;\n};\n# 9 \"/home/larsvi/botw/lib/hkStubs/./Havok/Physics2012/Collide/Filter/hkpCollisionFilter.h\" 2\n# 1 \"/home/larsvi/botw/lib/hkStubs/./Havok/Physics2012/Collide/Shape/Query/hkpRayShapeCollectionFilter.h\" 1\n\n\n\n\n\nclass hkpShapeContainer;\nstruct hkpShapeRayCastInput;\n\nclass hkpRayShapeCollectionFilter {\npublic:\n virtual hkBool isCollisionEnabled(const hkpShapeRayCastInput& aInput,\n const hkpShapeContainer& bContainer,\n hkpShapeKey bKey) const = 0;\n\n virtual ~hkpRayShapeCollectionFilter() = default;\n};\n# 10 \"/home/larsvi/botw/lib/hkStubs/./Havok/Physics2012/Collide/Filter/hkpCollisionFilter.h\" 2\n\nclass hkpWorld;\n\nclass hkpCollisionFilter : public hkReferencedObject,\n public hkpCollidableCollidableFilter,\n public hkpShapeCollectionFilter,\n public hkpRayShapeCollectionFilter,\n public hkpRayCollidableFilter {\npublic:\n inline __attribute__((always_inline)) void* operator new(hk_size_t nbytes) { if constexpr (std::is_base_of_v<hkReferencedObject, hkpCollisionFilter>) { return hkMemoryRouter::getInstance().heap().blockAlloc(static_cast<int>(nbytes)); } else { return hkMemoryRouter::getInstance().heap().blockAlloc(sizeof(hkpCollisionFilter)); } } inline __attribute__((always_inline)) void operator delete(void* p, hk_size_t nbytes) { if constexpr (std::is_base_of_v<hkReferencedObject, hkpCollisionFilter>) { auto* b = static_cast<hkReferencedObject*>(p); hkMemoryRouter::getInstance().heap().blockFree( p, (b->getMemorySizeAndFlags() == 0xffff) ? static_cast<int>(nbytes) : b->getMemorySizeAndFlags()); } else { if (p) hkMemoryRouter::getInstance().heap().blockFree(p, sizeof(hkpCollisionFilter)); } } inline __attribute__((always_inline)) void* operator new(hk_size_t, void* p) { return p; } inline __attribute__((always_inline)) void* operator new[](hk_size_t, void* p) { return p; } inline __attribute__((always_inline)) void operator delete(void*, void*) {} inline __attribute__((always_inline)) void operator delete[](void*, void*) {}\n\n enum hkpFilterType {\n HK_FILTER_UNKNOWN = 0,\n HK_FILTER_NULL = 1,\n HK_FILTER_GROUP = 2,\n HK_FILTER_LIST = 3,\n HK_FILTER_CUSTOM = 4,\n HK_FILTER_PAIR = 5,\n HK_FILTER_CONSTRAINT = 6,\n };\n\n hkpCollisionFilter();\n explicit hkpCollisionFilter(hkFinishLoadedObjectFlag flag) : hkReferencedObject(flag) {}\n\n virtual void init(hkpWorld* world) {}\n\n hkBool isCollisionEnabled(const hkpCollidable& a, const hkpCollidable& b) const override = 0;\n\n hkBool isCollisionEnabled(const hkpCollisionInput& input, const hkpCdBody& a,\n const hkpCdBody& b, const hkpShapeContainer& bContainer,\n hkpShapeKey bKey) const override = 0;\n\n hkBool isCollisionEnabled(const hkpCollisionInput& input, const hkpCdBody& collectionBodyA,\n const hkpCdBody& collectionBodyB,\n
const hkpShapeContainer& containerShapeA,\n const hkpShapeContainer& containerShapeB, hkpShapeKey keyA,\n hkpShapeKey keyB) const override = 0;\n\n int numShapeKeyHitsLimitBreached(const hkpCollisionInput& input, const hkpCdBody& bodyA,\n const hkpCdBody& bodyB, const hkpBvTreeShape* bvTreeShapeB,\n hkAabb& aabb, hkpShapeKey* shapeKeysInOut,\n int shapeKeysCapacity) const override;\n\n hkBool isCollisionEnabled(const hkpShapeRayCastInput& aInput,\n const hkpShapeContainer& bContainer,\n hkpShapeKey bKey) const override = 0;\n\n hkBool isCollisionEnabled(const hkpWorldRayCastInput& a,\n const hkpCollidable& collidableB) const override = 0;\n\npublic:\n hkUint32 m_prepad[2];\n hkEnum<hkpFilterType, hkUint32> m_type;\n hkUint32 m_postpad[3];\n};\n# 6 \"/home/larsvi/botw/lib/hkStubs/./Havok/Physics2012/Dynamics/World/hkpWorldCinfo.h\" 2\n# 1 \"/home/larsvi/botw/lib/hkStubs/./Havok/Physics2012/Collide/Filter/hkpConvexListFilter.h\" 1\n\n\n\n\n\nclass hkpCdBody;\nstruct hkpCollisionInput;\n\nclass hkpConvexListFilter : public hkReferencedObject {\npublic:\n inline __attribute__((always_inline)) void* operator new(hk_size_t nbytes) { if constexpr (std::is_base_of_v<hkReferencedObject, hkpConvexListFilter>) { return hkMemoryRouter::getInstance().heap().blockAlloc(static_cast<int>(nbytes)); } else { return hkMemoryRouter::getInstance().heap().blockAlloc(sizeof(hkpConvexListFilter)); } } inline __attribute__((always_inline)) void operator delete(void* p, hk_size_t nbytes) { if constexpr (std::is_base_of_v<hkReferencedObject, hkpConvexListFilter>) { auto* b = static_cast<hkReferencedObject*>(p); hkMemoryRouter::getInstance().heap().blockFree( p, (b->getMemorySizeAndFlags() == 0xffff) ? static_cast<int>(nbytes) : b->getMemorySizeAndFlags()); } else { if (p) hkMemoryRouter::getInstance().heap().blockFree(p, sizeof(hkpConvexListFilter)); } } inline __attribute__((always_inline)) void* operator new(hk_size_t, void* p) { return p; } inline __attribute__((always_inline)) void* operator new[](hk_size_t, void* p) { return p; } inline __attribute__((always_inline)) void operator delete(void*, void*) {} inline __attribute__((always_inline)) void operator delete[](void*, void*) {}\n\n enum ConvexListCollisionType {\n TREAT_CONVEX_LIST_AS_NORMAL,\n TREAT_CONVEX_LIST_AS_LIST,\n TREAT_CONVEX_LIST_AS_CONVEX,\n };\n\n virtual ConvexListCollisionType\n getConvexListCollisionType(const hkpCdBody& convexListBody, const hkpCdBody& otherBody,\n const hkpCollisionInput& input) const = 0;\n\npublic:\n explicit hkpConvexListFilter(hkFinishLoadedObjectFlag flag) : hkReferencedObject(flag) {}\n\nprotected:\n hkpConvexListFilter() = default;\n};\n# 7 \"/home/larsvi/botw/lib/hkStubs/./Havok/Physics2012/Dynamics/World/hkpWorldCinfo.h\" 2\n# 1 \"/home/larsvi/botw/lib/hkStubs/./Havok/Physics2012/Dynamics/World/Memory/hkpWorldMemoryAvailableWatchDog.h\" 1\n\n\n\n\n\nclass hkpSimulationIsland;\nclass hkpWorld;\n\nclass hkWorldMemoryAvailableWatchDog : public hkReferencedObject {\npublic:\n inline __attribute__((always_inline)) void* operator new(hk_size_t nbytes) { if constexpr (std::is_base_of_v<hkReferencedObject, hkWorldMemoryAvailableWatchDog>) { return hkMemoryRouter::getInstance().heap().blockAlloc(static_cast<int>(nbytes)); } else { return hkMemoryRouter::getInstance().heap().blockAlloc(sizeof(hkWorldMemoryAvailableWatchDog)); } } inline __attribute__((always_inline)) void operator delete(void* p, hk_size_t nbytes) { if constexpr (std::is_base_of_v<hkReferencedObject, hkWorldMemoryAvailableWatchDog>) { auto* b = static_cast<hkReferencedObject*>(p); hkMemoryRouter::getInstance().heap().blockFree( p, (b->getMemorySizeAndFlags() == 0xffff) ? static_cast<int>(nbytes) : b->getMemorySizeAndFlags()); } else { if (p) hkMemoryRouter::getInstance().heap().blockFree(p, sizeof(hkWorldMemoryAvailableWatchDog)); } } inline __attribute__((always_inline)) void* operator new(hk_size_t, void* p) { return p; } inline __attribute__((always_inline)) void* operator new[](hk_size_t, void* p) { return p; } inline __attribute__((always_inline)) void operator delete(void*, void*) {} inline __attribute__((always_inline)) void operator delete[](void*, void*) {}\n\n struct MemUsageInfo {\n inline __attribute__((always_inline)) void* operator new(hk_size_t nbytes) { if constexpr (std::is_base_of_v<hkReferencedObject, MemUsageInfo>) { return hkMemoryRouter::getInstance().heap().blockAlloc(static_cast<int>(nbytes)); } else { return hkMemoryRouter::getInstance().heap().blockAlloc(sizeof(MemUsageInfo)); } } inline __attribute__((always_inline)) void operator delete(void* p, hk_size_t nbytes) { if constexpr (std::is_base_of_v<hkReferencedObject, MemUsageInfo>) { auto* b = static_cast<hkReferencedObject*>(p); hkMemoryRouter::getInstance().heap().blockFree( p, (b->getMemorySizeAndFlags() == 0xffff) ? static_cast<int>(nbytes) : b->getMemorySizeAndFlags()); } else { if (p) hkMemoryRouter::getInstance().heap().blockFree(p, sizeof(MemUsageInfo)); } } inline __attribute__((always_inline)) void* operator new(hk_size_t, void* p) { return p; } inline __attribute__((always_inline)) void* operator new[](hk_size_t, void* p) { return p; } inline __attribute__((always_inline)) void operator delete(void*, void*) {} inline __attribute__((always_inline)) void operator delete[](void*, void*) {}\n\n int m_maxRuntimeBlockSize;\n int m_sumRuntimeBlockSize;\n hkpSimulationIsland* m_largestSimulationIsland;\n };\n\n inline hkWorldMemoryAvailableWatchDog() = default;\n inline explicit hkWorldMemoryAvailableWatchDog(hkFinishLoadedObjectFlag flag)\n : hkReferencedObject(flag) {}\n\n virtual hkInt32 getAmountOfFreeHeapMemoryRequested() = 0;\n virtual void freeHeapMemoryTillRequestedAmountIsAvailable(hkpWorld* world) = 0;\n virtual void reduceConstraintsInIsland(const MemUsageInfo& info, int numIterations) = 0;\n};\n# 8 \"/home/larsvi/botw/lib/hkStubs/./Havok/Physics2012/Dynamics/World/hkpWorldCinfo.h\" 2\n\nclass hkpWorldCinfo : public hkReferencedObject {\npublic:\n inline __attribute__((always_inline)) void* operator new(hk_size_t nbytes) { if constexpr (std::is_base_of_v<hkReferencedObject, hkpWorldCinfo>) { return hkMemoryRouter::getInstance().heap().blockAlloc(static_cast<int>(nbytes)); } else { return hkMemoryRouter::getInstance().heap().blockAlloc(sizeof(hkpWorldCinfo)); } } inline __attribute__((always_inline)) void operator delete(void* p, hk_size_t nbytes) { if constexpr (std::is_base_of_v<hkReferencedObject, hkpWorldCinfo>) { auto* b = static_cast<hkReferencedObject*>(p); hkMemoryRouter::getInstance().heap().blockFree( p, (b->getMemorySizeAndFlags() == 0xffff) ? static_cast<int>(nbytes) : b->getMemorySizeAndFlags()); } else { if (p) hkMemoryRouter::getInstance().heap().blockFree(p, sizeof(hkpWorldCinfo)); } } inline __attribute__((always_inline)) void* operator new(hk_size_t, void* p) { return p; } inline __attribute__((always_inline)) void* operator new[](hk_size_t, void* p) { return p; } inline __attribute__((always_inline)) void operator delete(void*, void*) {} inline __attribute__((always_inline)) void operator delete[](void*, void*) {}\n\n enum SolverType {\n SOLVER_TYPE_INVALID,\n SOLVER_TYPE_2ITERS_SOFT,\n SOLVER_TYPE_2ITERS_MEDIUM,\n SOLVER_TYPE_2ITERS_HARD,\n SOLVER_TYPE_4ITERS_SOFT,\n SOLVER_TYPE_4ITERS_MEDIUM,\n SOLVER_TYPE_4ITERS_HARD,\n SOLVER_TYPE_8ITERS_SOFT,\n SOLVER_TYPE_8ITERS_MEDIUM,\n SOLVER_TYPE_8ITERS_HARD,\n SOLVER_TYPE_MAX_ID\n };\n\n enum SimulationType {\n SIMULATION_TYPE_INVALID,\n SIMULATION_TYPE_DISCRETE,\n SIMULATION_TYPE_CONTINUOUS,\n SIMULATION_TYPE_MULTITHREADED,\n };\n\n enum ContactPointGeneration {\n CONTACT_POINT_ACCEPT_ALWAYS,\n CONTACT_POINT_REJECT_DUBIOUS,\n CONTACT_POINT_REJECT_MANY,\n };\n\n enum BroadPhaseType {\n BROADPHASE_TYPE_SAP,\n BROADPHASE_TYPE_TREE,\n BROADPHASE_TYPE_HYBRID,\n };\n\n enum BroadPhaseBorderBehaviour {\n BROADPHASE_BORDER_ASSERT,\n BROADPHASE_BORDER_FIX_ENTITY,\n BROADPHASE_BORDER_REMOVE_ENTITY,\n BROADPHASE_BORDER_DO_NOTHING,\n };\n\n hkpWorldCinfo();\n explicit hkpWorldCinfo(hkFinishLoadedObjectFlag flag);\n ~hkpWorldCinfo() override = default;\n\n void setupSolverInfo(SolverType st);\n void setBroadPhaseWorldSize(hkReal size);\n\n hkVector4 m_gravity;\n hkInt32 m_broadPhaseQuerySize;\n hkReal m_contactRestingVelocity;\n hkEnum<BroadPhaseType, hkInt8> m_broadPhaseType;\n hkEnum<BroadPhaseBorderBehaviour, hkInt8> m_broadPhaseBorderBehaviour;\n hkBool m_mtPostponeAndSortBroadPhaseBorderCallbacks;\n hkAabb m_broadPhaseWorldAabb;\n hkReal m_collisionTolerance;\n hkRefPtr<hkpCollisionFilter> m_collisionFilter;\n hkRefPtr<hkpConvexListFilter> m_convexListFilter;\n hkReal m_expectedMaxLinearVelocity;\n int m_sizeOfToiEventQueue;\n hkReal m_expectedMinPsiDeltaTime;\n hkRefPtr<hkWorldMemoryAvailableWatchDog> m_memoryWatchDog;\n\n hkInt32 m_broadPhaseNumMarkers;\n hkEnum<ContactPointGeneration, hkInt8> m_contactPointGeneration;\n hkBool m_allowToSkipConfirmedCallbacks;\n\n hkReal m_solverTau;\n hkReal m_solverDamp;\n hkInt32 m_solverIterations;\n hkInt32 m_solverMicrosteps;\n hkReal m_maxConstraintViolation;\n hkBool m_forceCoherentConstraintOrderingInSolver;\n\n hkReal m_snapCollisionToConvexEdgeThreshold;\n hkReal m_snapCollisionToConcaveEdgeThreshold;\n hkBool m_enableToiWeldRejection;\n hkBool m_enableDeprecatedWelding;\n hkReal m_iterativeLinearCastEarlyOutDistance;\n hkInt32 m_iterativeLinearCastMaxIterations;\n hkUint8 m_deactivationNumInactiveFramesSelectFlag0;\n hkUint8 m_deactivationNumInactiveFramesSelectFlag1;\n hkUint8 m_deactivationIntegrateCounter;\n hkBool m_shouldActivateOnRigidBodyTransformChange;\n hkReal m_deactivationReferenceDistance;\n hkReal m_toiCollisionResponseRotateNormal;\n\n hkBool m_useCompoundSpuElf;\n int m_maxSectorsPerMidphaseCollideTask;\n int m_maxSectorsPerNarrowphaseCollideTask;\n hkBool m_processToisMultithreaded;\n int m_maxEntriesPerToiMidphaseCollideTask;\n int m_maxEntriesPerToiNarrowphaseCollideTask;\n int m_maxNumToiCollisionPairsSinglethreaded;\n hkReal m_numToisTillAllowedPenetrationSimplifiedToi;\n hkReal m_numToisTillAllowedPenetrationToi;\n hkReal m_numToisTillAllowedPenetrationToiHigher;\n hkReal m_numToisTillAllowedPenetrationToiForced;\n\n hkBool m_enableDeactivation;\n hkEnum<SimulationType, hkInt8> m_simulationType;\n hkBool m_enableSimulationIslands;\n hkUint32 m_minDesiredIslandSize;\n hkBool m_processActionsInSingleThread;\n hkBool m_allowIntegrationOfIslandsWithoutConstraintsInASeparateJob;\n hkReal m_frameMarkerPsiSnap;\n hkBool m_fireCollisionCallbacks;\n};\n# 8 \"/home/larsvi/botw/lib/hkStubs/./Havok/Physics2012/Dynamics/World/hkpWorld.h\" 2\n\nclass hkCriticalSection;\nclass hkJobQueue;\nclass hkSemaphoreBusyWait;\nclass hkThreadPool;\nclass hkWorldMemoryAvailableWatchDog;\nclass hkdWorld;\nclass hknpWorld;\nclass hkpAction;\nclass hkpActionListener;\nclass hkpBodyOperation;\nclass hkpBroadPhase;\nclass hkpBroadPhaseBorder;\nclass hkpBroadPhaseBorderListener;\nclass hkpCdBodyPairCollector;\nclass hkpCdPointCollector;\nclass hkpCollisionDispatcher;\nclass hkpCollisionFilter;\nclass hkpConstraintData;\nclass hkpConstraintInstance;\nclass hkpConstraintListener;\nclass hkpContactImpulseLimitBreachedListener;\nclass hkpContactListener;\nclass hkpDebugInfoOnPendingOperationQueues;\nclass hkpEntity;\nclass hkpEntityEntityBroadPhaseListener;\nclass hkpEntityListener;\nclass hkpIslandActivationListener;\nclass hkpIslandPostCollideListener;\nclass hkpIslandPostIntegrateListener;\nstruct hkpLinearCastInput;\nclass hkpMtThreadStructure;\nclass hkpMultithreadConfig;\nclass hkpPhantom;\nclass hkpPhantomBroadPhaseListener;\nclass hkpPhantomListener;\nclass hkpPhysicsSystem;\nstruct hkpProcessCollisionInput;\nclass hkpRigidBody;\nclass hkpSimulation;\nclass hkpSimulationIsland;\nclass hkpTypedBroadPhaseDispatcher;\nstruct hkpViolatedConstraintArray;\nclass hkpWorldDeletionListener;\nclass hkpWorldExtension;\nstruct hkpWorldGetClosestPointsCommand;\nstruct hkpWorldLinearCastCommand;\nclass hkpWorldMaintenanceMgr;\nclass hkpWorldOperationQueue;\nclass hkpWorldPostCollideListener;\nclass hkpWorldPostIntegrateListener;\nclass hkpWorldPostSimulationListener;\nstruct hkpWorldRayCastCommand;\nstruct hkpWorldRayCastOutput;\n\nnamespace hkWorldOperation {\nstruct BaseOperation;\nclass UserCallback;\n} // namespace hkWorldOperation\n\nenum hkpUpdateCollisionFilterOnWorldMode {\n HK_UPDATE_FILTER_ON_WORLD_FULL_CHECK,\n HK_UPDATE_FILTER_ON_WORLD_DISABLE_ENTITY_ENTITY_COLLISIONS_ONLY,\n};\n\nenum hkpUpdateCollisionFilterOnEntityMode {\n HK_UPDATE_FILTER_ON_ENTITY_FULL_CHECK,\n HK_UPDATE_FILTER_ON_ENTITY_DISABLE_ENTITY_ENTITY_COLLISIONS_ONLY,\n};\n\nenum hkpEntityActivation {\n HK_ENTITY_ACTIVATION_DO_NOT_ACTIVATE,\n HK_ENTITY_ACTIVATION_DO_ACTIVATE,\n};\n\nenum hkpUpdateCollectionFilterMode {\n HK_UPDATE_COLLECTION_FILTER_IGNORE_SHAPE_COLLECTIONS,\n HK_UPDATE_COLLECTION_FILTER_PROCESS_SHAPE_COLLECTIONS,\n};\n\nenum hkpStepResult {\n HK_STEP_RESULT_SUCCESS,\n HK_STEP_RESULT_MEMORY_FAILURE_BEFORE_INTEGRATION,\n HK_STEP_RESULT_MEMORY_FAILURE_DURING_COLLIDE,\n HK_STEP_RESULT_MEMORY_FAILURE_DURING_TOI_SOLVE,\n};\n\nstruct hkpWorldDynamicsStepInfo {\n inline __attribute__((always_inline)) void* operator new(hk_size_t nbytes) { if constexpr (std::is_base_of_v<hkReferencedObject, hkpWorldDynamicsStepInfo>) { return hkMemoryRouter::getInstance().heap().blockAlloc(static_cast<int>(nbytes)); } else { return hkMemoryRouter::getInstance().heap().blockAlloc(sizeof(hkpWorldDynamicsStepInfo)); } } inline __attribute__((always_inline)) void operator delete(void* p, hk_size_t nbytes) { if constexpr (std::is_base_of_v<hkReferencedObject, hkpWorldDynamicsStepInfo>) { auto* b = static_cast<hkReferencedObject*>(p); hkMemoryRouter::getInstance().heap().blockFree( p, (b->getMemorySizeAndFlags() == 0xffff) ? static_cast<int>(nbytes) : b->getMemorySizeAndFlags()); } else { if (p) hkMemoryRouter::getInstance().heap().blockFree(p, sizeof(hkpWorldDynamicsStepInfo)); } } inline __attribute__((always_inline)) void* operator new(hk_size_t, void* p) { return p; } inline __attribute__((always_inline)) void* operator new[](hk_size_t, void* p) { return p; } inline __attribute__((always_inline)) void operator delete(void*, void*) {} inline __attribute__((always_inline)) void operator delete[](void*, void*) {}\n\n hkStepInfo m_stepInfo;\n hkpSolverInfo m_solverInfo;\n};\n\nclass hkpWorld : public hkReferencedObject {\npublic:\n inline __attribute__((always_inline)) void* operator new(hk_size_t nbytes) { if constexpr (std::is_base_of_v<hkReferencedObject, hkpWorld>) { return hkMemoryRouter::getInstance().heap().blockAlloc(static_cast<int>(nbytes)); } else { return hkMemoryRouter::getInstance().heap().blockAlloc(sizeof(hkpWorld)); } } inline __attribute__((always_inline)) void operator delete(void* p, hk_size_t nbytes) { if constexpr (std::is_base_of_v<hkReferencedObject, hkpWorld>) { auto* b = static_cast<hkReferencedObject*>(p); hkMemoryRouter::getInstance().heap().blockFree( p, (b->getMemorySizeAndFlags() == 0xffff) ? static_cast<int>(nbytes) : b->getMemorySizeAndFlags()); } else { if (p) hkMemoryRouter::getInstance().heap().blockFree(p, sizeof(hkpWorld)); } } inline __attribute__((always_inline)) void* operator new(hk_size_t, void* p) { return p; } inline __attribute__((always_inline)) void* operator new[](hk_size_t, void* p) { return p; } inline __attribute__((always_inline)) void operator delete(void*, void*) {} inline __attribute__((always_inline)) void operator delete[](void*, void*) {}\n static const hkClass& staticClass();\n\n enum ReintegrationRecollideMode {\n RR_MODE_REINTEGRATE = 1 << 0,\n RR_MODE_RECOLLIDE_BROADPHASE = 1 << 1,\n RR_MODE_RECOLLIDE_NARROWPHASE = 1 << 2,\n RR_MODE_ALL = (1 << 3) - 1,\n };\n\n hkpWorld(const hkpWorldCinfo& info, unsigned int sdkversion = 20140200u);\n explicit hkpWorld(hkFinishLoadedObjectFlag flag);\n ~hkpWorld() override;\n\n void getCinfo(hkpWorldCinfo& info) const;\n\n void setGravity(const hkVector4& gravity);\n inline const hkVector4& getGravity() const;\n\n hkTime getCurrentTime() const;\n hkTime getCurrentPsiTime() const;\n\n // region Entity\n\n hkpEntity*\n addEntity(hkpEntity* entity,\n hkpEntityActivation initialActivationState = HK_ENTITY_ACTIVATION_DO_ACTIVATE);\n\n hkBool removeEntity(hkpEntity* entity);\n\n void\n addEntityBatch(hkpEntity* const* entityBatch, int numEntities,\n hkpEntityActivation initialActivationState = HK_ENTITY_ACTIVATION_DO_ACTIVATE);\n\n void removeEntityBatch(hkpEntity* const* entityBatch, int numEntities);\n\n // endregion\n\n // region Constraint\n\n hkpConstraintInstance* addConstraint(hkpConstraintInstance* constraint);\n hkBool removeConstraint(hkpConstraintInstance* constraint);\n hkpConstraintInstance* createAndAddConstraintInstance(hkpRigidBody* bodyA, hkpRigidBody* bodyB,\n
hkpConstraintData* constraintData);\n\n // endregion\n\n // region Action\n\n hkpAction* addAction(hkpAction* action);\n void removeAction(hkpAction* action);\n void removeActionImmediately(hkpAction* action);\n\n // endregion\n\n // region Phantom\n\n inline const hkArray<hkpPhantom*>& getPhantoms() const;\n hkpPhantom* addPhantom(hkpPhantom* phantom);\n void addPhantomBatch(hkpPhantom* const* phantomBatch, int numPhantoms);\n void removePhantom(hkpPhantom* phantom);\n void removePhantomBatch(hkpPhantom* const* phantomBatch, int numPhantoms);\n void activateRegion(const hkAabb& aabb);\n\n // endregion\n\n // region System\n\n void addPhysicsSystem(const hkpPhysicsSystem* sys);\n void removePhysicsSystem(const hkpPhysicsSystem* sys);\n\n // endregion\n\n // region Fixed rigid body\n\n inline hkpRigidBody* getFixedRigidBody();\n inline const hkpRigidBody* getFixedRigidBody() const;\n\n // endregion\n\n // region Collision filter\n\n void updateCollisionFilterOnEntity(hkpEntity* entity,\n hkpUpdateCollisionFilterOnEntityMode updateMode,\n hkpUpdateCollectionFilterMode updateShapeCollectionFilter);\n\n void reenableCollisionBetweenEntityPair(hkpEntity* entityA, hkpEntity* entityB);\n\n void updateCollisionFilterOnPhantom(hkpPhantom* phantom,\n
hkpUpdateCollectionFilterMode updateShapeCollectionFilter);\n\n void updateCollisionFilterOnWorld(hkpUpdateCollisionFilterOnWorldMode updateMode,\n hkpUpdateCollectionFilterMode updateShapeCollectionFilter);\n\n void reintegrateAndRecollideEntities(hkpEntity** entityBatch, int numEntities,\n ReintegrationRecollideMode mode = RR_MODE_ALL);\n\n // endregion\n\n // region Simulation\n\n void findInitialContactPoints(hkpEntity** entities, int numEntities);\n void findInitialContactPointsOfAllEntities();\n void calcRequiredSolverBufferSize(hkWorldMemoryAvailableWatchDog::MemUsageInfo& infoOut);\n void checkDeterminism();\n void checkDeterminismOfIslandBroadPhase(const hkpSimulationIsland* island);\n hkWorldMemoryAvailableWatchDog* getMemoryWatchDog() const;\n void setMemoryWatchDog(hkWorldMemoryAvailableWatchDog* watchDog);\n\n // endregion\n\n // region Multithreading\n\n enum MtAccessChecking { MT_ACCESS_CHECKING_ENABLED = 0, MT_ACCESS_CHECKING_DISABLED };\n\n void lock();\n void lockReadOnly();\n void unlock();\n void unlockReadOnly();\n bool checkUnmarked();\n void lockIslandForConstraintUpdate(hkpSimulationIsland* island);\n void lockForIslandSplit(hkpSimulationIsland* island);\n void unlockIslandForConstraintUpdate(hkpSimulationIsland* island);\n void unlockForIslandSplit(hkpSimulationIsland* island);\n void setMultithreadedAccessChecking(MtAccessChecking accessCheckState);\n MtAccessChecking getMultithreadedAccessChecking() const;\n void markForRead() const;\n void markForWrite();\n void unmarkForRead() const;\n void unmarkForWrite();\n\n // endregion\n\n // region Event handling\n\n void addActionListener(hkpActionListener* worldListener);\n void removeActionListener(hkpActionListener* worldListener);\n\n void addConstraintListener(hkpConstraintListener* worldListener);\n void removeConstraintListener(hkpConstraintListener* worldListener);\n\n void addEntityListener(hkpEntityListener* worldListener);\n void removeEntityListener(hkpEntityListener* worldListener);\n\n void addPhantomListener(hkpPhantomListener* worldListener);\n void removePhantomListener(hkpPhantomListener* worldListener);\n\n void addIslandActivationListener(hkpIslandActivationListener* worldListener);\n void removeIslandActivationListener(hkpIslandActivationListener* worldListener);\n\n void addWorldPostCollideListener(hkpWorldPostCollideListener* worldListener);\n void removeWorldPostCollideListener(hkpWorldPostCollideListener* worldListener);\n\n void addWorldPostSimulationListener(hkpWorldPostSimulationListener* worldListener);\n void removeWorldPostSimulationListener(hkpWorldPostSimulationListener* worldListener);\n\n void addWorldPostIntegrateListener(hkpWorldPostIntegrateListener* worldListener);\n void removeWorldPostIntegrateListener(hkpWorldPostIntegrateListener* worldListener);\n\n void addIslandPostCollideListener(hkpIslandPostCollideListener* islandListener);\n void removeIslandPostCollideListener(hkpIslandPostCollideListener* islandListener);\n\n void addIslandPostIntegrateListener(hkpIslandPostIntegrateListener* islandListener);\n void removeIslandPostIntegrateListener(hkpIslandPostIntegrateListener* islandListener);\n\n void addContactListener(hkpContactListener* worldListener);\n void removeContactListener(hkpContactListener* worldListener);\n\n const hkArray<hkpContactListener*>& getContactListeners() const;\n\n void addWorldDeletionListener(hkpWorldDeletionListener* worldListener);\n void removeWorldDeletionListener(hkpWorldDeletionListener* worldListener);\n\n void addContactImpulseLimitBreachedListener(hkpContactImpulseLimitBreachedListener* listener);\n void\n removeContactImpulseLimitBreachedListener(hkpContactImpulseLimitBreachedListener* listener);\n\n void addWorldExtension(hkpWorldExtension* extension);\n void removeWorldExtension(hkpWorldExtension* extension);\n hkpWorldExtension* findWorldExtension(int id) const;\n\n // endregion\n\n // region Collision detection\n\n inline hkpBroadPhase* getBroadPhase();\n inline const hkpBroadPhase* getBroadPhase() const;\n\n hkpBroadPhaseBorder* getBroadPhaseBorder() const;\n void setBroadPhaseBorder(hkpBroadPhaseBorder* bpb);\n\n inline const hkpProcessCollisionInput* getCollisionInput() const;\n inline hkpProcessCollisionInput* getCollisionInputRw();\n inline hkpSolverInfo* getSolverInfo();\n inline hkpCollisionDispatcher* getCollisionDispatcher() const;\n\n inline const hkpCollisionFilter* getCollisionFilter() const;\n void setCollisionFilter(hkpCollisionFilter* filter,\n hkBool runUpdateCollisionFilterOnWorld = true,\n hkpUpdateCollisionFilterOnWorldMode checkBroadPhaseMode =\n HK_UPDATE_FILTER_ON_WORLD_FULL_CHECK,\n hkpUpdateCollectionFilterMode updateShapeCollectionFilter =\n HK_UPDATE_COLLECTION_FILTER_PROCESS_SHAPE_COLLECTIONS);\n\n void castRay(const hkpWorldRayCastInput& input, hkpWorldRayCastOutput& output) const;\n void castRay(const hkpWorldRayCastInput& input, hkpRayHitCollector& collector) const;\n void castRayMt(hkpWorldRayCastCommand* commandArray, int numCommands, hkJobQueue* jobQueue,\n hkThreadPool* threadPool, hkSemaphoreBusyWait* semaphore,\n int numCommandsPerJob = 32) const;\n\n /// Cast a shape.\n ///\n /// @param collA The collidable for the shape to cast.\n /// @param castCollector Collects all potential hits.\n /// @param startCollector [Optional] Collects points that are closest to the start point.\n void linearCast(const hkpCollidable* collA, const hkpLinearCastInput& input,\n hkpCdPointCollector& castCollector,\n hkpCdPointCollector* startCollector = nullptr) const;\n\n void linearCastMt(hkpWorldLinearCastCommand* commandArray, int numCommands,\n hkJobQueue* jobQueue, hkThreadPool* threadPool,\n hkSemaphoreBusyWait* semaphore, int numCommandsPerJob = 32) const;\n\n void getClosestPoints(const hkpCollidable* collA, const hkpCollisionInput& input,\n hkpCdPointCollector& collector) const;\n\n void getClosestPointsMt(hkpWorldGetClosestPointsCommand* commandArray, int numCommands,\n hkJobQueue* jobQueue, hkThreadPool* threadPool,\n
hkSemaphoreBusyWait* semaphore, int numCommandsPerJob = 32) const;\n\n void getPenetrations(const hkpCollidable* collA, const hkpCollisionInput& input,\n hkpCdBodyPairCollector& collector) const;\n\n enum CachedAabbUpdate {\n SHIFT_BROADPHASE_UPDATE_ENTITY_AABBS,\n SHIFT_BROADPHASE_IGNORE_ENTITY_AABBS\n };\n void shiftBroadPhase(const hkVector4& shiftDistance, hkVector4& effectiveShiftDistanceOut,\n CachedAabbUpdate updateAabbs);\n\n // endregion\n\n // region Simulation island\n\n inline const hkArray<hkpSimulationIsland*>& getActiveSimulationIslands() const;\n inline const hkArray<hkpSimulationIsland*>& getInactiveSimulationIslands() const;\n inline const hkpSimulationIsland* getFixedIsland() const;\n\n // endregion\n\n // region Stepping\n\n hkpStepResult stepDeltaTime(hkReal physicsDeltaTime);\n\n hkpStepResult integrate(hkReal physicsDeltaTime);\n hkpStepResult collide();\n hkpStepResult advanceTime();\n\n void setFrameTimeMarker(hkReal frameDeltaTime);\n bool isSimulationAtMarker() const;\n bool isSimulationAtPsi() const;\n\n static void registerWithJobQueue(hkJobQueue* jobQueue);\n hkpStepResult stepMultithreaded(hkJobQueue* jobQueue, hkThreadPool* threadPool,\n hkReal physicsDeltaTime);\n hkpStepResult initMtStep(hkJobQueue* jobQueue, hkReal physicsDeltaTime);\n hkpStepResult finishMtStep(hkJobQueue* jobQueue = nullptr, hkThreadPool* threadPool = nullptr);\n\n // endregion\n\n // region Multithreading config\n\n void getMultithreadConfig(hkpMultithreadConfig& config);\n void setMultithreadConfig(const hkpMultithreadConfig& config, hkJobQueue* queue);\n hkMultiThreadCheck& getMultiThreadCheck() const { return m_multiThreadCheck; }\n void checkAccessGetActiveSimulationIslands() const;\n\n // endregion\n\n // region Serialisation\n\n hkpPhysicsSystem* getWorldAsOneSystem() const;\n void getWorldAsSystems(hkArray<hkpPhysicsSystem*>& systemsOut) const;\n\n // endregion\n\n void removeAll();\n void attachActionToEntity(hkpAction* action, hkpEntity* entity);\n void detachActionFromEntity(hkpAction* action, hkpEntity* entity);\n\n // region Locking\n\n inline __attribute__((always_inline)) void lockCriticalOperations();\n inline __attribute__((always_inline)) void unlockCriticalOperations();\n inline __attribute__((always_inline)) int areCriticalOperationsLocked() const;\n inline __attribute__((always_inline)) int areCriticalOperationsLockedUnchecked() const;\n\n inline __attribute__((always_inline)) void unlockCriticalOperationsForPhantoms();\n inline __attribute__((always_inline)) void lockCriticalOperationsForPhantoms();\n inline __attribute__((always_inline)) int areCriticalOperationsLockedForPhantoms() const;\n\n inline __attribute__((always_inline)) void blockExecutingPendingOperations(hkBool block);\n inline __attribute__((always_inline)) void unlockAndAttemptToExecutePendingOperations();\n\n inline __attribute__((always_inline)) void attemptToExecutePendingOperations(bool executeBodyOperations = true);\n\n void queueOperation(const hkWorldOperation::BaseOperation& operation);\n\n hkWorldOperation::UserCallback* queueCallback(hkWorldOperation::UserCallback* callback,\n hkUlong userData = 0);\n\n void addBodyOperation(hkpRigidBody* breakingBody, hkpBodyOperation* operation, int priority,\n /*hkpBodyOperation::ExecutionState*/ int hint);\n\n void checkConstraintsViolated();\n\nprivate:\n void internal_executePendingOperations();\n void internal_executePendingBodyOperations();\n\npublic:\n inline __attribute__((always_inline)) void allowCriticalOperations(hkBool allow);\n\n // endregion\n\n hkpSimulation* m_simulation;\n hkVector4 m_gravity;\n hkpSimulationIsland* m_fixedIsland;\n hkpRigidBody* m_fixedRigidBody;\n\n hkArray<hkpSimulationIsland*> m_activeSimulationIslands;\n hkArray<hkpSimulationIsland*> m_inactiveSimulationIslands;\n hkArray<hkpSimulationIsland*> m_dirtySimulationIslands;\n\n hkpWorldMaintenanceMgr* m_maintenanceMgr;\n hkRefPtr<hkWorldMemoryAvailableWatchDog> m_memoryWatchDog;\n\n hkBool m_assertOnRunningOutOfSolverMemory;\n\n hkEnum<hkpWorldCinfo::BroadPhaseType, hkInt8> m_broadPhaseType;\n hkpBroadPhase* m_broadPhase;\n\n hkpTypedBroadPhaseDispatcher* m_broadPhaseDispatcher;\n hkpPhantomBroadPhaseListener* m_phantomBroadPhaseListener;\n hkpEntityEntityBroadPhaseListener* m_entityEntityBroadPhaseListener;\n hkpBroadPhaseBorderListener* m_broadPhaseBorderListener;\n\n hkpMtThreadStructure* m_multithreadedSimulationJobData;\n hkpProcessCollisionInput* m_collisionInput;\n hkpCollisionFilter* m_collisionFilter;\n hkpCollisionDispatcher* m_collisionDispatcher;\n hkpConvexListFilter* m_convexListFilter;\n\n hkpWorldOperationQueue* m_pendingOperations;\n int m_pendingOperationsCount;\n int m_pendingBodyOperationsCount;\n int m_criticalOperationsLockCount;\n int m_criticalOperationsLockCountForPhantoms;\n hkBool m_blockExecutingPendingOperations;\n hkBool m_criticalOperationsAllowed;\n hkpDebugInfoOnPendingOperationQueues* m_pendingOperationQueues;\n int m_pendingOperationQueueCount;\n\n mutable hkMultiThreadCheck m_multiThreadCheck;\n\n hkBool m_processActionsInSingleThread;\n hkBool m_allowIntegrationOfIslandsWithoutConstraintsInASeparateJob;\n\n hkUint32 m_minDesiredIslandSize;\n\n hkCriticalSection* m_modifyConstraintCriticalSection;\n int m_isLocked;\n hkCriticalSection* m_islandDirtyListCriticalSection;\n hkCriticalSection* m_propertyMasterLock;\n\n hkBool m_wantSimulationIslands;\n\n hkReal m_snapCollisionToConvexEdgeThreshold;\n hkReal m_snapCollisionToConcaveEdgeThreshold;\n hkBool m_enableToiWeldRejection;\n\n hkBool m_wantDeactivation;\n hkBool m_shouldActivateOnRigidBodyTransformChange;\n hkReal m_deactivationReferenceDistance;\n\n hkReal m_toiCollisionResponseRotateNormal;\n\n int m_maxSectorsPerMidphaseCollideTask;\n int m_maxSectorsPerNarrowphaseCollideTask;\n hkBool m_processToisMultithreaded;\n int m_maxEntriesPerToiMidphaseCollideTask;\n int m_maxEntriesPerToiNarrowphaseCollideTask;\n int m_maxNumToiCollisionPairsSinglethreaded;\n hkEnum<hkpWorldCinfo::SimulationType, hkInt32> m_simulationType;\n hkReal m_numToisTillAllowedPenetrationSimplifiedToi;\n hkReal m_numToisTillAllowedPenetrationToi;\n hkReal m_numToisTillAllowedPenetrationToiHigher;\n hkReal m_numToisTillAllowedPenetrationToiForced;\n\n hkUint32 m_lastEntityUid;\n hkUint32 m_lastIslandUid;\n hkUint32 m_lastConstraintUid;\n\n friend class hkHalfstepSimulation;\n friend class hkpContinuousSimulation;\n friend class hkpMultiThreadedSimulation;\n friend class hkpSimpleConstraintContactMgr;\n friend class hkpSimulation;\n friend class hkpWorldCallbackUtil;\n friend class hkpWorldOperationUtil;\n\n hkArray<hkpPhantom*> m_phantoms;\n\n hkArray<hkpActionListener*> m_actionListeners;\n hkArray<hkpEntityListener*> m_entityListeners;\n hkArray<hkpPhantomListener*> m_phantomListeners;\n hkArray<hkpConstraintListener*> m_constraintListeners;\n hkArray<hkpWorldDeletionListener*> m_worldDeletionListeners;\n hkArray<hkpIslandActivationListener*> m_islandActivationListeners;\n hkArray<hkpWorldPostSimulationListener*> m_worldPostSimulationListeners;\n hkArray<hkpWorldPostIntegrateListener*> m_worldPostIntegrateListeners;\n hkArray<hkpWorldPostCollideListener*> m_worldPostCollideListeners;\n hkArray<hkpIslandPostIntegrateListener*> m_islandPostIntegrateListeners;\n hkArray<hkpIslandPostCollideListener*> m_islandPostCollideListeners;\n hkArray<hkpContactListener*> m_contactListeners;\n hkArray<hkpContactImpulseLimitBreachedListener*> m_contactImpulseLimitBreachedListeners;\n hkArray<hkpWorldExtension*> m_worldExtensions;\n hkpViolatedConstraintArray* m_violatedConstraintArray;\n\n hkpBroadPhaseBorder* m_broadPhaseBorder;\n\n hkdWorld* m_destructionWorld;\n hknpWorld* m_npWorld;\n\n hkpWorldDynamicsStepInfo m_dynamicsStepInfo;\n\n hkVector4 m_broadPhaseExtents[2];\n int m_broadPhaseNumMarkers;\n int m_sizeOfToiEventQueue;\n hkInt32 m_broadPhaseQuerySize;\n hkInt32 m_broadPhaseUpdateSize;\n hkEnum<hkpWorldCinfo::ContactPointGeneration, hkInt8> m_contactPointGeneration;\n hkBool m_useCompoundSpuElf;\n};\n\ninline hkpSolverInfo* hkpWorld::getSolverInfo() {\n return &m_dynamicsStepInfo.m_solverInfo;\n}\n# 5 \"/home/larsvi/botw/lib/hkStubs/./Havok/Physics2012/Dynamics/Entity/hkpRigidBody.h\" 2\n\nclass hkpRigidBodyCinfo;\n\nclass hkpRigidBody : public hkpEntity {\npublic:\n inline __attribute__((always_inline)) void* operator new(hk_size_t nbytes) { if constexpr (std::is_base_of_v<hkReferencedObject, hkpRigidBody>) { return hkMemoryRouter::getInstance().heap().blockAlloc(static_cast<int>(nbytes)); } else { return hkMemoryRouter::getInstance().heap().blockAlloc(sizeof(hkpRigidBody)); } } inline __attribute__((always_inline)) void operator delete(void* p, hk_size_t nbytes) { if constexpr (std::is_base_of_v<hkReferencedObject, hkpRigidBody>) { auto* b = static_cast<hkReferencedObject*>(p); hkMemoryRouter::getInstance().heap().blockFree( p, (b->getMemorySizeAndFlags() == 0xffff) ? static_cast<int>(nbytes) : b->getMemorySizeAndFlags()); } else { if (p) hkMemoryRouter::getInstance().heap().blockFree(p, sizeof(hkpRigidBody)); } } inline __attribute__((always_inline)) void* operator new(hk_size_t, void* p) { return p; } inline __attribute__((always_inline)) void* operator new[](hk_size_t, void* p) { return p; } inline __attribute__((always_inline)) void operator delete(void*, void*) {} inline __attribute__((always_inline)) void operator delete[](void*, void*) {}\n static const hkClass& staticClass();\n\n explicit hkpRigidBody(const hkpRigidBodyCinfo& info);\n explicit hkpRigidBody(hkFinishLoadedObjectFlag flag);\n\n ~hkpRigidBody() override;\n\n /// Returns the rigid body's current state.\n void getCinfo(hkpRigidBodyCinfo& info) const;\n\n inline hkReal getMass() const;\n inline hkReal getMassInv() const;\n void setMass(hkReal m);\n void setMassInv(hkReal mInv);\n\n inline void getInertiaLocal(hkMatrix3& inertiaOut) const;\n inline void getInertiaWorld(hkMatrix3& inertiaOut) const;\n void setInertiaLocal(const hkMatrix3& inertia);\n void setInertiaInvLocal(const hkMatrix3& inertiaInv);\n inline void getInertiaInvLocal(hkMatrix3& inertiaInv) const;\n inline void getInertiaInvWorld(hkMatrix3& inertiaInvOut) const;\n\n void setCenterOfMassLocal(const hkVector4& centerOfMass);\n inline const hkVector4& getCenterOfMassLocal() const;\n inline const hkVector4& getCenterOfMassInWorld() const;\n\n inline const hkVector4& getPosition() const;\n void setPosition(const hkVector4& position);\n inline const hkQuaternion& getRotation() const;\n void setRotation(const hkQuaternion& rotation);\n void setPositionAndRotation(const hkVector4& position, const hkQuaternion& rotation);\n inline const hkTransform& getTransform() const;\n void setTransform(const hkTransform& transform);\n void setPositionAndRotationAsCriticalOperation(const hkVector4& position,\n const hkQuaternion& rotation);\n inline void approxTransformAt(hkTime time, hkTransform& transformOut) const;\n inline void approxCurrentTransform(hkTransform& transformOut) const;\n\n inline const hkVector4& getLinearVelocity() const;\n inline void setLinearVelocity(const hkVector4& newVel);\n inline const hkVector4& getAngularVelocity() const;\n inline void setAngularVelocity(const hkVector4& newVel);\n inline void getPointVelocity(const hkVector4& p, hkVector4& vecOut) const;\n void setLinearVelocityAsCriticalOperation(const hkVector4& newVel);\n void setAngularVelocityAsCriticalOperation(const hkVector4& newVel);\n\n inline void applyLinearImpulse(const hkVector4& imp);\n inline void applyPointImpulse(const hkVector4& imp, const hkVector4& p);\n inline void applyAngularImpulse(const hkVector4& imp);\n void applyLinearImpulseAsCriticalOperation(const hkVector4& imp);\n void applyPointImpulseAsCriticalOperation(const hkVector4& imp, const hkVector4& p);\n void applyAngularImpulseAsCriticalOperation(const hkVector4& imp);\n\n inline void applyForce(hkReal deltaTime, const hkVector4& force);\n inline void applyForce(hkReal deltaTime, const hkVector4& force, const hkVector4& p);\n inline void applyTorque(hkReal deltaTime, const hkVector4& torque);\n\n inline hkReal getLinearDamping() const;\n inline void setLinearDamping(hkReal d);\n inline hkReal getAngularDamping() const;\n inline void setAngularDamping(hkReal d);\n inline hkReal getTimeFactor() const;\n inline void setTimeFactor(hkReal f);\n inline hkReal getGravityFactor() const;\n inline void setGravityFactor(hkReal f);\n\n inline hkReal getMaxLinearVelocity() const;\n inline void setMaxLinearVelocity(hkReal maxVel);\n inline hkReal getMaxAngularVelocity() const;\n inline void setMaxAngularVelocity(hkReal maxVel);\n\n void enableDeactivation(bool enable);\n bool isDeactivationEnabled() const;\n\n inline hkUint32 getCollisionFilterInfo() const;\n inline void setCollisionFilterInfo(hkUint32 info);\n\n inline hkpCollidableQualityType getQualityType() const;\n inline void setQualityType(hkpCollidableQualityType type);\n\n inline hkReal getAllowedPenetrationDepth() const;\n inline void setAllowedPenetrationDepth(hkReal val);\n\n void\n setMotionType(hkpMotion::MotionType newState,\n hkpEntityActivation preferredActivationState = HK_ENTITY_ACTIVATION_DO_ACTIVATE,\n hkpUpdateCollisionFilterOnEntityMode collisionFilterUpdateMode =\n HK_UPDATE_FILTER_ON_ENTITY_FULL_CHECK);\n inline hkpMotion::MotionType getMotionType() const;\n hkpMotion* getStoredDynamicMotion();\n const hkpMotion* getStoredDynamicMotion() const;\n void updateCachedShapeInfo(const hkpShape* shape, hkVector4& extentOut);\n\n inline hkReal getFriction() const;\n inline hkReal getRollingFrictionMultiplier() const;\n inline hkReal getRestitution() const;\n void setFriction(hkReal newFriction);\n void setRollingFrictionMultiplier(hkReal multiplier);\n void setRestitution(hkReal newRestitution);\n\n hkWorldOperation::Result setShape(const hkpShape* shape) override;\n hkWorldOperation::Result updateShape(hkpShapeModifier* shapeModifier = nullptr) override;\n virtual hkpRigidBody* clone() const;\n\n inline hkpMotion* getRigidMotion() const;\n hkBool checkPerformance() const;\n\n static void createDynamicRigidMotion(hkpMotion::MotionType motionType,\n const hkVector4& position, const hkQuaternion& rotation,\n hkReal mass, const hkMatrix3& inertiaLocal,\n const hkVector4& centreOfMassLocal,\n hkReal maxLinearVelocity, hkReal maxAngularVelocity,\n hkpMaxSizeMotion* motionBufferOut);\n\n static void updateBroadphaseAndResetCollisionInformationOfWarpedBody(hkpEntity* entity);\n\nprotected:\n hkMotionState* getMotionState() override;\n};\n\ninline hkpRigidBody* hkpGetRigidBody(const hkpCollidable* collidable) {\n if (collidable->getType() == hkpWorldObject::BROAD_PHASE_ENTITY) {\n return static_cast<hkpRigidBody*>(hkpGetWorldObject(collidable));\n }\n return nullptr;\n}\n\ninline hkpRigidBody* hkpGetRigidBodyUnchecked(const hkpCollidable* collidable) {\n return static_cast<hkpRigidBody*>(hkpGetWorldObject(collidable));\n}\n\ninline hkReal hkpRigidBody::getMass() const {\n return getRigidMotion()->getMass();\n}\n\ninline hkReal hkpRigidBody::getMassInv() const {\n return getRigidMotion()->getMassInv();\n}\n\ninline void hkpRigidBody::getInertiaLocal(hkMatrix3& inertiaOut) const {\n getRigidMotion()->getInertiaLocal(inertiaOut);\n}\n\ninline void hkpRigidBody::getInertiaWorld(hkMatrix3& inertiaOut) const {\n getRigidMotion()->getInertiaWorld(inertiaOut);\n}\n\ninline void hkpRigidBody::getInertiaInvLocal(hkMatrix3& inertiaInv) const {\n getRigidMotion()->getInertiaInvLocal(inertiaInv);\n}\n\ninline void hkpRigidBody::getInertiaInvWorld(hkMatrix3& inertiaInvOut) const {\n getRigidMotion()->getInertiaInvWorld(inertiaInvOut);\n}\n\ninline const hkVector4& hkpRigidBody::getCenterOfMassLocal() const {\n return getRigidMotion()->getCenterOfMassLocal();\n}\n\ninline const hkVector4& hkpRigidBody::getCenterOfMassInWorld() const {\n return getRigidMotion()->getCenterOfMassInWorld();\n}\n\ninline const hkVector4& hkpRigidBody::getPosition() const {\n return getRigidMotion()->getPosition();\n}\n\ninline const hkQuaternion& hkpRigidBody::getRotation() const {\n return getRigidMotion()->getRotation();\n}\n\ninline const hkTransform& hkpRigidBody::getTransform() const {\n return getRigidMotion()->getTransform();\n}\n\ninline void hkpRigidBody::approxTransformAt(hkTime time, hkTransform& transformOut) const {\n getRigidMotion()->approxTransformAt(time, transformOut);\n}\n\ninline void hkpRigidBody::approxCurrentTransform(hkTransform& transformOut) const {\n getRigidMotion()->approxTransformAt(m_world->getCurrentTime(), transformOut);\n}\n\ninline const hkVector4& hkpRigidBody::getLinearVelocity() const {\n return getRigidMotion()->getLinearVelocity();\n}\n\ninline void hkpRigidBody::setLinearVelocity(const hkVector4& newVel) {\n getRigidMotion()->setLinearVelocity(newVel);\n}\n\ninline const hkVector4& hkpRigidBody::getAngularVelocity() const {\n return getRigidMotion()->getAngularVelocity();\n}\n\ninline void hkpRigidBody::setAngularVelocity(const hkVector4& newVel) {\n getRigidMotion()->setAngularVelocity(newVel);\n}\n\ninline void hkpRigidBody::getPointVelocity(const hkVector4& p, hkVector4& vecOut) const {\n getRigidMotion()->getPointVelocity(p, vecOut);\n}\n\ninline void hkpRigidBody::applyLinearImpulse(const hkVector4& imp) {\n activate();\n getRigidMotion()->applyLinearImpulse(imp);\n}\n\ninline void hkpRigidBody::applyPointImpulse(const hkVector4& imp, const hkVector4& p) {\n activate();\n getRigidMotion()->applyPointImpulse(imp, p);\n}\n\ninline void hkpRigidBody::applyAngularImpulse(const hkVector4& imp) {\n activate();\n getRigidMotion()->applyAngularImpulse(imp);\n}\n\ninline void hkpRigidBody::applyForce(const hkReal deltaTime, const hkVector4& force) {\n activate();\n getRigidMotion()->applyForce(deltaTime, force);\n}\n\ninline void hkpRigidBody::applyForce(const hkReal deltaTime, const hkVector4& force,\n const hkVector4& p) {\n activate();\n getRigidMotion()->applyForce(deltaTime, force, p);\n}\n\ninline void hkpRigidBody::applyTorque(const hkReal deltaTime, const hkVector4& torque) {\n activate();\n getRigidMotion()->applyTorque(deltaTime, torque);\n}\n\ninline hkReal hkpRigidBody::getLinearDamping() const {\n return getRigidMotion()->getLinearDamping();\n}\n\ninline void hkpRigidBody::setLinearDamping(hkReal d) {\n getRigidMotion()->setLinearDamping(d);\n}\n\ninline hkReal hkpRigidBody::getAngularDamping() const {\n return getRigidMotion()->getAngularDamping();\n}\n\ninline void hkpRigidBody::setAngularDamping(hkReal d) {\n getRigidMotion()->setAngularDamping(d);\n}\n\ninline hkReal hkpRigidBody::getTimeFactor() const {\n return getRigidMotion()->getTimeFactor();\n}\n\ninline void hkpRigidBody::setTimeFactor(hkReal f) {\n getRigidMotion()->setTimeFactor(f);\n}\n\ninline hkReal hkpRigidBody::getGravityFactor() const {\n return getRigidMotion()->getGravityFactor();\n}\n\ninline void hkpRigidBody::setGravityFactor(hkReal f) {\n getRigidMotion()->setGravityFactor(f);\n}\n\ninline hkReal hkpRigidBody::getMaxLinearVelocity() const {\n return getRigidMotion()->getMotionState()->m_maxLinearVelocity;\n}\n\ninline void hkpRigidBody::setMaxLinearVelocity(hkReal maxVel) {\n getRigidMotion()->getMotionState()->m_maxLinearVelocity = maxVel;\n}\n\ninline hkReal hkpRigidBody::getMaxAngularVelocity() const {\n return getRigidMotion()->getMotionState()->m_maxAngularVelocity;\n}\n\ninline void hkpRigidBody::setMaxAngularVelocity(hkReal maxVel) {\n getRigidMotion()->getMotionState()->m_maxAngularVelocity = maxVel;\n}\n\ninline hkUint32 hkpRigidBody::getCollisionFilterInfo() const {\n return getCollidable()->getCollisionFilterInfo();\n}\n\ninline void hkpRigidBody::setCollisionFilterInfo(hkUint32 info) {\n getCollidableRw()->setCollisionFilterInfo(info);\n}\n\ninline hkpCollidableQualityType hkpRigidBody::getQualityType() const {\n return getCollidable()->getQualityType();\n}\n\ninline void hkpRigidBody::setQualityType(hkpCollidableQualityType type) {\n getCollidableRw()->setQualityType(type);\n}\n\ninline hkReal hkpRigidBody::getAllowedPenetrationDepth() const {\n return getCollidable()->m_allowedPenetrationDepth;\n}\n\ninline void hkpRigidBody::setAllowedPenetrationDepth(hkReal val) {\n getCollidableRw()->m_allowedPenetrationDepth = val;\n}\n\ninline hkpMotion::MotionType hkpRigidBody::getMotionType() const {\n return getRigidMotion()->getType();\n}\n\ninline hkReal hkpRigidBody::getFriction() const {\n return m_material.getFriction();\n}\n\ninline hkReal hkpRigidBody::getRollingFrictionMultiplier() const {\n return m_material.getRollingFrictionMultiplier();\n}\n\ninline hkReal hkpRigidBody::getRestitution() const {\n return m_material.getRestitution();\n}\n\ninline hkpMotion* hkpRigidBody::getRigidMotion() const {\n return const_cast<hkpMaxSizeMotion*>(&m_motion);\n}\n# 11 \"/home/larsvi/botw/src/KingSystem/Physics/System/physRayCast.cpp\" 2\n\n# 1 \"/home/larsvi/botw/lib/hkStubs/./Havok/Physics2012/Internal/Collide/BvCompressedMesh/hkpBvCompressedMeshShape.h\" 1\n\n\n\n# 1 \"/home/larsvi/botw/lib/hkStubs/./Havok/Physics2012/Collide/Shape/Compound/Tree/hkpBvTreeShape.h\" 1\n\n\n\n\n\nclass hkpAabbCastCollector;\n\nclass hkpBvTreeShape : public hkpShape {\npublic:\n inline __attribute__((always_inline)) void* operator new(hk_size_t nbytes) { if constexpr (std::is_base_of_v<hkReferencedObject, hkpBvTreeShape>) { return hkMemoryRouter::getInstance().heap().blockAlloc(static_cast<int>(nbytes)); } else { return hkMemoryRouter::getInstance().heap().blockAlloc(sizeof(hkpBvTreeShape)); } } inline __attribute__((always_inline)) void operator delete(void* p, hk_size_t nbytes) { if constexpr (std::is_base_of_v<hkReferencedObject, hkpBvTreeShape>) { auto* b = static_cast<hkReferencedObject*>(p); hkMemoryRouter::getInstance().heap().blockFree( p, (b->getMemorySizeAndFlags() == 0xffff) ? static_cast<int>(nbytes) : b->getMemorySizeAndFlags()); } else { if (p) hkMemoryRouter::getInstance().heap().blockFree(p, sizeof(hkpBvTreeShape)); } } inline __attribute__((always_inline)) void* operator new(hk_size_t, void* p) { return p; } inline __attribute__((always_inline)) void* operator new[](hk_size_t, void* p) { return p; } inline __attribute__((always_inline)) void operator delete(void*, void*) {} inline __attribute__((always_inline)) void operator delete[](void*, void*) {}\n enum { THIS_SHAPE_TYPE = (hkcdShapeType::BV_TREE) };\n\n enum BvTreeType {\n BVTREE_MOPP,\n BVTREE_TRISAMPLED_HEIGHTFIELD,\n BVTREE_STATIC_COMPOUND,\n BVTREE_COMPRESSED_MESH,\n BVTREE_USER,\n BVTREE_MAX\n };\n\n inline __attribute__((always_inline)) hkpBvTreeShape() {}\n\n inline hkpBvTreeShape(ShapeType type, BvTreeType bvType)\n : hkpShape(type), m_bvTreeType(bvType) {}\n\n explicit hkpBvTreeShape(hkFinishLoadedObjectFlag flag);\n\n virtual void queryAabb(const hkAabb& aabb, hkArray<hkpShapeKey>& hits) const = 0;\n inline hkUint32 queryAabb(const hkAabb& aabb, hkpShapeKey* hits, int maxNumKeys) const;\n inline void castAabb(const hkAabb& from, hkVector4Parameter to,\n hkpAabbCastCollector& collector) const;\n virtual void castAabbImpl(const hkAabb& from, hkVector4Parameter to,\n hkpAabbCastCollector& collector) const;\n const hkpShapeContainer* getContainer() const override = 0;\n virtual hkUint32 queryAabbImpl(const hkAabb& aabb, hkpShapeKey* hits, int maxNumKeys) const = 0;\n\n hkEnum<BvTreeType, hkUint8> m_bvTreeType;\n};\n\ninline hkUint32 hkpBvTreeShape::queryAabb(const hkAabb& aabb, hkpShapeKey* hits,\n int maxNumKeys) const {\n return queryAabbImpl(aabb, hits, maxNumKeys);\n}\n\ninline void hkpBvTreeShape::castAabb(const hkAabb& from, hkVector4Parameter to,\n hkpAabbCastCollector& collector) const {\n castAabbImpl(from, to, collector);\n}\n# 5 \"/home/larsvi/botw/lib/hkStubs/./Havok/Physics2012/Internal/Collide/BvCompressedMesh/hkpBvCompressedMeshShape.h\" 2\n\n\n\nstruct hkGeometry;\nclass hkpBvCompressedMeshShapeCinfo;\n\nclass hkpBvCompressedMeshShape : public hkpBvTreeShape, public hkpShapeContainer {\npublic:\n enum PerPrimitiveDataMode {\n PER_PRIMITIVE_DATA_NONE,\n PER_PRIMITIVE_DATA_8_BIT,\n PER_PRIMITIVE_DATA_PALETTE,\n PER_PRIMITIVE_DATA_STRING_PALETTE,\n };\n\n enum PrimitiveType {\n PRIMITIVE_TYPE_BOX,\n PRIMITIVE_TYPE_HULL,\n PRIMITIVE_TYPE_SPHERE,\n PRIMITIVE_TYPE_CAPSULE,\n PRIMITIVE_TYPE_CYLINDER,\n };\n\n enum Config {\n# 39 \"/home/larsvi/botw/lib/hkStubs/./Havok/Physics2012/Internal/Collide/BvCompressedMesh/hkpBvCompressedMeshShape.h\"\n NUM_BYTES_FOR_TREE = 144,\n\n\n\n MAX_NUM_VERTICES_PER_HULL = 255,\n\n MAX_NUM_PRIMITIVES = 1 << 23\n };\n\npublic:\n inline __attribute__((always_inline)) void* operator new(hk_size_t nbytes) { if constexpr (std::is_base_of_v<hkReferencedObject, hkpBvCompressedMeshShape>) { return hkMemoryRouter::getInstance().heap().blockAlloc(static_cast<int>(nbytes)); } else { return hkMemoryRouter::getInstance().heap().blockAlloc(sizeof(hkpBvCompressedMeshShape)); } } inline __attribute__((always_inline)) void operator delete(void* p, hk_size_t nbytes) { if constexpr (std::is_base_of_v<hkReferencedObject, hkpBvCompressedMeshShape>) { auto* b = static_cast<hkReferencedObject*>(p); hkMemoryRouter::getInstance().heap().blockFree( p, (b->getMemorySizeAndFlags() == 0xffff) ? static_cast<int>(nbytes) : b->getMemorySizeAndFlags()); } else { if (p) hkMemoryRouter::getInstance().heap().blockFree(p, sizeof(hkpBvCompressedMeshShape)); } } inline __attribute__((always_inline)) void* operator new(hk_size_t, void* p) { return p; } inline __attribute__((always_inline)) void* operator new[](hk_size_t, void* p) { return p; } inline __attribute__((always_inline)) void operator delete(void*, void*) {} inline __attribute__((always_inline)) void operator delete[](void*, void*) {}\n static const hkClass& staticClass();\n enum { THIS_SHAPE_TYPE = (hkcdShapeType::BV_COMPRESSED_MESH) };\n\n explicit hkpBvCompressedMeshShape(const hkpBvCompressedMeshShapeCinfo& cInfo);\n explicit hkpBvCompressedMeshShape(hkFinishLoadedObjectFlag flag);\n inline __attribute__((always_inline)) hkpBvCompressedMeshShape() {}\n\n ~hkpBvCompressedMeshShape() override;\n\n inline __attribute__((always_inline)) hkReal getConvexRadius() const;\n\n hkUint32 getPrimitiveUserData(hkpShapeKey key) const;\n hkStringPtr getPrimitiveUserString(hkpShapeKey key) const;\n\n inline __attribute__((always_inline)) PerPrimitiveDataMode getCollisionFilterInfoMode() const;\n inline __attribute__((always_inline)) PerPrimitiveDataMode getUserDataMode() const;\n inline __attribute__((always_inline)) hkArray<hkUint32>& accessCollisionFilterInfoPalette();\n inline __attribute__((always_inline)) hkArray<hkUint32>& accessUserDataPalette();\n inline __attribute__((always_inline)) hkArray<hkStringPtr>& accessUserStringPalette();\n\n void convertToGeometry(hkGeometry& geometryOut, const hkArray<hkpShapeKey>* inclKeys = nullptr,\n const hkArray<hkpShapeKey>* exclKeys = nullptr) const;\n\n const hkpShapeContainer* getContainer() const override { return this; }\n\n int calcSizeForSpu(const CalcSizeForSpuInput& input, int spuBufferSizeLeft) const override;\n\n void getAabb(const hkTransform& localToWorld, hkReal tolerance, hkAabb& out) const override;\n\n hkBool castRay(const hkpShapeRayCastInput& input,\n hkpShapeRayCastOutput& results) const override;\n\n void castRayWithCollector(const hkpShapeRayCastInput& input, const hkpCdBody& body,\n hkpRayHitCollector& collector) const override;\n\n void queryAabb(const hkAabb& aabb, hkArray<hkpShapeKey>& hits) const override;\n\n hkUint32 queryAabbImpl(const hkAabb& aabb, hkpShapeKey* hits, int maxNumKeys) const override;\n\n void castAabbImpl(const hkAabb& from, hkVector4Parameter to,\n hkpAabbCastCollector& collector) const override;\n\n int getNumChildShapes() const override;\n\n hkpShapeKey getFirstKey() const override;\n\n hkpShapeKey getNextKey(hkpShapeKey oldKey) const override;\n\n const hkpShape* getChildShape(hkpShapeKey key, hkpShapeBuffer& buffer) const override;\n\n hkUint32 getCollisionFilterInfo(hkpShapeKey key) const override;\n\nprotected:\n hkReal m_convexRadius;\n hkEnum<hkpWeldingUtility::WeldingType, hkUint8> m_weldingType;\n hkBool m_hasPerPrimitiveCollisionFilterInfo;\n hkBool m_hasPerPrimitiveUserData;\n hkArray<hkUint32> m_collisionFilterInfoPalette;\n hkArray<hkUint32> m_userDataPalette;\n hkArray<hkStringPtr> m_userStringPalette;\n alignas(16) hkUint8 m_tree[NUM_BYTES_FOR_TREE];\n\n friend struct hkpBvCompressedMeshShape_Internals;\n\npublic:\n alignas(16) static hkVector4 g_vertexBufferPool[12][MAX_NUM_VERTICES_PER_HULL];\n};\n\ninline hkReal hkpBvCompressedMeshShape::getConvexRadius() const {\n return m_convexRadius;\n}\n\ninline hkpBvCompressedMeshShape::PerPrimitiveDataMode\nhkpBvCompressedMeshShape::getCollisionFilterInfoMode() const {\n return m_hasPerPrimitiveCollisionFilterInfo ?\n (m_collisionFilterInfoPalette.getSize() ? PER_PRIMITIVE_DATA_PALETTE :\n PER_PRIMITIVE_DATA_8_BIT) :\n PER_PRIMITIVE_DATA_NONE;\n}\n\ninline hkpBvCompressedMeshShape::PerPrimitiveDataMode\nhkpBvCompressedMeshShape::getUserDataMode() const {\n if (!m_hasPerPrimitiveUserData)\n return PER_PRIMITIVE_DATA_NONE;\n\n if (m_userDataPalette.getSize() > 0)\n return PER_PRIMITIVE_DATA_PALETTE;\n\n if (m_userStringPalette.getSize() > 0)\n return PER_PRIMITIVE_DATA_STRING_PALETTE;\n\n return PER_PRIMITIVE_DATA_8_BIT;\n}\n\ninline hkArray<hkUint32>& hkpBvCompressedMeshShape::accessCollisionFilterInfoPalette() {\n return m_collisionFilterInfoPalette;\n}\n\ninline hkArray<hkUint32>& hkpBvCompressedMeshShape::accessUserDataPalette() {\n return m_userDataPalette;\n}\n\ninline hkArray<hkStringPtr>& hkpBvCompressedMeshShape::accessUserStringPalette() {\n return m_userStringPalette;\n}\n# 13 \"/home/larsvi/botw/src/KingSystem/Physics/System/physRayCast.cpp\" 2\n# 1 \"/home/larsvi/botw/lib/hkStubs/./Havok/Physics2012/Internal/Collide/StaticCompound/hkpStaticCompoundShape.h\" 1\n\n\n\n\n\n# 1 \"/home/larsvi/botw/lib/hkStubs/./Havok/Physics2012/Internal/Collide/StaticCompound/hkpShapeKeyTable.h\" 1\n\n\n\n\n\nclass hkpShapeKeyTable {\npublic:\n inline __attribute__((always_inline)) void* operator new(hk_size_t nbytes) { if constexpr (std::is_base_of_v<hkReferencedObject, hkpShapeKeyTable>) { return hkMemoryRouter::getInstance().heap().blockAlloc(static_cast<int>(nbytes)); } else { return hkMemoryRouter::getInstance().heap().blockAlloc(sizeof(hkpShapeKeyTable)); } } inline __attribute__((always_inline)) void operator delete(void* p, hk_size_t nbytes) { if constexpr (std::is_base_of_v<hkReferencedObject, hkpShapeKeyTable>) { auto* b = static_cast<hkReferencedObject*>(p); hkMemoryRouter::getInstance().heap().blockFree( p, (b->getMemorySizeAndFlags() == 0xffff) ? static_cast<int>(nbytes) : b->getMemorySizeAndFlags()); } else { if (p) hkMemoryRouter::getInstance().heap().blockFree(p, sizeof(hkpShapeKeyTable)); } } inline __attribute__((always_inline)) void* operator new(hk_size_t, void* p) { return p; } inline __attribute__((always_inline)) void* operator new[](hk_size_t, void* p) { return p; } inline __attribute__((always_inline)) void operator delete(void*, void*) {} inline __attribute__((always_inline)) void operator delete[](void*, void*) {}\n static const hkClass& staticClass();\n\n enum { NUM_LISTS = 32, NUM_SLOTS_PER_BLOCK = 63 };\n\n // A block of shape key slots.\n // Free slots have a value of HK_INVALID_SHAPEKEY.\n struct Block {\n inline __attribute__((always_inline)) void* operator new(hk_size_t nbytes) { if constexpr (std::is_base_of_v<hkReferencedObject, Block>) { return hkMemoryRouter::getInstance().heap().blockAlloc(static_cast<int>(nbytes)); } else { return hkMemoryRouter::getInstance().heap().blockAlloc(sizeof(Block)); } } inline __attribute__((always_inline)) void operator delete(void* p, hk_size_t nbytes) { if constexpr (std::is_base_of_v<hkReferencedObject, Block>) { auto* b = static_cast<hkReferencedObject*>(p); hkMemoryRouter::getInstance().heap().blockFree( p, (b->getMemorySizeAndFlags() == 0xffff) ? static_cast<int>(nbytes) : b->getMemorySizeAndFlags()); } else { if (p) hkMemoryRouter::getInstance().heap().blockFree(p, sizeof(Block)); } } inline __attribute__((always_inline)) void* operator new(hk_size_t, void* p) { return p; } inline __attribute__((always_inline)) void* operator new[](hk_size_t, void* p) { return p; } inline __attribute__((always_inline)) void operator delete(void*, void*) {} inline __attribute__((always_inline)) void operator delete[](void*, void*) {}\n static const hkClass& staticClass();\n\n Block();\n ~Block();\n\n alignas(16) hkpShapeKey m_slots[NUM_SLOTS_PER_BLOCK];\n Block* m_next;\n };\n\n enum { NUM_BYTES_PER_BLOCK = sizeof(Block) };\n\n hkpShapeKeyTable();\n explicit hkpShapeKeyTable(hkFinishLoadedObjectFlag flag);\n ~hkpShapeKeyTable();\n\n void insert(hkpShapeKey key);\n void remove(hkpShapeKey key);\n bool exists(hkpShapeKey key) const;\n\n bool isEmpty() const { return (m_occupancyBitField == 0); }\n void clear();\n void getDistribution(hkArray<int>& counts) const;\n\nprotected:\n Block* m_lists;\n hkUint32 m_occupancyBitField;\n};\n# 7 \"/home/larsvi/botw/lib/hkStubs/./Havok/Physics2012/Internal/Collide/StaticCompound/hkpStaticCompoundShape.h\" 2\n\nclass hkpStaticCompoundShape : public hkpBvTreeShape, public hkpShapeContainer {\npublic:\n inline __attribute__((always_inline)) void* operator new(hk_size_t nbytes) { if constexpr (std::is_base_of_v<hkReferencedObject, hkpStaticCompoundShape>) { return hkMemoryRouter::getInstance().heap().blockAlloc(static_cast<int>(nbytes)); } else { return hkMemoryRouter::getInstance().heap().blockAlloc(sizeof(hkpStaticCompoundShape)); } } inline __attribute__((always_inline)) void operator delete(void* p, hk_size_t nbytes) { if constexpr (std::is_base_of_v<hkReferencedObject, hkpStaticCompoundShape>) { auto* b = static_cast<hkReferencedObject*>(p); hkMemoryRouter::getInstance().heap().blockFree( p, (b->getMemorySizeAndFlags() == 0xffff) ? static_cast<int>(nbytes) : b->getMemorySizeAndFlags()); } else { if (p) hkMemoryRouter::getInstance().heap().blockFree(p, sizeof(hkpStaticCompoundShape)); } } inline __attribute__((always_inline)) void* operator new(hk_size_t, void* p) { return p; } inline __attribute__((always_inline)) void* operator new[](hk_size_t, void* p) { return p; } inline __attribute__((always_inline)) void operator delete(void*, void*) {} inline __attribute__((always_inline)) void operator delete[](void*, void*) {}\n static const hkClass& staticClass();\n enum { THIS_SHAPE_TYPE = (hkcdShapeType::STATIC_COMPOUND) };\n\n struct Instance {\n public:\n enum {\n FLAG_IS_LEAF = 1 << 0,\n FLAG_HAS_TRANSFORM = 1 << 1,\n FLAG_HAS_SCALE = 1 << 2,\n FLAG_HAS_FLIP = 1 << 3,\n\n FLAG_IS_DISABLED = 1 << 4,\n FLAG_HAS_DISABLED_SMALL_KEYS = 1 << 5,\n FLAG_HAS_DISABLED_LARGE_KEYS = 1 << 6,\n\n FLAGS_HAS_DISABLED_KEYS = FLAG_HAS_DISABLED_SMALL_KEYS | FLAG_HAS_DISABLED_LARGE_KEYS,\n FLAGS_ALL = (1 << 7) - 1,\n };\n\n enum : hkUint32 {\n NUM_BITS_FOR_FLAGS = 7,\n NUM_BITS_FOR_SHAPE_SIZE = 4,\n NUM_BITS_FOR_DISABLED_SMALL_KEYS = 37\n };\n\n protected:\n inline __attribute__((always_inline)) void setShapeSizeForSpu(hkUint32 size);\n inline __attribute__((always_inline)) void setFlags(hkUint32 flags);\n\n hkQsTransform m_transform;\n const hkpShape* m_shape;\n\n public:\n inline __attribute__((always_inline)) void* operator new(hk_size_t nbytes) { if constexpr (std::is_base_of_v<hkReferencedObject, Instance>) { return hkMemoryRouter::getInstance().heap().blockAlloc(static_cast<int>(nbytes)); } else { return hkMemoryRouter::getInstance().heap().blockAlloc(sizeof(Instance)); } } inline __attribute__((always_inline)) void operator delete(void* p, hk_size_t nbytes) { if constexpr (std::is_base_of_v<hkReferencedObject, Instance>) { auto* b = static_cast<hkReferencedObject*>(p); hkMemoryRouter::getInstance().heap().blockFree( p, (b->getMemorySizeAndFlags() == 0xffff) ? static_cast<int>(nbytes) : b->getMemorySizeAndFlags()); } else { if (p) hkMemoryRouter::getInstance().heap().blockFree(p, sizeof(Instance)); } } inline __attribute__((always_inline)) void* operator new(hk_size_t, void* p) { return p; } inline __attribute__((always_inline)) void* operator new[](hk_size_t, void* p) { return p; } inline __attribute__((always_inline)) void operator delete(void*, void*) {} inline __attribute__((always_inline)) void operator delete[](void*, void*) {}\n static const hkClass& staticClass();\n\n inline __attribute__((always_inline)) const hkQsTransform& getTransform() const;\n inline __attribute__((always_inline)) const hkpShape* getShape() const;\n inline __attribute__((always_inline)) hkUint32 getShapeSizeForSpu() const;\n inline __attribute__((always_inline)) hkUint32 getFlags() const;\n\n hkUint32 m_filterInfo;\n hkUint32 m_childFilterInfoMask;\n hkUlong m_userData;\n\n friend class hkpStaticCompoundShape;\n friend class hkpStaticCompoundShape_Internals;\n };\n\n enum Config {\n\n\n\n NUM_BYTES_FOR_TREE = 48\n\n };\n\npublic:\n explicit hkpStaticCompoundShape(ReferencePolicy ref = REFERENCE_POLICY_INCREMENT);\n explicit hkpStaticCompoundShape(hkFinishLoadedObjectFlag flag);\n\n ~hkpStaticCompoundShape() override;\n\n int addInstance(const hkpShape* shape, const hkQsTransform& transform);\n\n void bake();\n\n inline __attribute__((always_inline)) void decomposeShapeKey(hkpShapeKey keyIn, int& instanceIdOut,\n hkpShapeKey& childKeyOut) const;\n\n inline __attribute__((always_inline)) hkpShapeKey composeShapeKey(int instanceId, hkpShapeKey childKey) const;\n\n inline __attribute__((always_inline)) hkInt8 getNumBitsForChildShapeKey() const;\n\n inline __attribute__((always_inline)) const hkArray<Instance>& getInstances() const;\n\n inline __attribute__((always_inline)) void setInstanceFilterInfo(int instanceId, hkUint32 filterInfo);\n inline __attribute__((always_inline)) hkUint32 getInstanceFilterInfo(int instanceId) const;\n\n inline __attribute__((always_inline)) void setInstanceFilterInfoMask(int instanceId, hkUint32 filterInfoMask);\n inline __attribute__((always_inline)) hkUint32 getInstanceFilterInfoMask(int instanceId) const;\n\n inline __attribute__((always_inline)) void setInstanceUserData(int instanceId, hkUlong userData);\n inline __attribute__((always_inline)) hkUlong getInstanceUserData(int instanceId) const;\n\n inline __attribute__((always_inline)) void setInstanceExtraInfo(int instanceId, hkUint16 instanceInfo);\n inline __attribute__((always_inline)) hkUint16 getInstanceExtraInfo(int instanceId) const;\n inline __attribute__((always_inline)) const hkArray<hkUint16>& getInstanceExtraInfos() const;\n\n inline __attribute__((always_inline)) void setInstanceEnabled(int instanceId, hkBool32 isEnabled);\n inline __attribute__((always_inline)) hkBool32 isInstanceEnabled(int instanceId) const;\n\n void setShapeKeyEnabled(hkpShapeKey key, hkBool32 isEnabled);\n hkBool32 isShapeKeyEnabled(hkpShapeKey key) const;\n\n void enableAllInstancesAndShapeKeys();\n\n void castAabb(const hkpShape* shape, const hkTransform& transform, hkVector4Parameter to,\n hkpAabbCastCollector& collector, hkReal tolerance = 0.0f) const;\n\n const hkpShapeContainer* getContainer() const override { return this; }\n int calcSizeForSpu(const CalcSizeForSpuInput& input, int spuBufferSizeLeft) const override;\n hkReal getMaximumProjection(const hkVector4& direction) const override;\n void getAabb(const hkTransform& localToWorld, hkReal tolerance, hkAabb& out) const override;\n hkBool castRay(const hkpShapeRayCastInput& input,\n hkpShapeRayCastOutput& results) const override;\n void castRayWithCollector(const hkpShapeRayCastInput& input, const hkpCdBody& body,\n hkpRayHitCollector& collector) const override;\n\n void queryAabb(const hkAabb& aabb, hkArray<hkpShapeKey>& hits) const override;\n hkUint32 queryAabbImpl(const hkAabb& aabb, hkpShapeKey* hits, int maxNumKeys) const override;\n void castAabbImpl(const hkAabb& from, hkVector4Parameter to,\n hkpAabbCastCollector& collector) const override;\n\n int getNumChildShapes() const override;\n hkpShapeKey getFirstKey() const override;\n hkpShapeKey getNextKey(hkpShapeKey oldKey) const override;\n const hkpShape* getChildShape(hkpShapeKey key, hkpShapeBuffer& buffer) const override;\n hkUint32 getCollisionFilterInfo(hkpShapeKey key) const override;\n\nprotected:\n hkInt8 m_numBitsForChildShapeKey;\n hkInt8 m_referencePolicy;\n hkUint32 m_childShapeKeyMask;\n\n hkArray<Instance> m_instances;\n hkArray<hkUint16> m_instanceExtraInfos;\n hkpShapeKeyTable m_disabledLargeShapeKeyTable;\n\n alignas(16) hkUint8 m_tree[NUM_BYTES_FOR_TREE];\n\n friend class hkpStaticCompoundShape_Internals;\n};\n\ninline const hkQsTransform& hkpStaticCompoundShape::Instance::getTransform() const {\n return m_transform;\n}\n\ninline const hkpShape* hkpStaticCompoundShape::Instance::getShape() const {\n return m_shape;\n}\n\ninline void hkpStaticCompoundShape::Instance::setFlags(hkUint32 flags) {\n m_transform.m_translation.setInt24W(\n int((m_transform.m_translation.getInt24W() & ~FLAGS_ALL) | flags));\n}\n\ninline hkUint32 hkpStaticCompoundShape::Instance::getFlags() const {\n return m_transform.m_translation.getInt24W() & FLAGS_ALL;\n}\n\ninline void hkpStaticCompoundShape::Instance::setShapeSizeForSpu(hkUint32 size) {\n const hkUint32 shapeSizeMask = ((1 << NUM_BITS_FOR_SHAPE_SIZE) - 1) << NUM_BITS_FOR_FLAGS;\n hkUint32 bitfield = (m_transform.m_translation.getInt24W() & ~shapeSizeMask);\n\n const hkUint32 storedShapeSize = size / 16;\n\n bitfield |= storedShapeSize << NUM_BITS_FOR_FLAGS;\n m_transform.m_translation.setInt24W(int(bitfield));\n}\n\ninline hkUint32 hkpStaticCompoundShape::Instance::getShapeSizeForSpu() const {\n return ((m_transform.m_translation.getInt24W() >> NUM_BITS_FOR_FLAGS) &\n ((1 << NUM_BITS_FOR_SHAPE_SIZE) - 1)) *\n 16;\n}\n\ninline void hkpStaticCompoundShape::decomposeShapeKey(hkpShapeKey keyIn, int& instanceIdOut,\n hkpShapeKey& childKeyOut) const {\n instanceIdOut = int(keyIn >> m_numBitsForChildShapeKey);\n childKeyOut = keyIn & m_childShapeKeyMask;\n}\n\ninline hkpShapeKey hkpStaticCompoundShape::composeShapeKey(int instanceId,\n hkpShapeKey childKey) const {\n return (instanceId << m_numBitsForChildShapeKey) | childKey;\n}\n\ninline hkInt8 hkpStaticCompoundShape::getNumBitsForChildShapeKey() const {\n return m_numBitsForChildShapeKey;\n}\n\ninline const hkArray<hkpStaticCompoundShape::Instance>&\nhkpStaticCompoundShape::getInstances() const {\n return m_instances;\n}\n\ninline void hkpStaticCompoundShape::setInstanceFilterInfo(int instanceId, hkUint32 filterInfo) {\n m_instances[instanceId].m_filterInfo = filterInfo;\n}\n\ninline hkUint32 hkpStaticCompoundShape::getInstanceFilterInfo(int instanceId) const {\n return m_instances[instanceId].m_filterInfo;\n}\n\ninline void hkpStaticCompoundShape::setInstanceFilterInfoMask(int instanceId,\n hkUint32 filterInfoMask) {\n m_instances[instanceId].m_childFilterInfoMask = filterInfoMask;\n}\n\ninline hkUint32 hkpStaticCompoundShape::getInstanceFilterInfoMask(int instanceId) const {\n return m_instances[instanceId].m_childFilterInfoMask;\n}\n\ninline void hkpStaticCompoundShape::setInstanceUserData(int instanceId, hkUlong userData) {\n m_instances[instanceId].m_userData = userData;\n}\n\ninline hkUlong hkpStaticCompoundShape::getInstanceUserData(int instanceId) const {\n return m_instances[instanceId].m_userData;\n}\n\ninline void hkpStaticCompoundShape::setInstanceExtraInfo(int instanceId, hkUint16 instanceInfo) {\n const int maxSize = hkMath::max2(m_instanceExtraInfos.getSize(), instanceId + 1);\n m_instanceExtraInfos.setSize(maxSize);\n m_instanceExtraInfos[instanceId] = instanceInfo;\n}\n\ninline hkUint16 hkpStaticCompoundShape::getInstanceExtraInfo(int instanceId) const {\n return m_instanceExtraInfos[instanceId];\n}\n\ninline const hkArray<hkUint16>& hkpStaticCompoundShape::getInstanceExtraInfos() const {\n return m_instanceExtraInfos;\n}\n\ninline void hkpStaticCompoundShape::setInstanceEnabled(int instanceId, hkBool32 isEnabled) {\n Instance& instance = m_instances[instanceId];\n hkUint32 flags = instance.getFlags();\n flags =\n (isEnabled ? (flags & ~Instance::FLAG_IS_DISABLED) : (flags | Instance::FLAG_IS_DISABLED));\n instance.setFlags(flags);\n}\n\ninline hkBool32 hkpStaticCompoundShape::isInstanceEnabled(int instanceId) const {\n return !(m_instances[instanceId].getFlags() & Instance::FLAG_IS_DISABLED);\n}\n# 14 \"/home/larsvi/botw/src/KingSystem/Physics/System/physRayCast.cpp\" 2\n# 1 \"/home/larsvi/botw/lib/hkStubs/./Havok/Physics2012/Utilities/Collide/ShapeUtils/ShapeKeyPath/hkpShapeKeyPath.h\" 1\n\n\n\n\n\n\nclass hkpContactPointEvent;\nstruct hkpRootCdPoint;\nstruct hkpShapeRayBundleCastOutput;\nstruct hkpWorldRayCastOutput;\n\nclass hkpShapeKeyPath {\npublic:\n inline __attribute__((always_inline)) void* operator new(hk_size_t nbytes) { if constexpr (std::is_base_of_v<hkReferencedObject, hkpShapeKeyPath>) { return hkMemoryRouter::getInstance().heap().blockAlloc(static_cast<int>(nbytes)); } else { return hkMemoryRouter::getInstance().heap().blockAlloc(sizeof(hkpShapeKeyPath)); } } inline __attribute__((always_inline)) void operator delete(void* p, hk_size_t nbytes) { if constexpr (std::is_base_of_v<hkReferencedObject, hkpShapeKeyPath>) { auto* b = static_cast<hkReferencedObject*>(p); hkMemoryRouter::getInstance().heap().blockFree( p, (b->getMemorySizeAndFlags() == 0xffff) ? static_cast<int>(nbytes) : b->getMemorySizeAndFlags()); } else { if (p) hkMemoryRouter::getInstance().heap().blockFree(p, sizeof(hkpShapeKeyPath)); } } inline __attribute__((always_inline)) void* operator new(hk_size_t, void* p) { return p; } inline __attribute__((always_inline)) void* operator new[](hk_size_t, void* p) { return p; } inline __attribute__((always_inline)) void operator delete(void*, void*) {} inline __attribute__((always_inline)) void operator delete[](void*, void*) {}\n\n class Iterator;\n\n hkpShapeKeyPath(const hkpContactPointEvent& event, int bodyIdx);\n explicit hkpShapeKeyPath(const hkpWorldRayCastOutput& output);\n hkpShapeKeyPath(const hkpShape* shape, const hkpShapeRayCastOutput& output);\n\n hkpShapeKey getShapeKey(int keyIndex) const;\n\n Iterator getIterator() const;\n\n void getShapes(int maxShapesOut, hkpShapeBuffer* buffers, const hkpShape** shapesOut,\n int& numShapesOut);\n\n class Iterator {\n public:\n inline __attribute__((always_inline)) void* operator new(hk_size_t nbytes) { if constexpr (std::is_base_of_v<hkReferencedObject, Iterator>) { return hkMemoryRouter::getInstance().heap().blockAlloc(static_cast<int>(nbytes)); } else { return hkMemoryRouter::getInstance().heap().blockAlloc(sizeof(Iterator)); } } inline __attribute__((always_inline)) void operator delete(void* p, hk_size_t nbytes) { if constexpr (std::is_base_of_v<hkReferencedObject, Iterator>) { auto* b = static_cast<hkReferencedObject*>(p); hkMemoryRouter::getInstance().heap().blockFree( p, (b->getMemorySizeAndFlags() == 0xffff) ? static_cast<int>(nbytes) : b->getMemorySizeAndFlags()); } else { if (p) hkMemoryRouter::getInstance().heap().blockFree(p, sizeof(Iterator)); } } inline __attribute__((always_inline)) void* operator new(hk_size_t, void* p) { return p; } inline __attribute__((always_inline)) void* operator new[](hk_size_t, void* p) { return p; } inline __attribute__((always_inline)) void operator delete(void*, void*) {} inline __attribute__((always_inline)) void operator delete[](void*, void*) {}\n\n friend class hkpShapeKeyPath;\n\n /// Returns nullptr if the iterator is invalid.\n const hkpShape* getShape() const;\n\n /// @warning This can invalidate the shape.\n void next();\n\n hkBool isValid() const;\n\n private:\n Iterator(const hkpShapeKeyPath* path, const hkpShape* rootShape);\n void nextImpl(hkpShapeBuffer* buf);\n\n const hkpShapeKeyPath* m_path;\n const hkpShape* m_currentShape;\n int m_currentKeyIdx;\n hkBool m_isValid;\n hkpShapeBuffer m_tempBuffer;\n };\n\nprivate:\n void init(const hkpShape* shape, const hkpShapeKey* keys, int maxKeys);\n\n const hkpShape* m_rootShape;\n const hkpShapeKey* m_keys;\n int m_numKeys;\n hkBool m_isOrderLeafToRoot;\n};\n\ninline hkpShapeKeyPath::Iterator hkpShapeKeyPath::getIterator() const {\n return {this, m_rootShape};\n}\n\ninline const hkpShape* hkpShapeKeyPath::Iterator::getShape() const {\n return m_currentShape;\n}\n\ninline void hkpShapeKeyPath::Iterator::next() {\n return nextImpl(&m_tempBuffer);\n}\n\ninline hkBool hkpShapeKeyPath::Iterator::isValid() const {\n return m_isValid;\n}\n# 15 \"/home/larsvi/botw/src/KingSystem/Physics/System/physRayCast.cpp\" 2\n# 1 \"/home/larsvi/botw/lib/sead/include/prim/seadScopeGuard.h\" 1\n\n\n#include <optional>\n\n\nnamespace sead\n{\ntemplate <typename Function>\nclass ScopeGuard final\n{\npublic:\n ScopeGuard(Function&& function) : mFunction(std::move(function)) {}\n ScopeGuard(ScopeGuard&& other) noexcept\n {\n mFunction = std::move(other.mFunction);\n other.dismiss();\n }\n\n ~ScopeGuard() { exit(); }\n\n void dismiss() { mFunction.reset(); }\n\n void exit()\n {\n if (!mFunction)\n return;\n (*mFunction)();\n dismiss();\n }\n\nprivate:\n std::optional<Function> mFunction;\n};\n\n/// To work around the lack of CTAD in compilers with incomplete C++17 support.\ntemplate <typename Function>\n[[nodiscard]] ScopeGuard<Function> makeScopeGuard(Function&& function)\n{\n return ScopeGuard<Function>(std::forward<Function>(function));\n}\n} // namespace sead\n# 16 \"/home/larsvi/botw/src/KingSystem/Physics/System/physRayCast.cpp\" 2\n# 1 \"/home/larsvi/botw/src/KingSystem/Physics/RigidBody/physRigidBody.h\" 1\n\n\n\n# 1 \"/home/larsvi/botw/lib/sead/include/gfx/seadColor.h\" 1\n/*\n * Copyright (c) 2020 The Starlight Project\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n\n\n\n\nnamespace sead\n{\nclass Color4f\n{\npublic:\n Color4f() = default;\n Color4f(f32 r, f32 g, f32 b, f32 a) : r(r), g(g), b(b), a(a) {}\n\n static Color4f lerp(const Color4f& color1, const Color4f& color2, f32 t);\n\n void setLerp(const Color4f& color1, const Color4f& color2, f32 t);\n // This should actually be called setGammaCorrection...\n void setGammaCollection(const Color4f& value, f32 gamma);\n void adjustOverflow();\n\n Color4f& operator+=(const Color4f& rhs);\n Color4f& operator-=(const Color4f& rhs);\n Color4f& operator*=(const Color4f& rhs);\n Color4f& operator/=(const Color4f& rhs);\n Color4f& operator+=(f32 x);\n Color4f& operator-=(f32 x);\n Color4f& operator*=(f32 x);\n Color4f& operator/=(f32 x);\n\n friend Color4f operator+(const Color4f& lhs, const Color4f& rhs);\n friend Color4f operator-(const Color4f& lhs, const Color4f& rhs);\n friend Color4f operator*(const Color4f& lhs, const Color4f& rhs);\n friend Color4f operator/(const Color4f& lhs, const Color4f& rhs);\n friend Color4f operator+(const Color4f& lhs, f32 x);\n friend Color4f operator-(const Color4f& lhs, f32 x);\n friend Color4f operator*(const Color4f& lhs, f32 x);\n friend Color4f operator/(const Color4f& lhs, f32 x);\n friend bool operator==(const Color4f& lhs, const Color4f& rhs);\n\n f32 r = cElementMin;\n f32 g = cElementMin;\n f32 b = cElementMin;\n f32 a = cElementMax;\n\n static const f32 cElementMax;\n static const f32 cElementMin;\n\n static const Color4f cBlack;\n static const Color4f cGray;\n static const Color4f cWhite;\n static const Color4f cRed;\n static const Color4f cGreen;\n static const Color4f cBlue;\n static const Color4f cYellow;\n static const Color4f cMagenta;\n static const Color4f cCyan;\n};\n\nclass Color4u8\n{\npublic:\n Color4u8() = default;\n Color4u8(u8 r, u8 g, u8 b, u8 a) : a(a), b(b), g(g), r(r) {}\n\n static Color4u8 lerp(const Color4u8& color1, const Color4u8& color2, f32 t);\n\n void setf(f32 r, f32 g, f32 b, f32 a);\n void setLerp(const Color4u8& color1, const Color4u8& color2, f32 t);\n // This should actually be called setGammaCorrection...\n void setGammaCollection(const Color4u8& value, f32 gamma);\n\n Color4u8& operator+=(const Color4u8& rhs);\n Color4u8& operator-=(const Color4u8& rhs);\n Color4u8& operator*=(const Color4u8& rhs);\n Color4u8& operator/=(const Color4u8& rhs);\n Color4u8& operator|=(const Color4u8& rhs);\n Color4u8& operator&=(const Color4u8& rhs);\n Color4u8& operator+=(u8 x);\n Color4u8& operator-=(u8 x);\n Color4u8& operator*=(f32 x);\n Color4u8& operator/=(f32 x);\n Color4u8& operator|=(u8 x);\n Color4u8& operator&=(u8 x);\n\n friend Color4u8 operator+(const Color4u8& lhs, const Color4u8& rhs);\n friend Color4u8 operator-(const Color4u8& lhs, const Color4u8& rhs);\n friend Color4u8 operator*(const Color4u8& lhs, const Color4u8& rhs);\n friend Color4u8 operator/(const Color4u8& lhs, const Color4u8& rhs);\n friend Color4u8 operator+(const Color4u8& lhs, u8 x);\n friend Color4u8 operator-(const Color4u8& lhs, u8 x);\n friend Color4u8 operator*(const Color4u8& lhs, f32 x);\n friend Color4u8 operator/(const Color4u8& lhs, f32 x);\n friend Color4u8 operator&(const Color4u8& lhs, u8 x);\n friend Color4u8 operator|(const Color4u8& lhs, u8 x);\n friend bool operator==(const Color4u8& lhs, const Color4u8& rhs);\n\n u8 a;\n u8 b;\n u8 g;\n u8 r;\n\n static const u8 cElementMax;\n static const u8 cElementMin;\n\n static const Color4u8 cBlack;\n static const Color4u8 cGray;\n static const Color4u8 cWhite;\n static const Color4u8 cRed;\n static const Color4u8 cGreen;\n static const Color4u8 cBlue;\n static const Color4u8 cYellow;\n static const Color4u8 cMagenta;\n static const Color4u8 cCyan;\n\nprivate:\n template <typename Callable>\n Color4u8& apply_(Callable fn)\n {\n fn(&Color4u8::r);\n fn(&Color4u8::g);\n fn(&Color4u8::b);\n fn(&Color4u8::a);\n return *this;\n }\n};\n} // namespace sead\n# 5 \"/home/larsvi/botw/src/KingSystem/Physics/RigidBody/physRigidBody.h\" 2\n\n# 1 \"/home/larsvi/botw/lib/sead/include/math/seadBoundBox.h\" 1\n\n\n\n\nnamespace sead\n{\ntemplate <typename T>\nstruct BoundBox2\n{\n using Vector2 = sead::Vector2<T>;\n\n BoundBox2() { setUndef(); }\n BoundBox2(T x0, T y0, T x1, T y1) { set(x0, y0, x1, y1); }\n BoundBox2(const Vector2& min, const Vector2& max) : mMin(min), mMax(max) {}\n\n T getSizeX() const { return mMax.x - mMin.x; }\n T getSizeY() const { return mMax.y - mMin.y; }\n\n T getHalfSizeX() const { return (mMax.x - mMin.x) / 2.0f; }\n T getHalfSizeY() const { return (mMax.y - mMin.y) / 2.0f; }\n\n const Vector2& getMin() const { return mMin; }\n const Vector2& getMax() const { return mMax; }\n\n Vector2 getTL() const { return mMin; }\n Vector2 getTR() const { return Vector2(mMax.x, mMin.y); }\n Vector2 getBL() const { return Vector2(mMin.x, mMax.y); }\n Vector2 getBR() const { return mMax; }\n\n Vector2 getCenter() const;\n void getCenter(Vector2* p) const;\n bool isUndef() const;\n bool isInside(const Vector2& p) const;\n\n void setUndef();\n void set(T x0, T y0, T x1, T y1);\n void set(const Vector2& min, const Vector2& max);\n void setMin(const Vector2& min);\n void setMax(const Vector2& max);\n void setFromCenterAndXY(T centerX, T centerY, T sizeX, T sizeY);\n void setFromCornerAndXY(T cornerX, T cornerY, T sizeX, T sizeY);\n void setFromCenterAndXY(const Vector2& center, T sizeX, T sizeY)\n {\n setFromCenterAndXY(center.x, center.y, sizeX, sizeY);\n }\n void setFromCornerAndXY(const Vector2& corner, T sizeX, T sizeY);\n void offset(T dx, T dy);\n void offset(const Vector2& dv);\n void scaleX(T sx);\n void scaleY(T sy);\n\nprivate:\n Vector2 mMin;\n Vector2 mMax;\n\n static const BoundBox2<T> cUndefined;\n};\n\ntemplate <typename T>\nstruct BoundBox3\n{\n using Vector3 = sead::Vector3<T>;\n\n BoundBox3() { setUndef(); }\n BoundBox3(T x0, T y0, T z0, T x1, T y1, T z1) { set(x0, y0, z0, x1, y1, z1); }\n BoundBox3(const Vector3& min, const Vector3& max) { set(min, max); }\n\n T getSizeX() const { return mMax.x - mMin.x; }\n T getSizeY() const { return mMax.y - mMin.y; }\n T getSizeZ() const { return mMax.z - mMin.z; }\n\n T getHalfSizeX() const { return (mMax.x - mMin.x) / 2.0f; }\n T getHalfSizeY() const { return (mMax.y - mMin.y) / 2.0f; }\n T getHalfSizeZ() const { return (mMax.z - mMin.z) / 2.0f; }\n\n const Vector3& getMin() const { return mMin; }\n const Vector3& getMax() const { return mMax; }\n\n Vector3 getCenter() const;\n void getCenter(Vector3* p) const;\n bool isUndef() const;\n bool isInside(const Vector3& p) const;\n\n void setUndef();\n void set(T x0, T y0, T z0, T x1, T y1, T z1);\n void set(const Vector3& min, const Vector3& max);\n void setMin(const Vector3& min);\n void setMax(const Vector3& max);\n void offset(T dx, T dy, T dz);\n void offset(const Vector3& dv);\n void scaleX(T sx);\n void scaleY(T sy);\n void scaleZ(T sz);\n\nprivate:\n Vector3 mMin;\n Vector3 mMax;\n\n static const BoundBox3<T> cUndefined;\n};\n\ntypedef BoundBox2<f32> BoundBox2f;\ntypedef BoundBox3<f32> BoundBox3f;\n\n} // namespace sead\n\n\n\n# 1 \"/home/larsvi/botw/lib/sead/include/math/seadBoundBox.hpp\" 1\n\n\n\n\n\n\n\n\nnamespace sead\n{\ntemplate <typename T>\ninline Vector2<T> BoundBox2<T>::getCenter() const\n{\n return Vector2((mMin.x + mMax.x) / 2.0f, (mMin.y + mMax.y) / 2.0f);\n}\n\ntemplate <typename T>\ninline void BoundBox2<T>::getCenter(Vector2* center) const\n{\n center->set((mMin.x + mMax.x) / 2.0f, (mMin.y + mMax.y) / 2.0f);\n}\n\ntemplate <typename T>\ninline bool BoundBox2<T>::isUndef() const\n{\n return mMin.x > mMax.x || mMin.y > mMax.y;\n}\n\ntemplate <typename T>\ninline bool BoundBox2<T>::isInside(const Vector2& p) const\n{\n return mMin.x <= p.x && p.x <= mMax.x && mMin.y <= p.y && p.y <= mMax.y;\n}\n\ntemplate <typename T>\ninline void BoundBox2<T>::setUndef()\n{\n const T max = MathCalcCommon<T>::maxNumber();\n mMin.set(max, max);\n const T min = MathCalcCommon<T>::minNumber();\n mMax.set(min, min);\n}\n\ntemplate <typename T>\ninline void BoundBox2<T>::set(T x0, T y0, T x1, T y1)\n{\n if (x0 < x1)\n {\n mMin.x = x0;\n mMax.x = x1;\n }\n else\n {\n mMin.x = x1;\n mMax.x = x0;\n }\n\n if (y0 < y1)\n {\n mMin.y = y0;\n mMax.y = y1;\n }\n else\n {\n mMin.y = y1;\n mMax.y = y0;\n }\n}\n\ntemplate <typename T>\ninline void BoundBox2<T>::set(const Vector2& min, const Vector2& max)\n{\n mMin = min;\n mMax = max;\n}\n\ntemplate <typename T>\ninline void BoundBox2<T>::setMin(const Vector2& min)\n{\n mMin = min;\n}\n\ntemplate <typename T>\ninline void BoundBox2<T>::setMax(const Vector2& max)\n{\n mMax = max;\n}\n\ntemplate <typename T>\ninline void BoundBox2<T>::setFromCenterAndXY(T centerX, T centerY, T sizeX, T sizeY)\n{\n mMin.set(centerX - sizeX / 2.0f, centerY - sizeY / 2.0f);\n mMax.set(centerX + sizeX / 2.0f, centerY + sizeY / 2.0f);\n}\n\ntemplate <typename T>\ninline void BoundBox2<T>::setFromCornerAndXY(T cornerX, T cornerY, T sizeX, T sizeY)\n{\n mMin.set(cornerX, cornerY);\n mMax.set(cornerX + sizeX, cornerY + sizeY);\n}\n\ntemplate <typename T>\ninline void BoundBox2<T>::setFromCornerAndXY(const Vector2& corner, T sizeX, T sizeY)\n{\n mMin.set(corner.x, corner.y);\n mMax.set(corner.x + sizeX, corner.y + sizeY);\n}\n\ntemplate <typename T>\ninline void BoundBox2<T>::offset(T dx, T dy)\n{\n mMin.x += dx;\n mMin.y += dy;\n mMax.x += dx;\n mMax.y += dy;\n}\n\ntemplate <typename T>\ninline void BoundBox2<T>::offset(const Vector2& dv)\n{\n offset(dv.x, dv.y);\n}\n\ntemplate <typename T>\ninline void BoundBox2<T>::scaleX(T sx)\n{\n T sizeX = (mMax.x - mMin.x) * (sx / 2.0f);\n T centerX = (mMin.x + mMax.x) / 2.0f;\n\n mMin.x = centerX - sizeX;\n mMax.x = centerX + sizeX;\n}\n\ntemplate <typename T>\ninline void BoundBox2<T>::scaleY(T sy)\n{\n T sizeY = (mMax.y - mMin.y) * (sy / 2.0f);\n T centerY = (mMin.y + mMax.y) / 2.0f;\n\n mMin.y = centerY - sizeY;\n mMax.y = centerY + sizeY;\n}\n\ntemplate <typename T>\ninline Vector3<T> BoundBox3<T>::getCenter() const\n{\n return Vector3((mMin.x + mMax.x) / 2.0f, (mMin.y + mMax.y) / 2.0f, (mMin.z + mMax.z) / 2.0f);\n}\n\ntemplate <typename T>\ninline void BoundBox3<T>::getCenter(Vector3* center) const\n{\n center->set((mMin.x + mMax.x) / 2.0f, (mMin.y + mMax.y) / 2.0f, (mMin.z + mMax.z) / 2.0f);\n}\n\ntemplate <typename T>\ninline bool BoundBox3<T>::isUndef() const\n{\n return mMin.x > mMax.x || mMin.y > mMax.y || mMin.z > mMax.z;\n}\n\ntemplate <typename T>\ninline bool BoundBox3<T>::isInside(const Vector3& p) const\n{\n return mMin.x <= p.x && p.x <= mMax.x && mMin.y <= p.y && p.y <= mMax.y && mMin.z <= p.z &&\n p.z <= mMax.z;\n}\n\ntemplate <typename T>\ninline void BoundBox3<T>::setUndef()\n{\n const T max = MathCalcCommon<T>::maxNumber();\n mMin.set(max, max, max);\n const T min = MathCalcCommon<T>::minNumber();\n mMax.set(min, min, min);\n}\n\ntemplate <typename T>\ninline void BoundBox3<T>::set(T x0, T y0, T z0, T x1, T y1, T z1)\n{\n if (x0 < x1)\n {\n mMin.x = x0;\n mMax.x = x1;\n }\n else\n {\n mMin.x = x1;\n mMax.x = x0;\n }\n\n if (y0 < y1)\n {\n mMin.y = y0;\n mMax.y = y1;\n }\n else\n {\n mMin.y = y1;\n mMax.y = y0;\n }\n\n if (z0 < z1)\n {\n mMin.z = z0;\n mMax.z = z1;\n }\n else\n {\n mMin.z = z1;\n mMax.z = z0;\n }\n}\n\ntemplate <typename T>\ninline void BoundBox3<T>::set(const Vector3& min, const Vector3& max)\n{\n mMin = min;\n mMax = max;\n}\n\ntemplate <typename T>\ninline void BoundBox3<T>::setMin(const Vector3& min)\n{\n mMin = min;\n}\n\ntemplate <typename T>\ninline void BoundBox3<T>::setMax(const Vector3& max)\n{\n mMax = max;\n}\n\ntemplate <typename T>\ninline void BoundBox3<T>::offset(T dx, T dy, T dz)\n{\n mMin.x += dx;\n mMin.y += dy;\n mMin.z += dz;\n mMax.x += dx;\n mMax.y += dy;\n mMax.z += dz;\n}\n\ntemplate <typename T>\ninline void BoundBox3<T>::offset(const Vector3& dv)\n{\n offset(dv.x, dv.y, dv.z);\n}\n\ntemplate <typename T>\ninline void BoundBox3<T>::scaleX(T sx)\n{\n T sizeX = (mMax.x - mMin.x) * (sx / 2.0f);\n T centerX = (mMin.x + mMax.x) / 2.0f;\n\n mMin.x = centerX - sizeX;\n mMax.x = centerX + sizeX;\n}\n\ntemplate <typename T>\ninline void BoundBox3<T>::scaleY(T sy)\n{\n T sizeY = (mMax.y - mMin.y) * (sy / 2.0f);\n T centerY = (mMin.y + mMax.y) / 2.0f;\n\n mMin.y = centerY - sizeY;\n mMax.y = centerY + sizeY;\n}\n\ntemplate <typename T>\ninline void BoundBox3<T>::scaleZ(T sz)\n{\n T sizeZ = (mMax.z - mMin.z) * (sz / 2.0f);\n T centerZ = (mMin.z + mMax.z) / 2.0f;\n\n mMin.z = centerZ - sizeZ;\n mMax.z = centerZ + sizeZ;\n}\n\n} // namespace sead\n# 109 \"/home/larsvi/botw/lib/sead/include/math/seadBoundBox.h\" 2\n# 7 \"/home/larsvi/botw/src/KingSystem/Physics/RigidBody/physRigidBody.h\" 2\n\n\n# 1 \"/home/larsvi/botw/lib/sead/include/prim/seadTypedBitFlag.h\" 1\n\n\n\n\n\n\n\nnamespace sead\n{\ntemplate <typename Enum, typename Storage = std::underlying_type_t<Enum>>\nclass TypedBitFlag\n{\npublic:\n static_assert(std::is_enum<Enum>(), \"Enum must be an enum\");\n using UnderlyingType = std::underlying_type_t<Enum>;\n\n TypedBitFlag() : mBits(0) {}\n explicit TypedBitFlag(UnderlyingType bits) : mBits(bits) {}\n TypedBitFlag(Enum bits) : mBits(UnderlyingType(bits)) {}\n template <typename T>\n explicit TypedBitFlag(const TypedBitFlag<Enum, T>& other)\n {\n *this = other;\n }\n\n template <typename T>\n TypedBitFlag& operator=(const TypedBitFlag<Enum, T>& other)\n {\n mBits = other.getDirect();\n return *this;\n }\n\n TypedBitFlag& operator=(Enum value)\n {\n setDirect(value);\n return *this;\n }\n\n void makeAllZero() { mBits = 0; }\n void makeAllOne() { mBits = ~UnderlyingType(0); }\n\n void setDirect(UnderlyingType bits) { mBits = bits; }\n void setDirect(Enum bits) { mBits = UnderlyingType(bits); }\n UnderlyingType getDirect() const { return mBits; }\n Storage& getStorage() { return mBits; }\n\n bool set(Enum val)\n {\n const auto mask = UnderlyingType(val);\n return ((mBits |= mask) & mask) == 0;\n }\n\n bool reset(Enum val)\n {\n const auto mask = UnderlyingType(val);\n return ((mBits &= ~mask) & mask) != 0;\n }\n\n UnderlyingType toggle(Enum val) { mBits ^= UnderlyingType(val); }\n bool change(Enum val, bool on) { return on ? set(val) : reset(val); }\n bool isZero() const { return mBits == 0; }\n /// Checks if (at least) one of the bits are set.\n bool isOn(Enum val) const { return (mBits & UnderlyingType(val)) != 0; }\n bool isAnyOn(std::initializer_list<Enum> list) const { return (mBits & orEnums_(list)) != 0; }\n /// Checks if all of the bits are set.\n bool isOnAll(Enum val) const { return (mBits & UnderlyingType(val)) == UnderlyingType(val); }\n bool isOff(Enum val) const { return !isOn(val); }\n\n bool testAndClear(Enum val)\n {\n if (!isOn(val))\n return false;\n reset(val);\n return true;\n }\n\n /// Popcount.\n int countOnBit() const\n {\n if constexpr (sizeof(UnderlyingType) <= 4)\n return BitFlagUtil::countOnBit(mBits);\n else\n return BitFlagUtil::countOnBit64(mBits);\n }\n /// Count trailing zeroes.\n int countContinuousOffBitFromRight() const\n {\n if constexpr (sizeof(UnderlyingType) <= 4)\n return BitFlagUtil::countContinuousOffBitFromRight(mBits);\n else\n return BitFlagUtil::countContinuousOffBitFromRight64(mBits);\n }\n int countRightOnBit(int bit) const\n {\n if constexpr (sizeof(UnderlyingType) <= 4)\n return BitFlagUtil::countRightOnBit(mBits, bit);\n else\n return BitFlagUtil::countRightOnBit64(mBits, bit);\n }\n int findOnBitFromRight(int num) const\n {\n if constexpr (sizeof(UnderlyingType) <= 4)\n
return BitFlagUtil::findOnBitFromRight(mBits, num);\n else\n return BitFlagUtil::findOnBitFromRight64(mBits, num);\n }\n\nprotected:\n static constexpr UnderlyingType orEnums_(std::initializer_list<Enum> list)\n {\n UnderlyingType value{};\n for (auto x : list)\n value |= static_cast<UnderlyingType>(x);\n return value;\n }\n\n Storage mBits;\n};\n} // namespace sead\n# 10 \"/home/larsvi/botw/src/KingSystem/Physics/RigidBody/physRigidBody.h\" 2\n\n\n# 1 \"/home/larsvi/botw/src/KingSystem/Physics/RigidBody/physRigidBodyAccessor.h\" 1\n\n\n# 1 \"/home/larsvi/botw/lib/sead/include/math/seadMatrix.h\" 1\n\n\n\n\n# 1 \"/home/larsvi/botw/lib/sead/include/math/seadQuat.h\" 1\n\n\n\n\n\n\n\n\nnamespace sead\n{\ntemplate <typename T>\nstruct Quat : public Policies<T>::QuatBase\n{\nprivate:\n typedef Quat<T> Self;\n typedef Vector3<T> Vec3;\n\npublic:\n Quat() {}\n Quat(const Quat& other) = default;\n Quat(T w, T x, T y, T z);\n\n Quat& operator=(const Quat& other)\n {\n this->w = other.w;\n this->x = other.x;\n this->y = other.y;\n this->z = other.z;\n return *this;\n }\n\n friend Quat operator*(const Quat& a, T t)\n {\n auto result = a;\n result *= t;\n return result;\n }\n\n friend Quat operator*(const Quat& a, const Quat& b)\n {\n auto result = a;\n result *= b;\n return result;\n }\n\n friend Quat operator*(T t, const Quat& a) { return operator*(a, t); }\n\n Quat& operator*=(const Quat& t);\n\n Quat& operator*=(T t)\n {\n this->w *= t;\n this->x *= t;\n this->y *= t;\n this->z *= t;\n return *this;\n }\n\n bool operator==(const Quat& rhs) const\n {\n return this->x == rhs.x && this->y == rhs.y && this->z == rhs.z && this->w == rhs.w;\n }\n\n T length() const;\n T normalize();\n T dot(const Self& q);\n void inverse(Self* q);\n\n void makeUnit();\n bool makeVectorRotation(const Vec3& from, const Vec3& to);\n void set(T w, T x, T y, T z);\n void setRPY(T roll, T pitch, T yaw);\n void calcRPY(Vec3& rpy) const;\n\n static const Quat unit;\n};\n\nusing Quatf = Quat<f32>;\n\ntemplate <>\nconst Quatf Quatf::unit;\n\n} // namespace sead\n\n\n\n# 1 \"/home/larsvi/botw/lib/sead/include/math/seadQuat.hpp\" 1\n\n\n# 1 \"/home/larsvi/botw/lib/sead/include/math/seadQuatCalcCommon.h\" 1\n\n\n\n\nnamespace sead\n{\ntemplate <typename T>\nclass QuatCalcCommon\n{\npublic:\n using Base = typename Policies<T>::QuatBase;\n using Vec3 = typename Policies<T>::Vec3Base;\n\n static T length(const Base& v);\n static T normalize(Base& v);\n static T dot(const Base& u, const Base& v);\n static void setMul(Base& out, const Base& u, const Base& v);\n static void slerpTo(Base& out, const Base& q1, const Base& q2, f32 t);\n static void makeUnit(Base& q);\n static bool makeVectorRotation(Base& q, const Vec3& from, const Vec3& to);\n static void set(Base& q, T w, T x, T y, T z);\n static void setRPY(Base& q, T roll, T pitch, T yaw);\n static void calcRPY(Vec3& rpy, const Base& q);\n};\n\n} // namespace sead\n\n\n\n# 1 \"/home/larsvi/botw/lib/sead/include/math/seadQuatCalcCommon.hpp\" 1\n# 11 \"/home/larsvi/botw/lib/sead/include/math/seadQuatCalcCommon.hpp\"\nnamespace sead\n{\ntemplate <typename T>\ninline T QuatCalcCommon<T>::length(const Base& v)\n{\n return std::sqrt(dot(v, v));\n}\n\ntemplate <typename T>\ninline T QuatCalcCommon<T>::normalize(Base& v)\n{\n const T len = length(v);\n if (len > 0)\n {\n const T inv_len = 1 / len;\n v.w *= inv_len;\n v.x *= inv_len;\n v.y *= inv_len;\n v.z *= inv_len;\n }\n\n return len;\n}\n\ntemplate <typename T>\ninline T QuatCalcCommon<T>::dot(const Base& u, const Base& v)\n{\n return (u.w * v.w) + (u.x * v.x) + (u.y * v.y) + (u.z * v.z);\n}\n\ntemplate <typename T>\ninline void QuatCalcCommon<T>::setMul(Base& out, const Base& u, const Base& v)\n{\n T w = (u.w * v.w) - (u.x * v.x) - (u.y * v.y) - (u.z * v.z);\n T x = (u.w * v.x) + (u.x * v.w) + (u.y * v.z) - (u.z * v.y);\n T y = (u.w * v.y) - (u.x * v.z) + (u.y * v.w) + (u.z * v.x);\n T z = (u.w * v.z) + (u.x * v.y) - (u.y * v.x) + (u.z * v.w);\n out.w = w;\n out.x = x;\n out.y = y;\n out.z = z;\n}\n\ntemplate <typename T>\ninline void QuatCalcCommon<T>::slerpTo(Base& out, const Base& q1, const Base& q2, f32 t)\n{\n T dot = (q1.x * q2.x) + (q1.y * q2.y) + (q1.z * q2.z) + (q1.w * q2.w);\n if (dot > 1)\n dot = 1;\n else if (dot < -1)\n dot = -1;\n\n const T dot_0 = dot;\n if (dot < 0)\n dot = -dot;\n\n T a, b;\n const T theta_0 = MathCalcCommon<T>::acos(dot);\n const T sin_theta_0 = std::sin(theta_0);\n if (MathCalcCommon<T>::abs(sin_theta_0) < std::numeric_limits<T>::epsilon())\n {\n a = 1.0f - t;\n b = t;\n }\n else\n {\n const T theta = theta_0 * t;\n const T sin_theta_0_inv = 1.0f / sin_theta_0;\n a = sin_theta_0_inv * std::sin(theta_0 - theta);\n b = sin_theta_0_inv * std::sin(theta);\n }\n\n if (dot_0 < 0)\n b = -b;\n\n out.x = a * q1.x + b * q2.x;\n out.y = a * q1.y + b * q2.y;\n out.z = a * q1.z + b * q2.z;\n out.w = a * q1.w + b * q2.w;\n}\n\ntemplate <typename T>\ninline void QuatCalcCommon<T>::makeUnit(Base& q)\n{\n q = Quat<T>::unit;\n}\n\ntemplate <typename T>\ninline bool QuatCalcCommon<T>::makeVectorRotation(Base& q, const Vec3& from, const Vec3& to)\n{\n // Based on The Shortest Arc Quaternion from Game Programming Gems 1\n Vec3 cross;\n Vector3CalcCommon<T>::cross(cross, from, to);\n const T dot = Vector3CalcCommon<T>::dot(from, to) + 1;\n\n if (dot <= MathCalcCommon<T>::epsilon())\n {\n makeUnit(q);\n return false;\n }\n else\n {\n T s = MathCalcCommon<T>::sqrt(2 * dot);\n T rs = 1 / s;\n set(q, s * 0.5f, cross.x * rs, cross.y * rs, cross.z * rs);\n return true;\n }\n}\n\ntemplate <typename T>\ninline void QuatCalcCommon<T>::set(Base& q, T w, T x, T y, T z)\n{\n q.w = w;\n q.x = x;\n q.y = y;\n q.z = z;\n}\n\ntemplate <typename T>\ninline void QuatCalcCommon<T>::setRPY(Base& q, T roll, T pitch, T yaw)\n{\n const T cy = std::cos(yaw / 2);\n const T cp = std::cos(pitch / 2);\n const T cr = std::cos(roll / 2);\n const T sy = std::sin(yaw / 2);\n const T sp = std::sin(pitch / 2);\n const T sr = std::sin(roll / 2);\n\n const T cy_cp = cy * cp;\n const T sy_sp = sy * sp;\n const T cy_sp = cy * sp;\n const T sy_cp = sy * cp;\n\n const T w = (cy_cp * cr) + (sy_sp * sr);\n const T x = (cy_cp * sr) - (sy_sp * cr);\n const T y = (cy_sp * cr) + (sy_cp * sr);\n const T z = (sy_cp * cr) - (cy_sp * sr);\n\n set(q, w, x, y, z);\n}\n\n} // namespace sead\n# 30 \"/home/larsvi/botw/lib/sead/include/math/seadQuatCalcCommon.h\" 2\n# 4 \"/home/larsvi/botw/lib/sead/include/math/seadQuat.hpp\" 2\n\n\n\n\nnamespace sead\n{\ntemplate <typename T>\ninline Quat<T>::Quat(T w_, T x_, T y_, T z_)\n{\n QuatCalcCommon<T>::set(*this, w_, x_, y_, z_);\n}\n\ntemplate <typename T>\ninline Quat<T>& Quat<T>::operator*=(const Quat<T>& t)\n{\n QuatCalcCommon<T>::setMul(*this, *this, t);\n return *this;\n}\n\ntemplate <typename T>\ninline T Quat<T>::length() const\n{\n return QuatCalcCommon<T>::length(*this);\n}\n\ntemplate <typename T>\ninline T Quat<T>::normalize()\n{\n return QuatCalcCommon<T>::normalize(*this);\n}\n\ntemplate <typename T>\ninline T Quat<T>::dot(const Self& q)\n{\n return QuatCalcCommon<T>::dot(*this, q);\n}\n\n// reference?\n// conjugate(q) / dot(q)?\ntemplate <typename T>\ninline void Quat<T>::inverse(Self* q)\n{\n T prod = dot(*this);\n if (prod > std::numeric_limits<T>::epsilon())\n {\n T inv = T(1) / prod;\n q->w = inv * this->w;\n q->x = inv * -this->x;\n q->y = inv * -this->y;\n q->z = inv * -this->z;\n }\n else\n {\n q->w = this->w;\n q->x = -this->x;\n q->y = -this->y;\n q->z = -this->z;\n }\n}\n\ntemplate <typename T>\ninline void Quat<T>::makeUnit()\n{\n QuatCalcCommon<T>::makeUnit(*this);\n}\n\ntemplate <typename T>\ninline bool Quat<T>::makeVectorRotation(const Vec3& from, const Vec3& to)\n{\n return QuatCalcCommon<T>::makeVectorRotation(*this, from, to);\n}\n\ntemplate <typename T>\ninline void Quat<T>::set(T w_, T x_, T y_, T z_)\n{\n QuatCalcCommon<T>::set(*this, w_, x_, y_, z_);\n}\n\ntemplate <typename T>\ninline void Quat<T>::setRPY(T roll, T pitch, T yaw)\n{\n QuatCalcCommon<T>::setRPY(*this, roll, pitch, yaw);\n}\n\ntemplate <typename T>\ninline void Quat<T>::calcRPY(Vec3& vec) const\n{\n QuatCalcCommon<T>::calcRPY(vec, *this);\n}\n\n} // namespace sead\n# 87 \"/home/larsvi/botw/lib/sead/include/math/seadQuat.h\" 2\n# 6 \"/home/larsvi/botw/lib/sead/include/math/seadMatrix.h\" 2\n\n\nnamespace sead\n{\ntemplate <typename T>\nclass Matrix22;\n\ntemplate <typename T>\nclass Matrix33;\n\ntemplate <typename T>\nclass Matrix34;\n\ntemplate <typename T>\nclass Matrix44;\n\ntemplate <typename T>\nclass Matrix22 : public Policies<T>::Mtx22Base\n{\nprivate:\n using Self = Matrix22<T>;\n\npublic:\n Matrix22() {}\n\n Matrix22(const Self& n) = default;\n\n Matrix22(T a00, T a01, T a10, T a11);\n\n T operator()(s32 i, s32 j) const;\n T& operator()(s32 i, s32 j);\n Self& operator=(const Self& n);\n\n void makeIdentity();\n void makeZero();\n\n void setInverse(const Self& n);\n void setInverseTranspose(const Self& n);\n void setMul(const Self& a, const Self& b);\n void setTranspose(const Self& n);\n void transpose();\n\n static const Matrix22 zero;\n static const Matrix22 ident;\n};\n\ntemplate <typename T>\nclass Matrix33 : public Policies<T>::Mtx33Base\n{\nprivate:\n using Self = Matrix33<T>;\n using Mtx34 = Matrix34<T>;\n\n using Vec3 = Vector3<T>;\n\npublic:\n Matrix33() {}\n\n Matrix33(const Self& n) = default;\n\n Matrix33(T a00, T a01, T a02, T a10, T a11, T a12, T a20, T a21, T a22);\n\n Matrix33(const Mtx34& mtx34);\n\n T operator()(s32 i, s32 j) const;\n T& operator()(s32 i, s32 j);\n Self& operator=(const Self& n);\n\n void makeIdentity();\n void makeZero();\n\n void setInverse(const Self& n);\n void setInverseTranspose(const Self& n);\n void setMul(const Self& a, const Self& b);\n void setMul(const Mtx34& a, const Self& b);\n void setMul(const Self& a, const Mtx34& b);\n void setTranspose(const Self& n);\n void transpose();\n\n void fromQuat(const Quat<T>& q);\n void makeR(const Vec3& r);\n void makeRIdx(u32 xr, u32 yr, u32 zr);\n void makeRzxyIdx(u32 xr, u32 yr, u32 zr);\n void makeS(const Vec3& s);\n void makeS(T x, T y, T z);\n void makeSR(const Vec3& s, const Vec3& r);\n void makeSRIdx(const Vec3& s, const Vector3<u32>& r);\n void makeSRzxyIdx(const Vec3& s, const Vector3<u32>& r);\n void toQuat(Quat<T>& q) const;\n\n static const Matrix33 zero;\n static const Matrix33 ident;\n};\n\ntemplate <typename T>\nclass Matrix34 : public Policies<T>::Mtx34Base\n{\nprivate:\n using Self = Matrix34<T>;\n using Mtx33 = Matrix33<T>;\n using Mtx44 = Matrix44<T>;\n\n using Vec3 = Vector3<T>;\n using Vec4 = Vector4<T>;\n using QuatT = Quat<T>;\n\npublic:\n Matrix34() {}\n\n Matrix34(const Self& n) = default;\n\n Matrix34(T _00, T _01, T _02, T _03, T _10, T _11, T _12, T _13, T _20, T _21, T _22, T _23);\n\n Matrix34(const Mtx33& mtx33, const Vec3& t = Vec3::zero);\n Matrix34(const Mtx44& mtx44);\n\n T operator()(s32 i, s32 j) const;\n T& operator()(s32 i, s32 j);\n Self& operator=(const Self& n);\n\n void makeIdentity();\n void makeZero();\n\n bool invert();\n bool invert33();\n bool invertTranspose();\n bool setInverse(const Self& n);\n bool setInverse33(const Self& n);\n bool setInverseTranspose(const Self& n);\n\n friend Self operator*(const Self& lhs, const Self& rhs)\n {\n Self result;\n result.setMul(lhs, rhs);\n return result;\n }\n friend Self operator*(const Mtx33& lhs, const Self& rhs)\n {\n Self result;\n result.setMul(lhs, rhs);\n return result;\n }\n void setMul(const Self& a, const Self& b);\n void setMul(const Mtx33& a, const Self& b);\n\n void setTranspose(const Self& n);\n void transpose();\n\n void fromQuat(const QuatT& q);\n void makeQT(const QuatT& q, const Vec3& t);\n void makeR(const Vec3& r);\n void makeRIdx(u32 xr, u32 yr, u32 zr);\n void makeRT(const Vec3& r, const Vec3& t);\n void makeRTIdx(const Vector3<u32>& r, const Vec3& t);\n void makeRzxyIdx(u32 xr, u32 yr, u32 zr);\n void makeRzxyTIdx(const Vector3<u32>& r, const Vec3& t);\n void makeS(const Vec3& s);\n void makeS(T x, T y, T z);\n void makeSQT(const Vec3& s, const QuatT& q, const Vec3& t);\n void makeSR(const Vec3& s, const Vec3& r);\n void makeSRIdx(const Vec3& s, const Vector3<u32>& r);\n void makeSRT(const Vec3& s, const Vec3& r, const Vec3& t);\n void makeSRTIdx(const Vec3& s, const Vector3<u32>& r, const Vec3& t);\n void makeSRzxyIdx(const Vec3& s, const Vector3<u32>& r);\n void makeSRzxyTIdx(const Vec3& s, const Vector3<u32>& r, const Vec3& t);\n void makeST(const Vec3& s, const Vec3& t);\n void makeT(const Vec3& t);\n void makeT(T x, T y, T z);\n void toQuat(QuatT& q) const;\n\n void getBase(Vec3& o, s32 axis) const;\n void getRow(Vec4& o, s32 row) const;\n void getTranslation(Vec3& o) const;\n void getRotation(Vec3& o) const;\n\n void scaleAllElements(T s);\n void scaleBases(T sx, T sy, T sz);\n void setBase(s32 axis, const Vec3& v);\n void setRow(s32 row, const Vec4& v);\n void setTranslation(const Vec3& t);\n void setTranslation(T x, T y, T z);\n\n static const Matrix34 zero;\n static const Matrix34 ident;\n};\n\ntemplate <typename T>\nclass Matrix44 : public Policies<T>::Mtx44Base\n{\nprivate:\n using Self = Matrix44<T>;\n using Mtx33 = Matrix33<T>;\n using Mtx34 = Matrix34<T>;\n\n using Vec3 = Vector3<T>;\n using Vec4 = Vector4<T>;\n\npublic:\n Matrix44() {}\n\n Matrix44(const Self& n) = default;\n\n Matrix44(T _00, T _01, T _02, T _03, T _10, T _11, T _12, T _13, T _20, T _21, T _22, T _23,\n T _30, T _31, T _32, T _33);\n\n Matrix44(const Mtx33& mtx33, const Vec3& t = Vec3::zero, const Vec4& vw = Vec4::ew);\n Matrix44(const Mtx34& mtx34, const Vec4& vw = Vec4::ew);\n\n T operator()(s32 i, s32 j) const;\n T& operator()(s32 i, s32 j);\n Self& operator=(const Self& n);\n\n void makeIdentity();\n void makeZero();\n\n void setInverse(const Self& n);\n void setInverseTranspose(const Self& n);\n void setMul(const Self& a, const Self& b);\n void setMul(const Mtx34& a, const Self& b);\n void setMul(const Self& a, const Mtx34& b);\n void setTranspose(const Self& n);\n void transpose();\n\n void fromQuat(const Quat<T>& q);\n void makeR(const Vec3& r);\n void makeRIdx(u32 xr, u32 yr, u32 zr);\n void makeRzxyIdx(u32 xr, u32 yr, u32 zr);\n void toQuat(Quat<T>& q) const;\n\n void getCol(Vec4& o, s32 axis) const;\n void getRow(Vec4& o, s32 row) const;\n\n void scaleAllElements(T s);\n void scaleBases(T sx, T sy, T sz, T sw);\n void setCol(s32 axis, const Vec4& v);\n void setRow(s32 row, const Vec4& v);\n\n static const Matrix44 zero;\n static const Matrix44 ident;\n};\n\ntypedef Matrix22<f32> Matrix22f;\ntypedef Matrix33<f32> Matrix33f;\ntypedef Matrix34<f32> Matrix34f;\ntypedef Matrix44<f32> Matrix44f;\n\ntypedef Matrix34<f32> Matrixf;\n\ntemplate <>\nconst Matrix22f Matrix22f::zero;\n\ntemplate <>\nconst Matrix22f Matrix22f::ident;\n\ntemplate <>\nconst Matrix33f Matrix33f::zero;\n\ntemplate <>\nconst Matrix33f Matrix33f::ident;\n\ntemplate <>\nconst Matrix34f Matrix34f::zero;\n\ntemplate <>\nconst Matrix34f Matrix34f::ident;\n\ntemplate <>\nconst Matrix44f Matrix44f::zero;\n\ntemplate <>\nconst Matrix44f Matrix44f::ident;\n\ntemplate <>\nconst Matrix22<f64> Matrix22<f64>::zero;\n\ntemplate <>\nconst Matrix22<f64> Matrix22<f64>::ident;\n\ntemplate <>\nconst Matrix33<f64> Matrix33<f64>::zero;\n\ntemplate <>\nconst Matrix33<f64> Matrix33<f64>::ident;\n\ntemplate <>\nconst Matrix34<f64> Matrix34<f64>::zero;\n\ntemplate <>\nconst Matrix34<f64> Matrix34<f64>::ident;\n\ntemplate <>\nconst Matrix44<f64> Matrix44<f64>::zero;\n\ntemplate <>\nconst Matrix44<f64> Matrix44<f64>::ident;\n\ntemplate <typename T>\nbool operator==(const Matrix34<T>& lhs, const Matrix34<T>& rhs);\ntemplate <typename T>\nbool operator!=(const Matrix34<T>& lhs, const Matrix34<T>& rhs);\n\n} // namespace sead\n\n\n\n# 1 \"/home/larsvi/botw/lib/sead/include/math/seadMatrix.hpp\" 1\n\n\n# 1 \"/home/larsvi/botw/lib/sead/include/math/seadMatrixCalcCommon.h\" 1\n\n\n\n\n\nnamespace sead\n{\ntemplate <typename T>\nclass Matrix22CalcCommon\n{\npublic:\n using Base = typename Policies<T>::Mtx22Base;\n\npublic:\n static void makeIdentity(Base& o);\n static void makeZero(Base& o);\n\n static void copy(Base& o, const Base& n);\n static void inverse(Base& o, const Base& n);\n static void inverseTranspose(Base& o, const Base& n);\n static void multiply(Base& o, const Base& a, const Base& b);\n static void transpose(Base& o);\n static void transposeTo(Base& o, const Base& n);\n};\n\ntemplate <typename T>\nclass Matrix33CalcCommon\n{\npublic:\n using Base = typename Policies<T>::Mtx33Base;\n using Mtx34 = typename Policies<T>::Mtx34Base;\n\n using Quat = typename Policies<T>::QuatBase;\n using Vec3 = typename Policies<T>::Vec3Base;\n\npublic:\n static void makeIdentity(Base& o);\n static void makeZero(Base& o);\n\n static void copy(Base& o, const Base& n);\n static void copy(Base& o, const Mtx34& n);\n static void inverse(Base& o, const Base& n);\n static void inverseTranspose(Base& o, const Base& n);\n static void multiply(Base& o, const Base& a, const Base& b);\n static void multiply(Base& o, const Mtx34& a, const Base& b);\n static void multiply(Base& o, const Base& a, const Mtx34& b);\n static void transpose(Base& o);\n static void transposeTo(Base& o, const Base& n);\n\n static void makeQ(Base& o, const Quat& q);\n static void makeR(Base& o, const Vec3& r);\n static void makeRIdx(Base& o, u32 xr, u32 yr, u32 zr);\n static void makeRzxyIdx(Base& o, u32 xr, u32 yr, u32 zr);\n static void makeS(Base& o, const Vec3& s);\n static void makeSR(Base& o, const Vec3& s, const Vec3& r);\n static void makeSRIdx(Base& o, const Vec3& s, const Vector3<u32>& r);\n static void makeSRzxyIdx(Base& o, const Vec3& s, const Vector3<u32>& r);\n static void toQuat(Quat& q, const Base& n);\n};\n\ntemplate <typename T>\nclass Matrix34CalcCommon\n{\npublic:\n using Base = typename Policies<T>::Mtx34Base;\n using Mtx33 = typename Policies<T>::Mtx33Base;\n using Mtx44 = typename Policies<T>::Mtx44Base;\n\n using Quat = typename Policies<T>::QuatBase;\n using Vec3 = typename Policies<T>::Vec3Base;\n using Vec4 = typename Policies<T>::Vec4Base;\n\npublic:\n static void makeIdentity(Base& o);\n static void makeZero(Base& o);\n\n static void copy(Base& o, const Base& n);\n static void copy(Base& o, const Mtx33& n, const Vec3& t);\n static void copy(Base& o, const Mtx44& n);\n static bool inverse(Base& o, const Base& n);\n static bool inverse33(Base& o, const Base& n);\n static bool inverseTranspose(Base& o, const Base& n);\n static void multiply(Base& o, const Base& a, const Base& b);\n static void multiply(Base& o, const Mtx33& a, const Base& b);\n static void multiply(Base& o, const Base& a, const Mtx33& b);\n static void transpose(Base& o);\n static void transposeTo(Base& o, const Base& n);\n\n static void makeQ(Base& o, const Quat& q);\n static void makeQT(Base& o, const Quat& q, const Vec3& t);\n static void makeR(Base& o, const Vec3& r);\n static void makeRIdx(Base& o, u32 xr, u32 yr, u32 zr);\n static void makeRT(Base& o, const Vec3& r, const Vec3& t);\n static void makeRTIdx(Base& o, const Vector3<u32>& r, const Vec3& t);\n static void makeRzxyIdx(Base& o, u32 xr, u32 yr, u32 zr);\n static void makeRzxyTIdx(Base& o, const Vector3<u32>& r, const Vec3& t);\n static void makeS(Base& o, const Vec3& s);\n static void makeSQT(Base& o, const Vec3& s, const Quat& q, const Vec3& t);\n static void makeSR(Base& o, const Vec3& s, const Vec3& r);\n static void makeSRIdx(Base& o, const Vec3& s, const Vector3<u32>& r);\n static void makeSRT(Base& o, const Vec3& s, const Vec3& r, const Vec3& t);\n static void makeSRTIdx(Base& o, const Vec3& s, const Vector3<u32>& r, const Vec3& t);\n static void makeSRzxyIdx(Base& o, const Vec3& s, const Vector3<u32>& r);\n static void makeSRzxyTIdx(Base& o, const Vec3& s, const Vector3<u32>& r, const Vec3& t);\n static void makeST(Base& o, const Vec3& s, const Vec3& t);\n static void makeT(Base& o, const Vec3& t);\n static void toQuat(Quat& q, const Base& n);\n\n static void getBase(Vec3& v, const Base& n, s32 axis);\n static void getRow(Vec4& v, const Base& n, s32 row);\n static void getTranslation(Vec3& v, const Base& n);\n static void getRotation(Vec3& v, const Base& n);\n\n static void scaleAllElements(Base& n, T s);\n static void scaleBases(Base& n, T sx, T sy, T sz);\n static void setBase(Base& n, s32 axis, const Vec3& v);\n static void setRow(Base& n, const Vec4& v, s32 row);\n static void setTranslation(Base& n, const Vec3& v);\n};\n\ntemplate <typename T>\nclass Matrix44CalcCommon\n{\npublic:\n using Base = typename Policies<T>::Mtx44Base;\n using Mtx33 = typename Policies<T>::Mtx33Base;\n using Mtx34 = typename Policies<T>::Mtx34Base;\n\n using Quat = typename Policies<T>::QuatBase;\n using Vec3 = typename Policies<T>::Vec3Base;\n using Vec4 = typename Policies<T>::Vec4Base;\n\npublic:\n static void makeIdentity(Base& o);\n static void makeZero(Base& o);\n\n static void copy(Base& o, const Base& n);\n static void copy(Base& o, const Mtx33& n, const Vec3& t, const Vec4& v);\n static void copy(Base& o, const Mtx34& n, const Vec4& v);\n static void inverse(Base& o, const Base& n);\n static void inverseTranspose(Base& o, const Base& n);\n static void multiply(Base& o, const Base& a, const Base& b);\n static void multiply(Base& o, const Mtx34& a, const Base& b);\n static void multiply(Base& o, const Base& a, const Mtx34& b);\n static void transpose(Base& o);\n static void transposeTo(Base& o, const Base& n);\n\n static void makeQ(Base& o, const Quat& q);\n static void makeR(Base& o, const Vec3& r);\n static void makeRIdx(Base& o, u32 xr, u32 yr, u32 zr);\n static void makeRzxyIdx(Base& o, u32 xr, u32 yr, u32 zr);\n static void toQuat(Quat& q, const Base& n);\n\n static void getCol(Vec4& v, const Base& n, s32 axis);\n static void getRow(Vec4& v, const Base& n, s32 row);\n\n static void scaleAllElements(Base& n, T s);\n static void scaleBases(Base& n, T sx, T sy, T sz, T sw);\n static void setCol(Base& n, s32 axis, const Vec4& v);\n static void setRow(Base& n, const Vec4& v, s32 row);\n};\n\n} // namespace sead\n\n\n\n# 1 \"/home/larsvi/botw/lib/sead/include/math/seadMatrixCalcCommon.hpp\" 1\n# 18 \"/home/larsvi/botw/lib/sead/include/math/seadMatrixCalcCommon.hpp\"\nnamespace sead\n{\ntemplate <typename T>\nvoid Matrix22CalcCommon<T>::makeIdentity(Base& o)\n{\n o.m[0][0] = 1;\n o.m[0][1] = 0;\n\n o.m[1][0] = 0;\n o.m[1][1] = 1;\n}\n\ntemplate <typename T>\nvoid Matrix22CalcCommon<T>::makeZero(Base& o)\n{\n o.m[0][0] = 0;\n o.m[0][1] = 0;\n\n o.m[1][0] = 0;\n o.m[1][1] = 0;\n}\n\ntemplate <typename T>\nvoid Matrix22CalcCommon<T>::copy(Base& o, const Base& n)\n{\n o.m[0][0] = n.m[0][0];\n o.m[0][1] = n.m[0][1];\n\n o.m[1][0] = n.m[1][0];\n o.m[1][1] = n.m[1][1];\n}\n\ntemplate <typename T>\nvoid Matrix22CalcCommon<T>::inverse(Base& o, const Base& n)\n{\n const T a11 = n.m[0][0];\n const T a12 = n.m[0][1];\n\n const T a21 = n.m[1][0];\n const T a22 = n.m[1][1];\n\n T det = a11 * a22 - a12 * a21;\n if (det == 0)\n return makeIdentity(o);\n\n det = 1 / det;\n\n o.m[0][0] = a22 * det;\n o.m[0][1] = -a12 * det;\n\n o.m[1][0] = -a21 * det;\n o.m[1][1] = a11 * det;\n}\n\ntemplate <typename T>\nvoid Matrix22CalcCommon<T>::inverseTranspose(Base& o, const Base& n)\n{\n const T a11 = n.m[0][0];\n const T a12 = n.m[0][1];\n\n const T a21 = n.m[1][0];\n const T a22 = n.m[1][1];\n\n T det = a11 * a22 - a12 * a21;\n if (det == 0)\n return makeIdentity(o);\n\n det = 1 / det;\n\n o.m[0][0] = a22 * det;\n o.m[0][1] = -a21 * det;\n\n o.m[1][0] = -a12 * det;\n o.m[1][1] = a11 * det;\n}\n\ntemplate <typename T>\nvoid Matrix22CalcCommon<T>::multiply(Base& o, const Base& a, const Base& b)\n{\n const T a11 = a.m[0][0];\n const T a12 = a.m[0][1];\n\n const T a21 = a.m[1][0];\n const T a22 = a.m[1][1];\n\n const T b11 = b.m[0][0];\n const T b12 = b.m[0][1];\n\n const T b21 = b.m[1][0];\n const T b22 = b.m[1][1];\n\n o.m[0][0] = a11 * b11 + a12 * b21;\n o.m[0][1] = a11 * b12 + a12 * b22;\n\n o.m[1][0] = a21 * b11 + a22 * b21;\n o.m[1][1] = a21 * b12 + a22 * b22;\n}\n\ntemplate <typename T>\nvoid Matrix22CalcCommon<T>::transpose(Base& o)\n{\n const T a12 = o.m[0][1];\n const T a21 = o.m[1][0];\n\n o.m[0][1] = a21;\n o.m[1][0] = a12;\n}\n\ntemplate <typename T>\nvoid Matrix22CalcCommon<T>::transposeTo(Base& o, const Base& n)\n{\n do { if (false) static_cast<void>(&o != &n); } while (0);\n\n o.m[0][0] = n.m[0][0];\n o.m[0][1] = n.m[1][0];\n\n o.m[1][0] = n.m[0][1];\n o.m[1][1] = n.m[1][1];\n}\n\ntemplate <typename T>\nvoid Matrix33CalcCommon<T>::makeIdentity(Base& o)\n{\n o.m[0][0] = 1;\n o.m[0][1] = 0;\n o.m[0][2] = 0;\n\n o.m[1][0] = 0;\n o.m[1][1] = 1;\n o.m[1][2] = 0;\n\n o.m[2][0] = 0;\n o.m[2][1] = 0;\n o.m[2][2] = 1;\n}\n\ntemplate <typename T>\nvoid Matrix33CalcCommon<T>::makeZero(Base& o)\n{\n o.m[0][0] = 0;\n o.m[0][1] = 0;\n o.m[0][2] = 0;\n\n o.m[1][0] = 0;\n o.m[1][1] = 0;\n o.m[1][2] = 0;\n\n o.m[2][0] = 0;\n o.m[2][1] = 0;\n o.m[2][2] = 0;\n}\n\ntemplate <typename T>\nvoid Matrix33CalcCommon<T>::copy(Base& o, const Base& n)\n{\n o.m[0][0] = n.m[0][0];\n o.m[0][1] = n.m[0][1];\n o.m[0][2] = n.m[0][2];\n\n o.m[1][0] = n.m[1][0];\n o.m[1][1] = n.m[1][1];\n o.m[1][2] = n.m[1][2];\n\n o.m[2][0] = n.m[2][0];\n o.m[2][1] = n.m[2][1];\n o.m[2][2] = n.m[2][2];\n}\n\ntemplate <typename T>\nvoid Matrix33CalcCommon<T>::copy(Base& o, const Mtx34& n)\n{\n o.m[0][0] = n.m[0][0];\n o.m[0][1] = n.m[0][1];\n o.m[0][2] = n.m[0][2];\n\n o.m[1][0] = n.m[1][0];\n o.m[1][1] = n.m[1][1];\n o.m[1][2] = n.m[1][2];\n\n o.m[2][0] = n.m[2][0];\n o.m[2][1] = n.m[2][1];\n o.m[2][2] = n.m[2][2];\n}\n\ntemplate <typename T>\nvoid Matrix33CalcCommon<T>::inverse(Base& o, const Base& n)\n{\n const T a11 = n.m[0][0];\n const T a12 = n.m[0][1];\n const T a13 = n.m[0][2];\n\n const T a21 = n.m[1][0];\n const T a22 = n.m[1][1];\n const T a23 = n.m[1][2];\n\n const T a31 = n.m[2][0];\n const T a32 = n.m[2][1];\n const T a33 = n.m[2][2];\n\n T det = (a11 * a22 * a33 - a31 * a22 * a13) + (a12 * a23 * a31 - a21 * a12 * a33) +\n (a13 * a21 * a32 - a11 * a32 * a23);\n\n if (det == 0)\n return makeIdentity(o);\n\n det = 1 / det;\n\n o.m[0][0] = (a22 * a33 - a32 * a23) * det;\n o.m[0][1] = (a32 * a13 - a12 * a33) * det;\n o.m[0][2] = (a12 * a23 - a22 * a13) * det;\n\n o.m[1][0] = (a31 * a23 - a21 * a33) * det;\n o.m[1][1] = (a11 * a33 - a31 * a13) * det;\n o.m[1][2] = (a21 * a13 - a11 * a23) * det;\n\n o.m[2][0] = (a21 * a32 - a31 * a22) * det;\n o.m[2][1] = (a31 * a12 - a11 * a32) * det;\n o.m[2][2] = (a11 * a22 - a21 * a12) * det;\n}\n\ntemplate <typename T>\nvoid Matrix33CalcCommon<T>::inverseTranspose(Base& o, const Base& n)\n{\n const T a11 = n.m[0][0];\n const T a12 = n.m[0][1];\n const T a13 = n.m[0][2];\n\n const T a21 = n.m[1][0];\n const T a22 = n.m[1][1];\n const T a23 = n.m[1][2];\n\n const T a31 = n.m[2][0];\n const T a32 = n.m[2][1];\n const T a33 = n.m[2][2];\n\n T det = (a11 * a22 * a33 - a31 * a22 * a13) + (a12 * a23 * a31 - a21 * a12 * a33) +\n (a13 * a21 * a32 - a11 * a32 * a23);\n\n if (det == 0)\n return makeIdentity(o);\n\n det = 1 / det;\n\n o.m[0][0] = (a22 * a33 - a32 * a23) * det;\n o.m[0][1] = (a31 * a23 - a21 * a33) * det;\n o.m[0][2] = (a21 * a32 - a31 * a22) * det;\n\n o.m[1][0] = (a32 * a13 - a12 * a33) * det;\n o.m[1][1] = (a11 * a33 - a31 * a13) * det;\n o.m[1][2] = (a31 * a12 - a11 * a32) * det;\n\n o.m[2][0] = (a12 * a23 - a22 * a13) * det;\n o.m[2][1] = (a21 * a13 - a11 * a23) * det;\n o.m[2][2] = (a11 * a22 - a21 * a12) * det;\n}\n\ntemplate <typename T>\nvoid Matrix33CalcCommon<T>::multiply(Base& o, const Base& a, const Base& b)\n{\n const T a11 = a.m[0][0];\n const T a12 = a.m[0][1];\n const T a13 = a.m[0][2];\n\n const T a21 = a.m[1][0];\n const T a22 = a.m[1][1];\n const T a23 = a.m[1][2];\n\n const T a31 = a.m[2][0];\n const T a32 = a.m[2][1];\n const T a33 = a.m[2][2];\n\n const T b11 = b.m[0][0];\n const T b12 = b.m[0][1];\n const T b13 = b.m[0][2];\n\n const T b21 = b.m[1][0];\n const T b22 = b.m[1][1];\n const T b23 = b.m[1][2];\n\n const T b31 = b.m[2][0];\n const T b32 = b.m[2][1];\n const T b33 = b.m[2][2];\n\n o.m[0][0] = a11 * b11 + a12 * b21 + a13 * b31;\n o.m[0][1] = a11 * b12 + a12 * b22 + a13 * b32;\n o.m[0][2] = a11 * b13 + a12 * b23 + a13 * b33;\n\n o.m[1][0] = a21 * b11 + a22 * b21 + a23 * b31;\n o.m[1][1] = a21 * b12 + a22 * b22 + a23 * b32;\n o.m[1][2] = a21 * b13 + a22 * b23 + a23 * b33;\n\n o.m[2][0] = a31 * b11 + a32 * b21 + a33 * b31;\n o.m[2][1] = a31 * b12 + a32 * b22 + a33 * b32;\n o.m[2][2] = a31 * b13 + a32 * b23 + a33 * b33;\n}\n\ntemplate <typename T>\nvoid Matrix33CalcCommon<T>::multiply(Base& o, const Mtx34& a, const Base& b)\n{\n const T a11 = a.m[0][0];\n const T a12 = a.m[0][1];\n const T a13 = a.m[0][2];\n\n const T a21 = a.m[1][0];\n const T a22 = a.m[1][1];\n const T a23 = a.m[1][2];\n\n const T a31 = a.m[2][0];\n const T a32 = a.m[2][1];\n const T a33 = a.m[2][2];\n\n const T b11 = b.m[0][0];\n const T b12 = b.m[0][1];\n const T b13 = b.m[0][2];\n\n const T b21 = b.m[1][0];\n const T b22 = b.m[1][1];\n const T b23 = b.m[1][2];\n\n const T b31 = b.m[2][0];\n const T b32 = b.m[2][1];\n const T b33 = b.m[2][2];\n\n o.m[0][0] = a11 * b11 + a12 * b21 + a13 * b31;\n o.m[0][1] = a11 * b12 + a12 * b22 + a13 * b32;\n o.m[0][2] = a11 * b13 + a12 * b23 + a13 * b33;\n\n o.m[1][0] = a21 * b11 + a22 * b21 + a23 * b31;\n o.m[1][1] = a21 * b12 + a22 * b22 + a23 * b32;\n o.m[1][2] = a21 * b13 + a22 * b23 + a23 * b33;\n\n o.m[2][0] = a31 * b11 + a32 * b21 + a33 * b31;\n o.m[2][1] = a31 * b12 + a32 * b22 + a33 * b32;\n o.m[2][2] = a31 * b13 + a32 * b23 + a33 * b33;\n}\n\ntemplate <typename T>\nvoid Matrix33CalcCommon<T>::multiply(Base& o, const Base& a, const Mtx34& b)\n{\n const T a11 = a.m[0][0];\n const T a12 = a.m[0][1];\n const T a13 = a.m[0][2];\n\n const T a21 = a.m[1][0];\n const T a22 = a.m[1][1];\n const T a23 = a.m[1][2];\n\n const T a31 = a.m[2][0];\n const T a32 = a.m[2][1];\n const T a33 = a.m[2][2];\n\n const T b11 = b.m[0][0];\n const T b12 = b.m[0][1];\n const T b13 = b.m[0][2];\n\n const T b21 = b.m[1][0];\n const T b22 = b.m[1][1];\n const T b23 = b.m[1][2];\n\n const T b31 = b.m[2][0];\n const T b32 = b.m[2][1];\n const T b33 = b.m[2][2];\n\n o.m[0][0] = a11 * b11 + a12 * b21 + a13 * b31;\n o.m[0][1] = a11 * b12 + a12 * b22 + a13 * b32;\n o.m[0][2] = a11 * b13 + a12 * b23 + a13 * b33;\n\n o.m[1][0] = a21 * b11 + a22 * b21 + a23 * b31;\n o.m[1][1] = a21 * b12 + a22 * b22 + a23 * b32;\n o.m[1][2] = a21 * b13 + a22 * b23 + a23 * b33;\n\n o.m[2][0] = a31 * b11 + a32 * b21 + a33 * b31;\n o.m[2][1] = a31 * b12 + a32 * b22 + a33 * b32;\n o.m[2][2] = a31 * b13 + a32 * b23 + a33 * b33;\n}\n\ntemplate <typename T>\nvoid Matrix33CalcCommon<T>::transpose(Base& o)\n{\n const T a12 = o.m[0][1];\n const T a13 = o.m[0][2];\n\n const T a21 = o.m[1][0];\n const T a23 = o.m[1][2];\n\n const T a31 = o.m[2][0];\n const T a32 = o.m[2][1];\n\n o.m[0][1] = a21;\n o.m[0][2] = a31;\n\n o.m[1][0] = a12;\n o.m[1][2] = a32;\n\n o.m[2][0] = a13;\n o.m[2][1] = a23;\n}\n\ntemplate <typename T>\nvoid Matrix33CalcCommon<T>::transposeTo(Base& o, const Base& n)\n{\n do { if (false) static_cast<void>(&o != &n); } while (0);\n\n o.m[0][0] = n.m[0][0];\n o.m[0][1] = n.m[1][0];\n o.m[0][2] = n.m[2][0];\n\n o.m[1][0] = n.m[0][1];\n o.m[1][1] = n.m[1][1];\n o.m[1][2] = n.m[2][1];\n\n o.m[2][0] = n.m[0][2];\n o.m[2][1] = n.m[1][2];\n o.m[2][2] = n.m[2][2];\n}\n\ntemplate <typename T>\nvoid Matrix33CalcCommon<T>::makeQ(Base& o, const Quat& q)\n{\n // Assuming the quaternion \"q\" is normalized\n\n const T yy = 2 * q.y * q.y;\n const T zz = 2 * q.z * q.z;\n const T xx = 2 * q.x * q.x;\n const T xy = 2 * q.x * q.y;\n const T xz = 2 * q.x * q.z;\n const T yz = 2 * q.y * q.z;\n const T wz = 2 * q.w * q.z;\n const T wx = 2 * q.w * q.x;\n const T wy = 2 * q.w * q.y;\n\n o.m[0][0] = 1 - yy - zz;\n o.m[0][1] = xy - wz;\n o.m[0][2] = xz + wy;\n\n o.m[1][0] = xy + wz;\n o.m[1][1] = 1 - xx - zz;\n o.m[1][2] = yz - wx;\n\n o.m[2][0] = xz - wy;\n o.m[2][1] = yz + wx;\n o.m[2][2] = 1 - xx - yy;\n}\n\ntemplate <typename T>\nvoid Matrix33CalcCommon<T>::makeR(Base& o, const Vec3& r)\n{\n const T sinV[3] = {MathCalcCommon<T>::sin(r.x), MathCalcCommon<T>::sin(r.y),\n MathCalcCommon<T>::sin(r.z)};\n\n const T cosV[3] = {MathCalcCommon<T>::cos(r.x), MathCalcCommon<T>::cos(r.y),\n
MathCalcCommon<T>::cos(r.z)};\n\n o.m[0][0] = (cosV[1] * cosV[2]);\n o.m[1][0] = (cosV[1] * sinV[2]);\n o.m[2][0] = -sinV[1];\n\n o.m[0][1] = (sinV[0] * sinV[1] * cosV[2] - cosV[0] * sinV[2]);\n o.m[1][1] = (sinV[0] * sinV[1] * sinV[2] + cosV[0] * cosV[2]);\n o.m[2][1] = (sinV[0] * cosV[1]);\n\n o.m[0][2] = (cosV[0] * cosV[2] * sinV[1] + sinV[0] * sinV[2]);\n o.m[1][2] = (cosV[0] * sinV[2] * sinV[1] - sinV[0] * cosV[2]);\n o.m[2][2] = (cosV[0] * cosV[1]);\n}\n\ntemplate <typename T>\nvoid Matrix33CalcCommon<T>::makeRIdx(Base& o, u32 xr, u32 yr, u32 zr)\n{\n const T sinV[3];\n const T cosV[3];\n\n MathCalcCommon<T>::sinCosIdx(&sinV[0], &cosV[0], xr);\n MathCalcCommon<T>::sinCosIdx(&sinV[1], &cosV[1], yr);\n MathCalcCommon<T>::sinCosIdx(&sinV[2], &cosV[2], zr);\n\n o.m[0][0] = (cosV[1] * cosV[2]);\n o.m[1][0] = (cosV[1] * sinV[2]);\n o.m[2][0] = -sinV[1];\n\n o.m[0][1] = (sinV[0] * sinV[1] * cosV[2] - cosV[0] * sinV[2]);\n o.m[1][1] = (sinV[0] * sinV[1] * sinV[2] + cosV[0] * cosV[2]);\n o.m[2][1] = (sinV[0] * cosV[1]);\n\n o.m[0][2] = (cosV[0] * cosV[2] * sinV[1] + sinV[0] * sinV[2]);\n o.m[1][2] = (cosV[0] * sinV[2] * sinV[1] - sinV[0] * cosV[2]);\n o.m[2][2] = (cosV[0] * cosV[1]);\n}\n\ntemplate <typename T>\nvoid Matrix33CalcCommon<T>::makeRzxyIdx(Base& o, u32 xr, u32 yr, u32 zr)\n{\n const T sinV[3];\n const T cosV[3];\n\n MathCalcCommon<T>::sinCosIdx(&sinV[0], &cosV[0], xr);\n MathCalcCommon<T>::sinCosIdx(&sinV[1], &cosV[1], yr);\n MathCalcCommon<T>::sinCosIdx(&sinV[2], &cosV[2], zr);\n\n o.m[2][2] = (cosV[0] * cosV[1]);\n o.m[0][2] = (cosV[0] * sinV[1]);\n o.m[1][2] = -sinV[0];\n\n o.m[2][0] = (sinV[1] * cosV[2] - sinV[0] * cosV[1] * sinV[2]);\n o.m[0][0] = (cosV[1] * cosV[2] + sinV[0] * sinV[1] * sinV[2]);\n o.m[1][0] = (cosV[0] * sinV[2]);\n\n o.m[2][1] = (sinV[1] * sinV[2] + sinV[0] * cosV[1] * cosV[2]);\n o.m[0][1] = (cosV[1] * sinV[2] - sinV[0] * sinV[1] * cosV[2]);\n o.m[1][1] = (cosV[0] * cosV[2]);\n}\n\ntemplate <typename T>\nvoid Matrix33CalcCommon<T>::makeS(Base& o, const Vec3& s)\n{\n o.m[0][0] = s.x;\n o.m[1][0] = 0;\n o.m[2][0] = 0;\n\n o.m[0][1] = 0;\n o.m[1][1] = s.y;\n o.m[2][1] = 0;\n\n o.m[0][2] = 0;\n o.m[1][2] = 0;\n o.m[2][2] = s.z;\n}\n\ntemplate <typename T>\nvoid Matrix33CalcCommon<T>::makeSR(Base& o, const Vec3& s, const Vec3& r)\n{\n const T sinV[3] = {MathCalcCommon<T>::sin(r.x), MathCalcCommon<T>::sin(r.y),\n MathCalcCommon<T>::sin(r.z)};\n\n const T cosV[3] = {MathCalcCommon<T>::cos(r.x), MathCalcCommon<T>::cos(r.y),\n MathCalcCommon<T>::cos(r.z)};\n\n o.m[0][0] = s.x * (cosV[1] * cosV[2]);\n o.m[1][0] = s.x * (cosV[1] * sinV[2]);\n o.m[2][0] = s.x * -sinV[1];\n\n o.m[0][1] = s.y * (sinV[0] * sinV[1] * cosV[2] - cosV[0] * sinV[2]);\n o.m[1][1] = s.y * (sinV[0] * sinV[1] * sinV[2] + cosV[0] * cosV[2]);\n o.m[2][1] = s.y * (sinV[0] * cosV[1]);\n\n o.m[0][2] = s.z * (cosV[0] * cosV[2] * sinV[1] + sinV[0] * sinV[2]);\n o.m[1][2] = s.z * (cosV[0] * sinV[2] * sinV[1] - sinV[0] * cosV[2]);\n o.m[2][2] = s.z * (cosV[0] * cosV[1]);\n}\n\ntemplate <typename T>\nvoid Matrix33CalcCommon<T>::makeSRIdx(Base& o, const Vec3& s, const Vector3<u32>& r)\n{\n const T sinV[3];\n const T cosV[3];\n\n MathCalcCommon<T>::sinCosIdx(&sinV[0], &cosV[0], r.x);\n MathCalcCommon<T>::sinCosIdx(&sinV[1], &cosV[1], r.y);\n MathCalcCommon<T>::sinCosIdx(&sinV[2], &cosV[2], r.z);\n\n o.m[0][0] = s.x * (cosV[1] * cosV[2]);\n o.m[1][0] = s.x * (cosV[1] * sinV[2]);\n o.m[2][0] = s.x * -sinV[1];\n\n o.m[0][1] = s.y * (sinV[0] * sinV[1] * cosV[2] - cosV[0] * sinV[2]);\n o.m[1][1] = s.y * (sinV[0] * sinV[1] * sinV[2] + cosV[0] * cosV[2]);\n o.m[2][1] = s.y * (sinV[0] * cosV[1]);\n\n o.m[0][2] = s.z * (cosV[0] * cosV[2] * sinV[1] + sinV[0] * sinV[2]);\n o.m[1][2] = s.z * (cosV[0] * sinV[2] * sinV[1] - sinV[0] * cosV[2]);\n o.m[2][2] = s.z * (cosV[0] * cosV[1]);\n}\n\ntemplate <typename T>\nvoid Matrix33CalcCommon<T>::makeSRzxyIdx(Base& o, const Vec3& s, const Vector3<u32>& r)\n{\n const T sinV[3];\n const T cosV[3];\n\n MathCalcCommon<T>::sinCosIdx(&sinV[0], &cosV[0], r.x);\n MathCalcCommon<T>::sinCosIdx(&sinV[1], &cosV[1], r.y);\n MathCalcCommon<T>::sinCosIdx(&sinV[2], &cosV[2], r.z);\n\n o.m[2][2] = s.z * (cosV[0] * cosV[1]);\n o.m[0][2] = s.z * (cosV[0] * sinV[1]);\n o.m[1][2] = s.z * -sinV[0];\n\n o.m[2][0] = s.x * (sinV[1] * cosV[2] - sinV[0] * cosV[1] * sinV[2]);\n o.m[0][0] = s.x * (cosV[1] * cosV[2] + sinV[0] * sinV[1] * sinV[2]);\n o.m[1][0] = s.x * (cosV[0] * sinV[2]);\n\n o.m[2][1] = s.y * (sinV[1] * sinV[2] + sinV[0] * cosV[1] * cosV[2]);\n o.m[0][1] = s.y * (cosV[1] * sinV[2] - sinV[0] * sinV[1] * cosV[2]);\n o.m[1][1] = s.y * (cosV[0] * cosV[2]);\n}\n\ntemplate <typename T>\nvoid Matrix33CalcCommon<T>::toQuat(Quat& q, const Base& n)\n{\n const T a11 = n.m[0][0];\n const T a12 = n.m[0][1];\n const T a13 = n.m[0][2];\n\n const T a21 = n.m[1][0];\n const T a22 = n.m[1][1];\n const T a23 = n.m[1][2];\n\n const T a31 = n.m[2][0];\n const T a32 = n.m[2][1];\n const T a33 = n.m[2][2];\n\n const T t = a11 + a22 + a33;\n T w, x, y, z;\n\n if (t > 0)\n {\n T s = MathCalcCommon<T>::sqrt(t + 1);\n\n w = s * 0.5f;\n\n // if (s != 0)\n s = 0.5f / s;\n\n x = (a32 - a23) * s;\n y = (a13 - a31) * s;\n z = (a21 - a12) * s;\n }\n else if (a22 > a11 && a33 <= a22)\n {\n T s = MathCalcCommon<T>::sqrt(a22 - (a33 + a11) + 1);\n\n y = s * 0.5f;\n\n if (s != 0)\n s = 0.5f / s;\n\n w = (a13 - a31) * s;\n x = (a21 + a12) * s;\n z = (a23 + a32) * s;\n }\n else if (a22 > a11 || a33 > a11)\n {\n T s = MathCalcCommon<T>::sqrt(a33 - (a11 + a22) + 1);\n\n z = s * 0.5f;\n\n if (s != 0)\n
s = 0.5f / s;\n\n w = (a21 - a12) * s;\n x = (a31 + a13) * s;\n y = (a32 + a23) * s;\n }\n else\n {\n T s = MathCalcCommon<T>::sqrt(a11 - (a22 + a33) + 1);\n\n x = s * 0.5f;\n\n if (s != 0)\n s = 0.5f / s;\n\n w = (a32 - a23) * s;\n y = (a12 + a21) * s;\n z = (a13 + a31) * s;\n }\n\n q.w = w;\n q.x = x;\n q.y = y;\n q.z = z;\n}\n\ntemplate <typename T>\nvoid Matrix34CalcCommon<T>::makeIdentity(Base& o)\n{\n Matrix34CalcCommon<T>::copy(o, Base{{{{1, 0, 0, 0}, {0, 1, 0, 0}, {0, 0, 1, 0}}}});\n}\n# 707 \"/home/larsvi/botw/lib/sead/include/math/seadMatrixCalcCommon.hpp\"\ntemplate <typename T>\nvoid Matrix34CalcCommon<T>::makeZero(Base& o)\n{\n o.m[0][0] = 0;\n o.m[0][1] = 0;\n o.m[0][2] = 0;\n o.m[0][3] = 0;\n\n o.m[1][0] = 0;\n o.m[1][1] = 0;\n o.m[1][2] = 0;\n o.m[1][3] = 0;\n\n o.m[2][0] = 0;\n o.m[2][1] = 0;\n o.m[2][2] = 0;\n o.m[2][3] = 0;\n}\n\ntemplate <typename T>\nvoid Matrix34CalcCommon<T>::copy(Base& o, const Base& n)\n{\n o.m[0][0] = n.m[0][0];\n o.m[0][1] = n.m[0][1];\n o.m[0][2] = n.m[0][2];\n o.m[0][3] = n.m[0][3];\n\n o.m[1][0] = n.m[1][0];\n o.m[1][1] = n.m[1][1];\n o.m[1][2] = n.m[1][2];\n o.m[1][3] = n.m[1][3];\n\n o.m[2][0] = n.m[2][0];\n o.m[2][1] = n.m[2][1];\n o.m[2][2] = n.m[2][2];\n o.m[2][3] = n.m[2][3];\n}\n\n\n\ntemplate <>\ninline void Matrix34CalcCommon<f32>::copy(Base& o, const Base& n)\n{\n for (int i = 0; i < 3; ++i)\n {\n __extension__ ({ float32x4_t __s1 = __extension__ ({ float32x4_t __ret; __ret = (float32x4_t) __builtin_neon_vld1q_v(n.m[i], 41); __ret; }); __builtin_neon_vst1q_v(o.m[i], (int8x16_t)__s1, 41); });\n }\n}\n# 768 \"/home/larsvi/botw/lib/sead/include/math/seadMatrixCalcCommon.hpp\"\ntemplate <typename T>\nvoid Matrix34CalcCommon<T>::copy(Base& o, const Mtx33& n, const Vec3& t)\n{\n o.m[0][0] = n.m[0][0];\n o.m[0][1] = n.m[0][1];\n o.m[0][2] = n.m[0][2];\n o.m[0][3] = t.x;\n\n o.m[1][0] = n.m[1][0];\n o.m[1][1] = n.m[1][1];\n o.m[1][2] = n.m[1][2];\n o.m[1][3] = t.y;\n\n o.m[2][0] = n.m[2][0];\n o.m[2][1] = n.m[2][1];\n o.m[2][2] = n.m[2][2];\n o.m[2][3] = t.z;\n}\n\ntemplate <typename T>\nvoid Matrix34CalcCommon<T>::copy(Base& o, const Mtx44& n)\n{\n o.m[0][0] = n.m[0][0];\n o.m[0][1] = n.m[0][1];\n o.m[0][2] = n.m[0][2];\n o.m[0][3] = n.m[0][3];\n\n o.m[1][0] = n.m[1][0];\n o.m[1][1] = n.m[1][1];\n o.m[1][2] = n.m[1][2];\n o.m[1][3] = n.m[1][3];\n\n o.m[2][0] = n.m[2][0];\n o.m[2][1] = n.m[2][1];\n o.m[2][2] = n.m[2][2];\n o.m[2][3] = n.m[2][3];\n}\n# 819 \"/home/larsvi/botw/lib/sead/include/math/seadMatrixCalcCommon.hpp\"\ntemplate <typename T>\nbool Matrix34CalcCommon<T>::inverse(Base& o, const Base& n)\n{\n const T a11 = n.m[0][0];\n const T a12 = n.m[0][1];\n const T a13 = n.m[0][2];\n const T a14 = n.m[0][3];\n\n const T a21 = n.m[1][0];\n const T a22 = n.m[1][1];\n const T a23 = n.m[1][2];\n const T a24 = n.m[1][3];\n\n const T a31 = n.m[2][0];\n const T a32 = n.m[2][1];\n const T a33 = n.m[2][2];\n const T a34 = n.m[2][3];\n\n T det = (a11 * a22 * a33 - a31 * a22 * a13) + (a12 * a23 * a31 - a21 * a12 * a33) +\n (a13 * a21 * a32 - a11 * a32 * a23);\n\n if (det == 0)\n return false;\n\n det = 1 / det;\n\n o.m[0][0] = (a22 * a33 - a32 * a23) * det;\n o.m[0][1] = (a32 * a13 - a12 * a33) * det;\n o.m[0][2] = (a12 * a23 - a22 * a13) * det;\n\n o.m[1][0] = (a31 * a23 - a21 * a33) * det;\n o.m[1][1] = (a11 * a33 - a31 * a13) * det;\n o.m[1][2] = (a21 * a13 - a11 * a23) * det;\n\n o.m[2][0] = (a21 * a32 - a31 * a22) * det;\n o.m[2][1] = (a31 * a12 - a11 * a32) * det;\n o.m[2][2] = (a11 * a22 - a21 * a12) * det;\n\n o.m[0][3] = o.m[0][0] * -a14 + o.m[0][1] * -a24 + o.m[0][2] * -a34;\n o.m[1][3] = o.m[1][0] * -a14 + o.m[1][1] * -a24 + o.m[1][2] * -a34;\n o.m[2][3] = o.m[2][0] * -a14 + o.m[2][1] * -a24 + o.m[2][2] * -a34;\n\n return true;\n}\n\ntemplate <typename T>\nbool Matrix34CalcCommon<T>::inverse33(Base& o, const Base& n)\n{\n const T a11 = n.m[0][0];\n const T a12 = n.m[0][1];\n const T a13 = n.m[0][2];\n\n const T a21 = n.m[1][0];\n const T a22 = n.m[1][1];\n const T a23 = n.m[1][2];\n\n const T a31 = n.m[2][0];\n const T a32 = n.m[2][1];\n const T a33 = n.m[2][2];\n\n T det = (a11 * a22 * a33 - a31 * a22 * a13) + (a12 * a23 * a31 - a21 * a12 * a33) +\n (a13 * a21 * a32 - a11 * a32 * a23);\n\n if (det == 0)\n return false;\n\n det = 1 / det;\n\n o.m[0][0] = (a22 * a33 - a32 * a23) * det;\n o.m[0][1] = (a32 * a13 - a12 * a33) * det;\n o.m[0][2] = (a12 * a23 - a22 * a13) * det;\n\n o.m[1][0] = (a31 * a23 - a21 * a33) * det;\n o.m[1][1] = (a11 * a33 - a31 * a13) * det;\n o.m[1][2] = (a21 * a13 - a11 * a23) * det;\n\n o.m[2][0] = (a21 * a32 - a31 * a22) * det;\n o.m[2][1] = (a31 * a12 - a11 * a32) * det;\n o.m[2][2] = (a11 * a22 - a21 * a12) * det;\n\n o.m[0][3] = 0;\n o.m[1][3] = 0;\n o.m[2][3] = 0;\n\n return true;\n}\n\ntemplate <typename T>\nbool Matrix34CalcCommon<T>::inverseTranspose(Base& o, const Base& n)\n{\n const T a11 = n.m[0][0];\n const T a12 = n.m[0][1];\n const T a13 = n.m[0][2];\n\n const T a21 = n.m[1][0];\n const T a22 = n.m[1][1];\n const T a23 = n.m[1][2];\n\n const T a31 = n.m[2][0];\n const T a32 = n.m[2][1];\n const T a33 = n.m[2][2];\n\n T det = (a11 * a22 * a33 - a31 * a22 * a13) + (a12 * a23 * a31 - a21 * a12 * a33) +\n (a13 * a21 * a32 - a11 * a32 * a23);\n\n if (det == 0)\n return false;\n\n det = 1 / det;\n\n o.m[0][0] = (a22 * a33 - a32 * a23) * det;\n o.m[0][1] = (a31 * a23 - a21 * a33) * det;\n o.m[0][2] = (a21 * a32 - a31 * a22) * det;\n\n o.m[1][0] = (a32 * a13 - a12 * a33) * det;\n o.m[1][1] = (a11 * a33 - a31 * a13) * det;\n o.m[1][2] = (a31 * a12 - a11 * a32) * det;\n\n o.m[2][0] = (a12 * a23 - a22 * a13) * det;\n o.m[2][1] = (a21 * a13 - a11 * a23) * det;\n o.m[2][2] = (a11 * a22 - a21 * a12) * det;\n\n o.m[0][3] = 0;\n o.m[1][3] = 0;\n o.m[2][3] = 0;\n\n return true;\n}\n\ntemplate <typename T>\nvoid Matrix34CalcCommon<T>::multiply(Base& o, const Base& a, const Base& b)\n{\n const T a11 = a.m[0][0];\n const T a12 = a.m[0][1];\n const T a13 = a.m[0][2];\n const T a14 = a.m[0][3];\n\n const T a21 = a.m[1][0];\n const T a22 = a.m[1][1];\n const T a23 = a.m[1][2];\n const T a24 = a.m[1][3];\n\n const T a31 = a.m[2][0];\n const T a32 = a.m[2][1];\n const T a33 = a.m[2][2];\n const T a34 = a.m[2][3];\n\n const T b11 = b.m[0][0];\n const T b12 = b.m[0][1];\n const T b13 = b.m[0][2];\n const T b14 = b.m[0][3];\n\n const T b21 = b.m[1][0];\n const T b22 = b.m[1][1];\n const T b23 = b.m[1][2];\n const T b24 = b.m[1][3];\n\n const T b31 = b.m[2][0];\n const T b32 = b.m[2][1];\n const T b33 = b.m[2][2];\n const T b34 = b.m[2][3];\n\n o.m[0][0] = a11 * b11 + a12 * b21 + a13 * b31;\n o.m[0][1] = a11 * b12 + a12 * b22 + a13 * b32;\n o.m[0][2] = a11 * b13 + a12 * b23 + a13 * b33;\n o.m[0][3] = a11 * b14 + a12 * b24 + a13 * b34 + a14;\n\n o.m[1][0] = a21 * b11 + a22 * b21 + a23 * b31;\n o.m[1][1] = a21 * b12 + a22 * b22 + a23 * b32;\n o.m[1][2] = a21 * b13 + a22 * b23 + a23 * b33;\n o.m[1][3] = a21 * b14 + a22 * b24 + a23 * b34 + a24;\n\n o.m[2][0] = a31 * b11 + a32 * b21 + a33 * b31;\n o.m[2][1] = a31 * b12 + a32 * b22 + a33 * b32;\n o.m[2][2] = a31 * b13 + a32 * b23 + a33 * b33;\n o.m[2][3] = a31 * b14 + a32 * b24 + a33 * b34 + a34;\n}\n\n\ntemplate <>\ninline void Matrix34CalcCommon<f32>::multiply(Base& o, const Base& a, const Base& b)\n{\n auto a0 = __extension__ ({ float32x4_t __ret; __ret = (float32x4_t) __builtin_neon_vld1q_v(a.m[0], 41); __ret; });\n auto a1 = __extension__ ({ float32x4_t __ret; __ret = (float32x4_t) __builtin_neon_vld1q_v(a.m[1], 41); __ret; });\n auto a2 = __extension__ ({ float32x4_t __ret; __ret = (float32x4_t) __builtin_neon_vld1q_v(a.m[2], 41); __ret; });\n\n auto b0 = __extension__ ({ float32x4_t __ret; __ret = (float32x4_t) __builtin_neon_vld1q_v(b.m[0], 41); __ret; });\n auto b1 = __extension__ ({ float32x4_t __ret; __ret = (float32x4_t) __builtin_neon_vld1q_v(b.m[1], 41); __ret; });\n auto b2 = __extension__ ({ float32x4_t __ret; __ret = (float32x4_t) __builtin_neon_vld1q_v(b.m[2], 41); __ret; });\n\n float32x4_t c0, c1, c2;\n\n c0 = __extension__ ({ float32x4_t __s0 = b0; float32x4_t __s1 = a0; float32x4_t __ret; __ret = __s0 * __builtin_shufflevector(__s1, __s1, 0, 0, 0, 0); __ret; });\n c0 = __extension__ ({ float32x4_t __s0 = c0; float32x4_t __s1 = b1; float32x4_t __s2 = a0; float32x4_t __ret; __ret = (float32x4_t) __builtin_neon_vfmaq_laneq_v((int8x16_t)__s0, (int8x16_t)__s1, (int8x16_t)__s2, 1, 41); __ret; });\n c0 = __extension__ ({ float32x4_t __s0 = c0; float32x4_t __s1 = b2; float32x4_t __s2 = a0; float32x4_t __ret; __ret = (float32x4_t) __builtin_neon_vfmaq_laneq_v((int8x16_t)__s0, (int8x16_t)__s1, (int8x16_t)__s2, 2, 41); __ret; });\n // XXX: why do something so convoluted when copying lane 3 from A to C would suffice?\n // `vcopyq_laneq_f32(vmovq_n_f32(0), 3, a0, 3)` is equivalent and generates better code.\n c0 += __extension__ ({ float32x4_t __s0_58 = vmovq_n_f32(0); float32x4_t __s2_58 = vmovq_n_f32(a0[3]); float32x4_t __ret_58; __ret_58 = __extension__ ({ float32_t __s0 = __extension__ ({ float32x4_t __s0 = __s2_58; float32_t __ret; __ret = (float32_t) __builtin_neon_vgetq_lane_f32((int8x16_t)__s0, 1); __ret; }); float32x4_t __s1 = __s0_58; float32x4_t __ret; __ret = (float32x4_t) __builtin_neon_vsetq_lane_f32(__s0, (int8x16_t)__s1, 3); __ret; }); __ret_58; });\n\n c1 = __extension__ ({ float32x4_t __s0 = b0; float32x4_t __s1 = a1; float32x4_t __ret; __ret = __s0 * __builtin_shufflevector(__s1, __s1, 0, 0, 0, 0); __ret; });\n c1 = __extension__ ({ float32x4_t __s0 = c1; float32x4_t __s1 = b1; float32x4_t __s2 = a1; float32x4_t __ret; __ret = (float32x4_t) __builtin_neon_vfmaq_laneq_v((int8x16_t)__s0, (int8x16_t)__s1, (int8x16_t)__s2, 1, 41); __ret; });\n c1 = __extension__ ({ float32x4_t __s0 = c1; float32x4_t __s1 = b2; float32x4_t __s2 = a1; float32x4_t __ret; __ret = (float32x4_t) __builtin_neon_vfmaq_laneq_v((int8x16_t)__s0, (int8x16_t)__s1, (int8x16_t)__s2, 2, 41); __ret; });\n c1 += __extension__ ({ float32x4_t __s0_58 = vmovq_n_f32(0); float32x4_t __s2_58 = vmovq_n_f32(a1[3]); float32x4_t __ret_58; __ret_58 = __extension__ ({ float32_t __s0 = __extension__ ({ float32x4_t __s0 = __s2_58; float32_t __ret; __ret = (float32_t) __builtin_neon_vgetq_lane_f32((int8x16_t)__s0, 1); __ret; }); float32x4_t __s1 = __s0_58; float32x4_t __ret; __ret = (float32x4_t) __builtin_neon_vsetq_lane_f32(__s0, (int8x16_t)__s1, 3); __ret; }); __ret_58; });\n\n c2 = __extension__ ({ float32x4_t __s0 = b0; float32x4_t __s1 = a2; float32x4_t __ret; __ret = __s0 * __builtin_shufflevector(__s1, __s1, 0, 0, 0, 0); __ret; });\n c2 = __extension__ ({ float32x4_t __s0 = c2; float32x4_t __s1 = b1; float32x4_t __s2 = a2; float32x4_t __ret; __ret = (float32x4_t) __builtin_neon_vfmaq_laneq_v((int8x16_t)__s0, (int8x16_t)__s1, (int8x16_t)__s2, 1, 41); __ret; });\n c2 = __extension__ ({ float32x4_t __s0 = c2; float32x4_t __s1 = b2; float32x4_t __s2 = a2; float32x4_t __ret; __ret = (float32x4_t) __builtin_neon_vfmaq_laneq_v((int8x16_t)__s0, (int8x16_t)__s1, (int8x16_t)__s2, 2, 41); __ret; });\n c2 += __extension__ ({ float32x4_t __s0_58 = vmovq_n_f32(0); float32x4_t __s2_58 = vmovq_n_f32(a2[3]); float32x4_t __ret_58; __ret_58 = __extension__ ({ float32_t __s0 = __extension__ ({ float32x4_t __s0 = __s2_58; float32_t __ret; __ret = (float32_t) __builtin_neon_vgetq_lane_f32((int8x16_t)__s0, 1); __ret; }); float32x4_t __s1 = __s0_58; float32x4_t __ret; __ret = (float32x4_t) __builtin_neon_vsetq_lane_f32(__s0, (int8x16_t)__s1, 3); __ret; }); __ret_58; });\n\n __extension__ ({ float32x4_t __s1 = c0; __builtin_neon_vst1q_v(o.m[0], (int8x16_t)__s1, 41); });\n __extension__ ({ float32x4_t __s1 = c1; __builtin_neon_vst1q_v(o.m[1], (int8x16_t)__s1, 41); });\n __extension__ ({ float32x4_t __s1 = c2; __builtin_neon_vst1q_v(o.m[2], (int8x16_t)__s1, 41); });\n}\n# 1044 \"/home/larsvi/botw/lib/sead/include/math/seadMatrixCalcCommon.hpp\"\ntemplate <typename T>\nvoid Matrix34CalcCommon<T>::multiply(Base& o, const Mtx33& a, const Base& b)\n{\n const T a11 = a.m[0][0];\n const T a12 = a.m[0][1];\n const T a13 = a.m[0][2];\n\n const T a21 = a.m[1][0];\n const T a22 = a.m[1][1];\n const T a23 = a.m[1][2];\n\n const T a31 = a.m[2][0];\n const T a32 = a.m[2][1];\n const T a33 = a.m[2][2];\n\n const T b11 = b.m[0][0];\n const T b12 = b.m[0][1];\n const T b13 = b.m[0][2];\n const T b14 = b.m[0][3];\n\n const T b21 = b.m[1][0];\n const T b22 = b.m[1][1];\n const T b23 = b.m[1][2];\n const T b24 = b.m[1][3];\n\n const T b31 = b.m[2][0];\n const T b32 = b.m[2][1];\n const T b33 = b.m[2][2];\n const T b34 = b.m[2][3];\n\n o.m[0][0] = a11 * b11 + a12 * b21 + a13 * b31;\n o.m[0][1] = a11 * b12 + a12 * b22 + a13 * b32;\n o.m[0][2] = a11 * b13 + a12 * b23 + a13 * b33;\n o.m[0][3] = a11 * b14 + a12 * b24 + a13 * b34;\n\n o.m[1][0] = a21 * b11 + a22 * b21 + a23 * b31;\n o.m[1][1] = a21 * b12 + a22 * b22 + a23 * b32;\n o.m[1][2] = a21 * b13 + a22 * b23 + a23 * b33;\n o.m[1][3] = a21 * b14 + a22 * b24 + a23 * b34;\n\n o.m[2][0] = a31 * b11 + a32 * b21 + a33 * b31;\n o.m[2][1] = a31 * b12 + a32 * b22 + a33 * b32;\n o.m[2][2] = a31 * b13 + a32 * b23 + a33 * b33;\n o.m[2][3] = a31 * b14 + a32 * b24 + a33 * b34;\n}\n\ntemplate <typename T>\nvoid Matrix34CalcCommon<T>::multiply(Base& o, const Base& a, const Mtx33& b)\n{\n const T a11 = a.m[0][0];\n const T a12 = a.m[0][1];\n const T a13 = a.m[0][2];\n const T a14 = a.m[0][3];\n\n const T a21 = a.m[1][0];\n const T a22 = a.m[1][1];\n const T a23 = a.m[1][2];\n const T a24 = a.m[1][3];\n\n const T a31 = a.m[2][0];\n const T a32 = a.m[2][1];\n const T a33 = a.m[2][2];\n const T a34 = a.m[2][3];\n\n const T b11 = b.m[0][0];\n const T b12 = b.m[0][1];\n const T b13 = b.m[0][2];\n\n const T b21 = b.m[1][0];\n const T b22 = b.m[1][1];\n const T b23 = b.m[1][2];\n\n const T b31 = b.m[2][0];\n const T b32 = b.m[2][1];\n const T b33 = b.m[2][2];\n\n o.m[0][0] = a11 * b11 + a12 * b21 + a13 * b31;\n o.m[0][1] = a11 * b12 + a12 * b22 + a13 * b32;\n o.m[0][2] = a11 * b13 + a12 * b23 + a13 * b33;\n o.m[0][3] = a14;\n\n o.m[1][0] = a21 * b11 + a22 * b21 + a23 * b31;\n o.m[1][1] = a21 * b12 + a22 * b22 + a23 * b32;\n o.m[1][2] = a21 * b13 + a22 * b23 + a23 * b33;\n o.m[1][3] = a24;\n\n o.m[2][0] = a31 * b11 + a32 * b21 + a33 * b31;\n o.m[2][1] = a31 * b12 + a32 * b22 + a33 * b32;\n o.m[2][2] = a31 * b13 + a32 * b23 + a33 * b33;\n o.m[2][3] = a34;\n}\n\ntemplate <typename T>\nvoid Matrix34CalcCommon<T>::transpose(Base& o)\n{\n const T a12 = o.m[0][1];\n const T a13 = o.m[0][2];\n\n const T a21 = o.m[1][0];\n const T a23 = o.m[1][2];\n\n const T a31 = o.m[2][0];\n const T a32 = o.m[2][1];\n\n o.m[0][1] = a21;\n o.m[0][2] = a31;\n o.m[0][3] = 0;\n\n o.m[1][0] = a12;\n o.m[1][2] = a32;\n o.m[1][3] = 0;\n\n o.m[2][0] = a13;\n o.m[2][1] = a23;\n o.m[2][3] = 0;\n}\n\ntemplate <typename T>\nvoid Matrix34CalcCommon<T>::transposeTo(Base& o, const Base& n)\n{\n do { if (false) static_cast<void>(&o != &n); } while (0);\n\n o.m[0][0] = n.m[0][0];\n o.m[0][1] = n.m[1][0];\n o.m[0][2] = n.m[2][0];\n o.m[0][3] = 0;\n\n o.m[1][0] = n.m[0][1];\n o.m[1][1] = n.m[1][1];\n o.m[1][2] = n.m[2][1];\n o.m[1][3] = 0;\n\n o.m[2][0] = n.m[0][2];\n o.m[2][1] = n.m[1][2];\n o.m[2][2] = n.m[2][2];\n o.m[2][3] = 0;\n}\n# 1195 \"/home/larsvi/botw/lib/sead/include/math/seadMatrixCalcCommon.hpp\"\ntemplate <typename T>\nvoid Matrix34CalcCommon<T>::makeQ(Base& o, const Quat& q)\n{\n // Assuming the quaternion \"q\" is normalized\n\n const T yy = 2 * q.y * q.y;\n const T zz = 2 * q.z * q.z;\n const T xx = 2 * q.x * q.x;\n const T xy = 2 * q.x * q.y;\n const T xz = 2 * q.x * q.z;\n const T yz = 2 * q.y * q.z;\n const T wz = 2 * q.w * q.z;\n const T wx = 2 * q.w * q.x;\n const T wy = 2 * q.w * q.y;\n\n o.m[0][0] = 1 - yy - zz;\n o.m[0][1] = xy - wz;\n o.m[0][2] = xz + wy;\n\n o.m[1][0] = xy + wz;\n o.m[1][1] = 1 - xx - zz;\n o.m[1][2] = yz - wx;\n\n o.m[2][0] = xz - wy;\n o.m[2][1] = yz + wx;\n o.m[2][2] = 1 - xx - yy;\n\n o.m[0][3] = 0;\n o.m[1][3] = 0;\n o.m[2][3] = 0;\n}\n\ntemplate <typename T>\nvoid Matrix34CalcCommon<T>::makeQT(Base& o, const Quat& q, const Vec3& t)\n{\n // Assuming the quaternion \"q\" is normalized\n\n const T yy = 2 * q.y * q.y;\n const T zz = 2 * q.z * q.z;\n const T xx = 2 * q.x * q.x;\n const T xy = 2 * q.x * q.y;\n const T xz = 2 * q.x * q.z;\n const T yz = 2 * q.y * q.z;\n const T wz = 2 * q.w * q.z;\n const T wx = 2 * q.w * q.x;\n const T wy = 2 * q.w * q.y;\n\n o.m[0][0] = 1 - yy - zz;\n o.m[0][1] = xy - wz;\n o.m[0][2] = xz + wy;\n\n o.m[1][0] = xy + wz;\n o.m[1][1] = 1 - xx - zz;\n o.m[1][2] = yz - wx;\n\n o.m[2][0] = xz - wy;\n o.m[2][1] = yz + wx;\n o.m[2][2] = 1 - xx - yy;\n\n o.m[0][3] = t.x;\n o.m[1][3] = t.y;\n o.m[2][3] = t.z;\n}\n\ntemplate <typename T>\nvoid Matrix34CalcCommon<T>::makeR(Base& o, const Vec3& r)\n{\n const T sinV[3] = {MathCalcCommon<T>::sin(r.x), MathCalcCommon<T>::sin(r.y),\n MathCalcCommon<T>::sin(r.z)};\n\n const T cosV[3] = {MathCalcCommon<T>::cos(r.x), MathCalcCommon<T>::cos(r.y),\n MathCalcCommon<T>::cos(r.z)};\n\n o.m[0][0] = (cosV[1] * cosV[2]);\n o.m[1][0] = (cosV[1] * sinV[2]);\n o.m[2][0] = -sinV[1];\n\n o.m[0][1] = (sinV[0] * sinV[1] * cosV[2] - cosV[0] * sinV[2]);\n o.m[1][1] = (sinV[0] * sinV[1] * sinV[2] + cosV[0] * cosV[2]);\n o.m[2][1] = (sinV[0] * cosV[1]);\n\n o.m[0][2] = (cosV[0] * cosV[2] * sinV[1] + sinV[0] * sinV[2]);\n o.m[1][2] = (cosV[0] * sinV[2] * sinV[1] - sinV[0] * cosV[2]);\n o.m[2][2] = (cosV[0] * cosV[1]);\n\n o.m[0][3] = 0;\n o.m[1][3] = 0;\n o.m[2][3] = 0;\n}\n\ntemplate <typename T>\nvoid Matrix34CalcCommon<T>::makeRIdx(Base& o, u32 xr, u32 yr, u32 zr)\n{\n const T sinV[3];\n const T cosV[3];\n\n MathCalcCommon<T>::sinCosIdx(&sinV[0], &cosV[0], xr);\n MathCalcCommon<T>::sinCosIdx(&sinV[1], &cosV[1], yr);\n MathCalcCommon<T>::sinCosIdx(&sinV[2], &cosV[2], zr);\n\n o.m[0][0] = (cosV[1] * cosV[2]);\n o.m[1][0] = (cosV[1] * sinV[2]);\n o.m[2][0] = -sinV[1];\n\n o.m[0][1] = (sinV[0] * sinV[1] * cosV[2] - cosV[0] * sinV[2]);\n o.m[1][1] = (sinV[0] * sinV[1] * sinV[2] + cosV[0] * cosV[2]);\n o.m[2][1] = (sinV[0] * cosV[1]);\n\n o.m[0][2] = (cosV[0] * cosV[2] * sinV[1] + sinV[0] * sinV[2]);\n o.m[1][2] = (cosV[0] * sinV[2] * sinV[1] - sinV[0] * cosV[2]);\n o.m[2][2] = (cosV[0] * cosV[1]);\n\n o.m[0][3] = 0;\n o.m[1][3] = 0;\n o.m[2][3] = 0;\n}\n\ntemplate <typename T>\ninline void Matrix34CalcCommon<T>::makeRT(Base& o, const Vec3& r, const Vec3& t)\n{\n const T sinV[3] = {std::sin(r.x), std::sin(r.y), std::sin(r.z)};\n\n const T cosV[3] = {std::cos(r.x), std::cos(r.y), std::cos(r.z)};\n\n T s0_s1 = sinV[0] * sinV[1];\n T c0_s2 = cosV[0] * sinV[2];\n T c0_c2 = cosV[0] * cosV[2];\n\n o.m[0][0] = cosV[1] * cosV[2];\n o.m[1][0] = cosV[1] * sinV[2];\n o.m[2][0] = -sinV[1];\n\n o.m[0][1] = (s0_s1 * cosV[2]) - c0_s2;\n o.m[1][1] = (s0_s1 * sinV[2]) + c0_c2;\n o.m[2][1] = sinV[0] * cosV[1];\n\n o.m[0][2] = (c0_c2 * sinV[1]) + (sinV[0] * sinV[2]);\n o.m[1][2] = (c0_s2 * sinV[1]) - (sinV[0] * cosV[2]);\n o.m[2][2] = cosV[0] * cosV[1];\n\n o.m[0][3] = t.x;\n o.m[1][3] = t.y;\n o.m[2][3] = t.z;\n}\n\ntemplate <typename T>\nvoid Matrix34CalcCommon<T>::makeRTIdx(Base& o, const Vector3<u32>& r, const Vec3& t)\n{\n const T sinV[3];\n const T cosV[3];\n\n MathCalcCommon<T>::sinCosIdx(&sinV[0], &cosV[0], r.x);\n MathCalcCommon<T>::sinCosIdx(&sinV[1], &cosV[1], r.y);\n MathCalcCommon<T>::sinCosIdx(&sinV[2], &cosV[2], r.z);\n\n o.m[0][0] = (cosV[1] * cosV[2]);\n o.m[1][0] = (cosV[1] * sinV[2]);\n o.m[2][0] = -sinV[1];\n\n o.m[0][1] = (sinV[0] * sinV[1] * cosV[2] - cosV[0] * sinV[2]);\n o.m[1][1] = (sinV[0] * sinV[1] * sinV[2] + cosV[0] * cosV[2]);\n o.m[2][1] = (sinV[0] * cosV[1]);\n\n o.m[0][2] = (cosV[0] * cosV[2] * sinV[1] + sinV[0] * sinV[2]);\n o.m[1][2] = (cosV[0] * sinV[2] * sinV[1] - sinV[0] * cosV[2]);\n o.m[2][2] = (cosV[0] * cosV[1]);\n\n o.m[0][3] = t.x;\n o.m[1][3] = t.y;\n o.m[2][3] = t.z;\n}\n\ntemplate <typename T>\nvoid Matrix34CalcCommon<T>::makeRzxyIdx(Base& o, u32 xr, u32 yr, u32 zr)\n{\n const T sinV[3];\n const T cosV[3];\n\n MathCalcCommon<T>::sinCosIdx(&sinV[0], &cosV[0], xr);\n MathCalcCommon<T>::sinCosIdx(&sinV[1], &cosV[1], yr);\n MathCalcCommon<T>::sinCosIdx(&sinV[2], &cosV[2], zr);\n\n o.m[2][2] = (cosV[0] * cosV[1]);\n o.m[0][2] = (cosV[0] * sinV[1]);\n o.m[1][2] = -sinV[0];\n\n o.m[2][0] = (sinV[1] * cosV[2] - sinV[0] * cosV[1] * sinV[2]);\n o.m[0][0] = (cosV[1] * cosV[2] + sinV[0] * sinV[1] * sinV[2]);\n o.m[1][0] = (cosV[0] * sinV[2]);\n\n o.m[2][1] = (sinV[1] * sinV[2] + sinV[0] * cosV[1] * cosV[2]);\n o.m[0][1] = (cosV[1] * sinV[2] - sinV[0] * sinV[1] * cosV[2]);\n o.m[1][1] = (cosV[0] * cosV[2]);\n\n o.m[0][3] = 0;\n o.m[1][3] = 0;\n o.m[2][3] = 0;\n}\n\ntemplate <typename T>\nvoid Matrix34CalcCommon<T>::makeRzxyTIdx(Base& o, const Vector3<u32>& r, const Vec3& t)\n{\n const T sinV[3];\n const T cosV[3];\n\n MathCalcCommon<T>::sinCosIdx(&sinV[0], &cosV[0], r.x);\n MathCalcCommon<T>::sinCosIdx(&sinV[1], &cosV[1], r.y);\n MathCalcCommon<T>::sinCosIdx(&sinV[2], &cosV[2], r.z);\n\n o.m[2][2] = (cosV[0] * cosV[1]);\n o.m[0][2] = (cosV[0] * sinV[1]);\n o.m[1][2] = -sinV[0];\n\n o.m[2][0] = (sinV[1] * cosV[2] - sinV[0] * cosV[1] * sinV[2]);\n o.m[0][0] = (cosV[1] * cosV[2] + sinV[0] * sinV[1] * sinV[2]);\n o.m[1][0] = (cosV[0] * sinV[2]);\n\n o.m[2][1] = (sinV[1] * sinV[2] + sinV[0] * cosV[1] * cosV[2]);\n o.m[0][1] = (cosV[1] * sinV[2] - sinV[0] * sinV[1] * cosV[2]);\n o.m[1][1] = (cosV[0] * cosV[2]);\n\n o.m[0][3] = t.x;\n o.m[1][3] = t.y;\n o.m[2][3] = t.z;\n}\n\ntemplate <typename T>\nvoid Matrix34CalcCommon<T>::makeS(Base& o, const Vec3& s)\n{\n o.m[0][0] = s.x;\n o.m[1][0] = 0;\n o.m[2][0] = 0;\n\n o.m[0][1] = 0;\n o.m[1][1] = s.y;\n o.m[2][1] = 0;\n\n o.m[0][2] = 0;\n o.m[1][2] = 0;\n o.m[2][2] = s.z;\n\n o.m[0][3] = 0;\n o.m[1][3] = 0;\n o.m[2][3] = 0;\n}\n# 1451 \"/home/larsvi/botw/lib/sead/include/math/seadMatrixCalcCommon.hpp\"\ntemplate <typename T>\nvoid Matrix34CalcCommon<T>::makeSQT(Base& o, const Vec3& s, const Quat& q, const Vec3& t)\n{\n // Assuming the quaternion \"q\" is normalized\n\n const T yy = 2 * q.y * q.y;\n const T zz = 2 * q.z * q.z;\n const T xx = 2 * q.x * q.x;\n const T xy = 2 * q.x * q.y;\n const T xz = 2 * q.x * q.z;\n const T yz = 2 * q.y * q.z;\n const T wz = 2 * q.w * q.z;\n const T wx = 2 * q.w * q.x;\n const T wy = 2 * q.w * q.y;\n\n o.m[0][0] = s.x * (1 - yy - zz);\n o.m[0][1] = s.y * (xy - wz);\n o.m[0][2] = s.z * (xz + wy);\n\n o.m[1][0] = s.x * (xy + wz);\n o.m[1][1] = s.y * (1 - xx - zz);\n o.m[1][2] = s.z * (yz - wx);\n\n o.m[2][0] = s.x * (xz - wy);\n o.m[2][1] = s.y * (yz + wx);\n o.m[2][2] = s.z * (1 - xx - yy);\n\n o.m[0][3] = t.x;\n o.m[1][3] = t.y;\n o.m[2][3] = t.z;\n}\n\ntemplate <typename T>\nvoid Matrix34CalcCommon<T>::makeSR(Base& o, const Vec3& s, const Vec3& r)\n{\n const T sinV[3] = {MathCalcCommon<T>::sin(r.x), MathCalcCommon<T>::sin(r.y),\n MathCalcCommon<T>::sin(r.z)};\n\n const T cosV[3] = {MathCalcCommon<T>::cos(r.x), MathCalcCommon<T>::cos(r.y),\n MathCalcCommon<T>::cos(r.z)};\n\n o.m[0][0] = s.x * (cosV[1] * cosV[2]);\n o.m[1][0] = s.x * (cosV[1] * sinV[2]);\n o.m[2][0] = s.x * -sinV[1];\n\n o.m[0][1] = s.y * (sinV[0] * sinV[1] * cosV[2] - cosV[0] * sinV[2]);\n o.m[1][1] = s.y * (sinV[0] * sinV[1] * sinV[2] + cosV[0] * cosV[2]);\n o.m[2][1] = s.y * (sinV[0] * cosV[1]);\n\n o.m[0][2] = s.z * (cosV[0] * cosV[2] * sinV[1] + sinV[0] * sinV[2]);\n o.m[1][2] = s.z * (cosV[0] * sinV[2] * sinV[1] - sinV[0] * cosV[2]);\n o.m[2][2] = s.z * (cosV[0] * cosV[1]);\n\n o.m[0][3] = 0;\n o.m[1][3] = 0;\n o.m[2][3] = 0;\n}\n\ntemplate <typename T>\nvoid Matrix34CalcCommon<T>::makeSRIdx(Base& o, const Vec3& s, const Vector3<u32>& r)\n{\n const T sinV[3];\n const T cosV[3];\n\n MathCalcCommon<T>::sinCosIdx(&sinV[0], &cosV[0], r.x);\n MathCalcCommon<T>::sinCosIdx(&sinV[1], &cosV[1], r.y);\n MathCalcCommon<T>::sinCosIdx(&sinV[2], &cosV[2], r.z);\n\n o.m[0][0] = s.x * (cosV[1] * cosV[2]);\n o.m[1][0] = s.x * (cosV[1] * sinV[2]);\n o.m[2][0] = s.x * -sinV[1];\n\n o.m[0][1] = s.y * (sinV[0] * sinV[1] * cosV[2] - cosV[0] * sinV[2]);\n o.m[1][1] = s.y * (sinV[0] * sinV[1] * sinV[2] + cosV[0] * cosV[2]);\n o.m[2][1] = s.y * (sinV[0] * cosV[1]);\n\n o.m[0][2] = s.z * (cosV[0] * cosV[2] * sinV[1] + sinV[0] * sinV[2]);\n o.m[1][2] = s.z * (cosV[0] * sinV[2] * sinV[1] - sinV[0] * cosV[2]);\n o.m[2][2] = s.z * (cosV[0] * cosV[1]);\n\n o.m[0][3] = 0;\n o.m[1][3] = 0;\n o.m[2][3] = 0;\n}\n\ntemplate <typename T>\nvoid Matrix34CalcCommon<T>::makeSRT(Base& o, const Vec3& s, const Vec3& r, const Vec3& t)\n{\n const T sinV[3] = {MathCalcCommon<T>::sin(r.x), MathCalcCommon<T>::sin(r.y),\n MathCalcCommon<T>::sin(r.z)};\n\n const T cosV[3] = {MathCalcCommon<T>::cos(r.x), MathCalcCommon<T>::cos(r.y),\n MathCalcCommon<T>::cos(r.z)};\n\n o.m[0][0] = s.x * (cosV[1] * cosV[2]);\n o.m[1][0] = s.x * (cosV[1] * sinV[2]);\n o.m[2][0] = s.x * -sinV[1];\n\n o.m[0][1] = s.y * (sinV[0] * sinV[1] * cosV[2] - cosV[0] * sinV[2]);\n o.m[1][1] = s.y * (sinV[0] * sinV[1] * sinV[2] + cosV[0] * cosV[2]);\n o.m[2][1] = s.y * (sinV[0] * cosV[1]);\n\n o.m[0][2] = s.z * (cosV[0] * cosV[2] * sinV[1] + sinV[0] * sinV[2]);\n o.m[1][2] = s.z * (cosV[0] * sinV[2] * sinV[1] - sinV[0] * cosV[2]);\n o.m[2][2] = s.z * (cosV[0] * cosV[1]);\n\n o.m[0][3] = t.x;\n o.m[1][3] = t.y;\n o.m[2][3] = t.z;\n}\n\ntemplate <typename T>\nvoid Matrix34CalcCommon<T>::makeSRTIdx(Base& o, const Vec3& s, const Vector3<u32>& r, const Vec3& t)\n{\n const T sinV[3];\n const T cosV[3];\n\n MathCalcCommon<T>::sinCosIdx(&sinV[0], &cosV[0], r.x);\n MathCalcCommon<T>::sinCosIdx(&sinV[1], &cosV[1], r.y);\n MathCalcCommon<T>::sinCosIdx(&sinV[2], &cosV[2], r.z);\n\n o.m[0][0] = s.x * (cosV[1] * cosV[2]);\n o.m[1][0] = s.x * (cosV[1] * sinV[2]);\n o.m[2][0] = s.x * -sinV[1];\n\n o.m[0][1] = s.y * (sinV[0] * sinV[1] * cosV[2] - cosV[0] * sinV[2]);\n o.m[1][1] = s.y * (sinV[0] * sinV[1] * sinV[2] + cosV[0] * cosV[2]);\n o.m[2][1] = s.y * (sinV[0] * cosV[1]);\n\n o.m[0][2] = s.z * (cosV[0] * cosV[2] * sinV[1] + sinV[0] * sinV[2]);\n o.m[1][2] = s.z * (cosV[0] * sinV[2] * sinV[1] - sinV[0] * cosV[2]);\n o.m[2][2] = s.z * (cosV[0] * cosV[1]);\n\n o.m[0][3] = t.x;\n o.m[1][3] = t.y;\n o.m[2][3] = t.z;\n}\n\ntemplate <typename T>\nvoid Matrix34CalcCommon<T>::makeSRzxyIdx(Base& o, const Vec3& s, const Vector3<u32>& r)\n{\n const T sinV[3];\n const T cosV[3];\n\n MathCalcCommon<T>::sinCosIdx(&sinV[0], &cosV[0], r.x);\n MathCalcCommon<T>::sinCosIdx(&sinV[1], &cosV[1], r.y);\n MathCalcCommon<T>::sinCosIdx(&sinV[2], &cosV[2], r.z);\n\n o.m[2][2] = s.z * (cosV[0] * cosV[1]);\n o.m[0][2] = s.z * (cosV[0] * sinV[1]);\n o.m[1][2] = s.z * -sinV[0];\n\n o.m[2][0] = s.x * (sinV[1] * cosV[2] - sinV[0] * cosV[1] * sinV[2]);\n o.m[0][0] = s.x * (cosV[1] * cosV[2] + sinV[0] * sinV[1] * sinV[2]);\n o.m[1][0] = s.x * (cosV[0] * sinV[2]);\n\n o.m[2][1] = s.y * (sinV[1] * sinV[2] + sinV[0] * cosV[1] * cosV[2]);\n o.m[0][1] = s.y * (cosV[1] * sinV[2] - sinV[0] * sinV[1] * cosV[2]);\n o.m[1][1] = s.y * (cosV[0] * cosV[2]);\n\n o.m[0][3] = 0;\n o.m[1][3] = 0;\n o.m[2][3] = 0;\n}\n\ntemplate <typename T>\nvoid Matrix34CalcCommon<T>::makeSRzxyTIdx(Base& o, const Vec3& s, const Vector3<u32>& r,\n const Vec3& t)\n{\n const T sinV[3];\n const T cosV[3];\n\n MathCalcCommon<T>::sinCosIdx(&sinV[0], &cosV[0], r.x);\n MathCalcCommon<T>::sinCosIdx(&sinV[1], &cosV[1], r.y);\n MathCalcCommon<T>::sinCosIdx(&sinV[2], &cosV[2], r.z);\n\n o.m[2][2] = s.z * (cosV[0] * cosV[1]);\n o.m[0][2] = s.z * (cosV[0] * sinV[1]);\n o.m[1][2] = s.z * -sinV[0];\n\n o.m[2][0] = s.x * (sinV[1] * cosV[2] - sinV[0] * cosV[1] * sinV[2]);\n o.m[0][0] = s.x * (cosV[1] * cosV[2] + sinV[0] * sinV[1] * sinV[2]);\n o.m[1][0] = s.x * (cosV[0] * sinV[2]);\n\n o.m[2][1] = s.y * (sinV[1] * sinV[2] + sinV[0] * cosV[1] * cosV[2]);\n o.m[0][1] = s.y * (cosV[1] * sinV[2] - sinV[0] * sinV[1] * cosV[2]);\n o.m[1][1] = s.y * (cosV[0] * cosV[2]);\n\n o.m[0][3] = t.x;\n o.m[1][3] = t.y;\n o.m[2][3] = t.z;\n}\n\ntemplate <typename T>\nvoid Matrix34CalcCommon<T>::makeST(Base& o, const Vec3& s, const Vec3& t)\n{\n o.m[0][0] = s.x;\n o.m[1][0] = 0;\n o.m[2][0] = 0;\n\n o.m[0][1] = 0;\n o.m[1][1] = s.y;\n o.m[2][1] = 0;\n\n o.m[0][2] = 0;\n o.m[1][2] = 0;\n o.m[2][2] = s.z;\n\n o.m[0][3] = t.x;\n o.m[1][3] = t.y;\n o.m[2][3] = t.z;\n}\n\ntemplate <typename T>\nvoid Matrix34CalcCommon<T>::makeT(Base& o, const Vec3& t)\n{\n o.m[0][0] = 1;\n o.m[1][0] = 0;\n o.m[2][0] = 0;\n\n o.m[0][1] = 0;\n o.m[1][1] = 1;\n o.m[2][1] = 0;\n\n o.m[0][2] = 0;\n o.m[1][2] = 0;\n o.m[2][2] = 1;\n\n o.m[0][3] = t.x;\n o.m[1][3] = t.y;\n o.m[2][3] = t.z;\n}\n\ntemplate <typename T>\nvoid Matrix34CalcCommon<T>::toQuat(Quat& q, const Base& n)\n{\n const T a11 = n.m[0][0];\n const T a12 = n.m[0][1];\n const T a13 = n.m[0][2];\n\n const T a21 = n.m[1][0];\n const T a22 = n.m[1][1];\n const T a23 = n.m[1][2];\n\n const T a31 = n.m[2][0];\n const T a32 = n.m[2][1];\n const T a33 = n.m[2][2];\n\n const T t = a11 + a22 + a33;\n T w, x, y, z;\n\n if (t > 0)\n {\n T s = MathCalcCommon<T>::sqrt(t + 1);\n\n w = s * 0.5f;\n\n // if (s != 0)\n s = 0.5f / s;\n\n x = (a32 - a23) * s;\n y = (a13 - a31) * s;\n z = (a21 - a12) * s;\n }\n else if (a22 > a11 && a33 <= a22)\n {\n T s = MathCalcCommon<T>::sqrt(a22 - (a33 + a11) + 1);\n\n y = s * 0.5f;\n\n if (s != 0)\n s = 0.5f / s;\n\n w = (a13 - a31) * s;\n x = (a21 + a12) * s;\n z = (a23 + a32) * s;\n }\n else if (a22 > a11 || a33 > a11)\n {\n T s = MathCalcCommon<T>::sqrt(a33 - (a11 + a22) + 1);\n\n z = s * 0.5f;\n\n if (s != 0)\n s = 0.5f / s;\n\n w = (a21 - a12) * s;\n x = (a31 + a13) * s;\n y = (a32 + a23) * s;\n }\n else\n {\n T s = MathCalcCommon<T>::sqrt(a11 - (a22 + a33) + 1);\n\n x = s * 0.5f;\n\n if (s != 0)\n s = 0.5f / s;\n\n w = (a32 - a23) * s;\n y = (a12 + a21) * s;\n z = (a13 + a31) * s;\n }\n\n q.w = w;\n q.x = x;\n q.y = y;\n q.z = z;\n}\n\ntemplate <typename T>\nvoid Matrix34CalcCommon<T>::getBase(Vec3& v, const Base& n, s32 axis)\n{\n v.x = n.m[0][axis];\n v.y = n.m[1][axis];\n v.z = n.m[2][axis];\n}\n\ntemplate <typename T>\nvoid Matrix34CalcCommon<T>::getRow(Vec4& v, const Base& n, s32 row)\n{\n v.x = n.m[row][0];\n v.y = n.m[row][1];\n v.z = n.m[row][2];\n v.w = n.m[row][3];\n}\n\ntemplate <typename T>\nvoid Matrix34CalcCommon<T>::getTranslation(Vec3& v, const Base& n)\n{\n getBase(v, n, 3);\n}\n\ntemplate <typename T>\nvoid Matrix34CalcCommon<T>::getRotation(Vec3& v, const Base& n)\n{\n const T a11 = n.m[0][0];\n const T a12 = n.m[0][1];\n const T a13 = n.m[0][2];\n\n const T a21 = n.m[1][0];\n const T a22 = n.m[1][1];\n const T a23 = n.m[1][2];\n\n const T a31 = n.m[2][0];\n const T a32 = n.m[2][1];\n const T a33 = n.m[2][2];\n\n T abs = MathCalcCommon<T>::abs(a31);\n // making sure pitch stays within bounds, setting roll to 0 otherwise\n if ((1.0f - abs) < MathCalcCommon<T>::epsilon() * 10)\n {\n v.x = 0.0f;\n v.y = (a31 / abs) * (-numbers::pi_v<T> / 2);\n v.z = std::atan2(-a12, -(a31 * a13));\n }\n else\n {\n v.x = std::atan2(a32, a33);\n v.y = std::asin(-a31);\n v.z = std::atan2(a21, a11);\n }\n}\n\ntemplate <typename T>\nvoid Matrix34CalcCommon<T>::scaleAllElements(Base& n, T s)\n{\n n.m[0][0] *= s;\n n.m[0][1] *= s;\n n.m[0][2] *= s;\n n.m[0][3] *= s;\n\n n.m[1][0] *= s;\n n.m[1][1] *= s;\n n.m[1][2] *= s;\n n.m[1][3] *= s;\n\n n.m[2][0] *= s;\n n.m[2][1] *= s;\n n.m[2][2] *= s;\n n.m[2][3] *= s;\n}\n\ntemplate <typename T>\nvoid Matrix34CalcCommon<T>::scaleBases(Base& n, T sx, T sy, T sz)\n{\n n.m[0][0] *= sx;\n n.m[1][0] *= sx;\n n.m[2][0] *= sx;\n\n n.m[0][1] *= sy;\n n.m[1][1] *= sy;\n n.m[2][1] *= sy;\n\n n.m[0][2] *= sz;\n n.m[1][2] *= sz;\n n.m[2][2] *= sz;\n}\n\ntemplate <typename T>\nvoid Matrix34CalcCommon<T>::setBase(Base& n, s32 axis, const Vec3& v)\n{\n n.m[0][axis] = v.x;\n n.m[1][axis] = v.y;\n n.m[2][axis] = v.z;\n}\n\ntemplate <typename T>\nvoid Matrix34CalcCommon<T>::setRow(Base& n, const Vec4& v, s32 row)\n{\n n.m[row][0] = v.x;\n n.m[row][1] = v.y;\n n.m[row][2] = v.z;\n n.m[row][3] = v.w;\n}\n\ntemplate <typename T>\nvoid Matrix34CalcCommon<T>::setTranslation(Base& n, const Vec3& v)\n{\n setBase(n, 3, v);\n}\n\ntemplate <typename T>\nvoid Matrix44CalcCommon<T>::makeIdentity(Base& o)\n{\n o.m[0][0] = 1;\n o.m[0][1] = 0;\n o.m[0][2] = 0;\n o.m[0][3] = 0;\n\n o.m[1][0] = 0;\n o.m[1][1] = 1;\n o.m[1][2] = 0;\n o.m[1][3] = 0;\n\n o.m[2][0] = 0;\n o.m[2][1] = 0;\n o.m[2][2] = 1;\n o.m[2][3] = 0;\n\n o.m[3][0] = 0;\n o.m[3][1] = 0;\n o.m[3][2] = 0;\n o.m[3][3] = 1;\n}\n# 1907 \"/home/larsvi/botw/lib/sead/include/math/seadMatrixCalcCommon.hpp\"\ntemplate <typename T>\nvoid Matrix44CalcCommon<T>::makeZero(Base& o)\n{\n o.m[0][0] = 0;\n o.m[0][1] = 0;\n o.m[0][2] = 0;\n o.m[0][3] = 0;\n\n o.m[1][0] = 0;\n o.m[1][1] = 0;\n o.m[1][2] = 0;\n o.m[1][3] = 0;\n\n o.m[2][0] = 0;\n o.m[2][1] = 0;\n o.m[2][2] = 0;\n o.m[2][3] = 0;\n\n o.m[3][0] = 0;\n o.m[3][1] = 0;\n o.m[3][2] = 0;\n o.m[3][3] = 0;\n}\n\ntemplate <typename T>\nvoid Matrix44CalcCommon<T>::copy(Base& o, const Base& n)\n{\n o.m[0][0] = n.m[0][0];\n o.m[0][1] = n.m[0][1];\n o.m[0][2] = n.m[0][2];\n o.m[0][3] = n.m[0][3];\n\n o.m[1][0] = n.m[1][0];\n o.m[1][1] = n.m[1][1];\n o.m[1][2] = n.m[1][2];\n o.m[1][3] = n.m[1][3];\n\n o.m[2][0] = n.m[2][0];\n o.m[2][1] = n.m[2][1];\n o.m[2][2] = n.m[2][2];\n o.m[2][3] = n.m[2][3];\n\n o.m[3][0] = n.m[3][0];\n o.m[3][1] = n.m[3][1];\n o.m[3][2] = n.m[3][2];\n o.m[3][3] = n.m[3][3];\n}\n# 1965 \"/home/larsvi/botw/lib/sead/include/math/seadMatrixCalcCommon.hpp\"\ntemplate <typename T>\nvoid Matrix44CalcCommon<T>::copy(Base& o, const Mtx33& n, const Vec3& t, const Vec4& v)\n{\n o.m[0][0] = n.m[0][0];\n o.m[0][1] = n.m[0][1];\n o.m[0][2] = n.m[0][2];\n o.m[0][3] = t.x;\n\n o.m[1][0] = n.m[1][0];\n o.m[1][1] = n.m[1][1];\n o.m[1][2] = n.m[1][2];\n o.m[1][3] = t.y;\n\n o.m[2][0] = n.m[2][0];\n o.m[2][1] = n.m[2][1];\n o.m[2][2] = n.m[2][2];\n o.m[2][3] = t.z;\n\n o.m[3][0] = v.x;\n o.m[3][1] = v.y;\n o.m[3][2] = v.z;\n o.m[3][3] = v.w;\n}\n\ntemplate <typename T>\nvoid Matrix44CalcCommon<T>::copy(Base& o, const Mtx34& n, const Vec4& v)\n{\n o.m[0][0] = n.m[0][0];\n o.m[0][1] = n.m[0][1];\n o.m[0][2] = n.m[0][2];\n o.m[0][3] = n.m[0][3];\n\n o.m[1][0] = n.m[1][0];\n o.m[1][1] = n.m[1][1];\n o.m[1][2] = n.m[1][2];\n o.m[1][3] = n.m[1][3];\n\n o.m[2][0] = n.m[2][0];\n o.m[2][1] = n.m[2][1];\n o.m[2][2] = n.m[2][2];\n o.m[2][3] = n.m[2][3];\n\n o.m[3][0] = v.x;\n o.m[3][1] = v.y;\n o.m[3][2] = v.z;\n o.m[3][3] = v.w;\n}\n# 2031 \"/home/larsvi/botw/lib/sead/include/math/seadMatrixCalcCommon.hpp\"\ntemplate <typename T>\nvoid Matrix44CalcCommon<T>::inverse(Base& o, const Base& n)\n{\n const T a11 = n.m[0][0];\n const T a12 = n.m[0][1];\n const T a13 = n.m[0][2];\n const T a14 = n.m[0][3];\n\n const T a21 = n.m[1][0];\n const T a22 = n.m[1][1];\n const T a23 = n.m[1][2];\n const T a24 = n.m[1][3];\n\n const T a31 = n.m[2][0];\n const T a32 = n.m[2][1];\n const T a33 = n.m[2][2];\n const T a34 = n.m[2][3];\n\n const T a41 = n.m[3][0];\n const T a42 = n.m[3][1];\n const T a43 = n.m[3][2];\n const T a44 = n.m[3][3];\n\n T det = a11 * (a22 * a33 * a44 + a23 * a34 * a42 + a24 * a32 * a43) +\n a12 * (a21 * a34 * a43 + a23 * a31 * a44 + a24 * a33 * a41) +\n a13 * (a21 * a32 * a44 + a22 * a34 * a41 + a24 * a31 * a42) +\n a14 * (a21 * a33 * a42 + a22 * a31 * a43 + a23 * a32 * a41) -\n a11 * (a22 * a34 * a43 + a23 * a32 * a44 + a24 * a33 * a42) -\n a12 * (a21 * a33 * a44 + a23 * a34 * a41 + a24 * a31 * a43) -\n a13 * (a21 * a34 * a42 + a22 * a31 * a44 + a24 * a32 * a41) -\n a14 * (a21 * a32 * a43 + a22 * a33 * a41 + a23 * a31 * a42);\n\n if (det == 0)\n return makeIdentity(o);\n\n det = 1 / det;\n\n const T a33xa44_a34xa43 = a33 * a44 - a34 * a43;\n const T a32xa44_a34xa42 = a32 * a44 - a34 * a42;\n const T a33xa42_a32xa43 = a33 * a42 - a32 * a43;\n const T a33xa41_a31xa43 = a33 * a41 - a31 * a43;\n const T a31xa44_a34xa41 = a31 * a44 - a34 * a41;\n const T a32xa41_a31xa42 = a32 * a41 - a31 * a42;\n const T a23xa44_a24xa43 = a23 * a44 - a24 * a43;\n const T a24xa33_a23xa34 = a24 * a33 - a23 * a34;\n const T a24xa42_a22xa44 = a24 * a42 - a22 * a44;\n const T a22xa43_a23xa42 = a22 * a43 - a23 * a42;\n const T a22xa34_a24xa32 = a22 * a34 - a24 * a32;\n const T a23xa32_a22xa33 = a23 * a32 - a22 * a33;\n const T a21xa44_a24xa41 = a21 * a44 - a24 * a41;\n const T a23xa41_a21xa43 = a23 * a41 - a21 * a43;\n const T a24xa31_a21xa34 = a24 * a31 - a21 * a34;\n const T a21xa33_a23xa31 = a21 * a33 - a23 * a31;\n const T a21xa42_a22xa41 = a21 * a42 - a22 * a41;\n const T a22xa31_a21xa32 = a22 * a31 - a21 * a32;\n\n o.m[0][0] = (a22 * a33xa44_a34xa43 - a23 * a32xa44_a34xa42 - a24 * a33xa42_a32xa43) * det;\n o.m[0][1] = (a13 * a32xa44_a34xa42 + a14 * a33xa42_a32xa43 - a12 * a33xa44_a34xa43) * det;\n o.m[0][2] = (a12 * a23xa44_a24xa43 + a13 * a24xa42_a22xa44 + a14 * a22xa43_a23xa42) * det;\n o.m[0][3] = (a12 * a24xa33_a23xa34 + a13 * a22xa34_a24xa32 + a14 * a23xa32_a22xa33) * det;\n\n o.m[1][0] = (a23 * a31xa44_a34xa41 + a24 * a33xa41_a31xa43 - a21 * a33xa44_a34xa43) * det;\n o.m[1][1] = (a11 * a33xa44_a34xa43 - a13 * a31xa44_a34xa41 - a14 * a33xa41_a31xa43) * det;\n o.m[1][2] = (a13 * a21xa44_a24xa41 + a14 * a23xa41_a21xa43 - a11 * a23xa44_a24xa43) * det;\n o.m[1][3] = (a13 * a24xa31_a21xa34 + a14 * a21xa33_a23xa31 - a11 * a24xa33_a23xa34) * det;\n\n o.m[2][0] = (a21 * a32xa44_a34xa42 - a22 * a31xa44_a34xa41 - a24 * a32xa41_a31xa42) * det;\n o.m[2][1] = (a12 * a31xa44_a34xa41 + a14 * a32xa41_a31xa42 - a11 * a32xa44_a34xa42) * det;\n o.m[2][2] = (a14 * a21xa42_a22xa41 - a11 * a24xa42_a22xa44 - a12 * a21xa44_a24xa41) * det;\n o.m[2][3] = (a14 * a22xa31_a21xa32 - a11 * a22xa34_a24xa32 - a12 * a24xa31_a21xa34) * det;\n\n o.m[3][0] = (a21 * a33xa42_a32xa43 - a22 * a33xa41_a31xa43 + a23 * a32xa41_a31xa42) * det;\n o.m[3][1] = (a12 * a33xa41_a31xa43 - a13 * a32xa41_a31xa42 - a11 * a33xa42_a32xa43) * det;\n o.m[3][2] = (-a13 * a21xa42_a22xa41 - a11 * a22xa43_a23xa42 - a12 * a23xa41_a21xa43) * det;\n o.m[3][3] = (-a13 * a22xa31_a21xa32 - a11 * a23xa32_a22xa33 - a12 * a21xa33_a23xa31) * det;\n}\n\ntemplate <typename T>\nvoid Matrix44CalcCommon<T>::inverseTranspose(Base& o, const Base& n)\n{\n const T a11 = n.m[0][0];\n const T a12 = n.m[0][1];\n const T a13 = n.m[0][2];\n const T a14 = n.m[0][3];\n\n const T a21 = n.m[1][0];\n const T a22 = n.m[1][1];\n const T a23 = n.m[1][2];\n const T a24 = n.m[1][3];\n\n const T a31 = n.m[2][0];\n const T a32 = n.m[2][1];\n const T a33 = n.m[2][2];\n const T a34 = n.m[2][3];\n\n const T a41 = n.m[3][0];\n const T a42 = n.m[3][1];\n const T a43 = n.m[3][2];\n const T a44 = n.m[3][3];\n\n T det = a11 * (a22 * a33 * a44 + a23 * a34 * a42 + a24 * a32 * a43) +\n a12 * (a21 * a34 * a43 + a23 * a31 * a44 + a24 * a33 * a41) +\n a13 * (a21 * a32 * a44 + a22 * a34 * a41 + a24 * a31 * a42) +\n a14 * (a21 * a33 * a42 + a22 * a31 * a43 + a23 * a32 * a41) -\n a11 * (a22 * a34 * a43 + a23 * a32 * a44 + a24 * a33 * a42) -\n a12 * (a21 * a33 * a44 + a23 * a34 * a41 + a24 * a31 * a43) -\n a13 * (a21 * a34 * a42 + a22 * a31 * a44 + a24 * a32 * a41) -\n a14 * (a21 * a32 * a43 + a22 * a33 * a41 + a23 * a31 * a42);\n\n if (det == 0)\n return makeIdentity(o);\n\n det = 1 / det;\n\n const T a33xa44_a34xa43 = a33 * a44 - a34 * a43;\n const T a32xa44_a34xa42 = a32 * a44 - a34 * a42;\n const T a33xa42_a32xa43 = a33 * a42 - a32 * a43;\n const T a33xa41_a31xa43 = a33 * a41 - a31 * a43;\n const T a31xa44_a34xa41 = a31 * a44 - a34 * a41;\n const T a32xa41_a31xa42 = a32 * a41 - a31 * a42;\n const T a23xa44_a24xa43 = a23 * a44 - a24 * a43;\n const T a24xa33_a23xa34 = a24 * a33 - a23 * a34;\n const T a24xa42_a22xa44 = a24 * a42 - a22 * a44;\n const T a22xa43_a23xa42 = a22 * a43 - a23 * a42;\n const T a22xa34_a24xa32 = a22 * a34 - a24 * a32;\n const T a23xa32_a22xa33 = a23 * a32 - a22 * a33;\n const T a21xa44_a24xa41 = a21 * a44 - a24 * a41;\n const T a23xa41_a21xa43 = a23 * a41 - a21 * a43;\n const T a24xa31_a21xa34 = a24 * a31 - a21 * a34;\n const T a21xa33_a23xa31 = a21 * a33 - a23 * a31;\n const T a21xa42_a22xa41 = a21 * a42 - a22 * a41;\n const T a22xa31_a21xa32 = a22 * a31 - a21 * a32;\n\n o.m[0][0] = (a22 * a33xa44_a34xa43 - a23 * a32xa44_a34xa42 - a24 * a33xa42_a32xa43) * det;\n o.m[0][1] = (a23 * a31xa44_a34xa41 + a24 * a33xa41_a31xa43 - a21 * a33xa44_a34xa43) * det;\n o.m[0][2] = (a21 * a32xa44_a34xa42 - a22 * a31xa44_a34xa41 - a24 * a32xa41_a31xa42) * det;\n o.m[0][3] = (a21 * a33xa42_a32xa43 - a22 * a33xa41_a31xa43 + a23 * a32xa41_a31xa42) * det;\n\n o.m[1][0] = (a13 * a32xa44_a34xa42 + a14 * a33xa42_a32xa43 - a12 * a33xa44_a34xa43) * det;\n o.m[1][1] = (a11 * a33xa44_a34xa43 - a13 * a31xa44_a34xa41 - a14 * a33xa41_a31xa43) * det;\n o.m[1][2] = (a12 * a31xa44_a34xa41 + a14 * a32xa41_a31xa42 - a11 * a32xa44_a34xa42) * det;\n o.m[1][3] = (a12 * a33xa41_a31xa43 - a13 * a32xa41_a31xa42 - a11 * a33xa42_a32xa43) * det;\n\n o.m[2][0] = (a12 * a23xa44_a24xa43 + a13 * a24xa42_a22xa44 + a14 * a22xa43_a23xa42) * det;\n o.m[2][1] = (a13 * a21xa44_a24xa41 + a14 * a23xa41_a21xa43 - a11 * a23xa44_a24xa43) * det;\n o.m[2][2] = (a14 * a21xa42_a22xa41 - a11 * a24xa42_a22xa44 - a12 * a21xa44_a24xa41) * det;\n o.m[2][3] = (-a13 * a21xa42_a22xa41 - a11 * a22xa43_a23xa42 - a12 * a23xa41_a21xa43) * det;\n\n o.m[3][0] = (a12 * a24xa33_a23xa34 + a13 * a22xa34_a24xa32 + a14 * a23xa32_a22xa33) * det;\n o.m[3][1] = (a13 * a24xa31_a21xa34 + a14 * a21xa33_a23xa31 - a11 * a24xa33_a23xa34) * det;\n o.m[3][2] = (a14 * a22xa31_a21xa32 - a11 * a22xa34_a24xa32 - a12 * a24xa31_a21xa34) * det;\n o.m[3][3] = (-a13 * a22xa31_a21xa32 - a11 * a23xa32_a22xa33 - a12 * a21xa33_a23xa31) * det;\n}\n\ntemplate <typename T>\nvoid Matrix44CalcCommon<T>::multiply(Base& o, const Base& a, const Base& b)\n{\n const T a11 = a.m[0][0];\n const T a12 = a.m[0][1];\n const T a13 = a.m[0][2];\n const T a14 = a.m[0][3];\n\n const T a21 = a.m[1][0];\n const T a22 = a.m[1][1];\n const T a23 = a.m[1][2];\n const T a24 = a.m[1][3];\n\n const T a31 = a.m[2][0];\n const T a32 = a.m[2][1];\n const T a33 = a.m[2][2];\n const T a34 = a.m[2][3];\n\n const T a41 = a.m[3][0];\n const T a42 = a.m[3][1];\n const T a43 = a.m[3][2];\n const T a44 = a.m[3][3];\n\n const T b11 = b.m[0][0];\n const T b12 = b.m[0][1];\n const T b13 = b.m[0][2];\n const T b14 = b.m[0][3];\n\n const T b21 = b.m[1][0];\n const T b22 = b.m[1][1];\n const T b23 = b.m[1][2];\n const T b24 = b.m[1][3];\n\n const T b31 = b.m[2][0];\n const T b32 = b.m[2][1];\n const T b33 = b.m[2][2];\n const T b34 = b.m[2][3];\n\n const T b41 = b.m[3][0];\n const T b42 = b.m[3][1];\n const T b43 = b.m[3][2];\n const T b44 = b.m[3][3];\n\n o.m[0][0] = a11 * b11 + a12 * b21 + a13 * b31 + a14 * b41;\n o.m[0][1] = a11 * b12 + a12 * b22 + a13 * b32 + a14 * b42;\n o.m[0][2] = a11 * b13 + a12 * b23 + a13 * b33 + a14 * b43;\n o.m[0][3] = a11 * b14 + a12 * b24 + a13 * b34 + a14 * b44;\n\n o.m[1][0] = a21 * b11 + a22 * b21 + a23 * b31 + a24 * b41;\n o.m[1][1] = a21 * b12 + a22 * b22 + a23 * b32 + a24 * b42;\n o.m[1][2] = a21 * b13 + a22 * b23 + a23 * b33 + a24 * b43;\n o.m[1][3] = a21 * b14 + a22 * b24 + a23 * b34 + a24 * b44;\n\n o.m[2][0] = a31 * b11 + a32 * b21 + a33 * b31 + a34 * b41;\n o.m[2][1] = a31 * b12 + a32 * b22 + a33 * b32 + a34 * b42;\n o.m[2][2] = a31 * b13 + a32 * b23 + a33 * b33 + a34 * b43;\n o.m[2][3] = a31 * b14 + a32 * b24 + a33 * b34 + a34 * b44;\n\n o.m[3][0] = a41 * b11 + a42 * b21 + a43 * b31 + a44 * b41;\n o.m[3][1] = a41 * b12 + a42 * b22 + a43 * b32 + a44 * b42;\n o.m[3][2] = a41 * b13 + a42 * b23 + a43 * b33 + a44 * b43;\n o.m[3][3] = a41 * b14 + a42 * b24 + a43 * b34 + a44 * b44;\n}\n# 2259 \"/home/larsvi/botw/lib/sead/include/math/seadMatrixCalcCommon.hpp\"\ntemplate <typename T>\nvoid Matrix44CalcCommon<T>::multiply(Base& o, const Mtx34& a, const Base& b)\n{\n const T a11 = a.m[0][0];\n const T a12 = a.m[0][1];\n const T a13 = a.m[0][2];\n const T a14 = a.m[0][3];\n\n const T a21 = a.m[1][0];\n const T a22 = a.m[1][1];\n const T a23 = a.m[1][2];\n const T a24 = a.m[1][3];\n\n const T a31 = a.m[2][0];\n const T a32 = a.m[2][1];\n const T a33 = a.m[2][2];\n const T a34 = a.m[2][3];\n\n const T b11 = b.m[0][0];\n const T b12 = b.m[0][1];\n const T b13 = b.m[0][2];\n const T b14 = b.m[0][3];\n\n const T b21 = b.m[1][0];\n const T b22 = b.m[1][1];\n const T b23 = b.m[1][2];\n const T b24 = b.m[1][3];\n\n const T b31 = b.m[2][0];\n const T b32 = b.m[2][1];\n const T b33 = b.m[2][2];\n const T b34 = b.m[2][3];\n\n const T b41 = b.m[3][0];\n const T b42 = b.m[3][1];\n const T b43 = b.m[3][2];\n const T b44 = b.m[3][3];\n\n o.m[0][0] = a11 * b11 + a12 * b21 + a13 * b31 + a14 * b41;\n o.m[0][1] = a11 * b12 + a12 * b22 + a13 * b32 + a14 * b42;\n o.m[0][2] = a11 * b13 + a12 * b23 + a13 * b33 + a14 * b43;\n o.m[0][3] = a11 * b14 + a12 * b24 + a13 * b34 + a14 * b44;\n\n o.m[1][0] = a21 * b11 + a22 * b21 + a23 * b31 + a24 * b41;\n o.m[1][1] = a21 * b12 + a22 * b22 + a23 * b32 + a24 * b42;\n o.m[1][2] = a21 * b13 + a22 * b23 + a23 * b33 + a24 * b43;\n o.m[1][3] = a21 * b14 + a22 * b24 + a23 * b34 + a24 * b44;\n\n o.m[2][0] = a31 * b11 + a32 * b21 + a33 * b31 + a34 * b41;\n o.m[2][1] = a31 * b12 + a32 * b22 + a33 * b32 + a34 * b42;\n o.m[2][2] = a31 * b13 + a32 * b23 + a33 * b33 + a34 * b43;\n o.m[2][3] = a31 * b14 + a32 * b24 + a33 * b34 + a34 * b44;\n\n o.m[3][0] = b41;\n o.m[3][1] = b42;\n o.m[3][2] = b43;\n o.m[3][3] = b44;\n}\n\ntemplate <typename T>\nvoid Matrix44CalcCommon<T>::multiply(Base& o, const Base& a, const Mtx34& b)\n{\n const T a11 = a.m[0][0];\n const T a12 = a.m[0][1];\n const T a13 = a.m[0][2];\n const T a14 = a.m[0][3];\n\n const T a21 = a.m[1][0];\n const T a22 = a.m[1][1];\n const T a23 = a.m[1][2];\n const T a24 = a.m[1][3];\n\n const T a31 = a.m[2][0];\n const T a32 = a.m[2][1];\n const T a33 = a.m[2][2];\n const T a34 = a.m[2][3];\n\n const T a41 = a.m[3][0];\n const T a42 = a.m[3][1];\n const T a43 = a.m[3][2];\n const T a44 = a.m[3][3];\n\n const T b11 = b.m[0][0];\n const T b12 = b.m[0][1];\n const T b13 = b.m[0][2];\n const T b14 = b.m[0][3];\n\n const T b21 = b.m[1][0];\n const T b22 = b.m[1][1];\n const T b23 = b.m[1][2];\n const T b24 = b.m[1][3];\n\n const T b31 = b.m[2][0];\n const T b32 = b.m[2][1];\n const T b33 = b.m[2][2];\n const T b34 = b.m[2][3];\n\n o.m[0][0] = a11 * b11 + a12 * b21 + a13 * b31;\n o.m[0][1] = a11 * b12 + a12 * b22 + a13 * b32;\n o.m[0][2] = a11 * b13 + a12 * b23 + a13 * b33;\n o.m[0][3] = a11 * b14 + a12 * b24 + a13 * b34 + a14;\n\n o.m[1][0] = a21 * b11 + a22 * b21 + a23 * b31;\n o.m[1][1] = a21 * b12 + a22 * b22 + a23 * b32;\n o.m[1][2] = a21 * b13 + a22 * b23 + a23 * b33;\n o.m[1][3] = a21 * b14 + a22 * b24 + a23 * b34 + a24;\n\n o.m[2][0] = a31 * b11 + a32 * b21 + a33 * b31;\n o.m[2][1] = a31 * b12 + a32 * b22 + a33 * b32;\n o.m[2][2] = a31 * b13 + a32 * b23 + a33 * b33;\n o.m[2][3] = a31 * b14 + a32 * b24 + a33 * b34 + a34;\n\n o.m[3][0] = a41 * b11 + a42 * b21 + a43 * b31;\n o.m[3][1] = a41 * b12 + a42 * b22 + a43 * b32;\n o.m[3][2] = a41 * b13 + a42 * b23 + a43 * b33;\n o.m[3][3] = a41 * b14 + a42 * b24 + a43 * b34 + a44;\n}\n\ntemplate <typename T>\nvoid Matrix44CalcCommon<T>::transpose(Base& o)\n{\n const T a12 = o.m[0][1];\n const T a13 = o.m[0][2];\n const T a14 = o.m[0][3];\n\n const T a21 = o.m[1][0];\n const T a23 = o.m[1][2];\n const T a24 = o.m[1][3];\n\n const T a31 = o.m[2][0];\n const T a32 = o.m[2][1];\n const T a34 = o.m[2][3];\n\n const T a41 = o.m[3][0];\n const T a42 = o.m[3][1];\n const T a43 = o.m[3][2];\n\n o.m[0][1] = a21;\n o.m[0][2] = a31;\n o.m[0][3] = a41;\n\n o.m[1][0] = a12;\n o.m[1][2] = a32;\n o.m[1][3] = a42;\n\n o.m[2][0] = a13;\n o.m[2][1] = a23;\n o.m[2][3] = a43;\n\n o.m[3][0] = a14;\n o.m[3][1] = a24;\n o.m[3][2] = a34;\n}\n\ntemplate <typename T>\nvoid Matrix44CalcCommon<T>::transposeTo(Base& o, const Base& n)\n{\n do { if (false) static_cast<void>(&o != &n); } while (0);\n\n o.m[0][0] = n.m[0][0];\n o.m[0][1] = n.m[1][0];\n o.m[0][2] = n.m[2][0];\n o.m[0][3] = n.m[3][0];\n\n o.m[1][0] = n.m[0][1];\n o.m[1][1] = n.m[1][1];\n o.m[1][2] = n.m[2][1];\n o.m[1][3] = n.m[3][1];\n\n o.m[2][0] = n.m[0][2];\n o.m[2][1] = n.m[1][2];\n o.m[2][2] = n.m[2][2];\n o.m[2][3] = n.m[3][2];\n\n o.m[3][0] = n.m[0][3];\n o.m[3][1] = n.m[1][3];\n o.m[3][2] = n.m[2][3];\n o.m[3][3] = n.m[3][3];\n}\n\ntemplate <typename T>\nvoid Matrix44CalcCommon<T>::makeQ(Base& o, const Quat& q)\n{\n // Assuming the quaternion \"q\" is normalized\n\n const T yy = 2 * q.y * q.y;\n const T zz = 2 * q.z * q.z;\n const T xx = 2 * q.x * q.x;\n const T xy = 2 * q.x * q.y;\n const T xz = 2 * q.x * q.z;\n const T yz = 2 * q.y * q.z;\n const T wz = 2 * q.w * q.z;\n const T wx = 2 * q.w * q.x;\n const T wy = 2 * q.w * q.y;\n\n o.m[0][0] = 1 - yy - zz;\n o.m[0][1] = xy - wz;\n o.m[0][2] = xz + wy;\n\n o.m[1][0] = xy + wz;\n o.m[1][1] = 1 - xx - zz;\n o.m[1][2] = yz - wx;\n\n o.m[2][0] = xz - wy;\n o.m[2][1] = yz + wx;\n o.m[2][2] = 1 - xx - yy;\n\n o.m[0][3] = 0;\n o.m[1][3] = 0;\n o.m[2][3] = 0;\n\n o.m[3][0] = 0;\n o.m[3][1] = 0;\n o.m[3][2] = 0;\n o.m[3][3] = 1;\n}\n\ntemplate <typename T>\nvoid Matrix44CalcCommon<T>::makeR(Base& o, const Vec3& r)\n{\n const T sinV[3] = {MathCalcCommon<T>::sin(r.x
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment