@bloomengine/engine 0.4.0 → 0.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/native/tvos/metal-patched/Cargo.toml +178 -0
- package/native/tvos/metal-patched/LICENSE-APACHE +201 -0
- package/native/tvos/metal-patched/LICENSE-MIT +25 -0
- package/native/tvos/metal-patched/src/acceleration_structure.rs +667 -0
- package/native/tvos/metal-patched/src/acceleration_structure_pass.rs +108 -0
- package/native/tvos/metal-patched/src/argument.rs +366 -0
- package/native/tvos/metal-patched/src/blitpass.rs +102 -0
- package/native/tvos/metal-patched/src/buffer.rs +71 -0
- package/native/tvos/metal-patched/src/capturedescriptor.rs +76 -0
- package/native/tvos/metal-patched/src/capturemanager.rs +113 -0
- package/native/tvos/metal-patched/src/commandbuffer.rs +192 -0
- package/native/tvos/metal-patched/src/commandqueue.rs +44 -0
- package/native/tvos/metal-patched/src/computepass.rs +107 -0
- package/native/tvos/metal-patched/src/constants.rs +152 -0
- package/native/tvos/metal-patched/src/counters.rs +119 -0
- package/native/tvos/metal-patched/src/depthstencil.rs +190 -0
- package/native/tvos/metal-patched/src/device.rs +2134 -0
- package/native/tvos/metal-patched/src/drawable.rs +39 -0
- package/native/tvos/metal-patched/src/encoder.rs +2041 -0
- package/native/tvos/metal-patched/src/heap.rs +281 -0
- package/native/tvos/metal-patched/src/indirect_encoder.rs +344 -0
- package/native/tvos/metal-patched/src/lib.rs +657 -0
- package/native/tvos/metal-patched/src/library.rs +902 -0
- package/native/tvos/metal-patched/src/mps.rs +575 -0
- package/native/tvos/metal-patched/src/pipeline/compute.rs +475 -0
- package/native/tvos/metal-patched/src/pipeline/mod.rs +71 -0
- package/native/tvos/metal-patched/src/pipeline/render.rs +762 -0
- package/native/tvos/metal-patched/src/renderpass.rs +443 -0
- package/native/tvos/metal-patched/src/resource.rs +182 -0
- package/native/tvos/metal-patched/src/sampler.rs +165 -0
- package/native/tvos/metal-patched/src/sync.rs +178 -0
- package/native/tvos/metal-patched/src/texture.rs +352 -0
- package/native/tvos/metal-patched/src/types.rs +90 -0
- package/native/tvos/metal-patched/src/vertexdescriptor.rs +250 -0
- package/package.json +8 -11
- package/native/third_party/JoltPhysics/Build/Android/PerformanceTest/build.gradle +0 -51
- package/native/third_party/JoltPhysics/Build/Android/PerformanceTest/src/main/AndroidManifest.xml +0 -20
- package/native/third_party/JoltPhysics/Build/Android/PerformanceTest/src/main/cpp/CMakeLists.txt +0 -20
- package/native/third_party/JoltPhysics/Build/Android/UnitTests/build.gradle +0 -51
- package/native/third_party/JoltPhysics/Build/Android/UnitTests/src/main/AndroidManifest.xml +0 -20
- package/native/third_party/JoltPhysics/Build/Android/UnitTests/src/main/cpp/CMakeLists.txt +0 -20
- package/native/third_party/JoltPhysics/Build/Android/build.gradle +0 -17
- package/native/third_party/JoltPhysics/Build/Android/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/native/third_party/JoltPhysics/Build/Android/gradle/wrapper/gradle-wrapper.properties +0 -5
- package/native/third_party/JoltPhysics/Build/Android/gradle.properties +0 -21
- package/native/third_party/JoltPhysics/Build/Android/gradlew +0 -185
- package/native/third_party/JoltPhysics/Build/Android/gradlew.bat +0 -89
- package/native/third_party/JoltPhysics/Build/Android/settings.gradle +0 -10
- package/native/third_party/JoltPhysics/Build/CMakeLists.txt +0 -449
- package/native/third_party/JoltPhysics/Build/README.md +0 -250
- package/native/third_party/JoltPhysics/Build/cmake_linux_clang_gcc.sh +0 -28
- package/native/third_party/JoltPhysics/Build/cmake_linux_emscripten.sh +0 -19
- package/native/third_party/JoltPhysics/Build/cmake_linux_mingw.sh +0 -19
- package/native/third_party/JoltPhysics/Build/cmake_vs2022_cl.bat +0 -3
- package/native/third_party/JoltPhysics/Build/cmake_vs2022_cl_32bit.bat +0 -3
- package/native/third_party/JoltPhysics/Build/cmake_vs2022_cl_arm.bat +0 -3
- package/native/third_party/JoltPhysics/Build/cmake_vs2022_cl_arm_32bit.bat +0 -4
- package/native/third_party/JoltPhysics/Build/cmake_vs2022_cl_cross_platform_deterministic.bat +0 -3
- package/native/third_party/JoltPhysics/Build/cmake_vs2022_cl_double.bat +0 -3
- package/native/third_party/JoltPhysics/Build/cmake_vs2022_cl_no_object_stream.bat +0 -3
- package/native/third_party/JoltPhysics/Build/cmake_vs2022_clang.bat +0 -10
- package/native/third_party/JoltPhysics/Build/cmake_vs2022_clang_cross_platform_deterministic.bat +0 -10
- package/native/third_party/JoltPhysics/Build/cmake_vs2022_clang_double.bat +0 -10
- package/native/third_party/JoltPhysics/Build/cmake_vs2022_uwp.bat +0 -5
- package/native/third_party/JoltPhysics/Build/cmake_vs2022_uwp_arm.bat +0 -5
- package/native/third_party/JoltPhysics/Build/cmake_vs2026_cl.bat +0 -3
- package/native/third_party/JoltPhysics/Build/cmake_vs2026_cl_cross_platform_deterministic.bat +0 -3
- package/native/third_party/JoltPhysics/Build/cmake_vs2026_cl_double.bat +0 -3
- package/native/third_party/JoltPhysics/Build/cmake_vs2026_clang.bat +0 -10
- package/native/third_party/JoltPhysics/Build/cmake_vs2026_clang_cross_platform_deterministic.bat +0 -10
- package/native/third_party/JoltPhysics/Build/cmake_vs2026_clang_double.bat +0 -10
- package/native/third_party/JoltPhysics/Build/cmake_windows_mingw.sh +0 -19
- package/native/third_party/JoltPhysics/Build/cmake_xcode_ios.sh +0 -4
- package/native/third_party/JoltPhysics/Build/cmake_xcode_macos.sh +0 -4
- package/native/third_party/JoltPhysics/Build/iOS/JoltViewerInfo.plist +0 -34
- package/native/third_party/JoltPhysics/Build/iOS/SamplesInfo.plist +0 -34
- package/native/third_party/JoltPhysics/Build/iOS/UnitTestsInfo.plist +0 -34
- package/native/third_party/JoltPhysics/Build/macOS/icon.icns +0 -0
- package/native/third_party/JoltPhysics/Build/macos_install_vulkan_sdk.sh +0 -13
- package/native/third_party/JoltPhysics/Build/ubuntu24_install_vulkan_sdk.sh +0 -4
- package/native/third_party/JoltPhysics/Jolt/AABBTree/AABBTreeBuilder.cpp +0 -242
- package/native/third_party/JoltPhysics/Jolt/AABBTree/AABBTreeBuilder.h +0 -121
- package/native/third_party/JoltPhysics/Jolt/AABBTree/AABBTreeToBuffer.h +0 -296
- package/native/third_party/JoltPhysics/Jolt/AABBTree/NodeCodec/NodeCodecQuadTreeHalfFloat.h +0 -323
- package/native/third_party/JoltPhysics/Jolt/AABBTree/TriangleCodec/TriangleCodecIndexed8BitPackSOA4Flags.h +0 -555
- package/native/third_party/JoltPhysics/Jolt/ConfigurationString.h +0 -112
- package/native/third_party/JoltPhysics/Jolt/Core/ARMNeon.h +0 -94
- package/native/third_party/JoltPhysics/Jolt/Core/Array.h +0 -713
- package/native/third_party/JoltPhysics/Jolt/Core/Atomics.h +0 -44
- package/native/third_party/JoltPhysics/Jolt/Core/BinaryHeap.h +0 -96
- package/native/third_party/JoltPhysics/Jolt/Core/ByteBuffer.h +0 -74
- package/native/third_party/JoltPhysics/Jolt/Core/Color.cpp +0 -38
- package/native/third_party/JoltPhysics/Jolt/Core/Color.h +0 -98
- package/native/third_party/JoltPhysics/Jolt/Core/Core.h +0 -652
- package/native/third_party/JoltPhysics/Jolt/Core/FPControlWord.h +0 -143
- package/native/third_party/JoltPhysics/Jolt/Core/FPException.h +0 -96
- package/native/third_party/JoltPhysics/Jolt/Core/FPFlushDenormals.h +0 -43
- package/native/third_party/JoltPhysics/Jolt/Core/Factory.cpp +0 -92
- package/native/third_party/JoltPhysics/Jolt/Core/Factory.h +0 -54
- package/native/third_party/JoltPhysics/Jolt/Core/FixedSizeFreeList.h +0 -122
- package/native/third_party/JoltPhysics/Jolt/Core/FixedSizeFreeList.inl +0 -215
- package/native/third_party/JoltPhysics/Jolt/Core/HashCombine.h +0 -234
- package/native/third_party/JoltPhysics/Jolt/Core/HashTable.h +0 -876
- package/native/third_party/JoltPhysics/Jolt/Core/InsertionSort.h +0 -58
- package/native/third_party/JoltPhysics/Jolt/Core/IssueReporting.cpp +0 -27
- package/native/third_party/JoltPhysics/Jolt/Core/IssueReporting.h +0 -38
- package/native/third_party/JoltPhysics/Jolt/Core/JobSystem.h +0 -311
- package/native/third_party/JoltPhysics/Jolt/Core/JobSystem.inl +0 -56
- package/native/third_party/JoltPhysics/Jolt/Core/JobSystemSingleThreaded.cpp +0 -65
- package/native/third_party/JoltPhysics/Jolt/Core/JobSystemSingleThreaded.h +0 -62
- package/native/third_party/JoltPhysics/Jolt/Core/JobSystemThreadPool.cpp +0 -364
- package/native/third_party/JoltPhysics/Jolt/Core/JobSystemThreadPool.h +0 -101
- package/native/third_party/JoltPhysics/Jolt/Core/JobSystemWithBarrier.cpp +0 -230
- package/native/third_party/JoltPhysics/Jolt/Core/JobSystemWithBarrier.h +0 -85
- package/native/third_party/JoltPhysics/Jolt/Core/LinearCurve.cpp +0 -51
- package/native/third_party/JoltPhysics/Jolt/Core/LinearCurve.h +0 -67
- package/native/third_party/JoltPhysics/Jolt/Core/LockFreeHashMap.h +0 -182
- package/native/third_party/JoltPhysics/Jolt/Core/LockFreeHashMap.inl +0 -351
- package/native/third_party/JoltPhysics/Jolt/Core/Memory.cpp +0 -85
- package/native/third_party/JoltPhysics/Jolt/Core/Memory.h +0 -85
- package/native/third_party/JoltPhysics/Jolt/Core/Mutex.h +0 -223
- package/native/third_party/JoltPhysics/Jolt/Core/MutexArray.h +0 -98
- package/native/third_party/JoltPhysics/Jolt/Core/NonCopyable.h +0 -18
- package/native/third_party/JoltPhysics/Jolt/Core/Profiler.cpp +0 -677
- package/native/third_party/JoltPhysics/Jolt/Core/Profiler.h +0 -301
- package/native/third_party/JoltPhysics/Jolt/Core/Profiler.inl +0 -90
- package/native/third_party/JoltPhysics/Jolt/Core/QuickSort.h +0 -137
- package/native/third_party/JoltPhysics/Jolt/Core/RTTI.cpp +0 -149
- package/native/third_party/JoltPhysics/Jolt/Core/RTTI.h +0 -436
- package/native/third_party/JoltPhysics/Jolt/Core/Reference.h +0 -244
- package/native/third_party/JoltPhysics/Jolt/Core/Result.h +0 -174
- package/native/third_party/JoltPhysics/Jolt/Core/STLAlignedAllocator.h +0 -72
- package/native/third_party/JoltPhysics/Jolt/Core/STLAllocator.h +0 -127
- package/native/third_party/JoltPhysics/Jolt/Core/STLLocalAllocator.h +0 -170
- package/native/third_party/JoltPhysics/Jolt/Core/STLTempAllocator.h +0 -80
- package/native/third_party/JoltPhysics/Jolt/Core/ScopeExit.h +0 -49
- package/native/third_party/JoltPhysics/Jolt/Core/Semaphore.cpp +0 -135
- package/native/third_party/JoltPhysics/Jolt/Core/Semaphore.h +0 -68
- package/native/third_party/JoltPhysics/Jolt/Core/StaticArray.h +0 -329
- package/native/third_party/JoltPhysics/Jolt/Core/StreamIn.h +0 -120
- package/native/third_party/JoltPhysics/Jolt/Core/StreamOut.h +0 -97
- package/native/third_party/JoltPhysics/Jolt/Core/StreamUtils.h +0 -168
- package/native/third_party/JoltPhysics/Jolt/Core/StreamWrapper.h +0 -53
- package/native/third_party/JoltPhysics/Jolt/Core/StridedPtr.h +0 -63
- package/native/third_party/JoltPhysics/Jolt/Core/StringTools.cpp +0 -101
- package/native/third_party/JoltPhysics/Jolt/Core/StringTools.h +0 -38
- package/native/third_party/JoltPhysics/Jolt/Core/TempAllocator.h +0 -209
- package/native/third_party/JoltPhysics/Jolt/Core/TickCounter.cpp +0 -37
- package/native/third_party/JoltPhysics/Jolt/Core/TickCounter.h +0 -58
- package/native/third_party/JoltPhysics/Jolt/Core/UnorderedMap.h +0 -80
- package/native/third_party/JoltPhysics/Jolt/Core/UnorderedSet.h +0 -32
- package/native/third_party/JoltPhysics/Jolt/Geometry/AABox.h +0 -313
- package/native/third_party/JoltPhysics/Jolt/Geometry/AABox4.h +0 -224
- package/native/third_party/JoltPhysics/Jolt/Geometry/ClipPoly.h +0 -200
- package/native/third_party/JoltPhysics/Jolt/Geometry/ClosestPoint.h +0 -498
- package/native/third_party/JoltPhysics/Jolt/Geometry/ConvexHullBuilder.cpp +0 -1467
- package/native/third_party/JoltPhysics/Jolt/Geometry/ConvexHullBuilder.h +0 -276
- package/native/third_party/JoltPhysics/Jolt/Geometry/ConvexHullBuilder2D.cpp +0 -335
- package/native/third_party/JoltPhysics/Jolt/Geometry/ConvexHullBuilder2D.h +0 -105
- package/native/third_party/JoltPhysics/Jolt/Geometry/ConvexSupport.h +0 -188
- package/native/third_party/JoltPhysics/Jolt/Geometry/EPAConvexHullBuilder.h +0 -845
- package/native/third_party/JoltPhysics/Jolt/Geometry/EPAPenetrationDepth.h +0 -557
- package/native/third_party/JoltPhysics/Jolt/Geometry/Ellipse.h +0 -77
- package/native/third_party/JoltPhysics/Jolt/Geometry/GJKClosestPoint.h +0 -945
- package/native/third_party/JoltPhysics/Jolt/Geometry/IndexedTriangle.h +0 -130
- package/native/third_party/JoltPhysics/Jolt/Geometry/Indexify.cpp +0 -222
- package/native/third_party/JoltPhysics/Jolt/Geometry/Indexify.h +0 -19
- package/native/third_party/JoltPhysics/Jolt/Geometry/MortonCode.h +0 -40
- package/native/third_party/JoltPhysics/Jolt/Geometry/OrientedBox.cpp +0 -178
- package/native/third_party/JoltPhysics/Jolt/Geometry/OrientedBox.h +0 -39
- package/native/third_party/JoltPhysics/Jolt/Geometry/Plane.h +0 -104
- package/native/third_party/JoltPhysics/Jolt/Geometry/RayAABox.h +0 -241
- package/native/third_party/JoltPhysics/Jolt/Geometry/RayCapsule.h +0 -37
- package/native/third_party/JoltPhysics/Jolt/Geometry/RayCylinder.h +0 -101
- package/native/third_party/JoltPhysics/Jolt/Geometry/RaySphere.h +0 -96
- package/native/third_party/JoltPhysics/Jolt/Geometry/RayTriangle.h +0 -158
- package/native/third_party/JoltPhysics/Jolt/Geometry/Sphere.h +0 -72
- package/native/third_party/JoltPhysics/Jolt/Geometry/Triangle.h +0 -34
- package/native/third_party/JoltPhysics/Jolt/Jolt.cmake +0 -703
- package/native/third_party/JoltPhysics/Jolt/Jolt.h +0 -16
- package/native/third_party/JoltPhysics/Jolt/Jolt.natvis +0 -116
- package/native/third_party/JoltPhysics/Jolt/Math/BVec16.h +0 -99
- package/native/third_party/JoltPhysics/Jolt/Math/BVec16.inl +0 -177
- package/native/third_party/JoltPhysics/Jolt/Math/DMat44.h +0 -158
- package/native/third_party/JoltPhysics/Jolt/Math/DMat44.inl +0 -310
- package/native/third_party/JoltPhysics/Jolt/Math/DVec3.h +0 -291
- package/native/third_party/JoltPhysics/Jolt/Math/DVec3.inl +0 -941
- package/native/third_party/JoltPhysics/Jolt/Math/Double3.h +0 -48
- package/native/third_party/JoltPhysics/Jolt/Math/DynMatrix.h +0 -31
- package/native/third_party/JoltPhysics/Jolt/Math/EigenValueSymmetric.h +0 -177
- package/native/third_party/JoltPhysics/Jolt/Math/FindRoot.h +0 -42
- package/native/third_party/JoltPhysics/Jolt/Math/Float2.h +0 -36
- package/native/third_party/JoltPhysics/Jolt/Math/Float3.h +0 -50
- package/native/third_party/JoltPhysics/Jolt/Math/Float4.h +0 -44
- package/native/third_party/JoltPhysics/Jolt/Math/GaussianElimination.h +0 -102
- package/native/third_party/JoltPhysics/Jolt/Math/HalfFloat.h +0 -208
- package/native/third_party/JoltPhysics/Jolt/Math/Mat44.h +0 -243
- package/native/third_party/JoltPhysics/Jolt/Math/Mat44.inl +0 -952
- package/native/third_party/JoltPhysics/Jolt/Math/Math.h +0 -208
- package/native/third_party/JoltPhysics/Jolt/Math/MathTypes.h +0 -32
- package/native/third_party/JoltPhysics/Jolt/Math/Matrix.h +0 -259
- package/native/third_party/JoltPhysics/Jolt/Math/Quat.h +0 -268
- package/native/third_party/JoltPhysics/Jolt/Math/Quat.inl +0 -406
- package/native/third_party/JoltPhysics/Jolt/Math/Real.h +0 -44
- package/native/third_party/JoltPhysics/Jolt/Math/Swizzle.h +0 -19
- package/native/third_party/JoltPhysics/Jolt/Math/Trigonometry.h +0 -79
- package/native/third_party/JoltPhysics/Jolt/Math/UVec4.h +0 -232
- package/native/third_party/JoltPhysics/Jolt/Math/UVec4.inl +0 -636
- package/native/third_party/JoltPhysics/Jolt/Math/Vec3.cpp +0 -71
- package/native/third_party/JoltPhysics/Jolt/Math/Vec3.h +0 -308
- package/native/third_party/JoltPhysics/Jolt/Math/Vec3.inl +0 -942
- package/native/third_party/JoltPhysics/Jolt/Math/Vec4.h +0 -320
- package/native/third_party/JoltPhysics/Jolt/Math/Vec4.inl +0 -1152
- package/native/third_party/JoltPhysics/Jolt/Math/Vector.h +0 -211
- package/native/third_party/JoltPhysics/Jolt/ObjectStream/GetPrimitiveTypeOfType.h +0 -54
- package/native/third_party/JoltPhysics/Jolt/ObjectStream/ObjectStream.cpp +0 -38
- package/native/third_party/JoltPhysics/Jolt/ObjectStream/ObjectStream.h +0 -337
- package/native/third_party/JoltPhysics/Jolt/ObjectStream/ObjectStreamBinaryIn.cpp +0 -252
- package/native/third_party/JoltPhysics/Jolt/ObjectStream/ObjectStreamBinaryIn.h +0 -57
- package/native/third_party/JoltPhysics/Jolt/ObjectStream/ObjectStreamBinaryOut.cpp +0 -165
- package/native/third_party/JoltPhysics/Jolt/ObjectStream/ObjectStreamBinaryOut.h +0 -57
- package/native/third_party/JoltPhysics/Jolt/ObjectStream/ObjectStreamIn.cpp +0 -635
- package/native/third_party/JoltPhysics/Jolt/ObjectStream/ObjectStreamIn.h +0 -148
- package/native/third_party/JoltPhysics/Jolt/ObjectStream/ObjectStreamOut.cpp +0 -166
- package/native/third_party/JoltPhysics/Jolt/ObjectStream/ObjectStreamOut.h +0 -101
- package/native/third_party/JoltPhysics/Jolt/ObjectStream/ObjectStreamTextIn.cpp +0 -418
- package/native/third_party/JoltPhysics/Jolt/ObjectStream/ObjectStreamTextIn.h +0 -55
- package/native/third_party/JoltPhysics/Jolt/ObjectStream/ObjectStreamTextOut.cpp +0 -255
- package/native/third_party/JoltPhysics/Jolt/ObjectStream/ObjectStreamTextOut.h +0 -62
- package/native/third_party/JoltPhysics/Jolt/ObjectStream/ObjectStreamTypes.h +0 -26
- package/native/third_party/JoltPhysics/Jolt/ObjectStream/SerializableAttribute.h +0 -111
- package/native/third_party/JoltPhysics/Jolt/ObjectStream/SerializableAttributeEnum.h +0 -67
- package/native/third_party/JoltPhysics/Jolt/ObjectStream/SerializableAttributeTyped.h +0 -60
- package/native/third_party/JoltPhysics/Jolt/ObjectStream/SerializableObject.cpp +0 -15
- package/native/third_party/JoltPhysics/Jolt/ObjectStream/SerializableObject.h +0 -170
- package/native/third_party/JoltPhysics/Jolt/ObjectStream/TypeDeclarations.cpp +0 -70
- package/native/third_party/JoltPhysics/Jolt/ObjectStream/TypeDeclarations.h +0 -45
- package/native/third_party/JoltPhysics/Jolt/Physics/Body/AllowedDOFs.h +0 -68
- package/native/third_party/JoltPhysics/Jolt/Physics/Body/Body.cpp +0 -426
- package/native/third_party/JoltPhysics/Jolt/Physics/Body/Body.h +0 -452
- package/native/third_party/JoltPhysics/Jolt/Physics/Body/Body.inl +0 -197
- package/native/third_party/JoltPhysics/Jolt/Physics/Body/BodyAccess.h +0 -68
- package/native/third_party/JoltPhysics/Jolt/Physics/Body/BodyActivationListener.h +0 -28
- package/native/third_party/JoltPhysics/Jolt/Physics/Body/BodyCreationSettings.cpp +0 -234
- package/native/third_party/JoltPhysics/Jolt/Physics/Body/BodyCreationSettings.h +0 -124
- package/native/third_party/JoltPhysics/Jolt/Physics/Body/BodyFilter.h +0 -130
- package/native/third_party/JoltPhysics/Jolt/Physics/Body/BodyID.h +0 -101
- package/native/third_party/JoltPhysics/Jolt/Physics/Body/BodyInterface.cpp +0 -1099
- package/native/third_party/JoltPhysics/Jolt/Physics/Body/BodyInterface.h +0 -324
- package/native/third_party/JoltPhysics/Jolt/Physics/Body/BodyLock.h +0 -111
- package/native/third_party/JoltPhysics/Jolt/Physics/Body/BodyLockInterface.h +0 -134
- package/native/third_party/JoltPhysics/Jolt/Physics/Body/BodyLockMulti.h +0 -120
- package/native/third_party/JoltPhysics/Jolt/Physics/Body/BodyManager.cpp +0 -1220
- package/native/third_party/JoltPhysics/Jolt/Physics/Body/BodyManager.h +0 -403
- package/native/third_party/JoltPhysics/Jolt/Physics/Body/BodyPair.h +0 -36
- package/native/third_party/JoltPhysics/Jolt/Physics/Body/BodyType.h +0 -19
- package/native/third_party/JoltPhysics/Jolt/Physics/Body/MassProperties.cpp +0 -185
- package/native/third_party/JoltPhysics/Jolt/Physics/Body/MassProperties.h +0 -58
- package/native/third_party/JoltPhysics/Jolt/Physics/Body/MotionProperties.cpp +0 -92
- package/native/third_party/JoltPhysics/Jolt/Physics/Body/MotionProperties.h +0 -308
- package/native/third_party/JoltPhysics/Jolt/Physics/Body/MotionProperties.inl +0 -178
- package/native/third_party/JoltPhysics/Jolt/Physics/Body/MotionQuality.h +0 -31
- package/native/third_party/JoltPhysics/Jolt/Physics/Body/MotionType.h +0 -17
- package/native/third_party/JoltPhysics/Jolt/Physics/Character/Character.cpp +0 -354
- package/native/third_party/JoltPhysics/Jolt/Physics/Character/Character.h +0 -159
- package/native/third_party/JoltPhysics/Jolt/Physics/Character/CharacterBase.cpp +0 -59
- package/native/third_party/JoltPhysics/Jolt/Physics/Character/CharacterBase.h +0 -157
- package/native/third_party/JoltPhysics/Jolt/Physics/Character/CharacterID.h +0 -98
- package/native/third_party/JoltPhysics/Jolt/Physics/Character/CharacterVirtual.cpp +0 -1933
- package/native/third_party/JoltPhysics/Jolt/Physics/Character/CharacterVirtual.h +0 -752
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/AABoxCast.h +0 -20
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/ActiveEdgeMode.h +0 -17
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/ActiveEdges.h +0 -114
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/BackFaceMode.h +0 -16
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/BroadPhase/BroadPhase.cpp +0 -16
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/BroadPhase/BroadPhase.h +0 -109
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/BroadPhase/BroadPhaseBruteForce.cpp +0 -313
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/BroadPhase/BroadPhaseBruteForce.h +0 -38
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/BroadPhase/BroadPhaseLayer.h +0 -148
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/BroadPhase/BroadPhaseLayerInterfaceMask.h +0 -92
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/BroadPhase/BroadPhaseLayerInterfaceTable.h +0 -64
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/BroadPhase/BroadPhaseQuadTree.cpp +0 -629
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/BroadPhase/BroadPhaseQuadTree.h +0 -108
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/BroadPhase/BroadPhaseQuery.h +0 -56
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/BroadPhase/ObjectVsBroadPhaseLayerFilterMask.h +0 -35
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/BroadPhase/ObjectVsBroadPhaseLayerFilterTable.h +0 -66
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/BroadPhase/QuadTree.cpp +0 -1768
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/BroadPhase/QuadTree.h +0 -389
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/CastConvexVsTriangles.cpp +0 -107
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/CastConvexVsTriangles.h +0 -46
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/CastResult.h +0 -37
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/CastSphereVsTriangles.cpp +0 -223
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/CastSphereVsTriangles.h +0 -49
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/CollectFacesMode.h +0 -16
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/CollideConvexVsTriangles.cpp +0 -155
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/CollideConvexVsTriangles.h +0 -56
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/CollidePointResult.h +0 -25
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/CollideShape.h +0 -106
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/CollideShapeVsShapePerLeaf.h +0 -94
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/CollideSoftBodyVertexIterator.h +0 -110
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/CollideSoftBodyVerticesVsTriangles.h +0 -102
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/CollideSphereVsTriangles.cpp +0 -121
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/CollideSphereVsTriangles.h +0 -50
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/CollisionCollector.h +0 -109
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/CollisionCollectorImpl.h +0 -219
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/CollisionDispatch.cpp +0 -107
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/CollisionDispatch.h +0 -97
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/CollisionGroup.cpp +0 -35
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/CollisionGroup.h +0 -97
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/ContactListener.h +0 -143
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/EstimateCollisionResponse.cpp +0 -213
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/EstimateCollisionResponse.h +0 -48
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/GroupFilter.cpp +0 -32
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/GroupFilter.h +0 -46
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/GroupFilterTable.cpp +0 -38
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/GroupFilterTable.h +0 -130
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/InternalEdgeRemovingCollector.h +0 -279
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/ManifoldBetweenTwoFaces.cpp +0 -271
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/ManifoldBetweenTwoFaces.h +0 -44
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/NarrowPhaseQuery.cpp +0 -448
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/NarrowPhaseQuery.h +0 -77
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/NarrowPhaseStats.cpp +0 -62
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/NarrowPhaseStats.h +0 -110
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/ObjectLayer.h +0 -111
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/ObjectLayerPairFilterMask.h +0 -52
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/ObjectLayerPairFilterTable.h +0 -78
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/PhysicsMaterial.cpp +0 -35
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/PhysicsMaterial.h +0 -57
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/PhysicsMaterialSimple.cpp +0 -38
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/PhysicsMaterialSimple.h +0 -37
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/RayCast.h +0 -87
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/Shape/BoxShape.cpp +0 -318
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/Shape/BoxShape.h +0 -115
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/Shape/CapsuleShape.cpp +0 -438
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/Shape/CapsuleShape.h +0 -129
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/Shape/CompoundShape.cpp +0 -433
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/Shape/CompoundShape.h +0 -354
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/Shape/CompoundShapeVisitors.h +0 -461
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/Shape/ConvexHullShape.cpp +0 -1311
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/Shape/ConvexHullShape.h +0 -202
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/Shape/ConvexShape.cpp +0 -566
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/Shape/ConvexShape.h +0 -150
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/Shape/CylinderShape.cpp +0 -418
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/Shape/CylinderShape.h +0 -126
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/Shape/DecoratedShape.cpp +0 -87
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/Shape/DecoratedShape.h +0 -80
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/Shape/EmptyShape.cpp +0 -64
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/Shape/EmptyShape.h +0 -75
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/Shape/GetTrianglesContext.h +0 -248
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/Shape/HeightFieldShape.cpp +0 -2754
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/Shape/HeightFieldShape.h +0 -380
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/Shape/MeshShape.cpp +0 -1305
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/Shape/MeshShape.h +0 -228
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/Shape/MutableCompoundShape.cpp +0 -596
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/Shape/MutableCompoundShape.h +0 -176
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/Shape/OffsetCenterOfMassShape.cpp +0 -217
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/Shape/OffsetCenterOfMassShape.h +0 -140
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/Shape/PlaneShape.cpp +0 -541
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/Shape/PlaneShape.h +0 -147
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/Shape/PolyhedronSubmergedVolumeCalculator.h +0 -319
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/Shape/RotatedTranslatedShape.cpp +0 -333
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/Shape/RotatedTranslatedShape.h +0 -161
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/Shape/ScaleHelpers.h +0 -83
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/Shape/ScaledShape.cpp +0 -238
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/Shape/ScaledShape.h +0 -145
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/Shape/Shape.cpp +0 -325
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/Shape/Shape.h +0 -466
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/Shape/SphereShape.cpp +0 -347
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/Shape/SphereShape.h +0 -125
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/Shape/StaticCompoundShape.cpp +0 -674
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/Shape/StaticCompoundShape.h +0 -139
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/Shape/SubShapeID.h +0 -138
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/Shape/SubShapeIDPair.h +0 -65
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/Shape/TaperedCapsuleShape.cpp +0 -453
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/Shape/TaperedCapsuleShape.gliffy +0 -1
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/Shape/TaperedCapsuleShape.h +0 -135
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/Shape/TaperedCylinderShape.cpp +0 -691
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/Shape/TaperedCylinderShape.h +0 -132
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/Shape/TriangleShape.cpp +0 -430
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/Shape/TriangleShape.h +0 -143
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/ShapeCast.h +0 -173
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/ShapeFilter.h +0 -73
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/SimShapeFilter.h +0 -40
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/SimShapeFilterWrapper.h +0 -58
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/SortReverseAndStore.h +0 -48
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/TransformedShape.cpp +0 -180
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/TransformedShape.h +0 -194
- package/native/third_party/JoltPhysics/Jolt/Physics/Constraints/CalculateSolverSteps.h +0 -70
- package/native/third_party/JoltPhysics/Jolt/Physics/Constraints/ConeConstraint.cpp +0 -246
- package/native/third_party/JoltPhysics/Jolt/Physics/Constraints/ConeConstraint.h +0 -133
- package/native/third_party/JoltPhysics/Jolt/Physics/Constraints/Constraint.cpp +0 -73
- package/native/third_party/JoltPhysics/Jolt/Physics/Constraints/Constraint.h +0 -243
- package/native/third_party/JoltPhysics/Jolt/Physics/Constraints/ConstraintManager.cpp +0 -289
- package/native/third_party/JoltPhysics/Jolt/Physics/Constraints/ConstraintManager.h +0 -100
- package/native/third_party/JoltPhysics/Jolt/Physics/Constraints/ConstraintPart/AngleConstraintPart.h +0 -257
- package/native/third_party/JoltPhysics/Jolt/Physics/Constraints/ConstraintPart/AxisConstraintPart.h +0 -682
- package/native/third_party/JoltPhysics/Jolt/Physics/Constraints/ConstraintPart/DualAxisConstraintPart.h +0 -276
- package/native/third_party/JoltPhysics/Jolt/Physics/Constraints/ConstraintPart/GearConstraintPart.h +0 -195
- package/native/third_party/JoltPhysics/Jolt/Physics/Constraints/ConstraintPart/HingeRotationConstraintPart.h +0 -222
- package/native/third_party/JoltPhysics/Jolt/Physics/Constraints/ConstraintPart/IndependentAxisConstraintPart.h +0 -246
- package/native/third_party/JoltPhysics/Jolt/Physics/Constraints/ConstraintPart/PointConstraintPart.h +0 -239
- package/native/third_party/JoltPhysics/Jolt/Physics/Constraints/ConstraintPart/RackAndPinionConstraintPart.h +0 -196
- package/native/third_party/JoltPhysics/Jolt/Physics/Constraints/ConstraintPart/RotationEulerConstraintPart.h +0 -283
- package/native/third_party/JoltPhysics/Jolt/Physics/Constraints/ConstraintPart/RotationQuatConstraintPart.h +0 -246
- package/native/third_party/JoltPhysics/Jolt/Physics/Constraints/ConstraintPart/SpringPart.h +0 -169
- package/native/third_party/JoltPhysics/Jolt/Physics/Constraints/ConstraintPart/SwingTwistConstraintPart.h +0 -597
- package/native/third_party/JoltPhysics/Jolt/Physics/Constraints/ContactConstraintManager.cpp +0 -1804
- package/native/third_party/JoltPhysics/Jolt/Physics/Constraints/ContactConstraintManager.h +0 -524
- package/native/third_party/JoltPhysics/Jolt/Physics/Constraints/DistanceConstraint.cpp +0 -266
- package/native/third_party/JoltPhysics/Jolt/Physics/Constraints/DistanceConstraint.h +0 -120
- package/native/third_party/JoltPhysics/Jolt/Physics/Constraints/FixedConstraint.cpp +0 -215
- package/native/third_party/JoltPhysics/Jolt/Physics/Constraints/FixedConstraint.h +0 -96
- package/native/third_party/JoltPhysics/Jolt/Physics/Constraints/GearConstraint.cpp +0 -188
- package/native/third_party/JoltPhysics/Jolt/Physics/Constraints/GearConstraint.h +0 -116
- package/native/third_party/JoltPhysics/Jolt/Physics/Constraints/HingeConstraint.cpp +0 -443
- package/native/third_party/JoltPhysics/Jolt/Physics/Constraints/HingeConstraint.h +0 -205
- package/native/third_party/JoltPhysics/Jolt/Physics/Constraints/MotorSettings.cpp +0 -43
- package/native/third_party/JoltPhysics/Jolt/Physics/Constraints/MotorSettings.h +0 -66
- package/native/third_party/JoltPhysics/Jolt/Physics/Constraints/PathConstraint.cpp +0 -458
- package/native/third_party/JoltPhysics/Jolt/Physics/Constraints/PathConstraint.h +0 -191
- package/native/third_party/JoltPhysics/Jolt/Physics/Constraints/PathConstraintPath.cpp +0 -85
- package/native/third_party/JoltPhysics/Jolt/Physics/Constraints/PathConstraintPath.h +0 -76
- package/native/third_party/JoltPhysics/Jolt/Physics/Constraints/PathConstraintPathHermite.cpp +0 -308
- package/native/third_party/JoltPhysics/Jolt/Physics/Constraints/PathConstraintPathHermite.h +0 -54
- package/native/third_party/JoltPhysics/Jolt/Physics/Constraints/PointConstraint.cpp +0 -157
- package/native/third_party/JoltPhysics/Jolt/Physics/Constraints/PointConstraint.h +0 -94
- package/native/third_party/JoltPhysics/Jolt/Physics/Constraints/PulleyConstraint.cpp +0 -253
- package/native/third_party/JoltPhysics/Jolt/Physics/Constraints/PulleyConstraint.h +0 -137
- package/native/third_party/JoltPhysics/Jolt/Physics/Constraints/RackAndPinionConstraint.cpp +0 -189
- package/native/third_party/JoltPhysics/Jolt/Physics/Constraints/RackAndPinionConstraint.h +0 -118
- package/native/third_party/JoltPhysics/Jolt/Physics/Constraints/SixDOFConstraint.cpp +0 -900
- package/native/third_party/JoltPhysics/Jolt/Physics/Constraints/SixDOFConstraint.h +0 -289
- package/native/third_party/JoltPhysics/Jolt/Physics/Constraints/SliderConstraint.cpp +0 -501
- package/native/third_party/JoltPhysics/Jolt/Physics/Constraints/SliderConstraint.h +0 -198
- package/native/third_party/JoltPhysics/Jolt/Physics/Constraints/SpringSettings.cpp +0 -35
- package/native/third_party/JoltPhysics/Jolt/Physics/Constraints/SpringSettings.h +0 -70
- package/native/third_party/JoltPhysics/Jolt/Physics/Constraints/SwingTwistConstraint.cpp +0 -524
- package/native/third_party/JoltPhysics/Jolt/Physics/Constraints/SwingTwistConstraint.h +0 -197
- package/native/third_party/JoltPhysics/Jolt/Physics/Constraints/TwoBodyConstraint.cpp +0 -56
- package/native/third_party/JoltPhysics/Jolt/Physics/Constraints/TwoBodyConstraint.h +0 -65
- package/native/third_party/JoltPhysics/Jolt/Physics/DeterminismLog.cpp +0 -17
- package/native/third_party/JoltPhysics/Jolt/Physics/DeterminismLog.h +0 -159
- package/native/third_party/JoltPhysics/Jolt/Physics/EActivation.h +0 -16
- package/native/third_party/JoltPhysics/Jolt/Physics/EPhysicsUpdateError.h +0 -37
- package/native/third_party/JoltPhysics/Jolt/Physics/IslandBuilder.cpp +0 -492
- package/native/third_party/JoltPhysics/Jolt/Physics/IslandBuilder.h +0 -144
- package/native/third_party/JoltPhysics/Jolt/Physics/LargeIslandSplitter.cpp +0 -582
- package/native/third_party/JoltPhysics/Jolt/Physics/LargeIslandSplitter.h +0 -187
- package/native/third_party/JoltPhysics/Jolt/Physics/PhysicsLock.h +0 -169
- package/native/third_party/JoltPhysics/Jolt/Physics/PhysicsScene.cpp +0 -261
- package/native/third_party/JoltPhysics/Jolt/Physics/PhysicsScene.h +0 -104
- package/native/third_party/JoltPhysics/Jolt/Physics/PhysicsSettings.h +0 -125
- package/native/third_party/JoltPhysics/Jolt/Physics/PhysicsStepListener.h +0 -37
- package/native/third_party/JoltPhysics/Jolt/Physics/PhysicsSystem.cpp +0 -2915
- package/native/third_party/JoltPhysics/Jolt/Physics/PhysicsSystem.h +0 -391
- package/native/third_party/JoltPhysics/Jolt/Physics/PhysicsUpdateContext.cpp +0 -25
- package/native/third_party/JoltPhysics/Jolt/Physics/PhysicsUpdateContext.h +0 -176
- package/native/third_party/JoltPhysics/Jolt/Physics/Ragdoll/Ragdoll.cpp +0 -744
- package/native/third_party/JoltPhysics/Jolt/Physics/Ragdoll/Ragdoll.h +0 -245
- package/native/third_party/JoltPhysics/Jolt/Physics/SoftBody/SoftBodyContactListener.h +0 -55
- package/native/third_party/JoltPhysics/Jolt/Physics/SoftBody/SoftBodyCreationSettings.cpp +0 -128
- package/native/third_party/JoltPhysics/Jolt/Physics/SoftBody/SoftBodyCreationSettings.h +0 -75
- package/native/third_party/JoltPhysics/Jolt/Physics/SoftBody/SoftBodyManifold.h +0 -74
- package/native/third_party/JoltPhysics/Jolt/Physics/SoftBody/SoftBodyMotionProperties.cpp +0 -1501
- package/native/third_party/JoltPhysics/Jolt/Physics/SoftBody/SoftBodyMotionProperties.h +0 -333
- package/native/third_party/JoltPhysics/Jolt/Physics/SoftBody/SoftBodyShape.cpp +0 -354
- package/native/third_party/JoltPhysics/Jolt/Physics/SoftBody/SoftBodyShape.h +0 -73
- package/native/third_party/JoltPhysics/Jolt/Physics/SoftBody/SoftBodySharedSettings.cpp +0 -1487
- package/native/third_party/JoltPhysics/Jolt/Physics/SoftBody/SoftBodySharedSettings.h +0 -390
- package/native/third_party/JoltPhysics/Jolt/Physics/SoftBody/SoftBodyUpdateContext.h +0 -63
- package/native/third_party/JoltPhysics/Jolt/Physics/SoftBody/SoftBodyVertex.h +0 -36
- package/native/third_party/JoltPhysics/Jolt/Physics/StateRecorder.h +0 -136
- package/native/third_party/JoltPhysics/Jolt/Physics/StateRecorderImpl.cpp +0 -90
- package/native/third_party/JoltPhysics/Jolt/Physics/StateRecorderImpl.h +0 -50
- package/native/third_party/JoltPhysics/Jolt/Physics/Vehicle/MotorcycleController.cpp +0 -306
- package/native/third_party/JoltPhysics/Jolt/Physics/Vehicle/MotorcycleController.h +0 -119
- package/native/third_party/JoltPhysics/Jolt/Physics/Vehicle/TrackedVehicleController.cpp +0 -547
- package/native/third_party/JoltPhysics/Jolt/Physics/Vehicle/TrackedVehicleController.h +0 -169
- package/native/third_party/JoltPhysics/Jolt/Physics/Vehicle/VehicleAntiRollBar.cpp +0 -33
- package/native/third_party/JoltPhysics/Jolt/Physics/Vehicle/VehicleAntiRollBar.h +0 -33
- package/native/third_party/JoltPhysics/Jolt/Physics/Vehicle/VehicleCollisionTester.cpp +0 -376
- package/native/third_party/JoltPhysics/Jolt/Physics/Vehicle/VehicleCollisionTester.h +0 -146
- package/native/third_party/JoltPhysics/Jolt/Physics/Vehicle/VehicleConstraint.cpp +0 -703
- package/native/third_party/JoltPhysics/Jolt/Physics/Vehicle/VehicleConstraint.h +0 -252
- package/native/third_party/JoltPhysics/Jolt/Physics/Vehicle/VehicleController.cpp +0 -17
- package/native/third_party/JoltPhysics/Jolt/Physics/Vehicle/VehicleController.h +0 -87
- package/native/third_party/JoltPhysics/Jolt/Physics/Vehicle/VehicleDifferential.cpp +0 -81
- package/native/third_party/JoltPhysics/Jolt/Physics/Vehicle/VehicleDifferential.h +0 -39
- package/native/third_party/JoltPhysics/Jolt/Physics/Vehicle/VehicleEngine.cpp +0 -122
- package/native/third_party/JoltPhysics/Jolt/Physics/Vehicle/VehicleEngine.h +0 -93
- package/native/third_party/JoltPhysics/Jolt/Physics/Vehicle/VehicleTrack.cpp +0 -52
- package/native/third_party/JoltPhysics/Jolt/Physics/Vehicle/VehicleTrack.h +0 -56
- package/native/third_party/JoltPhysics/Jolt/Physics/Vehicle/VehicleTransmission.cpp +0 -159
- package/native/third_party/JoltPhysics/Jolt/Physics/Vehicle/VehicleTransmission.h +0 -87
- package/native/third_party/JoltPhysics/Jolt/Physics/Vehicle/Wheel.cpp +0 -93
- package/native/third_party/JoltPhysics/Jolt/Physics/Vehicle/Wheel.h +0 -148
- package/native/third_party/JoltPhysics/Jolt/Physics/Vehicle/WheeledVehicleController.cpp +0 -866
- package/native/third_party/JoltPhysics/Jolt/Physics/Vehicle/WheeledVehicleController.h +0 -205
- package/native/third_party/JoltPhysics/Jolt/RegisterTypes.cpp +0 -204
- package/native/third_party/JoltPhysics/Jolt/RegisterTypes.h +0 -29
- package/native/third_party/JoltPhysics/Jolt/Renderer/DebugRenderer.cpp +0 -1107
- package/native/third_party/JoltPhysics/Jolt/Renderer/DebugRenderer.h +0 -383
- package/native/third_party/JoltPhysics/Jolt/Renderer/DebugRendererPlayback.cpp +0 -168
- package/native/third_party/JoltPhysics/Jolt/Renderer/DebugRendererPlayback.h +0 -48
- package/native/third_party/JoltPhysics/Jolt/Renderer/DebugRendererRecorder.cpp +0 -158
- package/native/third_party/JoltPhysics/Jolt/Renderer/DebugRendererRecorder.h +0 -130
- package/native/third_party/JoltPhysics/Jolt/Renderer/DebugRendererSimple.cpp +0 -80
- package/native/third_party/JoltPhysics/Jolt/Renderer/DebugRendererSimple.h +0 -88
- package/native/third_party/JoltPhysics/Jolt/Skeleton/SkeletalAnimation.cpp +0 -165
- package/native/third_party/JoltPhysics/Jolt/Skeleton/SkeletalAnimation.h +0 -91
- package/native/third_party/JoltPhysics/Jolt/Skeleton/Skeleton.cpp +0 -82
- package/native/third_party/JoltPhysics/Jolt/Skeleton/Skeleton.h +0 -72
- package/native/third_party/JoltPhysics/Jolt/Skeleton/SkeletonMapper.cpp +0 -237
- package/native/third_party/JoltPhysics/Jolt/Skeleton/SkeletonMapper.h +0 -145
- package/native/third_party/JoltPhysics/Jolt/Skeleton/SkeletonPose.cpp +0 -87
- package/native/third_party/JoltPhysics/Jolt/Skeleton/SkeletonPose.h +0 -82
- package/native/third_party/JoltPhysics/Jolt/TriangleSplitter/TriangleSplitter.cpp +0 -73
- package/native/third_party/JoltPhysics/Jolt/TriangleSplitter/TriangleSplitter.h +0 -84
- package/native/third_party/JoltPhysics/Jolt/TriangleSplitter/TriangleSplitterBinning.cpp +0 -139
- package/native/third_party/JoltPhysics/Jolt/TriangleSplitter/TriangleSplitterBinning.h +0 -52
- package/native/third_party/JoltPhysics/Jolt/TriangleSplitter/TriangleSplitterMean.cpp +0 -43
- package/native/third_party/JoltPhysics/Jolt/TriangleSplitter/TriangleSplitterMean.h +0 -28
- package/native/third_party/JoltPhysics/LICENSE +0 -7
- package/native/third_party/JoltPhysics/README.md +0 -173
- package/native/third_party/bloom_jolt/CMakeLists.txt +0 -87
- package/native/third_party/bloom_jolt/include/bloom_jolt.h +0 -519
- package/native/third_party/bloom_jolt/src/bloom_jolt.cpp +0 -1780
|
@@ -1,952 +0,0 @@
|
|
|
1
|
-
// Jolt Physics Library (https://github.com/jrouwe/JoltPhysics)
|
|
2
|
-
// SPDX-FileCopyrightText: 2021 Jorrit Rouwe
|
|
3
|
-
// SPDX-License-Identifier: MIT
|
|
4
|
-
|
|
5
|
-
#pragma once
|
|
6
|
-
|
|
7
|
-
#include <Jolt/Math/Vec3.h>
|
|
8
|
-
#include <Jolt/Math/Vec4.h>
|
|
9
|
-
#include <Jolt/Math/Quat.h>
|
|
10
|
-
|
|
11
|
-
JPH_NAMESPACE_BEGIN
|
|
12
|
-
|
|
13
|
-
#define JPH_EL(r, c) mCol[c].mF32[r]
|
|
14
|
-
|
|
15
|
-
Mat44::Mat44(Vec4Arg inC1, Vec4Arg inC2, Vec4Arg inC3, Vec4Arg inC4) :
|
|
16
|
-
mCol { inC1, inC2, inC3, inC4 }
|
|
17
|
-
{
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
Mat44::Mat44(Vec4Arg inC1, Vec4Arg inC2, Vec4Arg inC3, Vec3Arg inC4) :
|
|
21
|
-
mCol { inC1, inC2, inC3, Vec4(inC4, 1.0f) }
|
|
22
|
-
{
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
Mat44::Mat44(Type inC1, Type inC2, Type inC3, Type inC4) :
|
|
26
|
-
mCol { inC1, inC2, inC3, inC4 }
|
|
27
|
-
{
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
Mat44 Mat44::sZero()
|
|
31
|
-
{
|
|
32
|
-
return Mat44(Vec4::sZero(), Vec4::sZero(), Vec4::sZero(), Vec4::sZero());
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
Mat44 Mat44::sIdentity()
|
|
36
|
-
{
|
|
37
|
-
return Mat44(Vec4(1, 0, 0, 0), Vec4(0, 1, 0, 0), Vec4(0, 0, 1, 0), Vec4(0, 0, 0, 1));
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
Mat44 Mat44::sNaN()
|
|
41
|
-
{
|
|
42
|
-
return Mat44(Vec4::sNaN(), Vec4::sNaN(), Vec4::sNaN(), Vec4::sNaN());
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
Mat44 Mat44::sLoadFloat4x4(const Float4 *inV)
|
|
46
|
-
{
|
|
47
|
-
Mat44 result;
|
|
48
|
-
for (int c = 0; c < 4; ++c)
|
|
49
|
-
result.mCol[c] = Vec4::sLoadFloat4(inV + c);
|
|
50
|
-
return result;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
Mat44 Mat44::sLoadFloat4x4Aligned(const Float4 *inV)
|
|
54
|
-
{
|
|
55
|
-
Mat44 result;
|
|
56
|
-
for (int c = 0; c < 4; ++c)
|
|
57
|
-
result.mCol[c] = Vec4::sLoadFloat4Aligned(inV + c);
|
|
58
|
-
return result;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
Mat44 Mat44::sRotationX(float inX)
|
|
62
|
-
{
|
|
63
|
-
Vec4 sv, cv;
|
|
64
|
-
Vec4::sReplicate(inX).SinCos(sv, cv);
|
|
65
|
-
float s = sv.GetX(), c = cv.GetX();
|
|
66
|
-
return Mat44(Vec4(1, 0, 0, 0), Vec4(0, c, s, 0), Vec4(0, -s, c, 0), Vec4(0, 0, 0, 1));
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
Mat44 Mat44::sRotationY(float inY)
|
|
70
|
-
{
|
|
71
|
-
Vec4 sv, cv;
|
|
72
|
-
Vec4::sReplicate(inY).SinCos(sv, cv);
|
|
73
|
-
float s = sv.GetX(), c = cv.GetX();
|
|
74
|
-
return Mat44(Vec4(c, 0, -s, 0), Vec4(0, 1, 0, 0), Vec4(s, 0, c, 0), Vec4(0, 0, 0, 1));
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
Mat44 Mat44::sRotationZ(float inZ)
|
|
78
|
-
{
|
|
79
|
-
Vec4 sv, cv;
|
|
80
|
-
Vec4::sReplicate(inZ).SinCos(sv, cv);
|
|
81
|
-
float s = sv.GetX(), c = cv.GetX();
|
|
82
|
-
return Mat44(Vec4(c, s, 0, 0), Vec4(-s, c, 0, 0), Vec4(0, 0, 1, 0), Vec4(0, 0, 0, 1));
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
Mat44 Mat44::sRotation(QuatArg inQuat)
|
|
86
|
-
{
|
|
87
|
-
JPH_ASSERT(inQuat.IsNormalized());
|
|
88
|
-
|
|
89
|
-
// See: https://en.wikipedia.org/wiki/Quaternions_and_spatial_rotation section 'Quaternion-derived rotation matrix'
|
|
90
|
-
#ifdef JPH_USE_SSE4_1
|
|
91
|
-
__m128 xyzw = inQuat.mValue.mValue;
|
|
92
|
-
__m128 two_xyzw = _mm_add_ps(xyzw, xyzw);
|
|
93
|
-
__m128 yzxw = _mm_shuffle_ps(xyzw, xyzw, _MM_SHUFFLE(3, 0, 2, 1));
|
|
94
|
-
__m128 two_yzxw = _mm_add_ps(yzxw, yzxw);
|
|
95
|
-
__m128 zxyw = _mm_shuffle_ps(xyzw, xyzw, _MM_SHUFFLE(3, 1, 0, 2));
|
|
96
|
-
__m128 two_zxyw = _mm_add_ps(zxyw, zxyw);
|
|
97
|
-
__m128 wwww = _mm_shuffle_ps(xyzw, xyzw, _MM_SHUFFLE(3, 3, 3, 3));
|
|
98
|
-
__m128 diagonal = _mm_sub_ps(_mm_sub_ps(_mm_set1_ps(1.0f), _mm_mul_ps(two_yzxw, yzxw)), _mm_mul_ps(two_zxyw, zxyw)); // (1 - 2 y^2 - 2 z^2, 1 - 2 x^2 - 2 z^2, 1 - 2 x^2 - 2 y^2, 1 - 4 w^2)
|
|
99
|
-
__m128 plus = _mm_add_ps(_mm_mul_ps(two_xyzw, zxyw), _mm_mul_ps(two_yzxw, wwww)); // 2 * (xz + yw, xy + zw, yz + xw, ww)
|
|
100
|
-
__m128 minus = _mm_sub_ps(_mm_mul_ps(two_yzxw, xyzw), _mm_mul_ps(two_zxyw, wwww)); // 2 * (xy - zw, yz - xw, xz - yw, 0)
|
|
101
|
-
|
|
102
|
-
// Workaround for compiler changing _mm_sub_ps(_mm_mul_ps(...), ...) into a fused multiply sub instruction, resulting in w not being 0
|
|
103
|
-
// There doesn't appear to be a reliable way to turn this off in Clang
|
|
104
|
-
minus = _mm_insert_ps(minus, minus, 0b1000);
|
|
105
|
-
|
|
106
|
-
__m128 col0 = _mm_blend_ps(_mm_blend_ps(plus, diagonal, 0b0001), minus, 0b1100); // (1 - 2 y^2 - 2 z^2, 2 xy + 2 zw, 2 xz - 2 yw, 0)
|
|
107
|
-
__m128 col1 = _mm_blend_ps(_mm_blend_ps(diagonal, minus, 0b1001), plus, 0b0100); // (2 xy - 2 zw, 1 - 2 x^2 - 2 z^2, 2 yz + 2 xw, 0)
|
|
108
|
-
__m128 col2 = _mm_blend_ps(_mm_blend_ps(minus, plus, 0b0001), diagonal, 0b0100); // (2 xz + 2 yw, 2 yz - 2 xw, 1 - 2 x^2 - 2 y^2, 0)
|
|
109
|
-
__m128 col3 = _mm_set_ps(1, 0, 0, 0);
|
|
110
|
-
|
|
111
|
-
return Mat44(col0, col1, col2, col3);
|
|
112
|
-
#else
|
|
113
|
-
float x = inQuat.GetX();
|
|
114
|
-
float y = inQuat.GetY();
|
|
115
|
-
float z = inQuat.GetZ();
|
|
116
|
-
float w = inQuat.GetW();
|
|
117
|
-
|
|
118
|
-
float tx = x + x; // Note: Using x + x instead of 2.0f * x to force this function to return the same value as the SSE4.1 version across platforms.
|
|
119
|
-
float ty = y + y;
|
|
120
|
-
float tz = z + z;
|
|
121
|
-
|
|
122
|
-
float xx = tx * x;
|
|
123
|
-
float yy = ty * y;
|
|
124
|
-
float zz = tz * z;
|
|
125
|
-
float xy = tx * y;
|
|
126
|
-
float xz = tx * z;
|
|
127
|
-
float xw = tx * w;
|
|
128
|
-
float yz = ty * z;
|
|
129
|
-
float yw = ty * w;
|
|
130
|
-
float zw = tz * w;
|
|
131
|
-
|
|
132
|
-
return Mat44(Vec4((1.0f - yy) - zz, xy + zw, xz - yw, 0.0f), // Note: Added extra brackets to force this function to return the same value as the SSE4.1 version across platforms.
|
|
133
|
-
Vec4(xy - zw, (1.0f - zz) - xx, yz + xw, 0.0f),
|
|
134
|
-
Vec4(xz + yw, yz - xw, (1.0f - xx) - yy, 0.0f),
|
|
135
|
-
Vec4(0.0f, 0.0f, 0.0f, 1.0f));
|
|
136
|
-
#endif
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
Mat44 Mat44::sRotation(Vec3Arg inAxis, float inAngle)
|
|
140
|
-
{
|
|
141
|
-
return sRotation(Quat::sRotation(inAxis, inAngle));
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
Mat44 Mat44::sTranslation(Vec3Arg inV)
|
|
145
|
-
{
|
|
146
|
-
return Mat44(Vec4(1, 0, 0, 0), Vec4(0, 1, 0, 0), Vec4(0, 0, 1, 0), Vec4(inV, 1));
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
Mat44 Mat44::sRotationTranslation(QuatArg inR, Vec3Arg inT)
|
|
150
|
-
{
|
|
151
|
-
Mat44 m = sRotation(inR);
|
|
152
|
-
m.SetTranslation(inT);
|
|
153
|
-
return m;
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
Mat44 Mat44::sInverseRotationTranslation(QuatArg inR, Vec3Arg inT)
|
|
157
|
-
{
|
|
158
|
-
Mat44 m = sRotation(inR.Conjugated());
|
|
159
|
-
m.SetTranslation(-m.Multiply3x3(inT));
|
|
160
|
-
return m;
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
Mat44 Mat44::sScale(float inScale)
|
|
164
|
-
{
|
|
165
|
-
return Mat44(Vec4(inScale, 0, 0, 0), Vec4(0, inScale, 0, 0), Vec4(0, 0, inScale, 0), Vec4(0, 0, 0, 1));
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
Mat44 Mat44::sScale(Vec3Arg inV)
|
|
169
|
-
{
|
|
170
|
-
return Mat44(Vec4(inV.GetX(), 0, 0, 0), Vec4(0, inV.GetY(), 0, 0), Vec4(0, 0, inV.GetZ(), 0), Vec4(0, 0, 0, 1));
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
Mat44 Mat44::sOuterProduct(Vec3Arg inV1, Vec3Arg inV2)
|
|
174
|
-
{
|
|
175
|
-
Vec4 v1(inV1, 0);
|
|
176
|
-
return Mat44(v1 * inV2.SplatX(), v1 * inV2.SplatY(), v1 * inV2.SplatZ(), Vec4(0, 0, 0, 1));
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
Mat44 Mat44::sCrossProduct(Vec3Arg inV)
|
|
180
|
-
{
|
|
181
|
-
#ifdef JPH_USE_SSE4_1
|
|
182
|
-
// Zero out the W component
|
|
183
|
-
__m128 zero = _mm_setzero_ps();
|
|
184
|
-
__m128 v = _mm_blend_ps(inV.mValue, zero, 0b1000);
|
|
185
|
-
|
|
186
|
-
// Negate
|
|
187
|
-
__m128 min_v = _mm_sub_ps(zero, v);
|
|
188
|
-
|
|
189
|
-
return Mat44(
|
|
190
|
-
_mm_shuffle_ps(v, min_v, _MM_SHUFFLE(3, 1, 2, 3)), // [0, z, -y, 0]
|
|
191
|
-
_mm_shuffle_ps(min_v, v, _MM_SHUFFLE(3, 0, 3, 2)), // [-z, 0, x, 0]
|
|
192
|
-
_mm_blend_ps(_mm_shuffle_ps(v, v, _MM_SHUFFLE(3, 3, 3, 1)), _mm_shuffle_ps(min_v, min_v, _MM_SHUFFLE(3, 3, 0, 3)), 0b0010), // [y, -x, 0, 0]
|
|
193
|
-
Vec4(0, 0, 0, 1));
|
|
194
|
-
#else
|
|
195
|
-
float x = inV.GetX();
|
|
196
|
-
float y = inV.GetY();
|
|
197
|
-
float z = inV.GetZ();
|
|
198
|
-
|
|
199
|
-
return Mat44(
|
|
200
|
-
Vec4(0, z, -y, 0),
|
|
201
|
-
Vec4(-z, 0, x, 0),
|
|
202
|
-
Vec4(y, -x, 0, 0),
|
|
203
|
-
Vec4(0, 0, 0, 1));
|
|
204
|
-
#endif
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
Mat44 Mat44::sLookAt(Vec3Arg inPos, Vec3Arg inTarget, Vec3Arg inUp)
|
|
208
|
-
{
|
|
209
|
-
Vec3 direction = (inTarget - inPos).NormalizedOr(-Vec3::sAxisZ());
|
|
210
|
-
Vec3 right = direction.Cross(inUp).NormalizedOr(Vec3::sAxisX());
|
|
211
|
-
Vec3 up = right.Cross(direction);
|
|
212
|
-
|
|
213
|
-
return Mat44(Vec4(right, 0), Vec4(up, 0), Vec4(-direction, 0), Vec4(inPos, 1)).InversedRotationTranslation();
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
Mat44 Mat44::sPerspective(float inFovY, float inAspect, float inNear, float inFar)
|
|
217
|
-
{
|
|
218
|
-
float height = 1.0f / Tan(0.5f * inFovY);
|
|
219
|
-
float width = height / inAspect;
|
|
220
|
-
float range = inFar / (inNear - inFar);
|
|
221
|
-
|
|
222
|
-
return Mat44(Vec4(width, 0.0f, 0.0f, 0.0f), Vec4(0.0f, height, 0.0f, 0.0f), Vec4(0.0f, 0.0f, range, -1.0f), Vec4(0.0f, 0.0f, range * inNear, 0.0f));
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
bool Mat44::operator == (Mat44Arg inM2) const
|
|
226
|
-
{
|
|
227
|
-
return UVec4::sAnd(
|
|
228
|
-
UVec4::sAnd(Vec4::sEquals(mCol[0], inM2.mCol[0]), Vec4::sEquals(mCol[1], inM2.mCol[1])),
|
|
229
|
-
UVec4::sAnd(Vec4::sEquals(mCol[2], inM2.mCol[2]), Vec4::sEquals(mCol[3], inM2.mCol[3]))
|
|
230
|
-
).TestAllTrue();
|
|
231
|
-
}
|
|
232
|
-
|
|
233
|
-
bool Mat44::IsClose(Mat44Arg inM2, float inMaxDistSq) const
|
|
234
|
-
{
|
|
235
|
-
for (int i = 0; i < 4; ++i)
|
|
236
|
-
if (!mCol[i].IsClose(inM2.mCol[i], inMaxDistSq))
|
|
237
|
-
return false;
|
|
238
|
-
return true;
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
Mat44 Mat44::operator * (Mat44Arg inM) const
|
|
242
|
-
{
|
|
243
|
-
Mat44 result;
|
|
244
|
-
#if defined(JPH_USE_SSE)
|
|
245
|
-
for (int i = 0; i < 4; ++i)
|
|
246
|
-
{
|
|
247
|
-
__m128 c = inM.mCol[i].mValue;
|
|
248
|
-
__m128 t = _mm_mul_ps(mCol[0].mValue, _mm_shuffle_ps(c, c, _MM_SHUFFLE(0, 0, 0, 0)));
|
|
249
|
-
t = _mm_add_ps(t, _mm_mul_ps(mCol[1].mValue, _mm_shuffle_ps(c, c, _MM_SHUFFLE(1, 1, 1, 1))));
|
|
250
|
-
t = _mm_add_ps(t, _mm_mul_ps(mCol[2].mValue, _mm_shuffle_ps(c, c, _MM_SHUFFLE(2, 2, 2, 2))));
|
|
251
|
-
t = _mm_add_ps(t, _mm_mul_ps(mCol[3].mValue, _mm_shuffle_ps(c, c, _MM_SHUFFLE(3, 3, 3, 3))));
|
|
252
|
-
result.mCol[i].mValue = t;
|
|
253
|
-
}
|
|
254
|
-
#elif defined(JPH_USE_NEON)
|
|
255
|
-
for (int i = 0; i < 4; ++i)
|
|
256
|
-
{
|
|
257
|
-
Type c = inM.mCol[i].mValue;
|
|
258
|
-
Type t = vmulq_f32(mCol[0].mValue, vdupq_laneq_f32(c, 0));
|
|
259
|
-
t = vmlaq_f32(t, mCol[1].mValue, vdupq_laneq_f32(c, 1));
|
|
260
|
-
t = vmlaq_f32(t, mCol[2].mValue, vdupq_laneq_f32(c, 2));
|
|
261
|
-
t = vmlaq_f32(t, mCol[3].mValue, vdupq_laneq_f32(c, 3));
|
|
262
|
-
result.mCol[i].mValue = t;
|
|
263
|
-
}
|
|
264
|
-
#else
|
|
265
|
-
for (int i = 0; i < 4; ++i)
|
|
266
|
-
result.mCol[i] = mCol[0] * inM.mCol[i].mF32[0] + mCol[1] * inM.mCol[i].mF32[1] + mCol[2] * inM.mCol[i].mF32[2] + mCol[3] * inM.mCol[i].mF32[3];
|
|
267
|
-
#endif
|
|
268
|
-
return result;
|
|
269
|
-
}
|
|
270
|
-
|
|
271
|
-
Vec3 Mat44::operator * (Vec3Arg inV) const
|
|
272
|
-
{
|
|
273
|
-
#if defined(JPH_USE_SSE)
|
|
274
|
-
__m128 t = _mm_mul_ps(mCol[0].mValue, _mm_shuffle_ps(inV.mValue, inV.mValue, _MM_SHUFFLE(0, 0, 0, 0)));
|
|
275
|
-
t = _mm_add_ps(t, _mm_mul_ps(mCol[1].mValue, _mm_shuffle_ps(inV.mValue, inV.mValue, _MM_SHUFFLE(1, 1, 1, 1))));
|
|
276
|
-
t = _mm_add_ps(t, _mm_mul_ps(mCol[2].mValue, _mm_shuffle_ps(inV.mValue, inV.mValue, _MM_SHUFFLE(2, 2, 2, 2))));
|
|
277
|
-
t = _mm_add_ps(t, mCol[3].mValue);
|
|
278
|
-
return Vec3::sFixW(t);
|
|
279
|
-
#elif defined(JPH_USE_NEON)
|
|
280
|
-
Type t = vmulq_f32(mCol[0].mValue, vdupq_laneq_f32(inV.mValue, 0));
|
|
281
|
-
t = vmlaq_f32(t, mCol[1].mValue, vdupq_laneq_f32(inV.mValue, 1));
|
|
282
|
-
t = vmlaq_f32(t, mCol[2].mValue, vdupq_laneq_f32(inV.mValue, 2));
|
|
283
|
-
t = vaddq_f32(t, mCol[3].mValue); // Don't combine this with the first mul into a fused multiply add, causes precision issues
|
|
284
|
-
return Vec3::sFixW(t);
|
|
285
|
-
#else
|
|
286
|
-
return Vec3(
|
|
287
|
-
mCol[0].mF32[0] * inV.mF32[0] + mCol[1].mF32[0] * inV.mF32[1] + mCol[2].mF32[0] * inV.mF32[2] + mCol[3].mF32[0],
|
|
288
|
-
mCol[0].mF32[1] * inV.mF32[0] + mCol[1].mF32[1] * inV.mF32[1] + mCol[2].mF32[1] * inV.mF32[2] + mCol[3].mF32[1],
|
|
289
|
-
mCol[0].mF32[2] * inV.mF32[0] + mCol[1].mF32[2] * inV.mF32[1] + mCol[2].mF32[2] * inV.mF32[2] + mCol[3].mF32[2]);
|
|
290
|
-
#endif
|
|
291
|
-
}
|
|
292
|
-
|
|
293
|
-
Vec4 Mat44::operator * (Vec4Arg inV) const
|
|
294
|
-
{
|
|
295
|
-
#if defined(JPH_USE_SSE)
|
|
296
|
-
__m128 t = _mm_mul_ps(mCol[0].mValue, _mm_shuffle_ps(inV.mValue, inV.mValue, _MM_SHUFFLE(0, 0, 0, 0)));
|
|
297
|
-
t = _mm_add_ps(t, _mm_mul_ps(mCol[1].mValue, _mm_shuffle_ps(inV.mValue, inV.mValue, _MM_SHUFFLE(1, 1, 1, 1))));
|
|
298
|
-
t = _mm_add_ps(t, _mm_mul_ps(mCol[2].mValue, _mm_shuffle_ps(inV.mValue, inV.mValue, _MM_SHUFFLE(2, 2, 2, 2))));
|
|
299
|
-
t = _mm_add_ps(t, _mm_mul_ps(mCol[3].mValue, _mm_shuffle_ps(inV.mValue, inV.mValue, _MM_SHUFFLE(3, 3, 3, 3))));
|
|
300
|
-
return t;
|
|
301
|
-
#elif defined(JPH_USE_NEON)
|
|
302
|
-
Type t = vmulq_f32(mCol[0].mValue, vdupq_laneq_f32(inV.mValue, 0));
|
|
303
|
-
t = vmlaq_f32(t, mCol[1].mValue, vdupq_laneq_f32(inV.mValue, 1));
|
|
304
|
-
t = vmlaq_f32(t, mCol[2].mValue, vdupq_laneq_f32(inV.mValue, 2));
|
|
305
|
-
t = vmlaq_f32(t, mCol[3].mValue, vdupq_laneq_f32(inV.mValue, 3));
|
|
306
|
-
return t;
|
|
307
|
-
#else
|
|
308
|
-
return Vec4(
|
|
309
|
-
mCol[0].mF32[0] * inV.mF32[0] + mCol[1].mF32[0] * inV.mF32[1] + mCol[2].mF32[0] * inV.mF32[2] + mCol[3].mF32[0] * inV.mF32[3],
|
|
310
|
-
mCol[0].mF32[1] * inV.mF32[0] + mCol[1].mF32[1] * inV.mF32[1] + mCol[2].mF32[1] * inV.mF32[2] + mCol[3].mF32[1] * inV.mF32[3],
|
|
311
|
-
mCol[0].mF32[2] * inV.mF32[0] + mCol[1].mF32[2] * inV.mF32[1] + mCol[2].mF32[2] * inV.mF32[2] + mCol[3].mF32[2] * inV.mF32[3],
|
|
312
|
-
mCol[0].mF32[3] * inV.mF32[0] + mCol[1].mF32[3] * inV.mF32[1] + mCol[2].mF32[3] * inV.mF32[2] + mCol[3].mF32[3] * inV.mF32[3]);
|
|
313
|
-
#endif
|
|
314
|
-
}
|
|
315
|
-
|
|
316
|
-
Vec3 Mat44::Multiply3x3(Vec3Arg inV) const
|
|
317
|
-
{
|
|
318
|
-
#if defined(JPH_USE_SSE)
|
|
319
|
-
__m128 t = _mm_mul_ps(mCol[0].mValue, _mm_shuffle_ps(inV.mValue, inV.mValue, _MM_SHUFFLE(0, 0, 0, 0)));
|
|
320
|
-
t = _mm_add_ps(t, _mm_mul_ps(mCol[1].mValue, _mm_shuffle_ps(inV.mValue, inV.mValue, _MM_SHUFFLE(1, 1, 1, 1))));
|
|
321
|
-
t = _mm_add_ps(t, _mm_mul_ps(mCol[2].mValue, _mm_shuffle_ps(inV.mValue, inV.mValue, _MM_SHUFFLE(2, 2, 2, 2))));
|
|
322
|
-
return Vec3::sFixW(t);
|
|
323
|
-
#elif defined(JPH_USE_NEON)
|
|
324
|
-
Type t = vmulq_f32(mCol[0].mValue, vdupq_laneq_f32(inV.mValue, 0));
|
|
325
|
-
t = vmlaq_f32(t, mCol[1].mValue, vdupq_laneq_f32(inV.mValue, 1));
|
|
326
|
-
t = vmlaq_f32(t, mCol[2].mValue, vdupq_laneq_f32(inV.mValue, 2));
|
|
327
|
-
return Vec3::sFixW(t);
|
|
328
|
-
#else
|
|
329
|
-
return Vec3(
|
|
330
|
-
mCol[0].mF32[0] * inV.mF32[0] + mCol[1].mF32[0] * inV.mF32[1] + mCol[2].mF32[0] * inV.mF32[2],
|
|
331
|
-
mCol[0].mF32[1] * inV.mF32[0] + mCol[1].mF32[1] * inV.mF32[1] + mCol[2].mF32[1] * inV.mF32[2],
|
|
332
|
-
mCol[0].mF32[2] * inV.mF32[0] + mCol[1].mF32[2] * inV.mF32[1] + mCol[2].mF32[2] * inV.mF32[2]);
|
|
333
|
-
#endif
|
|
334
|
-
}
|
|
335
|
-
|
|
336
|
-
Vec3 Mat44::Multiply3x3Transposed(Vec3Arg inV) const
|
|
337
|
-
{
|
|
338
|
-
#if defined(JPH_USE_SSE4_1)
|
|
339
|
-
__m128 x = _mm_dp_ps(mCol[0].mValue, inV.mValue, 0x7f);
|
|
340
|
-
__m128 y = _mm_dp_ps(mCol[1].mValue, inV.mValue, 0x7f);
|
|
341
|
-
__m128 xy = _mm_blend_ps(x, y, 0b0010);
|
|
342
|
-
__m128 z = _mm_dp_ps(mCol[2].mValue, inV.mValue, 0x7f);
|
|
343
|
-
__m128 xyzz = _mm_blend_ps(xy, z, 0b1100);
|
|
344
|
-
return xyzz;
|
|
345
|
-
#else
|
|
346
|
-
return Transposed3x3().Multiply3x3(inV);
|
|
347
|
-
#endif
|
|
348
|
-
}
|
|
349
|
-
|
|
350
|
-
Mat44 Mat44::Multiply3x3(Mat44Arg inM) const
|
|
351
|
-
{
|
|
352
|
-
JPH_ASSERT(mCol[0][3] == 0.0f);
|
|
353
|
-
JPH_ASSERT(mCol[1][3] == 0.0f);
|
|
354
|
-
JPH_ASSERT(mCol[2][3] == 0.0f);
|
|
355
|
-
|
|
356
|
-
Mat44 result;
|
|
357
|
-
#if defined(JPH_USE_SSE)
|
|
358
|
-
for (int i = 0; i < 3; ++i)
|
|
359
|
-
{
|
|
360
|
-
__m128 c = inM.mCol[i].mValue;
|
|
361
|
-
__m128 t = _mm_mul_ps(mCol[0].mValue, _mm_shuffle_ps(c, c, _MM_SHUFFLE(0, 0, 0, 0)));
|
|
362
|
-
t = _mm_add_ps(t, _mm_mul_ps(mCol[1].mValue, _mm_shuffle_ps(c, c, _MM_SHUFFLE(1, 1, 1, 1))));
|
|
363
|
-
t = _mm_add_ps(t, _mm_mul_ps(mCol[2].mValue, _mm_shuffle_ps(c, c, _MM_SHUFFLE(2, 2, 2, 2))));
|
|
364
|
-
result.mCol[i].mValue = t;
|
|
365
|
-
}
|
|
366
|
-
#elif defined(JPH_USE_NEON)
|
|
367
|
-
for (int i = 0; i < 3; ++i)
|
|
368
|
-
{
|
|
369
|
-
Type c = inM.mCol[i].mValue;
|
|
370
|
-
Type t = vmulq_f32(mCol[0].mValue, vdupq_laneq_f32(c, 0));
|
|
371
|
-
t = vmlaq_f32(t, mCol[1].mValue, vdupq_laneq_f32(c, 1));
|
|
372
|
-
t = vmlaq_f32(t, mCol[2].mValue, vdupq_laneq_f32(c, 2));
|
|
373
|
-
result.mCol[i].mValue = t;
|
|
374
|
-
}
|
|
375
|
-
#else
|
|
376
|
-
for (int i = 0; i < 3; ++i)
|
|
377
|
-
result.mCol[i] = mCol[0] * inM.mCol[i].mF32[0] + mCol[1] * inM.mCol[i].mF32[1] + mCol[2] * inM.mCol[i].mF32[2];
|
|
378
|
-
#endif
|
|
379
|
-
result.mCol[3] = Vec4(0, 0, 0, 1);
|
|
380
|
-
return result;
|
|
381
|
-
}
|
|
382
|
-
|
|
383
|
-
Mat44 Mat44::Multiply3x3LeftTransposed(Mat44Arg inM) const
|
|
384
|
-
{
|
|
385
|
-
// Transpose left hand side
|
|
386
|
-
Mat44 trans = Transposed3x3();
|
|
387
|
-
|
|
388
|
-
// Do 3x3 matrix multiply
|
|
389
|
-
Mat44 result;
|
|
390
|
-
result.mCol[0] = trans.mCol[0] * inM.mCol[0].SplatX() + trans.mCol[1] * inM.mCol[0].SplatY() + trans.mCol[2] * inM.mCol[0].SplatZ();
|
|
391
|
-
result.mCol[1] = trans.mCol[0] * inM.mCol[1].SplatX() + trans.mCol[1] * inM.mCol[1].SplatY() + trans.mCol[2] * inM.mCol[1].SplatZ();
|
|
392
|
-
result.mCol[2] = trans.mCol[0] * inM.mCol[2].SplatX() + trans.mCol[1] * inM.mCol[2].SplatY() + trans.mCol[2] * inM.mCol[2].SplatZ();
|
|
393
|
-
result.mCol[3] = Vec4(0, 0, 0, 1);
|
|
394
|
-
return result;
|
|
395
|
-
}
|
|
396
|
-
|
|
397
|
-
Mat44 Mat44::Multiply3x3RightTransposed(Mat44Arg inM) const
|
|
398
|
-
{
|
|
399
|
-
JPH_ASSERT(mCol[0][3] == 0.0f);
|
|
400
|
-
JPH_ASSERT(mCol[1][3] == 0.0f);
|
|
401
|
-
JPH_ASSERT(mCol[2][3] == 0.0f);
|
|
402
|
-
|
|
403
|
-
Mat44 result;
|
|
404
|
-
result.mCol[0] = mCol[0] * inM.mCol[0].SplatX() + mCol[1] * inM.mCol[1].SplatX() + mCol[2] * inM.mCol[2].SplatX();
|
|
405
|
-
result.mCol[1] = mCol[0] * inM.mCol[0].SplatY() + mCol[1] * inM.mCol[1].SplatY() + mCol[2] * inM.mCol[2].SplatY();
|
|
406
|
-
result.mCol[2] = mCol[0] * inM.mCol[0].SplatZ() + mCol[1] * inM.mCol[1].SplatZ() + mCol[2] * inM.mCol[2].SplatZ();
|
|
407
|
-
result.mCol[3] = Vec4(0, 0, 0, 1);
|
|
408
|
-
return result;
|
|
409
|
-
}
|
|
410
|
-
|
|
411
|
-
Mat44 Mat44::operator * (float inV) const
|
|
412
|
-
{
|
|
413
|
-
Vec4 multiplier = Vec4::sReplicate(inV);
|
|
414
|
-
|
|
415
|
-
Mat44 result;
|
|
416
|
-
for (int c = 0; c < 4; ++c)
|
|
417
|
-
result.mCol[c] = mCol[c] * multiplier;
|
|
418
|
-
return result;
|
|
419
|
-
}
|
|
420
|
-
|
|
421
|
-
Mat44 &Mat44::operator *= (float inV)
|
|
422
|
-
{
|
|
423
|
-
for (int c = 0; c < 4; ++c)
|
|
424
|
-
mCol[c] *= inV;
|
|
425
|
-
|
|
426
|
-
return *this;
|
|
427
|
-
}
|
|
428
|
-
|
|
429
|
-
Mat44 Mat44::operator + (Mat44Arg inM) const
|
|
430
|
-
{
|
|
431
|
-
Mat44 result;
|
|
432
|
-
for (int i = 0; i < 4; ++i)
|
|
433
|
-
result.mCol[i] = mCol[i] + inM.mCol[i];
|
|
434
|
-
return result;
|
|
435
|
-
}
|
|
436
|
-
|
|
437
|
-
Mat44 Mat44::operator - () const
|
|
438
|
-
{
|
|
439
|
-
Mat44 result;
|
|
440
|
-
for (int i = 0; i < 4; ++i)
|
|
441
|
-
result.mCol[i] = -mCol[i];
|
|
442
|
-
return result;
|
|
443
|
-
}
|
|
444
|
-
|
|
445
|
-
Mat44 Mat44::operator - (Mat44Arg inM) const
|
|
446
|
-
{
|
|
447
|
-
Mat44 result;
|
|
448
|
-
for (int i = 0; i < 4; ++i)
|
|
449
|
-
result.mCol[i] = mCol[i] - inM.mCol[i];
|
|
450
|
-
return result;
|
|
451
|
-
}
|
|
452
|
-
|
|
453
|
-
Mat44 &Mat44::operator += (Mat44Arg inM)
|
|
454
|
-
{
|
|
455
|
-
for (int c = 0; c < 4; ++c)
|
|
456
|
-
mCol[c] += inM.mCol[c];
|
|
457
|
-
|
|
458
|
-
return *this;
|
|
459
|
-
}
|
|
460
|
-
|
|
461
|
-
void Mat44::StoreFloat4x4(Float4 *outV) const
|
|
462
|
-
{
|
|
463
|
-
for (int c = 0; c < 4; ++c)
|
|
464
|
-
mCol[c].StoreFloat4(outV + c);
|
|
465
|
-
}
|
|
466
|
-
|
|
467
|
-
Mat44 Mat44::Transposed() const
|
|
468
|
-
{
|
|
469
|
-
#if defined(JPH_USE_SSE)
|
|
470
|
-
__m128 tmp1 = _mm_shuffle_ps(mCol[0].mValue, mCol[1].mValue, _MM_SHUFFLE(1, 0, 1, 0));
|
|
471
|
-
__m128 tmp3 = _mm_shuffle_ps(mCol[0].mValue, mCol[1].mValue, _MM_SHUFFLE(3, 2, 3, 2));
|
|
472
|
-
__m128 tmp2 = _mm_shuffle_ps(mCol[2].mValue, mCol[3].mValue, _MM_SHUFFLE(1, 0, 1, 0));
|
|
473
|
-
__m128 tmp4 = _mm_shuffle_ps(mCol[2].mValue, mCol[3].mValue, _MM_SHUFFLE(3, 2, 3, 2));
|
|
474
|
-
|
|
475
|
-
Mat44 result;
|
|
476
|
-
result.mCol[0].mValue = _mm_shuffle_ps(tmp1, tmp2, _MM_SHUFFLE(2, 0, 2, 0));
|
|
477
|
-
result.mCol[1].mValue = _mm_shuffle_ps(tmp1, tmp2, _MM_SHUFFLE(3, 1, 3, 1));
|
|
478
|
-
result.mCol[2].mValue = _mm_shuffle_ps(tmp3, tmp4, _MM_SHUFFLE(2, 0, 2, 0));
|
|
479
|
-
result.mCol[3].mValue = _mm_shuffle_ps(tmp3, tmp4, _MM_SHUFFLE(3, 1, 3, 1));
|
|
480
|
-
return result;
|
|
481
|
-
#elif defined(JPH_USE_NEON)
|
|
482
|
-
float32x4x2_t tmp1 = vzipq_f32(mCol[0].mValue, mCol[2].mValue);
|
|
483
|
-
float32x4x2_t tmp2 = vzipq_f32(mCol[1].mValue, mCol[3].mValue);
|
|
484
|
-
float32x4x2_t tmp3 = vzipq_f32(tmp1.val[0], tmp2.val[0]);
|
|
485
|
-
float32x4x2_t tmp4 = vzipq_f32(tmp1.val[1], tmp2.val[1]);
|
|
486
|
-
|
|
487
|
-
Mat44 result;
|
|
488
|
-
result.mCol[0].mValue = tmp3.val[0];
|
|
489
|
-
result.mCol[1].mValue = tmp3.val[1];
|
|
490
|
-
result.mCol[2].mValue = tmp4.val[0];
|
|
491
|
-
result.mCol[3].mValue = tmp4.val[1];
|
|
492
|
-
return result;
|
|
493
|
-
#else
|
|
494
|
-
Mat44 result;
|
|
495
|
-
for (int c = 0; c < 4; ++c)
|
|
496
|
-
for (int r = 0; r < 4; ++r)
|
|
497
|
-
result.mCol[r].mF32[c] = mCol[c].mF32[r];
|
|
498
|
-
return result;
|
|
499
|
-
#endif
|
|
500
|
-
}
|
|
501
|
-
|
|
502
|
-
Mat44 Mat44::Transposed3x3() const
|
|
503
|
-
{
|
|
504
|
-
#if defined(JPH_USE_SSE)
|
|
505
|
-
__m128 zero = _mm_setzero_ps();
|
|
506
|
-
__m128 tmp1 = _mm_shuffle_ps(mCol[0].mValue, mCol[1].mValue, _MM_SHUFFLE(1, 0, 1, 0));
|
|
507
|
-
__m128 tmp3 = _mm_shuffle_ps(mCol[0].mValue, mCol[1].mValue, _MM_SHUFFLE(3, 2, 3, 2));
|
|
508
|
-
__m128 tmp2 = _mm_shuffle_ps(mCol[2].mValue, zero, _MM_SHUFFLE(1, 0, 1, 0));
|
|
509
|
-
__m128 tmp4 = _mm_shuffle_ps(mCol[2].mValue, zero, _MM_SHUFFLE(3, 2, 3, 2));
|
|
510
|
-
|
|
511
|
-
Mat44 result;
|
|
512
|
-
result.mCol[0].mValue = _mm_shuffle_ps(tmp1, tmp2, _MM_SHUFFLE(2, 0, 2, 0));
|
|
513
|
-
result.mCol[1].mValue = _mm_shuffle_ps(tmp1, tmp2, _MM_SHUFFLE(3, 1, 3, 1));
|
|
514
|
-
result.mCol[2].mValue = _mm_shuffle_ps(tmp3, tmp4, _MM_SHUFFLE(2, 0, 2, 0));
|
|
515
|
-
#elif defined(JPH_USE_NEON)
|
|
516
|
-
float32x4x2_t tmp1 = vzipq_f32(mCol[0].mValue, mCol[2].mValue);
|
|
517
|
-
float32x4x2_t tmp2 = vzipq_f32(mCol[1].mValue, vdupq_n_f32(0));
|
|
518
|
-
float32x4x2_t tmp3 = vzipq_f32(tmp1.val[0], tmp2.val[0]);
|
|
519
|
-
float32x4x2_t tmp4 = vzipq_f32(tmp1.val[1], tmp2.val[1]);
|
|
520
|
-
|
|
521
|
-
Mat44 result;
|
|
522
|
-
result.mCol[0].mValue = tmp3.val[0];
|
|
523
|
-
result.mCol[1].mValue = tmp3.val[1];
|
|
524
|
-
result.mCol[2].mValue = tmp4.val[0];
|
|
525
|
-
#else
|
|
526
|
-
Mat44 result;
|
|
527
|
-
for (int c = 0; c < 3; ++c)
|
|
528
|
-
{
|
|
529
|
-
for (int r = 0; r < 3; ++r)
|
|
530
|
-
result.mCol[c].mF32[r] = mCol[r].mF32[c];
|
|
531
|
-
result.mCol[c].mF32[3] = 0;
|
|
532
|
-
}
|
|
533
|
-
#endif
|
|
534
|
-
result.mCol[3] = Vec4(0, 0, 0, 1);
|
|
535
|
-
return result;
|
|
536
|
-
}
|
|
537
|
-
|
|
538
|
-
Mat44 Mat44::Inversed() const
|
|
539
|
-
{
|
|
540
|
-
#if defined(JPH_USE_SSE)
|
|
541
|
-
// Algorithm from: http://download.intel.com/design/PentiumIII/sml/24504301.pdf
|
|
542
|
-
// Streaming SIMD Extensions - Inverse of 4x4 Matrix
|
|
543
|
-
// Adapted to load data using _mm_shuffle_ps instead of loading from memory
|
|
544
|
-
// Replaced _mm_rcp_ps with _mm_div_ps for better accuracy
|
|
545
|
-
|
|
546
|
-
__m128 tmp1 = _mm_shuffle_ps(mCol[0].mValue, mCol[1].mValue, _MM_SHUFFLE(1, 0, 1, 0));
|
|
547
|
-
__m128 row1 = _mm_shuffle_ps(mCol[2].mValue, mCol[3].mValue, _MM_SHUFFLE(1, 0, 1, 0));
|
|
548
|
-
__m128 row0 = _mm_shuffle_ps(tmp1, row1, _MM_SHUFFLE(2, 0, 2, 0));
|
|
549
|
-
row1 = _mm_shuffle_ps(row1, tmp1, _MM_SHUFFLE(3, 1, 3, 1));
|
|
550
|
-
tmp1 = _mm_shuffle_ps(mCol[0].mValue, mCol[1].mValue, _MM_SHUFFLE(3, 2, 3, 2));
|
|
551
|
-
__m128 row3 = _mm_shuffle_ps(mCol[2].mValue, mCol[3].mValue, _MM_SHUFFLE(3, 2, 3, 2));
|
|
552
|
-
__m128 row2 = _mm_shuffle_ps(tmp1, row3, _MM_SHUFFLE(2, 0, 2, 0));
|
|
553
|
-
row3 = _mm_shuffle_ps(row3, tmp1, _MM_SHUFFLE(3, 1, 3, 1));
|
|
554
|
-
|
|
555
|
-
tmp1 = _mm_mul_ps(row2, row3);
|
|
556
|
-
tmp1 = _mm_shuffle_ps(tmp1, tmp1, _MM_SHUFFLE(2, 3, 0, 1));
|
|
557
|
-
__m128 minor0 = _mm_mul_ps(row1, tmp1);
|
|
558
|
-
__m128 minor1 = _mm_mul_ps(row0, tmp1);
|
|
559
|
-
tmp1 = _mm_shuffle_ps(tmp1, tmp1, _MM_SHUFFLE(1, 0, 3, 2));
|
|
560
|
-
minor0 = _mm_sub_ps(_mm_mul_ps(row1, tmp1), minor0);
|
|
561
|
-
minor1 = _mm_sub_ps(_mm_mul_ps(row0, tmp1), minor1);
|
|
562
|
-
minor1 = _mm_shuffle_ps(minor1, minor1, _MM_SHUFFLE(1, 0, 3, 2));
|
|
563
|
-
|
|
564
|
-
tmp1 = _mm_mul_ps(row1, row2);
|
|
565
|
-
tmp1 = _mm_shuffle_ps(tmp1, tmp1, _MM_SHUFFLE(2, 3, 0, 1));
|
|
566
|
-
minor0 = _mm_add_ps(_mm_mul_ps(row3, tmp1), minor0);
|
|
567
|
-
__m128 minor3 = _mm_mul_ps(row0, tmp1);
|
|
568
|
-
tmp1 = _mm_shuffle_ps(tmp1, tmp1, _MM_SHUFFLE(1, 0, 3, 2));
|
|
569
|
-
minor0 = _mm_sub_ps(minor0, _mm_mul_ps(row3, tmp1));
|
|
570
|
-
minor3 = _mm_sub_ps(_mm_mul_ps(row0, tmp1), minor3);
|
|
571
|
-
minor3 = _mm_shuffle_ps(minor3, minor3, _MM_SHUFFLE(1, 0, 3, 2));
|
|
572
|
-
|
|
573
|
-
tmp1 = _mm_mul_ps(_mm_shuffle_ps(row1, row1, _MM_SHUFFLE(1, 0, 3, 2)), row3);
|
|
574
|
-
tmp1 = _mm_shuffle_ps(tmp1, tmp1, _MM_SHUFFLE(2, 3, 0, 1));
|
|
575
|
-
row2 = _mm_shuffle_ps(row2, row2, _MM_SHUFFLE(1, 0, 3, 2));
|
|
576
|
-
minor0 = _mm_add_ps(_mm_mul_ps(row2, tmp1), minor0);
|
|
577
|
-
__m128 minor2 = _mm_mul_ps(row0, tmp1);
|
|
578
|
-
tmp1 = _mm_shuffle_ps(tmp1, tmp1, _MM_SHUFFLE(1, 0, 3, 2));
|
|
579
|
-
minor0 = _mm_sub_ps(minor0, _mm_mul_ps(row2, tmp1));
|
|
580
|
-
minor2 = _mm_sub_ps(_mm_mul_ps(row0, tmp1), minor2);
|
|
581
|
-
minor2 = _mm_shuffle_ps(minor2, minor2, _MM_SHUFFLE(1, 0, 3, 2));
|
|
582
|
-
|
|
583
|
-
tmp1 = _mm_mul_ps(row0, row1);
|
|
584
|
-
tmp1 = _mm_shuffle_ps(tmp1, tmp1, _MM_SHUFFLE(2, 3, 0, 1));
|
|
585
|
-
minor2 = _mm_add_ps(_mm_mul_ps(row3, tmp1), minor2);
|
|
586
|
-
minor3 = _mm_sub_ps(_mm_mul_ps(row2, tmp1), minor3);
|
|
587
|
-
tmp1 = _mm_shuffle_ps(tmp1, tmp1, _MM_SHUFFLE(1, 0, 3, 2));
|
|
588
|
-
minor2 = _mm_sub_ps(_mm_mul_ps(row3, tmp1), minor2);
|
|
589
|
-
minor3 = _mm_sub_ps(minor3, _mm_mul_ps(row2, tmp1));
|
|
590
|
-
|
|
591
|
-
tmp1 = _mm_mul_ps(row0, row3);
|
|
592
|
-
tmp1 = _mm_shuffle_ps(tmp1, tmp1, _MM_SHUFFLE(2, 3, 0, 1));
|
|
593
|
-
minor1 = _mm_sub_ps(minor1, _mm_mul_ps(row2, tmp1));
|
|
594
|
-
minor2 = _mm_add_ps(_mm_mul_ps(row1, tmp1), minor2);
|
|
595
|
-
tmp1 = _mm_shuffle_ps(tmp1, tmp1, _MM_SHUFFLE(1, 0, 3, 2));
|
|
596
|
-
minor1 = _mm_add_ps(_mm_mul_ps(row2, tmp1), minor1);
|
|
597
|
-
minor2 = _mm_sub_ps(minor2, _mm_mul_ps(row1, tmp1));
|
|
598
|
-
|
|
599
|
-
tmp1 = _mm_mul_ps(row0, row2);
|
|
600
|
-
tmp1 = _mm_shuffle_ps(tmp1, tmp1, _MM_SHUFFLE(2, 3, 0, 1));
|
|
601
|
-
minor1 = _mm_add_ps(_mm_mul_ps(row3, tmp1), minor1);
|
|
602
|
-
minor3 = _mm_sub_ps(minor3, _mm_mul_ps(row1, tmp1));
|
|
603
|
-
tmp1 = _mm_shuffle_ps(tmp1, tmp1, _MM_SHUFFLE(1, 0, 3, 2));
|
|
604
|
-
minor1 = _mm_sub_ps(minor1, _mm_mul_ps(row3, tmp1));
|
|
605
|
-
minor3 = _mm_add_ps(_mm_mul_ps(row1, tmp1), minor3);
|
|
606
|
-
|
|
607
|
-
__m128 det = _mm_mul_ps(row0, minor0);
|
|
608
|
-
det = _mm_add_ps(_mm_shuffle_ps(det, det, _MM_SHUFFLE(2, 3, 0, 1)), det); // Original code did (x + z) + (y + w), changed to (x + y) + (z + w) to match the ARM code below and make the result cross platform deterministic
|
|
609
|
-
det = _mm_add_ss(_mm_shuffle_ps(det, det, _MM_SHUFFLE(1, 0, 3, 2)), det);
|
|
610
|
-
det = _mm_div_ss(_mm_set_ss(1.0f), det);
|
|
611
|
-
det = _mm_shuffle_ps(det, det, _MM_SHUFFLE(0, 0, 0, 0));
|
|
612
|
-
|
|
613
|
-
Mat44 result;
|
|
614
|
-
result.mCol[0].mValue = _mm_mul_ps(det, minor0);
|
|
615
|
-
result.mCol[1].mValue = _mm_mul_ps(det, minor1);
|
|
616
|
-
result.mCol[2].mValue = _mm_mul_ps(det, minor2);
|
|
617
|
-
result.mCol[3].mValue = _mm_mul_ps(det, minor3);
|
|
618
|
-
return result;
|
|
619
|
-
#elif defined(JPH_USE_NEON)
|
|
620
|
-
// Adapted from the SSE version, there's surprising few articles about efficient ways of calculating an inverse for ARM on the internet
|
|
621
|
-
Type tmp1 = JPH_NEON_SHUFFLE_F32x4(mCol[0].mValue, mCol[1].mValue, 0, 1, 4, 5);
|
|
622
|
-
Type row1 = JPH_NEON_SHUFFLE_F32x4(mCol[2].mValue, mCol[3].mValue, 0, 1, 4, 5);
|
|
623
|
-
Type row0 = JPH_NEON_SHUFFLE_F32x4(tmp1, row1, 0, 2, 4, 6);
|
|
624
|
-
row1 = JPH_NEON_SHUFFLE_F32x4(row1, tmp1, 1, 3, 5, 7);
|
|
625
|
-
tmp1 = JPH_NEON_SHUFFLE_F32x4(mCol[0].mValue, mCol[1].mValue, 2, 3, 6, 7);
|
|
626
|
-
Type row3 = JPH_NEON_SHUFFLE_F32x4(mCol[2].mValue, mCol[3].mValue, 2, 3, 6, 7);
|
|
627
|
-
Type row2 = JPH_NEON_SHUFFLE_F32x4(tmp1, row3, 0, 2, 4, 6);
|
|
628
|
-
row3 = JPH_NEON_SHUFFLE_F32x4(row3, tmp1, 1, 3, 5, 7);
|
|
629
|
-
|
|
630
|
-
tmp1 = vmulq_f32(row2, row3);
|
|
631
|
-
tmp1 = JPH_NEON_SHUFFLE_F32x4(tmp1, tmp1, 1, 0, 3, 2);
|
|
632
|
-
Type minor0 = vmulq_f32(row1, tmp1);
|
|
633
|
-
Type minor1 = vmulq_f32(row0, tmp1);
|
|
634
|
-
tmp1 = JPH_NEON_SHUFFLE_F32x4(tmp1, tmp1, 2, 3, 0, 1);
|
|
635
|
-
minor0 = vsubq_f32(vmulq_f32(row1, tmp1), minor0);
|
|
636
|
-
minor1 = vsubq_f32(vmulq_f32(row0, tmp1), minor1);
|
|
637
|
-
minor1 = JPH_NEON_SHUFFLE_F32x4(minor1, minor1, 2, 3, 0, 1);
|
|
638
|
-
|
|
639
|
-
tmp1 = vmulq_f32(row1, row2);
|
|
640
|
-
tmp1 = JPH_NEON_SHUFFLE_F32x4(tmp1, tmp1, 1, 0, 3, 2);
|
|
641
|
-
minor0 = vaddq_f32(vmulq_f32(row3, tmp1), minor0);
|
|
642
|
-
Type minor3 = vmulq_f32(row0, tmp1);
|
|
643
|
-
tmp1 = JPH_NEON_SHUFFLE_F32x4(tmp1, tmp1, 2, 3, 0, 1);
|
|
644
|
-
minor0 = vsubq_f32(minor0, vmulq_f32(row3, tmp1));
|
|
645
|
-
minor3 = vsubq_f32(vmulq_f32(row0, tmp1), minor3);
|
|
646
|
-
minor3 = JPH_NEON_SHUFFLE_F32x4(minor3, minor3, 2, 3, 0, 1);
|
|
647
|
-
|
|
648
|
-
tmp1 = JPH_NEON_SHUFFLE_F32x4(row1, row1, 2, 3, 0, 1);
|
|
649
|
-
tmp1 = vmulq_f32(tmp1, row3);
|
|
650
|
-
tmp1 = JPH_NEON_SHUFFLE_F32x4(tmp1, tmp1, 1, 0, 3, 2);
|
|
651
|
-
row2 = JPH_NEON_SHUFFLE_F32x4(row2, row2, 2, 3, 0, 1);
|
|
652
|
-
minor0 = vaddq_f32(vmulq_f32(row2, tmp1), minor0);
|
|
653
|
-
Type minor2 = vmulq_f32(row0, tmp1);
|
|
654
|
-
tmp1 = JPH_NEON_SHUFFLE_F32x4(tmp1, tmp1, 2, 3, 0, 1);
|
|
655
|
-
minor0 = vsubq_f32(minor0, vmulq_f32(row2, tmp1));
|
|
656
|
-
minor2 = vsubq_f32(vmulq_f32(row0, tmp1), minor2);
|
|
657
|
-
minor2 = JPH_NEON_SHUFFLE_F32x4(minor2, minor2, 2, 3, 0, 1);
|
|
658
|
-
|
|
659
|
-
tmp1 = vmulq_f32(row0, row1);
|
|
660
|
-
tmp1 = JPH_NEON_SHUFFLE_F32x4(tmp1, tmp1, 1, 0, 3, 2);
|
|
661
|
-
minor2 = vaddq_f32(vmulq_f32(row3, tmp1), minor2);
|
|
662
|
-
minor3 = vsubq_f32(vmulq_f32(row2, tmp1), minor3);
|
|
663
|
-
tmp1 = JPH_NEON_SHUFFLE_F32x4(tmp1, tmp1, 2, 3, 0, 1);
|
|
664
|
-
minor2 = vsubq_f32(vmulq_f32(row3, tmp1), minor2);
|
|
665
|
-
minor3 = vsubq_f32(minor3, vmulq_f32(row2, tmp1));
|
|
666
|
-
|
|
667
|
-
tmp1 = vmulq_f32(row0, row3);
|
|
668
|
-
tmp1 = JPH_NEON_SHUFFLE_F32x4(tmp1, tmp1, 1, 0, 3, 2);
|
|
669
|
-
minor1 = vsubq_f32(minor1, vmulq_f32(row2, tmp1));
|
|
670
|
-
minor2 = vaddq_f32(vmulq_f32(row1, tmp1), minor2);
|
|
671
|
-
tmp1 = JPH_NEON_SHUFFLE_F32x4(tmp1, tmp1, 2, 3, 0, 1);
|
|
672
|
-
minor1 = vaddq_f32(vmulq_f32(row2, tmp1), minor1);
|
|
673
|
-
minor2 = vsubq_f32(minor2, vmulq_f32(row1, tmp1));
|
|
674
|
-
|
|
675
|
-
tmp1 = vmulq_f32(row0, row2);
|
|
676
|
-
tmp1 = JPH_NEON_SHUFFLE_F32x4(tmp1, tmp1, 1, 0, 3, 2);
|
|
677
|
-
minor1 = vaddq_f32(vmulq_f32(row3, tmp1), minor1);
|
|
678
|
-
minor3 = vsubq_f32(minor3, vmulq_f32(row1, tmp1));
|
|
679
|
-
tmp1 = JPH_NEON_SHUFFLE_F32x4(tmp1, tmp1, 2, 3, 0, 1);
|
|
680
|
-
minor1 = vsubq_f32(minor1, vmulq_f32(row3, tmp1));
|
|
681
|
-
minor3 = vaddq_f32(vmulq_f32(row1, tmp1), minor3);
|
|
682
|
-
|
|
683
|
-
Type det = vmulq_f32(row0, minor0);
|
|
684
|
-
det = vdupq_n_f32(vaddvq_f32(det));
|
|
685
|
-
det = vdivq_f32(vdupq_n_f32(1.0f), det);
|
|
686
|
-
|
|
687
|
-
Mat44 result;
|
|
688
|
-
result.mCol[0].mValue = vmulq_f32(det, minor0);
|
|
689
|
-
result.mCol[1].mValue = vmulq_f32(det, minor1);
|
|
690
|
-
result.mCol[2].mValue = vmulq_f32(det, minor2);
|
|
691
|
-
result.mCol[3].mValue = vmulq_f32(det, minor3);
|
|
692
|
-
return result;
|
|
693
|
-
#else
|
|
694
|
-
float m00 = JPH_EL(0, 0), m10 = JPH_EL(1, 0), m20 = JPH_EL(2, 0), m30 = JPH_EL(3, 0);
|
|
695
|
-
float m01 = JPH_EL(0, 1), m11 = JPH_EL(1, 1), m21 = JPH_EL(2, 1), m31 = JPH_EL(3, 1);
|
|
696
|
-
float m02 = JPH_EL(0, 2), m12 = JPH_EL(1, 2), m22 = JPH_EL(2, 2), m32 = JPH_EL(3, 2);
|
|
697
|
-
float m03 = JPH_EL(0, 3), m13 = JPH_EL(1, 3), m23 = JPH_EL(2, 3), m33 = JPH_EL(3, 3);
|
|
698
|
-
|
|
699
|
-
float m10211120 = m10 * m21 - m11 * m20;
|
|
700
|
-
float m10221220 = m10 * m22 - m12 * m20;
|
|
701
|
-
float m10231320 = m10 * m23 - m13 * m20;
|
|
702
|
-
float m10311130 = m10 * m31 - m11 * m30;
|
|
703
|
-
float m10321230 = m10 * m32 - m12 * m30;
|
|
704
|
-
float m10331330 = m10 * m33 - m13 * m30;
|
|
705
|
-
float m11221221 = m11 * m22 - m12 * m21;
|
|
706
|
-
float m11231321 = m11 * m23 - m13 * m21;
|
|
707
|
-
float m11321231 = m11 * m32 - m12 * m31;
|
|
708
|
-
float m11331331 = m11 * m33 - m13 * m31;
|
|
709
|
-
float m12231322 = m12 * m23 - m13 * m22;
|
|
710
|
-
float m12331332 = m12 * m33 - m13 * m32;
|
|
711
|
-
float m20312130 = m20 * m31 - m21 * m30;
|
|
712
|
-
float m20322230 = m20 * m32 - m22 * m30;
|
|
713
|
-
float m20332330 = m20 * m33 - m23 * m30;
|
|
714
|
-
float m21322231 = m21 * m32 - m22 * m31;
|
|
715
|
-
float m21332331 = m21 * m33 - m23 * m31;
|
|
716
|
-
float m22332332 = m22 * m33 - m23 * m32;
|
|
717
|
-
|
|
718
|
-
Vec4 col0(m11 * m22332332 - m12 * m21332331 + m13 * m21322231, -m10 * m22332332 + m12 * m20332330 - m13 * m20322230, m10 * m21332331 - m11 * m20332330 + m13 * m20312130, -m10 * m21322231 + m11 * m20322230 - m12 * m20312130);
|
|
719
|
-
Vec4 col1(-m01 * m22332332 + m02 * m21332331 - m03 * m21322231, m00 * m22332332 - m02 * m20332330 + m03 * m20322230, -m00 * m21332331 + m01 * m20332330 - m03 * m20312130, m00 * m21322231 - m01 * m20322230 + m02 * m20312130);
|
|
720
|
-
Vec4 col2(m01 * m12331332 - m02 * m11331331 + m03 * m11321231, -m00 * m12331332 + m02 * m10331330 - m03 * m10321230, m00 * m11331331 - m01 * m10331330 + m03 * m10311130, -m00 * m11321231 + m01 * m10321230 - m02 * m10311130);
|
|
721
|
-
Vec4 col3(-m01 * m12231322 + m02 * m11231321 - m03 * m11221221, m00 * m12231322 - m02 * m10231320 + m03 * m10221220, -m00 * m11231321 + m01 * m10231320 - m03 * m10211120, m00 * m11221221 - m01 * m10221220 + m02 * m10211120);
|
|
722
|
-
|
|
723
|
-
float det = m00 * col0.mF32[0] + m01 * col0.mF32[1] + m02 * col0.mF32[2] + m03 * col0.mF32[3];
|
|
724
|
-
|
|
725
|
-
return Mat44(col0 / det, col1 / det, col2 / det, col3 / det);
|
|
726
|
-
#endif
|
|
727
|
-
}
|
|
728
|
-
|
|
729
|
-
Mat44 Mat44::InversedRotationTranslation() const
|
|
730
|
-
{
|
|
731
|
-
Mat44 m = Transposed3x3();
|
|
732
|
-
m.SetTranslation(-m.Multiply3x3(GetTranslation()));
|
|
733
|
-
return m;
|
|
734
|
-
}
|
|
735
|
-
|
|
736
|
-
float Mat44::GetDeterminant3x3() const
|
|
737
|
-
{
|
|
738
|
-
return GetAxisX().Dot(GetAxisY().Cross(GetAxisZ()));
|
|
739
|
-
}
|
|
740
|
-
|
|
741
|
-
Mat44 Mat44::Adjointed3x3() const
|
|
742
|
-
{
|
|
743
|
-
return Mat44(
|
|
744
|
-
Vec4(JPH_EL(1, 1), JPH_EL(1, 2), JPH_EL(1, 0), 0) * Vec4(JPH_EL(2, 2), JPH_EL(2, 0), JPH_EL(2, 1), 0)
|
|
745
|
-
- Vec4(JPH_EL(1, 2), JPH_EL(1, 0), JPH_EL(1, 1), 0) * Vec4(JPH_EL(2, 1), JPH_EL(2, 2), JPH_EL(2, 0), 0),
|
|
746
|
-
Vec4(JPH_EL(0, 2), JPH_EL(0, 0), JPH_EL(0, 1), 0) * Vec4(JPH_EL(2, 1), JPH_EL(2, 2), JPH_EL(2, 0), 0)
|
|
747
|
-
- Vec4(JPH_EL(0, 1), JPH_EL(0, 2), JPH_EL(0, 0), 0) * Vec4(JPH_EL(2, 2), JPH_EL(2, 0), JPH_EL(2, 1), 0),
|
|
748
|
-
Vec4(JPH_EL(0, 1), JPH_EL(0, 2), JPH_EL(0, 0), 0) * Vec4(JPH_EL(1, 2), JPH_EL(1, 0), JPH_EL(1, 1), 0)
|
|
749
|
-
- Vec4(JPH_EL(0, 2), JPH_EL(0, 0), JPH_EL(0, 1), 0) * Vec4(JPH_EL(1, 1), JPH_EL(1, 2), JPH_EL(1, 0), 0),
|
|
750
|
-
Vec4(0, 0, 0, 1));
|
|
751
|
-
}
|
|
752
|
-
|
|
753
|
-
Mat44 Mat44::Inversed3x3() const
|
|
754
|
-
{
|
|
755
|
-
float det = GetDeterminant3x3();
|
|
756
|
-
|
|
757
|
-
return Mat44(
|
|
758
|
-
(Vec4(JPH_EL(1, 1), JPH_EL(1, 2), JPH_EL(1, 0), 0) * Vec4(JPH_EL(2, 2), JPH_EL(2, 0), JPH_EL(2, 1), 0)
|
|
759
|
-
- Vec4(JPH_EL(1, 2), JPH_EL(1, 0), JPH_EL(1, 1), 0) * Vec4(JPH_EL(2, 1), JPH_EL(2, 2), JPH_EL(2, 0), 0)) / det,
|
|
760
|
-
(Vec4(JPH_EL(0, 2), JPH_EL(0, 0), JPH_EL(0, 1), 0) * Vec4(JPH_EL(2, 1), JPH_EL(2, 2), JPH_EL(2, 0), 0)
|
|
761
|
-
- Vec4(JPH_EL(0, 1), JPH_EL(0, 2), JPH_EL(0, 0), 0) * Vec4(JPH_EL(2, 2), JPH_EL(2, 0), JPH_EL(2, 1), 0)) / det,
|
|
762
|
-
(Vec4(JPH_EL(0, 1), JPH_EL(0, 2), JPH_EL(0, 0), 0) * Vec4(JPH_EL(1, 2), JPH_EL(1, 0), JPH_EL(1, 1), 0)
|
|
763
|
-
- Vec4(JPH_EL(0, 2), JPH_EL(0, 0), JPH_EL(0, 1), 0) * Vec4(JPH_EL(1, 1), JPH_EL(1, 2), JPH_EL(1, 0), 0)) / det,
|
|
764
|
-
Vec4(0, 0, 0, 1));
|
|
765
|
-
}
|
|
766
|
-
|
|
767
|
-
bool Mat44::SetInversed3x3(Mat44Arg inM)
|
|
768
|
-
{
|
|
769
|
-
float det = inM.GetDeterminant3x3();
|
|
770
|
-
|
|
771
|
-
// If the determinant is zero the matrix is singular and we return false
|
|
772
|
-
if (det == 0.0f)
|
|
773
|
-
return false;
|
|
774
|
-
|
|
775
|
-
// Finish calculating the inverse
|
|
776
|
-
*this = inM.Adjointed3x3();
|
|
777
|
-
mCol[0] /= det;
|
|
778
|
-
mCol[1] /= det;
|
|
779
|
-
mCol[2] /= det;
|
|
780
|
-
return true;
|
|
781
|
-
}
|
|
782
|
-
|
|
783
|
-
Quat Mat44::GetQuaternion() const
|
|
784
|
-
{
|
|
785
|
-
float tr = mCol[0].mF32[0] + mCol[1].mF32[1] + mCol[2].mF32[2];
|
|
786
|
-
|
|
787
|
-
if (tr >= 0.0f)
|
|
788
|
-
{
|
|
789
|
-
float s = sqrt(tr + 1.0f);
|
|
790
|
-
float is = 0.5f / s;
|
|
791
|
-
return Quat(
|
|
792
|
-
(mCol[1].mF32[2] - mCol[2].mF32[1]) * is,
|
|
793
|
-
(mCol[2].mF32[0] - mCol[0].mF32[2]) * is,
|
|
794
|
-
(mCol[0].mF32[1] - mCol[1].mF32[0]) * is,
|
|
795
|
-
0.5f * s);
|
|
796
|
-
}
|
|
797
|
-
else
|
|
798
|
-
{
|
|
799
|
-
int i = 0;
|
|
800
|
-
if (mCol[1].mF32[1] > mCol[0].mF32[0]) i = 1;
|
|
801
|
-
if (mCol[2].mF32[2] > mCol[i].mF32[i]) i = 2;
|
|
802
|
-
|
|
803
|
-
if (i == 0)
|
|
804
|
-
{
|
|
805
|
-
float s = sqrt(mCol[0].mF32[0] - (mCol[1].mF32[1] + mCol[2].mF32[2]) + 1);
|
|
806
|
-
float is = 0.5f / s;
|
|
807
|
-
return Quat(
|
|
808
|
-
0.5f * s,
|
|
809
|
-
(mCol[1].mF32[0] + mCol[0].mF32[1]) * is,
|
|
810
|
-
(mCol[0].mF32[2] + mCol[2].mF32[0]) * is,
|
|
811
|
-
(mCol[1].mF32[2] - mCol[2].mF32[1]) * is);
|
|
812
|
-
}
|
|
813
|
-
else if (i == 1)
|
|
814
|
-
{
|
|
815
|
-
float s = sqrt(mCol[1].mF32[1] - (mCol[2].mF32[2] + mCol[0].mF32[0]) + 1);
|
|
816
|
-
float is = 0.5f / s;
|
|
817
|
-
return Quat(
|
|
818
|
-
(mCol[1].mF32[0] + mCol[0].mF32[1]) * is,
|
|
819
|
-
0.5f * s,
|
|
820
|
-
(mCol[2].mF32[1] + mCol[1].mF32[2]) * is,
|
|
821
|
-
(mCol[2].mF32[0] - mCol[0].mF32[2]) * is);
|
|
822
|
-
}
|
|
823
|
-
else
|
|
824
|
-
{
|
|
825
|
-
JPH_ASSERT(i == 2);
|
|
826
|
-
|
|
827
|
-
float s = sqrt(mCol[2].mF32[2] - (mCol[0].mF32[0] + mCol[1].mF32[1]) + 1);
|
|
828
|
-
float is = 0.5f / s;
|
|
829
|
-
return Quat(
|
|
830
|
-
(mCol[0].mF32[2] + mCol[2].mF32[0]) * is,
|
|
831
|
-
(mCol[2].mF32[1] + mCol[1].mF32[2]) * is,
|
|
832
|
-
0.5f * s,
|
|
833
|
-
(mCol[0].mF32[1] - mCol[1].mF32[0]) * is);
|
|
834
|
-
}
|
|
835
|
-
}
|
|
836
|
-
}
|
|
837
|
-
|
|
838
|
-
Mat44 Mat44::sQuatLeftMultiply(QuatArg inQ)
|
|
839
|
-
{
|
|
840
|
-
return Mat44(
|
|
841
|
-
inQ.mValue.Swizzle<SWIZZLE_W, SWIZZLE_Z, SWIZZLE_Y, SWIZZLE_X>().FlipSign<1, 1, -1, -1>(),
|
|
842
|
-
inQ.mValue.Swizzle<SWIZZLE_Z, SWIZZLE_W, SWIZZLE_X, SWIZZLE_Y>().FlipSign<-1, 1, 1, -1>(),
|
|
843
|
-
inQ.mValue.Swizzle<SWIZZLE_Y, SWIZZLE_X, SWIZZLE_W, SWIZZLE_Z>().FlipSign<1, -1, 1, -1>(),
|
|
844
|
-
inQ.mValue);
|
|
845
|
-
}
|
|
846
|
-
|
|
847
|
-
Mat44 Mat44::sQuatRightMultiply(QuatArg inQ)
|
|
848
|
-
{
|
|
849
|
-
return Mat44(
|
|
850
|
-
inQ.mValue.Swizzle<SWIZZLE_W, SWIZZLE_Z, SWIZZLE_Y, SWIZZLE_X>().FlipSign<1, -1, 1, -1>(),
|
|
851
|
-
inQ.mValue.Swizzle<SWIZZLE_Z, SWIZZLE_W, SWIZZLE_X, SWIZZLE_Y>().FlipSign<1, 1, -1, -1>(),
|
|
852
|
-
inQ.mValue.Swizzle<SWIZZLE_Y, SWIZZLE_X, SWIZZLE_W, SWIZZLE_Z>().FlipSign<-1, 1, 1, -1>(),
|
|
853
|
-
inQ.mValue);
|
|
854
|
-
}
|
|
855
|
-
|
|
856
|
-
Mat44 Mat44::GetRotation() const
|
|
857
|
-
{
|
|
858
|
-
JPH_ASSERT(mCol[0][3] == 0.0f);
|
|
859
|
-
JPH_ASSERT(mCol[1][3] == 0.0f);
|
|
860
|
-
JPH_ASSERT(mCol[2][3] == 0.0f);
|
|
861
|
-
|
|
862
|
-
return Mat44(mCol[0], mCol[1], mCol[2], Vec4(0, 0, 0, 1));
|
|
863
|
-
}
|
|
864
|
-
|
|
865
|
-
Mat44 Mat44::GetRotationSafe() const
|
|
866
|
-
{
|
|
867
|
-
#if defined(JPH_USE_AVX512)
|
|
868
|
-
return Mat44(_mm_maskz_mov_ps(0b0111, mCol[0].mValue),
|
|
869
|
-
_mm_maskz_mov_ps(0b0111, mCol[1].mValue),
|
|
870
|
-
_mm_maskz_mov_ps(0b0111, mCol[2].mValue),
|
|
871
|
-
Vec4(0, 0, 0, 1));
|
|
872
|
-
#elif defined(JPH_USE_SSE4_1)
|
|
873
|
-
__m128 zero = _mm_setzero_ps();
|
|
874
|
-
return Mat44(_mm_blend_ps(mCol[0].mValue, zero, 8),
|
|
875
|
-
_mm_blend_ps(mCol[1].mValue, zero, 8),
|
|
876
|
-
_mm_blend_ps(mCol[2].mValue, zero, 8),
|
|
877
|
-
Vec4(0, 0, 0, 1));
|
|
878
|
-
#elif defined(JPH_USE_NEON)
|
|
879
|
-
return Mat44(vsetq_lane_f32(0, mCol[0].mValue, 3),
|
|
880
|
-
vsetq_lane_f32(0, mCol[1].mValue, 3),
|
|
881
|
-
vsetq_lane_f32(0, mCol[2].mValue, 3),
|
|
882
|
-
Vec4(0, 0, 0, 1));
|
|
883
|
-
#else
|
|
884
|
-
return Mat44(Vec4(mCol[0].mF32[0], mCol[0].mF32[1], mCol[0].mF32[2], 0),
|
|
885
|
-
Vec4(mCol[1].mF32[0], mCol[1].mF32[1], mCol[1].mF32[2], 0),
|
|
886
|
-
Vec4(mCol[2].mF32[0], mCol[2].mF32[1], mCol[2].mF32[2], 0),
|
|
887
|
-
Vec4(0, 0, 0, 1));
|
|
888
|
-
#endif
|
|
889
|
-
}
|
|
890
|
-
|
|
891
|
-
void Mat44::SetRotation(Mat44Arg inRotation)
|
|
892
|
-
{
|
|
893
|
-
mCol[0] = inRotation.mCol[0];
|
|
894
|
-
mCol[1] = inRotation.mCol[1];
|
|
895
|
-
mCol[2] = inRotation.mCol[2];
|
|
896
|
-
}
|
|
897
|
-
|
|
898
|
-
Mat44 Mat44::PreTranslated(Vec3Arg inTranslation) const
|
|
899
|
-
{
|
|
900
|
-
return Mat44(mCol[0], mCol[1], mCol[2], Vec4(GetTranslation() + Multiply3x3(inTranslation), 1));
|
|
901
|
-
}
|
|
902
|
-
|
|
903
|
-
Mat44 Mat44::PostTranslated(Vec3Arg inTranslation) const
|
|
904
|
-
{
|
|
905
|
-
return Mat44(mCol[0], mCol[1], mCol[2], Vec4(GetTranslation() + inTranslation, 1));
|
|
906
|
-
}
|
|
907
|
-
|
|
908
|
-
Mat44 Mat44::PreScaled(Vec3Arg inScale) const
|
|
909
|
-
{
|
|
910
|
-
return Mat44(inScale.GetX() * mCol[0], inScale.GetY() * mCol[1], inScale.GetZ() * mCol[2], mCol[3]);
|
|
911
|
-
}
|
|
912
|
-
|
|
913
|
-
Mat44 Mat44::PostScaled(Vec3Arg inScale) const
|
|
914
|
-
{
|
|
915
|
-
Vec4 scale(inScale, 1);
|
|
916
|
-
return Mat44(scale * mCol[0], scale * mCol[1], scale * mCol[2], scale * mCol[3]);
|
|
917
|
-
}
|
|
918
|
-
|
|
919
|
-
Mat44 Mat44::Decompose(Vec3 &outScale) const
|
|
920
|
-
{
|
|
921
|
-
// Start the modified Gram-Schmidt algorithm
|
|
922
|
-
// X axis will just be normalized
|
|
923
|
-
Vec3 x = GetAxisX();
|
|
924
|
-
|
|
925
|
-
// Make Y axis perpendicular to X
|
|
926
|
-
Vec3 y = GetAxisY();
|
|
927
|
-
float x_dot_x = x.LengthSq();
|
|
928
|
-
y -= (x.Dot(y) / x_dot_x) * x;
|
|
929
|
-
|
|
930
|
-
// Make Z axis perpendicular to X
|
|
931
|
-
Vec3 z = GetAxisZ();
|
|
932
|
-
z -= (x.Dot(z) / x_dot_x) * x;
|
|
933
|
-
|
|
934
|
-
// Make Z axis perpendicular to Y
|
|
935
|
-
float y_dot_y = y.LengthSq();
|
|
936
|
-
z -= (y.Dot(z) / y_dot_y) * y;
|
|
937
|
-
|
|
938
|
-
// Determine the scale
|
|
939
|
-
float z_dot_z = z.LengthSq();
|
|
940
|
-
outScale = Vec3(x_dot_x, y_dot_y, z_dot_z).Sqrt();
|
|
941
|
-
|
|
942
|
-
// If the resulting x, y and z vectors don't form a right handed matrix, flip the z axis.
|
|
943
|
-
if (x.Cross(y).Dot(z) < 0.0f)
|
|
944
|
-
outScale.SetZ(-outScale.GetZ());
|
|
945
|
-
|
|
946
|
-
// Determine the rotation and translation
|
|
947
|
-
return Mat44(Vec4(x / outScale.GetX(), 0), Vec4(y / outScale.GetY(), 0), Vec4(z / outScale.GetZ(), 0), GetColumn4(3));
|
|
948
|
-
}
|
|
949
|
-
|
|
950
|
-
#undef JPH_EL
|
|
951
|
-
|
|
952
|
-
JPH_NAMESPACE_END
|