@bloomengine/engine 0.3.1
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/LICENSE +21 -0
- package/README.md +169 -0
- package/native/android/Cargo.lock +1848 -0
- package/native/android/Cargo.toml +20 -0
- package/native/android/src/lib.rs +1747 -0
- package/native/ios/Cargo.lock +1688 -0
- package/native/ios/Cargo.toml +19 -0
- package/native/ios/src/lib.rs +2258 -0
- package/native/linux/Cargo.lock +1719 -0
- package/native/linux/Cargo.toml +22 -0
- package/native/linux/src/lib.rs +2236 -0
- package/native/macos/Cargo.lock +3310 -0
- package/native/macos/Cargo.toml +29 -0
- package/native/macos/src/lib.rs +3444 -0
- package/native/shared/Cargo.lock +1898 -0
- package/native/shared/Cargo.toml +42 -0
- package/native/shared/assets/default_font.ttf +0 -0
- package/native/shared/build.rs +77 -0
- package/native/shared/shaders/common/fog.wgsl +16 -0
- package/native/shared/shaders/common/imposter.wgsl +112 -0
- package/native/shared/shaders/common/pbr.wgsl +186 -0
- package/native/shared/shaders/common/shadows.wgsl +77 -0
- package/native/shared/shaders/common/sky.wgsl +8 -0
- package/native/shared/shaders/common/tonemap.wgsl +25 -0
- package/native/shared/shaders/impulse_field.wgsl +53 -0
- package/native/shared/shaders/material_abi.wgsl +360 -0
- package/native/shared/shaders/materials/test_minimal.wgsl +42 -0
- package/native/shared/src/audio.rs +363 -0
- package/native/shared/src/custom_shaders.rs +104 -0
- package/native/shared/src/drs.rs +211 -0
- package/native/shared/src/engine.rs +186 -0
- package/native/shared/src/frame_callbacks.rs +88 -0
- package/native/shared/src/geometry.rs +236 -0
- package/native/shared/src/handles.rs +76 -0
- package/native/shared/src/input.rs +273 -0
- package/native/shared/src/jolt_sys.rs +822 -0
- package/native/shared/src/lib.rs +43 -0
- package/native/shared/src/models.rs +1941 -0
- package/native/shared/src/physics_jolt.rs +1528 -0
- package/native/shared/src/picking.rs +298 -0
- package/native/shared/src/postfx.rs +339 -0
- package/native/shared/src/profiler.rs +416 -0
- package/native/shared/src/renderer/atmosphere_lut.rs +573 -0
- package/native/shared/src/renderer/brdf_lut.rs +154 -0
- package/native/shared/src/renderer/formats.rs +778 -0
- package/native/shared/src/renderer/graph.rs +465 -0
- package/native/shared/src/renderer/hot_reload.rs +390 -0
- package/native/shared/src/renderer/impulse_field.rs +455 -0
- package/native/shared/src/renderer/material_pipeline.rs +604 -0
- package/native/shared/src/renderer/material_system.rs +2106 -0
- package/native/shared/src/renderer/mod.rs +13923 -0
- package/native/shared/src/renderer/planar_reflection.rs +458 -0
- package/native/shared/src/renderer/post_pass.rs +249 -0
- package/native/shared/src/renderer/shader_include.rs +205 -0
- package/native/shared/src/renderer/shader_library.rs +134 -0
- package/native/shared/src/renderer/shaders.rs +5855 -0
- package/native/shared/src/renderer/transient.rs +576 -0
- package/native/shared/src/renderer/types.rs +259 -0
- package/native/shared/src/renderer/util.rs +151 -0
- package/native/shared/src/scene.rs +1066 -0
- package/native/shared/src/sdf_cache.rs +274 -0
- package/native/shared/src/shadows.rs +551 -0
- package/native/shared/src/staging.rs +90 -0
- package/native/shared/src/string_header.rs +35 -0
- package/native/shared/src/text_renderer.rs +456 -0
- package/native/shared/src/textures.rs +154 -0
- package/native/third_party/JoltPhysics/Jolt/AABBTree/AABBTreeBuilder.cpp +242 -0
- package/native/third_party/JoltPhysics/Jolt/AABBTree/AABBTreeBuilder.h +121 -0
- package/native/third_party/JoltPhysics/Jolt/AABBTree/AABBTreeToBuffer.h +296 -0
- package/native/third_party/JoltPhysics/Jolt/AABBTree/NodeCodec/NodeCodecQuadTreeHalfFloat.h +323 -0
- package/native/third_party/JoltPhysics/Jolt/AABBTree/TriangleCodec/TriangleCodecIndexed8BitPackSOA4Flags.h +555 -0
- package/native/third_party/JoltPhysics/Jolt/ConfigurationString.h +112 -0
- package/native/third_party/JoltPhysics/Jolt/Core/ARMNeon.h +94 -0
- package/native/third_party/JoltPhysics/Jolt/Core/Array.h +713 -0
- package/native/third_party/JoltPhysics/Jolt/Core/Atomics.h +44 -0
- package/native/third_party/JoltPhysics/Jolt/Core/BinaryHeap.h +96 -0
- package/native/third_party/JoltPhysics/Jolt/Core/ByteBuffer.h +74 -0
- package/native/third_party/JoltPhysics/Jolt/Core/Color.cpp +38 -0
- package/native/third_party/JoltPhysics/Jolt/Core/Color.h +98 -0
- package/native/third_party/JoltPhysics/Jolt/Core/Core.h +652 -0
- package/native/third_party/JoltPhysics/Jolt/Core/FPControlWord.h +143 -0
- package/native/third_party/JoltPhysics/Jolt/Core/FPException.h +96 -0
- package/native/third_party/JoltPhysics/Jolt/Core/FPFlushDenormals.h +43 -0
- package/native/third_party/JoltPhysics/Jolt/Core/Factory.cpp +92 -0
- package/native/third_party/JoltPhysics/Jolt/Core/Factory.h +54 -0
- package/native/third_party/JoltPhysics/Jolt/Core/FixedSizeFreeList.h +122 -0
- package/native/third_party/JoltPhysics/Jolt/Core/FixedSizeFreeList.inl +215 -0
- package/native/third_party/JoltPhysics/Jolt/Core/HashCombine.h +234 -0
- package/native/third_party/JoltPhysics/Jolt/Core/HashTable.h +876 -0
- package/native/third_party/JoltPhysics/Jolt/Core/InsertionSort.h +58 -0
- package/native/third_party/JoltPhysics/Jolt/Core/IssueReporting.cpp +27 -0
- package/native/third_party/JoltPhysics/Jolt/Core/IssueReporting.h +38 -0
- package/native/third_party/JoltPhysics/Jolt/Core/JobSystem.h +311 -0
- package/native/third_party/JoltPhysics/Jolt/Core/JobSystem.inl +56 -0
- package/native/third_party/JoltPhysics/Jolt/Core/JobSystemSingleThreaded.cpp +65 -0
- package/native/third_party/JoltPhysics/Jolt/Core/JobSystemSingleThreaded.h +62 -0
- package/native/third_party/JoltPhysics/Jolt/Core/JobSystemThreadPool.cpp +364 -0
- package/native/third_party/JoltPhysics/Jolt/Core/JobSystemThreadPool.h +101 -0
- package/native/third_party/JoltPhysics/Jolt/Core/JobSystemWithBarrier.cpp +230 -0
- package/native/third_party/JoltPhysics/Jolt/Core/JobSystemWithBarrier.h +85 -0
- package/native/third_party/JoltPhysics/Jolt/Core/LinearCurve.cpp +51 -0
- package/native/third_party/JoltPhysics/Jolt/Core/LinearCurve.h +67 -0
- package/native/third_party/JoltPhysics/Jolt/Core/LockFreeHashMap.h +182 -0
- package/native/third_party/JoltPhysics/Jolt/Core/LockFreeHashMap.inl +351 -0
- package/native/third_party/JoltPhysics/Jolt/Core/Memory.cpp +85 -0
- package/native/third_party/JoltPhysics/Jolt/Core/Memory.h +85 -0
- package/native/third_party/JoltPhysics/Jolt/Core/Mutex.h +223 -0
- package/native/third_party/JoltPhysics/Jolt/Core/MutexArray.h +98 -0
- package/native/third_party/JoltPhysics/Jolt/Core/NonCopyable.h +18 -0
- package/native/third_party/JoltPhysics/Jolt/Core/Profiler.cpp +677 -0
- package/native/third_party/JoltPhysics/Jolt/Core/Profiler.h +301 -0
- package/native/third_party/JoltPhysics/Jolt/Core/Profiler.inl +90 -0
- package/native/third_party/JoltPhysics/Jolt/Core/QuickSort.h +137 -0
- package/native/third_party/JoltPhysics/Jolt/Core/RTTI.cpp +149 -0
- package/native/third_party/JoltPhysics/Jolt/Core/RTTI.h +436 -0
- package/native/third_party/JoltPhysics/Jolt/Core/Reference.h +244 -0
- package/native/third_party/JoltPhysics/Jolt/Core/Result.h +174 -0
- package/native/third_party/JoltPhysics/Jolt/Core/STLAlignedAllocator.h +72 -0
- package/native/third_party/JoltPhysics/Jolt/Core/STLAllocator.h +127 -0
- package/native/third_party/JoltPhysics/Jolt/Core/STLLocalAllocator.h +170 -0
- package/native/third_party/JoltPhysics/Jolt/Core/STLTempAllocator.h +80 -0
- package/native/third_party/JoltPhysics/Jolt/Core/ScopeExit.h +49 -0
- package/native/third_party/JoltPhysics/Jolt/Core/Semaphore.cpp +135 -0
- package/native/third_party/JoltPhysics/Jolt/Core/Semaphore.h +68 -0
- package/native/third_party/JoltPhysics/Jolt/Core/StaticArray.h +329 -0
- package/native/third_party/JoltPhysics/Jolt/Core/StreamIn.h +120 -0
- package/native/third_party/JoltPhysics/Jolt/Core/StreamOut.h +97 -0
- package/native/third_party/JoltPhysics/Jolt/Core/StreamUtils.h +168 -0
- package/native/third_party/JoltPhysics/Jolt/Core/StreamWrapper.h +53 -0
- package/native/third_party/JoltPhysics/Jolt/Core/StridedPtr.h +63 -0
- package/native/third_party/JoltPhysics/Jolt/Core/StringTools.cpp +101 -0
- package/native/third_party/JoltPhysics/Jolt/Core/StringTools.h +38 -0
- package/native/third_party/JoltPhysics/Jolt/Core/TempAllocator.h +209 -0
- package/native/third_party/JoltPhysics/Jolt/Core/TickCounter.cpp +37 -0
- package/native/third_party/JoltPhysics/Jolt/Core/TickCounter.h +58 -0
- package/native/third_party/JoltPhysics/Jolt/Core/UnorderedMap.h +80 -0
- package/native/third_party/JoltPhysics/Jolt/Core/UnorderedSet.h +32 -0
- package/native/third_party/JoltPhysics/Jolt/Geometry/AABox.h +313 -0
- package/native/third_party/JoltPhysics/Jolt/Geometry/AABox4.h +224 -0
- package/native/third_party/JoltPhysics/Jolt/Geometry/ClipPoly.h +200 -0
- package/native/third_party/JoltPhysics/Jolt/Geometry/ClosestPoint.h +498 -0
- package/native/third_party/JoltPhysics/Jolt/Geometry/ConvexHullBuilder.cpp +1467 -0
- package/native/third_party/JoltPhysics/Jolt/Geometry/ConvexHullBuilder.h +276 -0
- package/native/third_party/JoltPhysics/Jolt/Geometry/ConvexHullBuilder2D.cpp +335 -0
- package/native/third_party/JoltPhysics/Jolt/Geometry/ConvexHullBuilder2D.h +105 -0
- package/native/third_party/JoltPhysics/Jolt/Geometry/ConvexSupport.h +188 -0
- package/native/third_party/JoltPhysics/Jolt/Geometry/EPAConvexHullBuilder.h +845 -0
- package/native/third_party/JoltPhysics/Jolt/Geometry/EPAPenetrationDepth.h +557 -0
- package/native/third_party/JoltPhysics/Jolt/Geometry/Ellipse.h +77 -0
- package/native/third_party/JoltPhysics/Jolt/Geometry/GJKClosestPoint.h +945 -0
- package/native/third_party/JoltPhysics/Jolt/Geometry/IndexedTriangle.h +130 -0
- package/native/third_party/JoltPhysics/Jolt/Geometry/Indexify.cpp +222 -0
- package/native/third_party/JoltPhysics/Jolt/Geometry/Indexify.h +19 -0
- package/native/third_party/JoltPhysics/Jolt/Geometry/MortonCode.h +40 -0
- package/native/third_party/JoltPhysics/Jolt/Geometry/OrientedBox.cpp +178 -0
- package/native/third_party/JoltPhysics/Jolt/Geometry/OrientedBox.h +39 -0
- package/native/third_party/JoltPhysics/Jolt/Geometry/Plane.h +104 -0
- package/native/third_party/JoltPhysics/Jolt/Geometry/RayAABox.h +241 -0
- package/native/third_party/JoltPhysics/Jolt/Geometry/RayCapsule.h +37 -0
- package/native/third_party/JoltPhysics/Jolt/Geometry/RayCylinder.h +101 -0
- package/native/third_party/JoltPhysics/Jolt/Geometry/RaySphere.h +96 -0
- package/native/third_party/JoltPhysics/Jolt/Geometry/RayTriangle.h +158 -0
- package/native/third_party/JoltPhysics/Jolt/Geometry/Sphere.h +72 -0
- package/native/third_party/JoltPhysics/Jolt/Geometry/Triangle.h +34 -0
- package/native/third_party/JoltPhysics/Jolt/Jolt.cmake +703 -0
- package/native/third_party/JoltPhysics/Jolt/Jolt.h +16 -0
- package/native/third_party/JoltPhysics/Jolt/Jolt.natvis +116 -0
- package/native/third_party/JoltPhysics/Jolt/Math/BVec16.h +99 -0
- package/native/third_party/JoltPhysics/Jolt/Math/BVec16.inl +177 -0
- package/native/third_party/JoltPhysics/Jolt/Math/DMat44.h +158 -0
- package/native/third_party/JoltPhysics/Jolt/Math/DMat44.inl +310 -0
- package/native/third_party/JoltPhysics/Jolt/Math/DVec3.h +291 -0
- package/native/third_party/JoltPhysics/Jolt/Math/DVec3.inl +941 -0
- package/native/third_party/JoltPhysics/Jolt/Math/Double3.h +48 -0
- package/native/third_party/JoltPhysics/Jolt/Math/DynMatrix.h +31 -0
- package/native/third_party/JoltPhysics/Jolt/Math/EigenValueSymmetric.h +177 -0
- package/native/third_party/JoltPhysics/Jolt/Math/FindRoot.h +42 -0
- package/native/third_party/JoltPhysics/Jolt/Math/Float2.h +36 -0
- package/native/third_party/JoltPhysics/Jolt/Math/Float3.h +50 -0
- package/native/third_party/JoltPhysics/Jolt/Math/Float4.h +44 -0
- package/native/third_party/JoltPhysics/Jolt/Math/GaussianElimination.h +102 -0
- package/native/third_party/JoltPhysics/Jolt/Math/HalfFloat.h +208 -0
- package/native/third_party/JoltPhysics/Jolt/Math/Mat44.h +243 -0
- package/native/third_party/JoltPhysics/Jolt/Math/Mat44.inl +952 -0
- package/native/third_party/JoltPhysics/Jolt/Math/Math.h +208 -0
- package/native/third_party/JoltPhysics/Jolt/Math/MathTypes.h +32 -0
- package/native/third_party/JoltPhysics/Jolt/Math/Matrix.h +259 -0
- package/native/third_party/JoltPhysics/Jolt/Math/Quat.h +268 -0
- package/native/third_party/JoltPhysics/Jolt/Math/Quat.inl +406 -0
- package/native/third_party/JoltPhysics/Jolt/Math/Real.h +44 -0
- package/native/third_party/JoltPhysics/Jolt/Math/Swizzle.h +19 -0
- package/native/third_party/JoltPhysics/Jolt/Math/Trigonometry.h +79 -0
- package/native/third_party/JoltPhysics/Jolt/Math/UVec4.h +232 -0
- package/native/third_party/JoltPhysics/Jolt/Math/UVec4.inl +636 -0
- package/native/third_party/JoltPhysics/Jolt/Math/Vec3.cpp +71 -0
- package/native/third_party/JoltPhysics/Jolt/Math/Vec3.h +308 -0
- package/native/third_party/JoltPhysics/Jolt/Math/Vec3.inl +942 -0
- package/native/third_party/JoltPhysics/Jolt/Math/Vec4.h +320 -0
- package/native/third_party/JoltPhysics/Jolt/Math/Vec4.inl +1152 -0
- package/native/third_party/JoltPhysics/Jolt/Math/Vector.h +211 -0
- package/native/third_party/JoltPhysics/Jolt/ObjectStream/GetPrimitiveTypeOfType.h +54 -0
- package/native/third_party/JoltPhysics/Jolt/ObjectStream/ObjectStream.cpp +38 -0
- package/native/third_party/JoltPhysics/Jolt/ObjectStream/ObjectStream.h +337 -0
- package/native/third_party/JoltPhysics/Jolt/ObjectStream/ObjectStreamBinaryIn.cpp +252 -0
- package/native/third_party/JoltPhysics/Jolt/ObjectStream/ObjectStreamBinaryIn.h +57 -0
- package/native/third_party/JoltPhysics/Jolt/ObjectStream/ObjectStreamBinaryOut.cpp +165 -0
- package/native/third_party/JoltPhysics/Jolt/ObjectStream/ObjectStreamBinaryOut.h +57 -0
- package/native/third_party/JoltPhysics/Jolt/ObjectStream/ObjectStreamIn.cpp +635 -0
- package/native/third_party/JoltPhysics/Jolt/ObjectStream/ObjectStreamIn.h +148 -0
- package/native/third_party/JoltPhysics/Jolt/ObjectStream/ObjectStreamOut.cpp +166 -0
- package/native/third_party/JoltPhysics/Jolt/ObjectStream/ObjectStreamOut.h +101 -0
- package/native/third_party/JoltPhysics/Jolt/ObjectStream/ObjectStreamTextIn.cpp +418 -0
- package/native/third_party/JoltPhysics/Jolt/ObjectStream/ObjectStreamTextIn.h +55 -0
- package/native/third_party/JoltPhysics/Jolt/ObjectStream/ObjectStreamTextOut.cpp +255 -0
- package/native/third_party/JoltPhysics/Jolt/ObjectStream/ObjectStreamTextOut.h +62 -0
- package/native/third_party/JoltPhysics/Jolt/ObjectStream/ObjectStreamTypes.h +26 -0
- package/native/third_party/JoltPhysics/Jolt/ObjectStream/SerializableAttribute.h +111 -0
- package/native/third_party/JoltPhysics/Jolt/ObjectStream/SerializableAttributeEnum.h +67 -0
- package/native/third_party/JoltPhysics/Jolt/ObjectStream/SerializableAttributeTyped.h +60 -0
- package/native/third_party/JoltPhysics/Jolt/ObjectStream/SerializableObject.cpp +15 -0
- package/native/third_party/JoltPhysics/Jolt/ObjectStream/SerializableObject.h +170 -0
- package/native/third_party/JoltPhysics/Jolt/ObjectStream/TypeDeclarations.cpp +70 -0
- package/native/third_party/JoltPhysics/Jolt/ObjectStream/TypeDeclarations.h +45 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Body/AllowedDOFs.h +68 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Body/Body.cpp +426 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Body/Body.h +452 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Body/Body.inl +197 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Body/BodyAccess.h +68 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Body/BodyActivationListener.h +28 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Body/BodyCreationSettings.cpp +234 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Body/BodyCreationSettings.h +124 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Body/BodyFilter.h +130 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Body/BodyID.h +101 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Body/BodyInterface.cpp +1099 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Body/BodyInterface.h +324 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Body/BodyLock.h +111 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Body/BodyLockInterface.h +134 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Body/BodyLockMulti.h +120 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Body/BodyManager.cpp +1220 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Body/BodyManager.h +403 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Body/BodyPair.h +36 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Body/BodyType.h +19 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Body/MassProperties.cpp +185 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Body/MassProperties.h +58 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Body/MotionProperties.cpp +92 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Body/MotionProperties.h +308 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Body/MotionProperties.inl +178 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Body/MotionQuality.h +31 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Body/MotionType.h +17 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Character/Character.cpp +354 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Character/Character.h +159 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Character/CharacterBase.cpp +59 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Character/CharacterBase.h +157 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Character/CharacterID.h +98 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Character/CharacterVirtual.cpp +1933 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Character/CharacterVirtual.h +752 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/AABoxCast.h +20 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/ActiveEdgeMode.h +17 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/ActiveEdges.h +114 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/BackFaceMode.h +16 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/BroadPhase/BroadPhase.cpp +16 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/BroadPhase/BroadPhase.h +109 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/BroadPhase/BroadPhaseBruteForce.cpp +313 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/BroadPhase/BroadPhaseBruteForce.h +38 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/BroadPhase/BroadPhaseLayer.h +148 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/BroadPhase/BroadPhaseLayerInterfaceMask.h +92 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/BroadPhase/BroadPhaseLayerInterfaceTable.h +64 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/BroadPhase/BroadPhaseQuadTree.cpp +629 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/BroadPhase/BroadPhaseQuadTree.h +108 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/BroadPhase/BroadPhaseQuery.h +56 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/BroadPhase/ObjectVsBroadPhaseLayerFilterMask.h +35 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/BroadPhase/ObjectVsBroadPhaseLayerFilterTable.h +66 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/BroadPhase/QuadTree.cpp +1768 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/BroadPhase/QuadTree.h +389 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/CastConvexVsTriangles.cpp +107 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/CastConvexVsTriangles.h +46 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/CastResult.h +37 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/CastSphereVsTriangles.cpp +223 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/CastSphereVsTriangles.h +49 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/CollectFacesMode.h +16 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/CollideConvexVsTriangles.cpp +155 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/CollideConvexVsTriangles.h +56 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/CollidePointResult.h +25 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/CollideShape.h +106 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/CollideShapeVsShapePerLeaf.h +94 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/CollideSoftBodyVertexIterator.h +110 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/CollideSoftBodyVerticesVsTriangles.h +102 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/CollideSphereVsTriangles.cpp +121 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/CollideSphereVsTriangles.h +50 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/CollisionCollector.h +109 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/CollisionCollectorImpl.h +219 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/CollisionDispatch.cpp +107 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/CollisionDispatch.h +97 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/CollisionGroup.cpp +35 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/CollisionGroup.h +97 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/ContactListener.h +143 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/EstimateCollisionResponse.cpp +213 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/EstimateCollisionResponse.h +48 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/GroupFilter.cpp +32 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/GroupFilter.h +46 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/GroupFilterTable.cpp +38 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/GroupFilterTable.h +130 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/InternalEdgeRemovingCollector.h +279 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/ManifoldBetweenTwoFaces.cpp +271 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/ManifoldBetweenTwoFaces.h +44 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/NarrowPhaseQuery.cpp +448 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/NarrowPhaseQuery.h +77 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/NarrowPhaseStats.cpp +62 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/NarrowPhaseStats.h +110 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/ObjectLayer.h +111 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/ObjectLayerPairFilterMask.h +52 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/ObjectLayerPairFilterTable.h +78 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/PhysicsMaterial.cpp +35 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/PhysicsMaterial.h +57 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/PhysicsMaterialSimple.cpp +38 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/PhysicsMaterialSimple.h +37 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/RayCast.h +87 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/Shape/BoxShape.cpp +318 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/Shape/BoxShape.h +115 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/Shape/CapsuleShape.cpp +438 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/Shape/CapsuleShape.h +129 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/Shape/CompoundShape.cpp +433 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/Shape/CompoundShape.h +354 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/Shape/CompoundShapeVisitors.h +461 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/Shape/ConvexHullShape.cpp +1311 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/Shape/ConvexHullShape.h +202 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/Shape/ConvexShape.cpp +566 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/Shape/ConvexShape.h +150 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/Shape/CylinderShape.cpp +418 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/Shape/CylinderShape.h +126 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/Shape/DecoratedShape.cpp +87 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/Shape/DecoratedShape.h +80 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/Shape/EmptyShape.cpp +64 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/Shape/EmptyShape.h +75 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/Shape/GetTrianglesContext.h +248 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/Shape/HeightFieldShape.cpp +2754 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/Shape/HeightFieldShape.h +380 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/Shape/MeshShape.cpp +1305 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/Shape/MeshShape.h +228 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/Shape/MutableCompoundShape.cpp +596 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/Shape/MutableCompoundShape.h +176 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/Shape/OffsetCenterOfMassShape.cpp +217 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/Shape/OffsetCenterOfMassShape.h +140 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/Shape/PlaneShape.cpp +541 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/Shape/PlaneShape.h +147 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/Shape/PolyhedronSubmergedVolumeCalculator.h +319 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/Shape/RotatedTranslatedShape.cpp +333 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/Shape/RotatedTranslatedShape.h +161 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/Shape/ScaleHelpers.h +83 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/Shape/ScaledShape.cpp +238 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/Shape/ScaledShape.h +145 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/Shape/Shape.cpp +325 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/Shape/Shape.h +466 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/Shape/SphereShape.cpp +347 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/Shape/SphereShape.h +125 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/Shape/StaticCompoundShape.cpp +674 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/Shape/StaticCompoundShape.h +139 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/Shape/SubShapeID.h +138 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/Shape/SubShapeIDPair.h +65 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/Shape/TaperedCapsuleShape.cpp +453 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/Shape/TaperedCapsuleShape.gliffy +1 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/Shape/TaperedCapsuleShape.h +135 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/Shape/TaperedCylinderShape.cpp +691 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/Shape/TaperedCylinderShape.h +132 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/Shape/TriangleShape.cpp +430 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/Shape/TriangleShape.h +143 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/ShapeCast.h +173 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/ShapeFilter.h +73 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/SimShapeFilter.h +40 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/SimShapeFilterWrapper.h +58 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/SortReverseAndStore.h +48 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/TransformedShape.cpp +180 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Collision/TransformedShape.h +194 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Constraints/CalculateSolverSteps.h +70 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Constraints/ConeConstraint.cpp +246 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Constraints/ConeConstraint.h +133 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Constraints/Constraint.cpp +73 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Constraints/Constraint.h +243 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Constraints/ConstraintManager.cpp +289 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Constraints/ConstraintManager.h +100 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Constraints/ConstraintPart/AngleConstraintPart.h +257 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Constraints/ConstraintPart/AxisConstraintPart.h +682 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Constraints/ConstraintPart/DualAxisConstraintPart.h +276 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Constraints/ConstraintPart/GearConstraintPart.h +195 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Constraints/ConstraintPart/HingeRotationConstraintPart.h +222 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Constraints/ConstraintPart/IndependentAxisConstraintPart.h +246 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Constraints/ConstraintPart/PointConstraintPart.h +239 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Constraints/ConstraintPart/RackAndPinionConstraintPart.h +196 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Constraints/ConstraintPart/RotationEulerConstraintPart.h +283 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Constraints/ConstraintPart/RotationQuatConstraintPart.h +246 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Constraints/ConstraintPart/SpringPart.h +169 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Constraints/ConstraintPart/SwingTwistConstraintPart.h +597 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Constraints/ContactConstraintManager.cpp +1804 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Constraints/ContactConstraintManager.h +524 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Constraints/DistanceConstraint.cpp +266 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Constraints/DistanceConstraint.h +120 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Constraints/FixedConstraint.cpp +215 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Constraints/FixedConstraint.h +96 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Constraints/GearConstraint.cpp +188 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Constraints/GearConstraint.h +116 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Constraints/HingeConstraint.cpp +443 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Constraints/HingeConstraint.h +205 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Constraints/MotorSettings.cpp +43 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Constraints/MotorSettings.h +66 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Constraints/PathConstraint.cpp +458 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Constraints/PathConstraint.h +191 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Constraints/PathConstraintPath.cpp +85 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Constraints/PathConstraintPath.h +76 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Constraints/PathConstraintPathHermite.cpp +308 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Constraints/PathConstraintPathHermite.h +54 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Constraints/PointConstraint.cpp +157 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Constraints/PointConstraint.h +94 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Constraints/PulleyConstraint.cpp +253 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Constraints/PulleyConstraint.h +137 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Constraints/RackAndPinionConstraint.cpp +189 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Constraints/RackAndPinionConstraint.h +118 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Constraints/SixDOFConstraint.cpp +900 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Constraints/SixDOFConstraint.h +289 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Constraints/SliderConstraint.cpp +501 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Constraints/SliderConstraint.h +198 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Constraints/SpringSettings.cpp +35 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Constraints/SpringSettings.h +70 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Constraints/SwingTwistConstraint.cpp +524 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Constraints/SwingTwistConstraint.h +197 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Constraints/TwoBodyConstraint.cpp +56 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Constraints/TwoBodyConstraint.h +65 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/DeterminismLog.cpp +17 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/DeterminismLog.h +159 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/EActivation.h +16 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/EPhysicsUpdateError.h +37 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/IslandBuilder.cpp +492 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/IslandBuilder.h +144 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/LargeIslandSplitter.cpp +582 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/LargeIslandSplitter.h +187 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/PhysicsLock.h +169 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/PhysicsScene.cpp +261 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/PhysicsScene.h +104 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/PhysicsSettings.h +125 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/PhysicsStepListener.h +37 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/PhysicsSystem.cpp +2915 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/PhysicsSystem.h +391 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/PhysicsUpdateContext.cpp +25 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/PhysicsUpdateContext.h +176 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Ragdoll/Ragdoll.cpp +744 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Ragdoll/Ragdoll.h +245 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/SoftBody/SoftBodyContactListener.h +55 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/SoftBody/SoftBodyCreationSettings.cpp +128 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/SoftBody/SoftBodyCreationSettings.h +75 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/SoftBody/SoftBodyManifold.h +74 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/SoftBody/SoftBodyMotionProperties.cpp +1501 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/SoftBody/SoftBodyMotionProperties.h +333 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/SoftBody/SoftBodyShape.cpp +354 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/SoftBody/SoftBodyShape.h +73 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/SoftBody/SoftBodySharedSettings.cpp +1487 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/SoftBody/SoftBodySharedSettings.h +390 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/SoftBody/SoftBodyUpdateContext.h +63 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/SoftBody/SoftBodyVertex.h +36 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/StateRecorder.h +136 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/StateRecorderImpl.cpp +90 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/StateRecorderImpl.h +50 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Vehicle/MotorcycleController.cpp +306 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Vehicle/MotorcycleController.h +119 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Vehicle/TrackedVehicleController.cpp +547 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Vehicle/TrackedVehicleController.h +169 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Vehicle/VehicleAntiRollBar.cpp +33 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Vehicle/VehicleAntiRollBar.h +33 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Vehicle/VehicleCollisionTester.cpp +376 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Vehicle/VehicleCollisionTester.h +146 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Vehicle/VehicleConstraint.cpp +703 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Vehicle/VehicleConstraint.h +252 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Vehicle/VehicleController.cpp +17 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Vehicle/VehicleController.h +87 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Vehicle/VehicleDifferential.cpp +81 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Vehicle/VehicleDifferential.h +39 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Vehicle/VehicleEngine.cpp +122 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Vehicle/VehicleEngine.h +93 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Vehicle/VehicleTrack.cpp +52 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Vehicle/VehicleTrack.h +56 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Vehicle/VehicleTransmission.cpp +159 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Vehicle/VehicleTransmission.h +87 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Vehicle/Wheel.cpp +93 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Vehicle/Wheel.h +148 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Vehicle/WheeledVehicleController.cpp +866 -0
- package/native/third_party/JoltPhysics/Jolt/Physics/Vehicle/WheeledVehicleController.h +205 -0
- package/native/third_party/JoltPhysics/Jolt/RegisterTypes.cpp +204 -0
- package/native/third_party/JoltPhysics/Jolt/RegisterTypes.h +29 -0
- package/native/third_party/JoltPhysics/Jolt/Renderer/DebugRenderer.cpp +1107 -0
- package/native/third_party/JoltPhysics/Jolt/Renderer/DebugRenderer.h +383 -0
- package/native/third_party/JoltPhysics/Jolt/Renderer/DebugRendererPlayback.cpp +168 -0
- package/native/third_party/JoltPhysics/Jolt/Renderer/DebugRendererPlayback.h +48 -0
- package/native/third_party/JoltPhysics/Jolt/Renderer/DebugRendererRecorder.cpp +158 -0
- package/native/third_party/JoltPhysics/Jolt/Renderer/DebugRendererRecorder.h +130 -0
- package/native/third_party/JoltPhysics/Jolt/Renderer/DebugRendererSimple.cpp +80 -0
- package/native/third_party/JoltPhysics/Jolt/Renderer/DebugRendererSimple.h +88 -0
- package/native/third_party/JoltPhysics/Jolt/Skeleton/SkeletalAnimation.cpp +165 -0
- package/native/third_party/JoltPhysics/Jolt/Skeleton/SkeletalAnimation.h +91 -0
- package/native/third_party/JoltPhysics/Jolt/Skeleton/Skeleton.cpp +82 -0
- package/native/third_party/JoltPhysics/Jolt/Skeleton/Skeleton.h +72 -0
- package/native/third_party/JoltPhysics/Jolt/Skeleton/SkeletonMapper.cpp +237 -0
- package/native/third_party/JoltPhysics/Jolt/Skeleton/SkeletonMapper.h +145 -0
- package/native/third_party/JoltPhysics/Jolt/Skeleton/SkeletonPose.cpp +87 -0
- package/native/third_party/JoltPhysics/Jolt/Skeleton/SkeletonPose.h +82 -0
- package/native/third_party/JoltPhysics/Jolt/TriangleSplitter/TriangleSplitter.cpp +73 -0
- package/native/third_party/JoltPhysics/Jolt/TriangleSplitter/TriangleSplitter.h +84 -0
- package/native/third_party/JoltPhysics/Jolt/TriangleSplitter/TriangleSplitterBinning.cpp +139 -0
- package/native/third_party/JoltPhysics/Jolt/TriangleSplitter/TriangleSplitterBinning.h +52 -0
- package/native/third_party/JoltPhysics/Jolt/TriangleSplitter/TriangleSplitterMean.cpp +43 -0
- package/native/third_party/JoltPhysics/Jolt/TriangleSplitter/TriangleSplitterMean.h +28 -0
- package/native/third_party/JoltPhysics/LICENSE +7 -0
- package/native/third_party/JoltPhysics/README.md +173 -0
- package/native/third_party/bloom_jolt/CMakeLists.txt +78 -0
- package/native/third_party/bloom_jolt/include/bloom_jolt.h +519 -0
- package/native/third_party/bloom_jolt/src/bloom_jolt.cpp +1780 -0
- package/native/tvos/Cargo.lock +1692 -0
- package/native/tvos/Cargo.toml +22 -0
- package/native/tvos/src/lib.rs +3179 -0
- package/native/watchos/Cargo.lock +16 -0
- package/native/watchos/Cargo.toml +19 -0
- package/native/watchos/shaders/bloom_postfx.metal +99 -0
- package/native/watchos/src/BloomWatchApp.swift +1236 -0
- package/native/watchos/src/BloomWatchAudio.swift +179 -0
- package/native/watchos/src/audio.rs +55 -0
- package/native/watchos/src/draw_list.rs +223 -0
- package/native/watchos/src/ffi_stubs.rs +454 -0
- package/native/watchos/src/lib.rs +1013 -0
- package/native/watchos/src/models.rs +746 -0
- package/native/watchos/src/postfx.rs +91 -0
- package/native/watchos/src/scene.rs +534 -0
- package/native/watchos/src/textures.rs +184 -0
- package/native/web/Cargo.lock +1656 -0
- package/native/web/Cargo.toml +38 -0
- package/native/web/bloom_glue.js +218 -0
- package/native/web/build.sh +101 -0
- package/native/web/index.html +390 -0
- package/native/web/jolt_bridge.js +1311 -0
- package/native/web/src/lib.rs +2739 -0
- package/native/windows/Cargo.lock +1813 -0
- package/native/windows/Cargo.toml +31 -0
- package/native/windows/src/lib.rs +1933 -0
- package/package.json +558 -0
- package/src/audio/index.ts +151 -0
- package/src/core/colors.ts +56 -0
- package/src/core/index.ts +903 -0
- package/src/core/keys.ts +63 -0
- package/src/core/types.ts +102 -0
- package/src/index.ts +158 -0
- package/src/math/index.ts +502 -0
- package/src/mobile/index.ts +294 -0
- package/src/models/index.ts +859 -0
- package/src/physics/index.ts +1072 -0
- package/src/scene/index.ts +570 -0
- package/src/shapes/index.ts +120 -0
- package/src/text/index.ts +48 -0
- package/src/textures/index.ts +173 -0
- package/src/world/index.ts +22 -0
- package/src/world/loader.ts +385 -0
- package/src/world/prefab.ts +205 -0
- package/src/world/saver.ts +61 -0
- package/src/world/terrain.ts +254 -0
- package/src/world/types.ts +136 -0
- package/src/world/validate.ts +202 -0
- package/src/world/version.ts +47 -0
|
@@ -0,0 +1,541 @@
|
|
|
1
|
+
// Jolt Physics Library (https://github.com/jrouwe/JoltPhysics)
|
|
2
|
+
// SPDX-FileCopyrightText: 2024 Jorrit Rouwe
|
|
3
|
+
// SPDX-License-Identifier: MIT
|
|
4
|
+
|
|
5
|
+
#include <Jolt/Jolt.h>
|
|
6
|
+
|
|
7
|
+
#include <Jolt/Physics/Collision/Shape/PlaneShape.h>
|
|
8
|
+
#include <Jolt/Physics/Collision/Shape/ConvexShape.h>
|
|
9
|
+
#include <Jolt/Physics/Collision/Shape/ScaleHelpers.h>
|
|
10
|
+
#include <Jolt/Physics/Collision/RayCast.h>
|
|
11
|
+
#include <Jolt/Physics/Collision/ShapeCast.h>
|
|
12
|
+
#include <Jolt/Physics/Collision/ShapeFilter.h>
|
|
13
|
+
#include <Jolt/Physics/Collision/CastResult.h>
|
|
14
|
+
#include <Jolt/Physics/Collision/CollisionDispatch.h>
|
|
15
|
+
#include <Jolt/Physics/Collision/TransformedShape.h>
|
|
16
|
+
#include <Jolt/Physics/Collision/CollidePointResult.h>
|
|
17
|
+
#include <Jolt/Physics/Collision/CollideSoftBodyVertexIterator.h>
|
|
18
|
+
#include <Jolt/Core/Profiler.h>
|
|
19
|
+
#include <Jolt/Core/StreamIn.h>
|
|
20
|
+
#include <Jolt/Core/StreamOut.h>
|
|
21
|
+
#include <Jolt/Geometry/Plane.h>
|
|
22
|
+
#include <Jolt/ObjectStream/TypeDeclarations.h>
|
|
23
|
+
#ifdef JPH_DEBUG_RENDERER
|
|
24
|
+
#include <Jolt/Renderer/DebugRenderer.h>
|
|
25
|
+
#endif // JPH_DEBUG_RENDERER
|
|
26
|
+
|
|
27
|
+
JPH_NAMESPACE_BEGIN
|
|
28
|
+
|
|
29
|
+
JPH_IMPLEMENT_SERIALIZABLE_VIRTUAL(PlaneShapeSettings)
|
|
30
|
+
{
|
|
31
|
+
JPH_ADD_BASE_CLASS(PlaneShapeSettings, ShapeSettings)
|
|
32
|
+
|
|
33
|
+
JPH_ADD_ATTRIBUTE(PlaneShapeSettings, mPlane)
|
|
34
|
+
JPH_ADD_ATTRIBUTE(PlaneShapeSettings, mMaterial)
|
|
35
|
+
JPH_ADD_ATTRIBUTE(PlaneShapeSettings, mHalfExtent)
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
ShapeSettings::ShapeResult PlaneShapeSettings::Create() const
|
|
39
|
+
{
|
|
40
|
+
if (mCachedResult.IsEmpty())
|
|
41
|
+
Ref<Shape> shape = new PlaneShape(*this, mCachedResult);
|
|
42
|
+
return mCachedResult;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
inline static void sPlaneGetOrthogonalBasis(Vec3Arg inNormal, Vec3 &outPerp1, Vec3 &outPerp2)
|
|
46
|
+
{
|
|
47
|
+
outPerp1 = inNormal.Cross(Vec3::sAxisY()).NormalizedOr(Vec3::sAxisX());
|
|
48
|
+
outPerp2 = outPerp1.Cross(inNormal).Normalized();
|
|
49
|
+
outPerp1 = inNormal.Cross(outPerp2);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
void PlaneShape::GetVertices(Vec3 *outVertices) const
|
|
53
|
+
{
|
|
54
|
+
// Create orthogonal basis
|
|
55
|
+
Vec3 normal = mPlane.GetNormal();
|
|
56
|
+
Vec3 perp1, perp2;
|
|
57
|
+
sPlaneGetOrthogonalBasis(normal, perp1, perp2);
|
|
58
|
+
|
|
59
|
+
// Scale basis
|
|
60
|
+
perp1 *= mHalfExtent;
|
|
61
|
+
perp2 *= mHalfExtent;
|
|
62
|
+
|
|
63
|
+
// Calculate corners
|
|
64
|
+
Vec3 point = -normal * mPlane.GetConstant();
|
|
65
|
+
outVertices[0] = point + perp1 + perp2;
|
|
66
|
+
outVertices[1] = point + perp1 - perp2;
|
|
67
|
+
outVertices[2] = point - perp1 - perp2;
|
|
68
|
+
outVertices[3] = point - perp1 + perp2;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
void PlaneShape::CalculateLocalBounds()
|
|
72
|
+
{
|
|
73
|
+
// Get the vertices of the plane
|
|
74
|
+
Vec3 vertices[4];
|
|
75
|
+
GetVertices(vertices);
|
|
76
|
+
|
|
77
|
+
// Encapsulate the vertices and a point mHalfExtent behind the plane
|
|
78
|
+
mLocalBounds = AABox();
|
|
79
|
+
Vec3 normal = mPlane.GetNormal();
|
|
80
|
+
for (const Vec3 &v : vertices)
|
|
81
|
+
{
|
|
82
|
+
mLocalBounds.Encapsulate(v);
|
|
83
|
+
mLocalBounds.Encapsulate(v - mHalfExtent * normal);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
PlaneShape::PlaneShape(const PlaneShapeSettings &inSettings, ShapeResult &outResult) :
|
|
88
|
+
Shape(EShapeType::Plane, EShapeSubType::Plane, inSettings, outResult),
|
|
89
|
+
mPlane(inSettings.mPlane),
|
|
90
|
+
mMaterial(inSettings.mMaterial),
|
|
91
|
+
mHalfExtent(inSettings.mHalfExtent)
|
|
92
|
+
{
|
|
93
|
+
if (!mPlane.GetNormal().IsNormalized())
|
|
94
|
+
{
|
|
95
|
+
outResult.SetError("Plane normal needs to be normalized!");
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
CalculateLocalBounds();
|
|
100
|
+
|
|
101
|
+
outResult.Set(this);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
MassProperties PlaneShape::GetMassProperties() const
|
|
105
|
+
{
|
|
106
|
+
// Object should always be static, return default mass properties
|
|
107
|
+
return MassProperties();
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
void PlaneShape::GetSupportingFace(const SubShapeID &inSubShapeID, Vec3Arg inDirection, Vec3Arg inScale, Mat44Arg inCenterOfMassTransform, SupportingFace &outVertices) const
|
|
111
|
+
{
|
|
112
|
+
// Get the vertices of the plane
|
|
113
|
+
Vec3 vertices[4];
|
|
114
|
+
GetVertices(vertices);
|
|
115
|
+
|
|
116
|
+
// Reverse if scale is inside out
|
|
117
|
+
if (ScaleHelpers::IsInsideOut(inScale))
|
|
118
|
+
{
|
|
119
|
+
std::swap(vertices[0], vertices[3]);
|
|
120
|
+
std::swap(vertices[1], vertices[2]);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
// Transform them to world space
|
|
124
|
+
outVertices.clear();
|
|
125
|
+
Mat44 com = inCenterOfMassTransform.PreScaled(inScale);
|
|
126
|
+
for (const Vec3 &v : vertices)
|
|
127
|
+
outVertices.push_back(com * v);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
#ifdef JPH_DEBUG_RENDERER
|
|
131
|
+
void PlaneShape::Draw(DebugRenderer *inRenderer, RMat44Arg inCenterOfMassTransform, Vec3Arg inScale, ColorArg inColor, bool inUseMaterialColors, bool inDrawWireframe) const
|
|
132
|
+
{
|
|
133
|
+
// Get the vertices of the plane
|
|
134
|
+
Vec3 local_vertices[4];
|
|
135
|
+
GetVertices(local_vertices);
|
|
136
|
+
|
|
137
|
+
// Reverse if scale is inside out
|
|
138
|
+
if (ScaleHelpers::IsInsideOut(inScale))
|
|
139
|
+
{
|
|
140
|
+
std::swap(local_vertices[0], local_vertices[3]);
|
|
141
|
+
std::swap(local_vertices[1], local_vertices[2]);
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
// Transform them to world space
|
|
145
|
+
RMat44 com = inCenterOfMassTransform.PreScaled(inScale);
|
|
146
|
+
RVec3 vertices[4];
|
|
147
|
+
for (uint i = 0; i < 4; ++i)
|
|
148
|
+
vertices[i] = com * local_vertices[i];
|
|
149
|
+
|
|
150
|
+
// Determine the color
|
|
151
|
+
Color color = inUseMaterialColors? GetMaterial(SubShapeID())->GetDebugColor() : inColor;
|
|
152
|
+
|
|
153
|
+
// Draw the plane
|
|
154
|
+
if (inDrawWireframe)
|
|
155
|
+
{
|
|
156
|
+
inRenderer->DrawWireTriangle(vertices[0], vertices[1], vertices[2], color);
|
|
157
|
+
inRenderer->DrawWireTriangle(vertices[0], vertices[2], vertices[3], color);
|
|
158
|
+
}
|
|
159
|
+
else
|
|
160
|
+
{
|
|
161
|
+
inRenderer->DrawTriangle(vertices[0], vertices[1], vertices[2], color, DebugRenderer::ECastShadow::On);
|
|
162
|
+
inRenderer->DrawTriangle(vertices[0], vertices[2], vertices[3], color, DebugRenderer::ECastShadow::On);
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
#endif // JPH_DEBUG_RENDERER
|
|
166
|
+
|
|
167
|
+
bool PlaneShape::CastRay(const RayCast &inRay, const SubShapeIDCreator &inSubShapeIDCreator, RayCastResult &ioHit) const
|
|
168
|
+
{
|
|
169
|
+
JPH_PROFILE_FUNCTION();
|
|
170
|
+
|
|
171
|
+
// Test starting inside of negative half space
|
|
172
|
+
float distance = mPlane.SignedDistance(inRay.mOrigin);
|
|
173
|
+
if (distance <= 0.0f)
|
|
174
|
+
{
|
|
175
|
+
ioHit.mFraction = 0.0f;
|
|
176
|
+
ioHit.mSubShapeID2 = inSubShapeIDCreator.GetID();
|
|
177
|
+
return true;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
// Test ray parallel to plane
|
|
181
|
+
float dot = inRay.mDirection.Dot(mPlane.GetNormal());
|
|
182
|
+
if (dot == 0.0f)
|
|
183
|
+
return false;
|
|
184
|
+
|
|
185
|
+
// Calculate hit fraction
|
|
186
|
+
float fraction = -distance / dot;
|
|
187
|
+
if (fraction >= 0.0f && fraction < ioHit.mFraction)
|
|
188
|
+
{
|
|
189
|
+
ioHit.mFraction = fraction;
|
|
190
|
+
ioHit.mSubShapeID2 = inSubShapeIDCreator.GetID();
|
|
191
|
+
return true;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
return false;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
void PlaneShape::CastRay(const RayCast &inRay, const RayCastSettings &inRayCastSettings, const SubShapeIDCreator &inSubShapeIDCreator, CastRayCollector &ioCollector, const ShapeFilter &inShapeFilter) const
|
|
198
|
+
{
|
|
199
|
+
JPH_PROFILE_FUNCTION();
|
|
200
|
+
|
|
201
|
+
// Test shape filter
|
|
202
|
+
if (!inShapeFilter.ShouldCollide(this, inSubShapeIDCreator.GetID()))
|
|
203
|
+
return;
|
|
204
|
+
|
|
205
|
+
// Inside solid half space?
|
|
206
|
+
float distance = mPlane.SignedDistance(inRay.mOrigin);
|
|
207
|
+
if (inRayCastSettings.mTreatConvexAsSolid
|
|
208
|
+
&& distance <= 0.0f // Inside plane
|
|
209
|
+
&& ioCollector.GetEarlyOutFraction() > 0.0f) // Willing to accept hits at fraction 0
|
|
210
|
+
{
|
|
211
|
+
// Hit at fraction 0
|
|
212
|
+
RayCastResult hit;
|
|
213
|
+
hit.mBodyID = TransformedShape::sGetBodyID(ioCollector.GetContext());
|
|
214
|
+
hit.mFraction = 0.0f;
|
|
215
|
+
hit.mSubShapeID2 = inSubShapeIDCreator.GetID();
|
|
216
|
+
ioCollector.AddHit(hit);
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
float dot = inRay.mDirection.Dot(mPlane.GetNormal());
|
|
220
|
+
if (dot != 0.0f // Parallel ray will not hit plane
|
|
221
|
+
&& (inRayCastSettings.mBackFaceModeConvex == EBackFaceMode::CollideWithBackFaces || dot < 0.0f)) // Back face culling
|
|
222
|
+
{
|
|
223
|
+
// Calculate hit with plane
|
|
224
|
+
float fraction = -distance / dot;
|
|
225
|
+
if (fraction >= 0.0f && fraction < ioCollector.GetEarlyOutFraction())
|
|
226
|
+
{
|
|
227
|
+
RayCastResult hit;
|
|
228
|
+
hit.mBodyID = TransformedShape::sGetBodyID(ioCollector.GetContext());
|
|
229
|
+
hit.mFraction = fraction;
|
|
230
|
+
hit.mSubShapeID2 = inSubShapeIDCreator.GetID();
|
|
231
|
+
ioCollector.AddHit(hit);
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
void PlaneShape::CollidePoint(Vec3Arg inPoint, const SubShapeIDCreator &inSubShapeIDCreator, CollidePointCollector &ioCollector, const ShapeFilter &inShapeFilter) const
|
|
237
|
+
{
|
|
238
|
+
JPH_PROFILE_FUNCTION();
|
|
239
|
+
|
|
240
|
+
// Test shape filter
|
|
241
|
+
if (!inShapeFilter.ShouldCollide(this, inSubShapeIDCreator.GetID()))
|
|
242
|
+
return;
|
|
243
|
+
|
|
244
|
+
// Check if the point is inside the plane
|
|
245
|
+
if (mPlane.SignedDistance(inPoint) < 0.0f)
|
|
246
|
+
ioCollector.AddHit({ TransformedShape::sGetBodyID(ioCollector.GetContext()), inSubShapeIDCreator.GetID() });
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
void PlaneShape::CollideSoftBodyVertices(Mat44Arg inCenterOfMassTransform, Vec3Arg inScale, const CollideSoftBodyVertexIterator &inVertices, uint inNumVertices, int inCollidingShapeIndex) const
|
|
250
|
+
{
|
|
251
|
+
JPH_PROFILE_FUNCTION();
|
|
252
|
+
|
|
253
|
+
// Convert plane to world space
|
|
254
|
+
Plane plane = mPlane.Scaled(inScale).GetTransformed(inCenterOfMassTransform);
|
|
255
|
+
|
|
256
|
+
for (CollideSoftBodyVertexIterator v = inVertices, sbv_end = inVertices + inNumVertices; v != sbv_end; ++v)
|
|
257
|
+
if (v.GetInvMass() > 0.0f)
|
|
258
|
+
{
|
|
259
|
+
// Calculate penetration
|
|
260
|
+
float penetration = -plane.SignedDistance(v.GetPosition());
|
|
261
|
+
if (v.UpdatePenetration(penetration))
|
|
262
|
+
v.SetCollision(plane, inCollidingShapeIndex);
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
// This is a version of GetSupportingFace that returns a face that is large enough to cover the shape we're colliding with but not as large as the regular GetSupportedFace to avoid numerical precision issues
|
|
267
|
+
inline static void sGetSupportingFace(const ConvexShape *inShape, Vec3Arg inShapeCOM, const Plane &inPlane, Mat44Arg inPlaneToWorld, ConvexShape::SupportingFace &outPlaneFace)
|
|
268
|
+
{
|
|
269
|
+
// Project COM of shape onto plane
|
|
270
|
+
Plane world_plane = inPlane.GetTransformed(inPlaneToWorld);
|
|
271
|
+
Vec3 center = world_plane.ProjectPointOnPlane(inShapeCOM);
|
|
272
|
+
|
|
273
|
+
// Create orthogonal basis for the plane
|
|
274
|
+
Vec3 normal = world_plane.GetNormal();
|
|
275
|
+
Vec3 perp1, perp2;
|
|
276
|
+
sPlaneGetOrthogonalBasis(normal, perp1, perp2);
|
|
277
|
+
|
|
278
|
+
// Base the size of the face on the bounding box of the shape, ensuring that it is large enough to cover the entire shape
|
|
279
|
+
float size = inShape->GetLocalBounds().GetSize().Length();
|
|
280
|
+
perp1 *= size;
|
|
281
|
+
perp2 *= size;
|
|
282
|
+
|
|
283
|
+
// Emit the vertices
|
|
284
|
+
outPlaneFace.resize(4);
|
|
285
|
+
outPlaneFace[0] = center + perp1 + perp2;
|
|
286
|
+
outPlaneFace[1] = center + perp1 - perp2;
|
|
287
|
+
outPlaneFace[2] = center - perp1 - perp2;
|
|
288
|
+
outPlaneFace[3] = center - perp1 + perp2;
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
void PlaneShape::sCastConvexVsPlane(const ShapeCast &inShapeCast, const ShapeCastSettings &inShapeCastSettings, const Shape *inShape, Vec3Arg inScale, [[maybe_unused]] const ShapeFilter &inShapeFilter, Mat44Arg inCenterOfMassTransform2, const SubShapeIDCreator &inSubShapeIDCreator1, const SubShapeIDCreator &inSubShapeIDCreator2, CastShapeCollector &ioCollector)
|
|
292
|
+
{
|
|
293
|
+
JPH_PROFILE_FUNCTION();
|
|
294
|
+
|
|
295
|
+
// Get the shapes
|
|
296
|
+
JPH_ASSERT(inShapeCast.mShape->GetType() == EShapeType::Convex);
|
|
297
|
+
JPH_ASSERT(inShape->GetType() == EShapeType::Plane);
|
|
298
|
+
const ConvexShape *convex_shape = static_cast<const ConvexShape *>(inShapeCast.mShape);
|
|
299
|
+
const PlaneShape *plane_shape = static_cast<const PlaneShape *>(inShape);
|
|
300
|
+
|
|
301
|
+
// Shape cast is provided relative to COM of inShape, so all we need to do is transform our plane with inScale
|
|
302
|
+
Plane plane = plane_shape->mPlane.Scaled(inScale);
|
|
303
|
+
Vec3 normal = plane.GetNormal();
|
|
304
|
+
|
|
305
|
+
// Get support function
|
|
306
|
+
ConvexShape::SupportBuffer shape1_support_buffer;
|
|
307
|
+
const ConvexShape::Support *shape1_support = convex_shape->GetSupportFunction(ConvexShape::ESupportMode::Default, shape1_support_buffer, inShapeCast.mScale);
|
|
308
|
+
|
|
309
|
+
// Get the support point of the convex shape in the opposite direction of the plane normal in our local space
|
|
310
|
+
Vec3 normal_in_convex_shape_space = inShapeCast.mCenterOfMassStart.Multiply3x3Transposed(normal);
|
|
311
|
+
Vec3 support_point = inShapeCast.mCenterOfMassStart * shape1_support->GetSupport(-normal_in_convex_shape_space);
|
|
312
|
+
float signed_distance = plane.SignedDistance(support_point);
|
|
313
|
+
float convex_radius = shape1_support->GetConvexRadius();
|
|
314
|
+
float penetration_depth = -signed_distance + convex_radius;
|
|
315
|
+
float dot = inShapeCast.mDirection.Dot(normal);
|
|
316
|
+
|
|
317
|
+
// Collision output
|
|
318
|
+
Mat44 com_hit;
|
|
319
|
+
Vec3 point1, point2;
|
|
320
|
+
float fraction;
|
|
321
|
+
|
|
322
|
+
// Do we start in collision?
|
|
323
|
+
if (penetration_depth > 0.0f)
|
|
324
|
+
{
|
|
325
|
+
// Back face culling?
|
|
326
|
+
if (inShapeCastSettings.mBackFaceModeConvex == EBackFaceMode::IgnoreBackFaces && dot > 0.0f)
|
|
327
|
+
return;
|
|
328
|
+
|
|
329
|
+
// Shallower hit?
|
|
330
|
+
if (penetration_depth <= -ioCollector.GetEarlyOutFraction())
|
|
331
|
+
return;
|
|
332
|
+
|
|
333
|
+
// We're hitting at fraction 0
|
|
334
|
+
fraction = 0.0f;
|
|
335
|
+
|
|
336
|
+
// Get contact point
|
|
337
|
+
com_hit = inCenterOfMassTransform2;
|
|
338
|
+
point1 = inCenterOfMassTransform2 * (support_point - normal * convex_radius);
|
|
339
|
+
point2 = inCenterOfMassTransform2 * (support_point - normal * signed_distance);
|
|
340
|
+
}
|
|
341
|
+
else if (dot < 0.0f) // Moving towards the plane?
|
|
342
|
+
{
|
|
343
|
+
// Calculate hit fraction
|
|
344
|
+
fraction = penetration_depth / dot;
|
|
345
|
+
JPH_ASSERT(fraction >= 0.0f);
|
|
346
|
+
|
|
347
|
+
// Further than early out fraction?
|
|
348
|
+
if (fraction >= ioCollector.GetEarlyOutFraction())
|
|
349
|
+
return;
|
|
350
|
+
|
|
351
|
+
// Get contact point
|
|
352
|
+
com_hit = inCenterOfMassTransform2.PostTranslated(fraction * inShapeCast.mDirection);
|
|
353
|
+
point1 = point2 = com_hit * (support_point - normal * convex_radius);
|
|
354
|
+
}
|
|
355
|
+
else
|
|
356
|
+
{
|
|
357
|
+
// Moving away from the plane
|
|
358
|
+
return;
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
// Create cast result
|
|
362
|
+
Vec3 penetration_axis_world = com_hit.Multiply3x3(-normal);
|
|
363
|
+
bool back_facing = dot > 0.0f;
|
|
364
|
+
ShapeCastResult result(fraction, point1, point2, penetration_axis_world, back_facing, inSubShapeIDCreator1.GetID(), inSubShapeIDCreator2.GetID(), TransformedShape::sGetBodyID(ioCollector.GetContext()));
|
|
365
|
+
|
|
366
|
+
// Gather faces
|
|
367
|
+
if (inShapeCastSettings.mCollectFacesMode == ECollectFacesMode::CollectFaces)
|
|
368
|
+
{
|
|
369
|
+
// Get supporting face of convex shape
|
|
370
|
+
Mat44 shape_to_world = com_hit * inShapeCast.mCenterOfMassStart;
|
|
371
|
+
convex_shape->GetSupportingFace(SubShapeID(), normal_in_convex_shape_space, inShapeCast.mScale, shape_to_world, result.mShape1Face);
|
|
372
|
+
|
|
373
|
+
// Get supporting face of plane
|
|
374
|
+
if (!result.mShape1Face.empty())
|
|
375
|
+
sGetSupportingFace(convex_shape, shape_to_world.GetTranslation(), plane, inCenterOfMassTransform2, result.mShape2Face);
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
// Notify the collector
|
|
379
|
+
JPH_IF_TRACK_NARROWPHASE_STATS(TrackNarrowPhaseCollector track;)
|
|
380
|
+
ioCollector.AddHit(result);
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
struct PlaneShape::PSGetTrianglesContext
|
|
384
|
+
{
|
|
385
|
+
Float3 mVertices[4];
|
|
386
|
+
bool mDone = false;
|
|
387
|
+
};
|
|
388
|
+
|
|
389
|
+
void PlaneShape::GetTrianglesStart(GetTrianglesContext &ioContext, const AABox &inBox, Vec3Arg inPositionCOM, QuatArg inRotation, Vec3Arg inScale) const
|
|
390
|
+
{
|
|
391
|
+
static_assert(sizeof(PSGetTrianglesContext) <= sizeof(GetTrianglesContext), "GetTrianglesContext too small");
|
|
392
|
+
JPH_ASSERT(IsAligned(&ioContext, alignof(PSGetTrianglesContext)));
|
|
393
|
+
|
|
394
|
+
PSGetTrianglesContext *context = new (&ioContext) PSGetTrianglesContext();
|
|
395
|
+
|
|
396
|
+
// Get the vertices of the plane
|
|
397
|
+
Vec3 vertices[4];
|
|
398
|
+
GetVertices(vertices);
|
|
399
|
+
|
|
400
|
+
// Reverse if scale is inside out
|
|
401
|
+
if (ScaleHelpers::IsInsideOut(inScale))
|
|
402
|
+
{
|
|
403
|
+
std::swap(vertices[0], vertices[3]);
|
|
404
|
+
std::swap(vertices[1], vertices[2]);
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
// Transform them to world space
|
|
408
|
+
Mat44 com = Mat44::sRotationTranslation(inRotation, inPositionCOM).PreScaled(inScale);
|
|
409
|
+
for (uint i = 0; i < 4; ++i)
|
|
410
|
+
(com * vertices[i]).StoreFloat3(&context->mVertices[i]);
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
int PlaneShape::GetTrianglesNext(GetTrianglesContext &ioContext, int inMaxTrianglesRequested, Float3 *outTriangleVertices, const PhysicsMaterial **outMaterials) const
|
|
414
|
+
{
|
|
415
|
+
static_assert(cGetTrianglesMinTrianglesRequested >= 2, "cGetTrianglesMinTrianglesRequested is too small");
|
|
416
|
+
JPH_ASSERT(inMaxTrianglesRequested >= cGetTrianglesMinTrianglesRequested);
|
|
417
|
+
|
|
418
|
+
// Check if we're done
|
|
419
|
+
PSGetTrianglesContext &context = (PSGetTrianglesContext &)ioContext;
|
|
420
|
+
if (context.mDone)
|
|
421
|
+
return 0;
|
|
422
|
+
context.mDone = true;
|
|
423
|
+
|
|
424
|
+
// 1st triangle
|
|
425
|
+
outTriangleVertices[0] = context.mVertices[0];
|
|
426
|
+
outTriangleVertices[1] = context.mVertices[1];
|
|
427
|
+
outTriangleVertices[2] = context.mVertices[2];
|
|
428
|
+
|
|
429
|
+
// 2nd triangle
|
|
430
|
+
outTriangleVertices[3] = context.mVertices[0];
|
|
431
|
+
outTriangleVertices[4] = context.mVertices[2];
|
|
432
|
+
outTriangleVertices[5] = context.mVertices[3];
|
|
433
|
+
|
|
434
|
+
if (outMaterials != nullptr)
|
|
435
|
+
{
|
|
436
|
+
// Get material
|
|
437
|
+
const PhysicsMaterial *material = GetMaterial(SubShapeID());
|
|
438
|
+
outMaterials[0] = material;
|
|
439
|
+
outMaterials[1] = material;
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
return 2;
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
void PlaneShape::sCollideConvexVsPlane(const Shape *inShape1, const Shape *inShape2, Vec3Arg inScale1, Vec3Arg inScale2, Mat44Arg inCenterOfMassTransform1, Mat44Arg inCenterOfMassTransform2, const SubShapeIDCreator &inSubShapeIDCreator1, const SubShapeIDCreator &inSubShapeIDCreator2, const CollideShapeSettings &inCollideShapeSettings, CollideShapeCollector &ioCollector, [[maybe_unused]] const ShapeFilter &inShapeFilter)
|
|
446
|
+
{
|
|
447
|
+
JPH_PROFILE_FUNCTION();
|
|
448
|
+
|
|
449
|
+
// Get the shapes
|
|
450
|
+
JPH_ASSERT(inShape1->GetType() == EShapeType::Convex);
|
|
451
|
+
JPH_ASSERT(inShape2->GetType() == EShapeType::Plane);
|
|
452
|
+
const ConvexShape *shape1 = static_cast<const ConvexShape *>(inShape1);
|
|
453
|
+
const PlaneShape *shape2 = static_cast<const PlaneShape *>(inShape2);
|
|
454
|
+
|
|
455
|
+
// Transform the plane to the space of the convex shape
|
|
456
|
+
Plane scaled_plane = shape2->mPlane.Scaled(inScale2);
|
|
457
|
+
Plane plane = scaled_plane.GetTransformed(inCenterOfMassTransform1.InversedRotationTranslation() * inCenterOfMassTransform2);
|
|
458
|
+
Vec3 normal = plane.GetNormal();
|
|
459
|
+
|
|
460
|
+
// Get support function
|
|
461
|
+
ConvexShape::SupportBuffer shape1_support_buffer;
|
|
462
|
+
const ConvexShape::Support *shape1_support = shape1->GetSupportFunction(ConvexShape::ESupportMode::Default, shape1_support_buffer, inScale1);
|
|
463
|
+
|
|
464
|
+
// Get the support point of the convex shape in the opposite direction of the plane normal
|
|
465
|
+
Vec3 support_point = shape1_support->GetSupport(-normal);
|
|
466
|
+
float signed_distance = plane.SignedDistance(support_point);
|
|
467
|
+
float convex_radius = shape1_support->GetConvexRadius();
|
|
468
|
+
float penetration_depth = -signed_distance + convex_radius;
|
|
469
|
+
if (penetration_depth > -inCollideShapeSettings.mMaxSeparationDistance)
|
|
470
|
+
{
|
|
471
|
+
// Get contact point
|
|
472
|
+
Vec3 point1 = inCenterOfMassTransform1 * (support_point - normal * convex_radius);
|
|
473
|
+
Vec3 point2 = inCenterOfMassTransform1 * (support_point - normal * signed_distance);
|
|
474
|
+
Vec3 penetration_axis_world = inCenterOfMassTransform1.Multiply3x3(-normal);
|
|
475
|
+
|
|
476
|
+
// Create collision result
|
|
477
|
+
CollideShapeResult result(point1, point2, penetration_axis_world, penetration_depth, inSubShapeIDCreator1.GetID(), inSubShapeIDCreator2.GetID(), TransformedShape::sGetBodyID(ioCollector.GetContext()));
|
|
478
|
+
|
|
479
|
+
// Gather faces
|
|
480
|
+
if (inCollideShapeSettings.mCollectFacesMode == ECollectFacesMode::CollectFaces)
|
|
481
|
+
{
|
|
482
|
+
// Get supporting face of shape 1
|
|
483
|
+
shape1->GetSupportingFace(SubShapeID(), normal, inScale1, inCenterOfMassTransform1, result.mShape1Face);
|
|
484
|
+
|
|
485
|
+
// Get supporting face of shape 2
|
|
486
|
+
if (!result.mShape1Face.empty())
|
|
487
|
+
sGetSupportingFace(shape1, inCenterOfMassTransform1.GetTranslation(), scaled_plane, inCenterOfMassTransform2, result.mShape2Face);
|
|
488
|
+
}
|
|
489
|
+
|
|
490
|
+
// Notify the collector
|
|
491
|
+
JPH_IF_TRACK_NARROWPHASE_STATS(TrackNarrowPhaseCollector track;)
|
|
492
|
+
ioCollector.AddHit(result);
|
|
493
|
+
}
|
|
494
|
+
}
|
|
495
|
+
|
|
496
|
+
void PlaneShape::SaveBinaryState(StreamOut &inStream) const
|
|
497
|
+
{
|
|
498
|
+
Shape::SaveBinaryState(inStream);
|
|
499
|
+
|
|
500
|
+
inStream.Write(mPlane);
|
|
501
|
+
inStream.Write(mHalfExtent);
|
|
502
|
+
}
|
|
503
|
+
|
|
504
|
+
void PlaneShape::RestoreBinaryState(StreamIn &inStream)
|
|
505
|
+
{
|
|
506
|
+
Shape::RestoreBinaryState(inStream);
|
|
507
|
+
|
|
508
|
+
inStream.Read(mPlane);
|
|
509
|
+
inStream.Read(mHalfExtent);
|
|
510
|
+
|
|
511
|
+
CalculateLocalBounds();
|
|
512
|
+
}
|
|
513
|
+
|
|
514
|
+
void PlaneShape::SaveMaterialState(PhysicsMaterialList &outMaterials) const
|
|
515
|
+
{
|
|
516
|
+
outMaterials = { mMaterial };
|
|
517
|
+
}
|
|
518
|
+
|
|
519
|
+
void PlaneShape::RestoreMaterialState(const PhysicsMaterialRefC *inMaterials, uint inNumMaterials)
|
|
520
|
+
{
|
|
521
|
+
JPH_ASSERT(inNumMaterials == 1);
|
|
522
|
+
mMaterial = inMaterials[0];
|
|
523
|
+
}
|
|
524
|
+
|
|
525
|
+
void PlaneShape::sRegister()
|
|
526
|
+
{
|
|
527
|
+
ShapeFunctions &f = ShapeFunctions::sGet(EShapeSubType::Plane);
|
|
528
|
+
f.mConstruct = []() -> Shape * { return new PlaneShape; };
|
|
529
|
+
f.mColor = Color::sDarkRed;
|
|
530
|
+
|
|
531
|
+
for (EShapeSubType s : sConvexSubShapeTypes)
|
|
532
|
+
{
|
|
533
|
+
CollisionDispatch::sRegisterCollideShape(s, EShapeSubType::Plane, sCollideConvexVsPlane);
|
|
534
|
+
CollisionDispatch::sRegisterCastShape(s, EShapeSubType::Plane, sCastConvexVsPlane);
|
|
535
|
+
|
|
536
|
+
CollisionDispatch::sRegisterCastShape(EShapeSubType::Plane, s, CollisionDispatch::sReversedCastShape);
|
|
537
|
+
CollisionDispatch::sRegisterCollideShape(EShapeSubType::Plane, s, CollisionDispatch::sReversedCollideShape);
|
|
538
|
+
}
|
|
539
|
+
}
|
|
540
|
+
|
|
541
|
+
JPH_NAMESPACE_END
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
// Jolt Physics Library (https://github.com/jrouwe/JoltPhysics)
|
|
2
|
+
// SPDX-FileCopyrightText: 2024 Jorrit Rouwe
|
|
3
|
+
// SPDX-License-Identifier: MIT
|
|
4
|
+
|
|
5
|
+
#pragma once
|
|
6
|
+
|
|
7
|
+
#include <Jolt/Physics/Collision/Shape/Shape.h>
|
|
8
|
+
#include <Jolt/Physics/Collision/Shape/SubShapeID.h>
|
|
9
|
+
#include <Jolt/Physics/Collision/PhysicsMaterial.h>
|
|
10
|
+
|
|
11
|
+
JPH_NAMESPACE_BEGIN
|
|
12
|
+
|
|
13
|
+
class CollideShapeSettings;
|
|
14
|
+
|
|
15
|
+
/// Class that constructs a PlaneShape
|
|
16
|
+
class JPH_EXPORT PlaneShapeSettings final : public ShapeSettings
|
|
17
|
+
{
|
|
18
|
+
JPH_DECLARE_SERIALIZABLE_VIRTUAL(JPH_EXPORT, PlaneShapeSettings)
|
|
19
|
+
|
|
20
|
+
public:
|
|
21
|
+
/// Default constructor for deserialization
|
|
22
|
+
PlaneShapeSettings() = default;
|
|
23
|
+
|
|
24
|
+
/// Create a plane shape.
|
|
25
|
+
explicit PlaneShapeSettings(const Plane &inPlane, const PhysicsMaterial *inMaterial = nullptr, float inHalfExtent = cDefaultHalfExtent) : mPlane(inPlane), mMaterial(inMaterial), mHalfExtent(inHalfExtent) { }
|
|
26
|
+
|
|
27
|
+
// See: ShapeSettings
|
|
28
|
+
virtual ShapeResult Create() const override;
|
|
29
|
+
|
|
30
|
+
Plane mPlane; ///< Plane that describes the shape. The negative half space is considered solid.
|
|
31
|
+
|
|
32
|
+
RefConst<PhysicsMaterial> mMaterial; ///< Surface material of the plane
|
|
33
|
+
|
|
34
|
+
static constexpr float cDefaultHalfExtent = 1000.0f; ///< Default half-extent of the plane (total size along 1 axis will be 2 * half-extent)
|
|
35
|
+
|
|
36
|
+
float mHalfExtent = cDefaultHalfExtent; ///< The bounding box of this plane will run from [-half_extent, half_extent]. Keep this as low as possible for better broad phase performance.
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
/// A plane shape. The negative half space is considered solid. Planes cannot be dynamic objects, only static or kinematic.
|
|
40
|
+
/// The plane is considered an infinite shape, but testing collision outside of its bounding box (defined by the half-extent parameter) will not return a collision result.
|
|
41
|
+
/// At the edge of the bounding box collision with the plane will be inconsistent. If you need something of a well defined size, a box shape may be better.
|
|
42
|
+
class JPH_EXPORT PlaneShape final : public Shape
|
|
43
|
+
{
|
|
44
|
+
public:
|
|
45
|
+
JPH_OVERRIDE_NEW_DELETE
|
|
46
|
+
|
|
47
|
+
/// Constructor
|
|
48
|
+
PlaneShape() : Shape(EShapeType::Plane, EShapeSubType::Plane) { }
|
|
49
|
+
explicit PlaneShape(const Plane &inPlane, const PhysicsMaterial *inMaterial = nullptr, float inHalfExtent = PlaneShapeSettings::cDefaultHalfExtent) : Shape(EShapeType::Plane, EShapeSubType::Plane), mPlane(inPlane), mMaterial(inMaterial), mHalfExtent(inHalfExtent) { CalculateLocalBounds(); }
|
|
50
|
+
PlaneShape(const PlaneShapeSettings &inSettings, ShapeResult &outResult);
|
|
51
|
+
|
|
52
|
+
/// Get the plane
|
|
53
|
+
const Plane & GetPlane() const { return mPlane; }
|
|
54
|
+
|
|
55
|
+
/// Get the half-extent of the bounding box of the plane
|
|
56
|
+
float GetHalfExtent() const { return mHalfExtent; }
|
|
57
|
+
|
|
58
|
+
// See Shape::MustBeStatic
|
|
59
|
+
virtual bool MustBeStatic() const override { return true; }
|
|
60
|
+
|
|
61
|
+
// See Shape::GetLocalBounds
|
|
62
|
+
virtual AABox GetLocalBounds() const override { return mLocalBounds; }
|
|
63
|
+
|
|
64
|
+
// See Shape::GetSubShapeIDBitsRecursive
|
|
65
|
+
virtual uint GetSubShapeIDBitsRecursive() const override { return 0; }
|
|
66
|
+
|
|
67
|
+
// See Shape::GetInnerRadius
|
|
68
|
+
virtual float GetInnerRadius() const override { return 0.0f; }
|
|
69
|
+
|
|
70
|
+
// See Shape::GetMassProperties
|
|
71
|
+
virtual MassProperties GetMassProperties() const override;
|
|
72
|
+
|
|
73
|
+
// See Shape::GetMaterial
|
|
74
|
+
virtual const PhysicsMaterial * GetMaterial(const SubShapeID &inSubShapeID) const override { JPH_ASSERT(inSubShapeID.IsEmpty(), "Invalid subshape ID"); return GetMaterial(); }
|
|
75
|
+
|
|
76
|
+
// See Shape::GetSurfaceNormal
|
|
77
|
+
virtual Vec3 GetSurfaceNormal(const SubShapeID &inSubShapeID, Vec3Arg inLocalSurfacePosition) const override { JPH_ASSERT(inSubShapeID.IsEmpty(), "Invalid subshape ID"); return mPlane.GetNormal(); }
|
|
78
|
+
|
|
79
|
+
// See Shape::GetSupportingFace
|
|
80
|
+
virtual void GetSupportingFace(const SubShapeID &inSubShapeID, Vec3Arg inDirection, Vec3Arg inScale, Mat44Arg inCenterOfMassTransform, SupportingFace &outVertices) const override;
|
|
81
|
+
|
|
82
|
+
#ifdef JPH_DEBUG_RENDERER
|
|
83
|
+
// See Shape::Draw
|
|
84
|
+
virtual void Draw(DebugRenderer *inRenderer, RMat44Arg inCenterOfMassTransform, Vec3Arg inScale, ColorArg inColor, bool inUseMaterialColors, bool inDrawWireframe) const override;
|
|
85
|
+
#endif // JPH_DEBUG_RENDERER
|
|
86
|
+
|
|
87
|
+
// See Shape::CastRay
|
|
88
|
+
virtual bool CastRay(const RayCast &inRay, const SubShapeIDCreator &inSubShapeIDCreator, RayCastResult &ioHit) const override;
|
|
89
|
+
virtual void CastRay(const RayCast &inRay, const RayCastSettings &inRayCastSettings, const SubShapeIDCreator &inSubShapeIDCreator, CastRayCollector &ioCollector, const ShapeFilter &inShapeFilter = { }) const override;
|
|
90
|
+
|
|
91
|
+
// See: Shape::CollidePoint
|
|
92
|
+
virtual void CollidePoint(Vec3Arg inPoint, const SubShapeIDCreator &inSubShapeIDCreator, CollidePointCollector &ioCollector, const ShapeFilter &inShapeFilter = { }) const override;
|
|
93
|
+
|
|
94
|
+
// See: Shape::CollideSoftBodyVertices
|
|
95
|
+
virtual void CollideSoftBodyVertices(Mat44Arg inCenterOfMassTransform, Vec3Arg inScale, const CollideSoftBodyVertexIterator &inVertices, uint inNumVertices, int inCollidingShapeIndex) const override;
|
|
96
|
+
|
|
97
|
+
// See Shape::GetTrianglesStart
|
|
98
|
+
virtual void GetTrianglesStart(GetTrianglesContext &ioContext, const AABox &inBox, Vec3Arg inPositionCOM, QuatArg inRotation, Vec3Arg inScale) const override;
|
|
99
|
+
|
|
100
|
+
// See Shape::GetTrianglesNext
|
|
101
|
+
virtual int GetTrianglesNext(GetTrianglesContext &ioContext, int inMaxTrianglesRequested, Float3 *outTriangleVertices, const PhysicsMaterial **outMaterials = nullptr) const override;
|
|
102
|
+
|
|
103
|
+
// See Shape::GetSubmergedVolume
|
|
104
|
+
virtual void GetSubmergedVolume(Mat44Arg inCenterOfMassTransform, Vec3Arg inScale, const Plane &inSurface, float &outTotalVolume, float &outSubmergedVolume, Vec3 &outCenterOfBuoyancy JPH_IF_DEBUG_RENDERER(, RVec3Arg inBaseOffset)) const override { JPH_ASSERT(false, "Not supported"); }
|
|
105
|
+
|
|
106
|
+
// See Shape
|
|
107
|
+
virtual void SaveBinaryState(StreamOut &inStream) const override;
|
|
108
|
+
virtual void SaveMaterialState(PhysicsMaterialList &outMaterials) const override;
|
|
109
|
+
virtual void RestoreMaterialState(const PhysicsMaterialRefC *inMaterials, uint inNumMaterials) override;
|
|
110
|
+
|
|
111
|
+
// See Shape::GetStats
|
|
112
|
+
virtual Stats GetStats() const override { return Stats(sizeof(*this), 0); }
|
|
113
|
+
|
|
114
|
+
// See Shape::GetVolume
|
|
115
|
+
virtual float GetVolume() const override { return 0; }
|
|
116
|
+
|
|
117
|
+
/// Material of the shape
|
|
118
|
+
void SetMaterial(const PhysicsMaterial *inMaterial) { mMaterial = inMaterial; }
|
|
119
|
+
const PhysicsMaterial * GetMaterial() const { return mMaterial != nullptr? mMaterial : PhysicsMaterial::sDefault; }
|
|
120
|
+
|
|
121
|
+
// Register shape functions with the registry
|
|
122
|
+
static void sRegister();
|
|
123
|
+
|
|
124
|
+
protected:
|
|
125
|
+
// See: Shape::RestoreBinaryState
|
|
126
|
+
virtual void RestoreBinaryState(StreamIn &inStream) override;
|
|
127
|
+
|
|
128
|
+
private:
|
|
129
|
+
struct PSGetTrianglesContext; ///< Context class for GetTrianglesStart/Next
|
|
130
|
+
|
|
131
|
+
// Get 4 vertices that form the plane
|
|
132
|
+
void GetVertices(Vec3 *outVertices) const;
|
|
133
|
+
|
|
134
|
+
// Cache the local bounds
|
|
135
|
+
void CalculateLocalBounds();
|
|
136
|
+
|
|
137
|
+
// Helper functions called by CollisionDispatch
|
|
138
|
+
static void sCollideConvexVsPlane(const Shape *inShape1, const Shape *inShape2, Vec3Arg inScale1, Vec3Arg inScale2, Mat44Arg inCenterOfMassTransform1, Mat44Arg inCenterOfMassTransform2, const SubShapeIDCreator &inSubShapeIDCreator1, const SubShapeIDCreator &inSubShapeIDCreator2, const CollideShapeSettings &inCollideShapeSettings, CollideShapeCollector &ioCollector, const ShapeFilter &inShapeFilter);
|
|
139
|
+
static void sCastConvexVsPlane(const ShapeCast &inShapeCast, const ShapeCastSettings &inShapeCastSettings, const Shape *inShape, Vec3Arg inScale, const ShapeFilter &inShapeFilter, Mat44Arg inCenterOfMassTransform2, const SubShapeIDCreator &inSubShapeIDCreator1, const SubShapeIDCreator &inSubShapeIDCreator2, CastShapeCollector &ioCollector);
|
|
140
|
+
|
|
141
|
+
Plane mPlane;
|
|
142
|
+
RefConst<PhysicsMaterial> mMaterial;
|
|
143
|
+
float mHalfExtent;
|
|
144
|
+
AABox mLocalBounds;
|
|
145
|
+
};
|
|
146
|
+
|
|
147
|
+
JPH_NAMESPACE_END
|