@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,822 @@
|
|
|
1
|
+
//! Raw FFI bindings to the `bloom_jolt` C++ shim.
|
|
2
|
+
//!
|
|
3
|
+
//! One-to-one mapping of `native/third_party/bloom_jolt/include/bloom_jolt.h`.
|
|
4
|
+
//! Higher-level Rust types and the Perry-facing FFI live in `physics_jolt.rs`.
|
|
5
|
+
|
|
6
|
+
#![allow(non_camel_case_types, non_snake_case, dead_code)]
|
|
7
|
+
|
|
8
|
+
use std::os::raw::c_char;
|
|
9
|
+
|
|
10
|
+
// ---------------------------------------------------------------------------
|
|
11
|
+
// Handles
|
|
12
|
+
// ---------------------------------------------------------------------------
|
|
13
|
+
|
|
14
|
+
pub type bj_world = u64;
|
|
15
|
+
pub type bj_shape = u64;
|
|
16
|
+
pub type bj_body = u64;
|
|
17
|
+
pub type bj_constraint = u64;
|
|
18
|
+
pub type bj_character = u64;
|
|
19
|
+
pub type bj_vehicle = u64;
|
|
20
|
+
|
|
21
|
+
pub const BJ_INVALID: u64 = 0;
|
|
22
|
+
pub const BJ_MAX_OBJECT_LAYERS: u32 = 16;
|
|
23
|
+
|
|
24
|
+
// ---------------------------------------------------------------------------
|
|
25
|
+
// Enums (match C `typedef enum`; layout: C int = 4 bytes on all supported targets)
|
|
26
|
+
// ---------------------------------------------------------------------------
|
|
27
|
+
|
|
28
|
+
#[repr(u32)]
|
|
29
|
+
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
|
|
30
|
+
pub enum BjMotionType {
|
|
31
|
+
Static = 0,
|
|
32
|
+
Kinematic = 1,
|
|
33
|
+
Dynamic = 2,
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
#[repr(u32)]
|
|
37
|
+
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
|
|
38
|
+
pub enum BjDefaultLayer {
|
|
39
|
+
NonMoving = 0,
|
|
40
|
+
Moving = 1,
|
|
41
|
+
Sensor = 2,
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
#[repr(u32)]
|
|
45
|
+
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
|
|
46
|
+
pub enum BjActivation {
|
|
47
|
+
Activate = 0,
|
|
48
|
+
DontActivate = 1,
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
#[repr(u32)]
|
|
52
|
+
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
|
|
53
|
+
pub enum BjContactEvent {
|
|
54
|
+
Added = 0,
|
|
55
|
+
Persisted = 1,
|
|
56
|
+
Removed = 2,
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
#[repr(u32)]
|
|
60
|
+
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
|
|
61
|
+
pub enum BjResult {
|
|
62
|
+
Ok = 0,
|
|
63
|
+
ErrUninitialized = 1,
|
|
64
|
+
ErrInvalidHandle = 2,
|
|
65
|
+
ErrOutOfMemory = 3,
|
|
66
|
+
ErrInvalidArg = 4,
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
#[repr(u32)]
|
|
70
|
+
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
|
|
71
|
+
pub enum BjGroundState {
|
|
72
|
+
OnGround = 0,
|
|
73
|
+
OnSteep = 1,
|
|
74
|
+
NotSupported = 2,
|
|
75
|
+
InAir = 3,
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
// ---------------------------------------------------------------------------
|
|
79
|
+
// POD structs
|
|
80
|
+
// ---------------------------------------------------------------------------
|
|
81
|
+
|
|
82
|
+
#[repr(C)]
|
|
83
|
+
#[derive(Copy, Clone, Debug, Default)]
|
|
84
|
+
pub struct BjVec3 { pub x: f32, pub y: f32, pub z: f32 }
|
|
85
|
+
|
|
86
|
+
#[repr(C)]
|
|
87
|
+
#[derive(Copy, Clone, Debug)]
|
|
88
|
+
pub struct BjQuat { pub x: f32, pub y: f32, pub z: f32, pub w: f32 }
|
|
89
|
+
impl Default for BjQuat {
|
|
90
|
+
fn default() -> Self { Self { x: 0.0, y: 0.0, z: 0.0, w: 1.0 } }
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
#[repr(C)]
|
|
94
|
+
#[derive(Copy, Clone, Debug, Default)]
|
|
95
|
+
pub struct BjTransform { pub position: BjVec3, pub rotation: BjQuat }
|
|
96
|
+
|
|
97
|
+
#[repr(C)]
|
|
98
|
+
#[derive(Copy, Clone, Debug)]
|
|
99
|
+
pub struct BjWorldDesc {
|
|
100
|
+
pub max_bodies: u32,
|
|
101
|
+
pub max_body_pairs: u32,
|
|
102
|
+
pub max_contact_constraints: u32,
|
|
103
|
+
pub num_threads: u32,
|
|
104
|
+
pub gravity: BjVec3,
|
|
105
|
+
pub temp_allocator_bytes: u32,
|
|
106
|
+
}
|
|
107
|
+
impl Default for BjWorldDesc {
|
|
108
|
+
fn default() -> Self {
|
|
109
|
+
Self {
|
|
110
|
+
max_bodies: 65_536,
|
|
111
|
+
max_body_pairs: 65_536,
|
|
112
|
+
max_contact_constraints: 10_240,
|
|
113
|
+
num_threads: 0,
|
|
114
|
+
gravity: BjVec3 { x: 0.0, y: -9.81, z: 0.0 },
|
|
115
|
+
temp_allocator_bytes: 0,
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
#[repr(C)]
|
|
121
|
+
#[derive(Copy, Clone, Debug)]
|
|
122
|
+
pub struct BjBodyDesc {
|
|
123
|
+
pub motion_type: BjMotionType,
|
|
124
|
+
pub position: BjVec3,
|
|
125
|
+
pub rotation: BjQuat,
|
|
126
|
+
pub linear_velocity: BjVec3,
|
|
127
|
+
pub angular_velocity: BjVec3,
|
|
128
|
+
pub gravity_factor: f32,
|
|
129
|
+
pub linear_damping: f32,
|
|
130
|
+
pub angular_damping: f32,
|
|
131
|
+
pub friction: f32,
|
|
132
|
+
pub restitution: f32,
|
|
133
|
+
pub mass_override: f32,
|
|
134
|
+
pub inertia_diag_override: BjVec3,
|
|
135
|
+
pub object_layer: u32,
|
|
136
|
+
pub is_sensor: u8,
|
|
137
|
+
pub allow_sleeping: u8,
|
|
138
|
+
pub use_ccd: u8,
|
|
139
|
+
pub start_awake: u8,
|
|
140
|
+
pub user_data: u64,
|
|
141
|
+
}
|
|
142
|
+
impl Default for BjBodyDesc {
|
|
143
|
+
fn default() -> Self {
|
|
144
|
+
Self {
|
|
145
|
+
motion_type: BjMotionType::Dynamic,
|
|
146
|
+
position: BjVec3::default(),
|
|
147
|
+
rotation: BjQuat::default(),
|
|
148
|
+
linear_velocity: BjVec3::default(),
|
|
149
|
+
angular_velocity: BjVec3::default(),
|
|
150
|
+
gravity_factor: 1.0,
|
|
151
|
+
linear_damping: 0.05,
|
|
152
|
+
angular_damping: 0.05,
|
|
153
|
+
friction: 0.2,
|
|
154
|
+
restitution: 0.0,
|
|
155
|
+
mass_override: 0.0,
|
|
156
|
+
inertia_diag_override: BjVec3::default(),
|
|
157
|
+
object_layer: BjDefaultLayer::Moving as u32,
|
|
158
|
+
is_sensor: 0,
|
|
159
|
+
allow_sleeping: 1,
|
|
160
|
+
use_ccd: 0,
|
|
161
|
+
start_awake: 1,
|
|
162
|
+
user_data: 0,
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
#[repr(C)]
|
|
168
|
+
#[derive(Copy, Clone, Debug, Default)]
|
|
169
|
+
pub struct BjRayHit {
|
|
170
|
+
pub body: bj_body,
|
|
171
|
+
pub point: BjVec3,
|
|
172
|
+
pub normal: BjVec3,
|
|
173
|
+
pub fraction: f32,
|
|
174
|
+
pub sub_shape_id: u32,
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
#[repr(C)]
|
|
178
|
+
#[derive(Copy, Clone, Debug)]
|
|
179
|
+
pub struct BjContact {
|
|
180
|
+
pub event: BjContactEvent,
|
|
181
|
+
pub body_a: bj_body,
|
|
182
|
+
pub body_b: bj_body,
|
|
183
|
+
pub point_a: BjVec3,
|
|
184
|
+
pub point_b: BjVec3,
|
|
185
|
+
pub normal: BjVec3,
|
|
186
|
+
pub penetration_depth: f32,
|
|
187
|
+
pub combined_friction: f32,
|
|
188
|
+
pub combined_restitution: f32,
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
#[repr(C)]
|
|
192
|
+
#[derive(Copy, Clone, Debug)]
|
|
193
|
+
pub struct BjConstraintAnchors {
|
|
194
|
+
pub body_a: bj_body,
|
|
195
|
+
pub body_b: bj_body,
|
|
196
|
+
pub anchor_a: BjVec3,
|
|
197
|
+
pub anchor_b: BjVec3,
|
|
198
|
+
pub use_world_space: u8,
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
#[repr(C)]
|
|
202
|
+
#[derive(Copy, Clone, Debug)]
|
|
203
|
+
pub struct BjVehicleDesc {
|
|
204
|
+
pub up: BjVec3,
|
|
205
|
+
pub forward: BjVec3,
|
|
206
|
+
pub wheel_positions: [BjVec3; 4], // front-left, front-right, rear-left, rear-right
|
|
207
|
+
pub wheel_radius: f32,
|
|
208
|
+
pub wheel_width: f32,
|
|
209
|
+
pub suspension_min_length: f32,
|
|
210
|
+
pub suspension_max_length: f32,
|
|
211
|
+
pub max_steer_angle: f32,
|
|
212
|
+
pub max_brake_torque: f32,
|
|
213
|
+
pub max_handbrake_torque: f32,
|
|
214
|
+
pub engine_max_torque: f32,
|
|
215
|
+
pub max_pitch_roll_angle: f32,
|
|
216
|
+
pub object_layer: u32,
|
|
217
|
+
}
|
|
218
|
+
impl Default for BjVehicleDesc {
|
|
219
|
+
fn default() -> Self {
|
|
220
|
+
// Sensible defaults for a typical compact car. Wheel positions
|
|
221
|
+
// are for a ~3.8m × 1.6m wheelbase/track.
|
|
222
|
+
Self {
|
|
223
|
+
up: BjVec3 { x: 0.0, y: 1.0, z: 0.0 },
|
|
224
|
+
forward: BjVec3 { x: 0.0, y: 0.0, z: 1.0 },
|
|
225
|
+
wheel_positions: [
|
|
226
|
+
BjVec3 { x: -0.8, y: -0.4, z: 1.3 }, // FL
|
|
227
|
+
BjVec3 { x: 0.8, y: -0.4, z: 1.3 }, // FR
|
|
228
|
+
BjVec3 { x: -0.8, y: -0.4, z: -1.3 }, // RL
|
|
229
|
+
BjVec3 { x: 0.8, y: -0.4, z: -1.3 }, // RR
|
|
230
|
+
],
|
|
231
|
+
wheel_radius: 0.35,
|
|
232
|
+
wheel_width: 0.2,
|
|
233
|
+
suspension_min_length: 0.3,
|
|
234
|
+
suspension_max_length: 0.5,
|
|
235
|
+
max_steer_angle: 35.0_f32.to_radians(),
|
|
236
|
+
max_brake_torque: 1500.0,
|
|
237
|
+
max_handbrake_torque: 4000.0,
|
|
238
|
+
engine_max_torque: 500.0,
|
|
239
|
+
max_pitch_roll_angle: 60.0_f32.to_radians(),
|
|
240
|
+
object_layer: BjDefaultLayer::Moving as u32,
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
#[repr(C)]
|
|
246
|
+
#[derive(Copy, Clone, Debug)]
|
|
247
|
+
pub struct BjCharacterDesc {
|
|
248
|
+
pub up: BjVec3,
|
|
249
|
+
pub max_slope_angle: f32,
|
|
250
|
+
pub character_padding: f32,
|
|
251
|
+
pub penetration_recovery_speed: f32,
|
|
252
|
+
pub predictive_contact_distance: f32,
|
|
253
|
+
pub max_strength: f32,
|
|
254
|
+
pub mass: f32,
|
|
255
|
+
pub object_layer: u32,
|
|
256
|
+
}
|
|
257
|
+
impl Default for BjCharacterDesc {
|
|
258
|
+
fn default() -> Self {
|
|
259
|
+
Self {
|
|
260
|
+
up: BjVec3 { x: 0.0, y: 1.0, z: 0.0 },
|
|
261
|
+
max_slope_angle: 50.0_f32.to_radians(),
|
|
262
|
+
character_padding: 0.02,
|
|
263
|
+
penetration_recovery_speed: 1.0,
|
|
264
|
+
predictive_contact_distance: 0.1,
|
|
265
|
+
max_strength: 100.0,
|
|
266
|
+
mass: 70.0,
|
|
267
|
+
object_layer: BjDefaultLayer::Moving as u32,
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
// ---------------------------------------------------------------------------
|
|
273
|
+
// extern "C" — matches bloom_jolt.h exactly.
|
|
274
|
+
// ---------------------------------------------------------------------------
|
|
275
|
+
|
|
276
|
+
extern "C" {
|
|
277
|
+
// Global
|
|
278
|
+
pub fn bj_global_init() -> BjResult;
|
|
279
|
+
pub fn bj_global_shutdown();
|
|
280
|
+
pub fn bj_version_string() -> *const c_char;
|
|
281
|
+
|
|
282
|
+
// World
|
|
283
|
+
pub fn bj_world_create(desc: *const BjWorldDesc) -> bj_world;
|
|
284
|
+
pub fn bj_world_destroy(world: bj_world);
|
|
285
|
+
pub fn bj_world_set_gravity(world: bj_world, gravity: BjVec3);
|
|
286
|
+
pub fn bj_world_get_gravity(world: bj_world, out: *mut BjVec3);
|
|
287
|
+
pub fn bj_world_optimize_broadphase(world: bj_world);
|
|
288
|
+
pub fn bj_world_step(world: bj_world, delta_time: f32, collision_steps: u32) -> BjResult;
|
|
289
|
+
pub fn bj_world_set_layer_collides(world: bj_world, a: u32, b: u32, collides: u8);
|
|
290
|
+
pub fn bj_world_get_layer_collides(world: bj_world, a: u32, b: u32) -> u8;
|
|
291
|
+
pub fn bj_world_body_count(world: bj_world) -> u32;
|
|
292
|
+
pub fn bj_world_active_body_count(world: bj_world) -> u32;
|
|
293
|
+
|
|
294
|
+
// Shapes
|
|
295
|
+
pub fn bj_shape_box(half_extents: BjVec3, convex_radius: f32) -> bj_shape;
|
|
296
|
+
pub fn bj_shape_sphere(radius: f32) -> bj_shape;
|
|
297
|
+
pub fn bj_shape_capsule(half_height: f32, radius: f32) -> bj_shape;
|
|
298
|
+
pub fn bj_shape_cylinder(half_height: f32, radius: f32, convex_radius: f32) -> bj_shape;
|
|
299
|
+
pub fn bj_shape_convex_hull(points: *const BjVec3, count: u32, convex_radius: f32) -> bj_shape;
|
|
300
|
+
pub fn bj_shape_mesh(
|
|
301
|
+
vertices: *const BjVec3, vertex_count: u32,
|
|
302
|
+
indices: *const u32, triangle_count: u32,
|
|
303
|
+
) -> bj_shape;
|
|
304
|
+
pub fn bj_shape_heightfield(
|
|
305
|
+
samples: *const f32, sample_count: u32,
|
|
306
|
+
offset: BjVec3, scale: BjVec3, block_size: u32,
|
|
307
|
+
) -> bj_shape;
|
|
308
|
+
pub fn bj_shape_compound_static(
|
|
309
|
+
shapes: *const bj_shape, local_transforms: *const BjTransform, count: u32,
|
|
310
|
+
) -> bj_shape;
|
|
311
|
+
pub fn bj_shape_scaled(base: bj_shape, scale: BjVec3) -> bj_shape;
|
|
312
|
+
pub fn bj_shape_offset_com(base: bj_shape, offset: BjVec3) -> bj_shape;
|
|
313
|
+
pub fn bj_shape_add_ref(shape: bj_shape);
|
|
314
|
+
pub fn bj_shape_release(shape: bj_shape);
|
|
315
|
+
pub fn bj_shape_get_local_bounds(shape: bj_shape, out_min: *mut BjVec3, out_max: *mut BjVec3);
|
|
316
|
+
pub fn bj_shape_get_volume(shape: bj_shape) -> f32;
|
|
317
|
+
|
|
318
|
+
// Bodies
|
|
319
|
+
pub fn bj_body_create(world: bj_world, shape: bj_shape, desc: *const BjBodyDesc) -> bj_body;
|
|
320
|
+
pub fn bj_body_destroy(world: bj_world, body: bj_body);
|
|
321
|
+
pub fn bj_body_activate(world: bj_world, body: bj_body);
|
|
322
|
+
pub fn bj_body_deactivate(world: bj_world, body: bj_body);
|
|
323
|
+
pub fn bj_body_is_active(world: bj_world, body: bj_body) -> u8;
|
|
324
|
+
pub fn bj_body_is_valid(world: bj_world, body: bj_body) -> u8;
|
|
325
|
+
pub fn bj_body_get_transform(world: bj_world, body: bj_body, out: *mut BjTransform);
|
|
326
|
+
pub fn bj_body_set_transform(world: bj_world, body: bj_body, xform: *const BjTransform, act: BjActivation);
|
|
327
|
+
pub fn bj_body_get_position(world: bj_world, body: bj_body, out: *mut BjVec3);
|
|
328
|
+
pub fn bj_body_get_rotation(world: bj_world, body: bj_body, out: *mut BjQuat);
|
|
329
|
+
pub fn bj_body_set_position(world: bj_world, body: bj_body, pos: BjVec3, act: BjActivation);
|
|
330
|
+
pub fn bj_body_set_rotation(world: bj_world, body: bj_body, rot: BjQuat, act: BjActivation);
|
|
331
|
+
pub fn bj_body_move_kinematic(world: bj_world, body: bj_body, target: *const BjTransform, delta_time: f32);
|
|
332
|
+
pub fn bj_body_get_linear_velocity(world: bj_world, body: bj_body, out: *mut BjVec3);
|
|
333
|
+
pub fn bj_body_get_angular_velocity(world: bj_world, body: bj_body, out: *mut BjVec3);
|
|
334
|
+
pub fn bj_body_set_linear_velocity(world: bj_world, body: bj_body, v: BjVec3);
|
|
335
|
+
pub fn bj_body_set_angular_velocity(world: bj_world, body: bj_body, v: BjVec3);
|
|
336
|
+
pub fn bj_body_get_point_velocity(world: bj_world, body: bj_body, world_point: BjVec3, out: *mut BjVec3);
|
|
337
|
+
pub fn bj_body_add_force(world: bj_world, body: bj_body, force: BjVec3);
|
|
338
|
+
pub fn bj_body_add_impulse(world: bj_world, body: bj_body, impulse: BjVec3);
|
|
339
|
+
pub fn bj_body_add_torque(world: bj_world, body: bj_body, torque: BjVec3);
|
|
340
|
+
pub fn bj_body_add_angular_impulse(world: bj_world, body: bj_body, impulse: BjVec3);
|
|
341
|
+
pub fn bj_body_add_force_at(world: bj_world, body: bj_body, force: BjVec3, world_point: BjVec3);
|
|
342
|
+
pub fn bj_body_add_impulse_at(world: bj_world, body: bj_body, impulse: BjVec3, world_point: BjVec3);
|
|
343
|
+
pub fn bj_body_set_friction(world: bj_world, body: bj_body, friction: f32);
|
|
344
|
+
pub fn bj_body_set_restitution(world: bj_world, body: bj_body, restitution: f32);
|
|
345
|
+
pub fn bj_body_set_linear_damping(world: bj_world, body: bj_body, damping: f32);
|
|
346
|
+
pub fn bj_body_set_angular_damping(world: bj_world, body: bj_body, damping: f32);
|
|
347
|
+
pub fn bj_body_set_gravity_factor(world: bj_world, body: bj_body, factor: f32);
|
|
348
|
+
pub fn bj_body_set_ccd(world: bj_world, body: bj_body, enabled: u8);
|
|
349
|
+
pub fn bj_body_set_motion_type(world: bj_world, body: bj_body, mtype: BjMotionType, act: BjActivation);
|
|
350
|
+
pub fn bj_body_set_object_layer(world: bj_world, body: bj_body, layer: u32);
|
|
351
|
+
pub fn bj_body_set_is_sensor(world: bj_world, body: bj_body, enabled: u8);
|
|
352
|
+
pub fn bj_body_set_allow_sleeping(world: bj_world, body: bj_body, enabled: u8);
|
|
353
|
+
pub fn bj_body_set_shape(world: bj_world, body: bj_body, shape: bj_shape, update_mass: u8, act: BjActivation);
|
|
354
|
+
pub fn bj_body_lock_rotation_axes(world: bj_world, body: bj_body, lock_x: u8, lock_y: u8, lock_z: u8);
|
|
355
|
+
pub fn bj_body_lock_translation_axes(world: bj_world, body: bj_body, lock_x: u8, lock_y: u8, lock_z: u8);
|
|
356
|
+
pub fn bj_body_get_mass(world: bj_world, body: bj_body) -> f32;
|
|
357
|
+
pub fn bj_body_get_friction(world: bj_world, body: bj_body) -> f32;
|
|
358
|
+
pub fn bj_body_get_restitution(world: bj_world, body: bj_body) -> f32;
|
|
359
|
+
pub fn bj_body_get_object_layer(world: bj_world, body: bj_body) -> u32;
|
|
360
|
+
pub fn bj_body_set_user_data(world: bj_world, body: bj_body, user_data: u64);
|
|
361
|
+
pub fn bj_body_get_user_data(world: bj_world, body: bj_body) -> u64;
|
|
362
|
+
pub fn bj_world_sync_transforms(
|
|
363
|
+
world: bj_world, bodies: *const bj_body, count: u32,
|
|
364
|
+
out_transforms: *mut BjTransform,
|
|
365
|
+
) -> u32;
|
|
366
|
+
|
|
367
|
+
// Queries
|
|
368
|
+
pub fn bj_query_raycast_closest(
|
|
369
|
+
world: bj_world, origin: BjVec3, direction: BjVec3, max_distance: f32,
|
|
370
|
+
layer_mask: u32, out_hit: *mut BjRayHit,
|
|
371
|
+
) -> u8;
|
|
372
|
+
pub fn bj_query_raycast_all(
|
|
373
|
+
world: bj_world, origin: BjVec3, direction: BjVec3, max_distance: f32,
|
|
374
|
+
layer_mask: u32, out_hits: *mut BjRayHit, max_hits: u32,
|
|
375
|
+
) -> u32;
|
|
376
|
+
pub fn bj_query_shape_cast_closest(
|
|
377
|
+
world: bj_world, shape: bj_shape, start: *const BjTransform, direction: BjVec3,
|
|
378
|
+
layer_mask: u32, out_hit: *mut BjRayHit,
|
|
379
|
+
) -> u8;
|
|
380
|
+
pub fn bj_query_overlap_sphere(
|
|
381
|
+
world: bj_world, center: BjVec3, radius: f32,
|
|
382
|
+
layer_mask: u32, out_bodies: *mut bj_body, max_results: u32,
|
|
383
|
+
) -> u32;
|
|
384
|
+
pub fn bj_query_overlap_box(
|
|
385
|
+
world: bj_world, box_transform: *const BjTransform, half_extents: BjVec3,
|
|
386
|
+
layer_mask: u32, out_bodies: *mut bj_body, max_results: u32,
|
|
387
|
+
) -> u32;
|
|
388
|
+
pub fn bj_query_overlap_point(
|
|
389
|
+
world: bj_world, point: BjVec3,
|
|
390
|
+
layer_mask: u32, out_bodies: *mut bj_body, max_results: u32,
|
|
391
|
+
) -> u32;
|
|
392
|
+
|
|
393
|
+
// Constraints
|
|
394
|
+
pub fn bj_constraint_fixed(world: bj_world, a: *const BjConstraintAnchors) -> bj_constraint;
|
|
395
|
+
pub fn bj_constraint_point(world: bj_world, a: *const BjConstraintAnchors) -> bj_constraint;
|
|
396
|
+
pub fn bj_constraint_hinge(
|
|
397
|
+
world: bj_world, a: *const BjConstraintAnchors, axis: BjVec3,
|
|
398
|
+
limit_min: f32, limit_max: f32,
|
|
399
|
+
) -> bj_constraint;
|
|
400
|
+
pub fn bj_constraint_slider(
|
|
401
|
+
world: bj_world, a: *const BjConstraintAnchors, axis: BjVec3,
|
|
402
|
+
limit_min: f32, limit_max: f32,
|
|
403
|
+
) -> bj_constraint;
|
|
404
|
+
pub fn bj_constraint_distance(
|
|
405
|
+
world: bj_world, a: *const BjConstraintAnchors,
|
|
406
|
+
min_distance: f32, max_distance: f32,
|
|
407
|
+
) -> bj_constraint;
|
|
408
|
+
pub fn bj_constraint_six_dof(
|
|
409
|
+
world: bj_world, a: *const BjConstraintAnchors,
|
|
410
|
+
translation_limits_xyz_minmax: *const f32,
|
|
411
|
+
rotation_limits_xyz_minmax: *const f32,
|
|
412
|
+
) -> bj_constraint;
|
|
413
|
+
pub fn bj_constraint_destroy(world: bj_world, c: bj_constraint);
|
|
414
|
+
pub fn bj_constraint_set_enabled(world: bj_world, c: bj_constraint, enabled: u8);
|
|
415
|
+
|
|
416
|
+
// Contact events
|
|
417
|
+
pub fn bj_world_contact_count(world: bj_world) -> u32;
|
|
418
|
+
pub fn bj_world_pop_contacts(world: bj_world, out: *mut BjContact, max_out: u32) -> u32;
|
|
419
|
+
pub fn bj_world_clear_contacts(world: bj_world);
|
|
420
|
+
|
|
421
|
+
// Character controller
|
|
422
|
+
pub fn bj_character_create(
|
|
423
|
+
world: bj_world, shape: bj_shape, desc: *const BjCharacterDesc,
|
|
424
|
+
position: BjVec3, rotation: BjQuat,
|
|
425
|
+
) -> bj_character;
|
|
426
|
+
pub fn bj_character_destroy(world: bj_world, character: bj_character);
|
|
427
|
+
pub fn bj_character_update(world: bj_world, character: bj_character,
|
|
428
|
+
delta_time: f32, gravity: BjVec3);
|
|
429
|
+
pub fn bj_character_get_position(world: bj_world, character: bj_character, out: *mut BjVec3);
|
|
430
|
+
pub fn bj_character_get_rotation(world: bj_world, character: bj_character, out: *mut BjQuat);
|
|
431
|
+
pub fn bj_character_set_position(world: bj_world, character: bj_character, position: BjVec3);
|
|
432
|
+
pub fn bj_character_set_rotation(world: bj_world, character: bj_character, rotation: BjQuat);
|
|
433
|
+
pub fn bj_character_get_linear_velocity(world: bj_world, character: bj_character, out: *mut BjVec3);
|
|
434
|
+
pub fn bj_character_set_linear_velocity(world: bj_world, character: bj_character, velocity: BjVec3);
|
|
435
|
+
pub fn bj_character_get_ground_state(world: bj_world, character: bj_character) -> BjGroundState;
|
|
436
|
+
pub fn bj_character_get_ground_normal (world: bj_world, character: bj_character, out: *mut BjVec3);
|
|
437
|
+
pub fn bj_character_get_ground_position(world: bj_world, character: bj_character, out: *mut BjVec3);
|
|
438
|
+
pub fn bj_character_get_ground_body (world: bj_world, character: bj_character) -> bj_body;
|
|
439
|
+
pub fn bj_character_set_shape (world: bj_world, character: bj_character, shape: bj_shape);
|
|
440
|
+
|
|
441
|
+
// Soft bodies
|
|
442
|
+
pub fn bj_soft_body_create(
|
|
443
|
+
world: bj_world,
|
|
444
|
+
vertex_data: *const f32, vertex_count: u32,
|
|
445
|
+
indices: *const u32, triangle_count: u32,
|
|
446
|
+
position: BjVec3, rotation: BjQuat,
|
|
447
|
+
object_layer: u32,
|
|
448
|
+
edge_compliance: f32, gravity_factor: f32, linear_damping: f32, pressure: f32,
|
|
449
|
+
) -> bj_body;
|
|
450
|
+
pub fn bj_soft_body_vertex_count(world: bj_world, body: bj_body) -> u32;
|
|
451
|
+
pub fn bj_soft_body_get_vertex(world: bj_world, body: bj_body, idx: u32, out: *mut BjVec3);
|
|
452
|
+
pub fn bj_soft_body_set_vertex(world: bj_world, body: bj_body, idx: u32, position: BjVec3);
|
|
453
|
+
pub fn bj_soft_body_set_vertex_inv_mass(world: bj_world, body: bj_body, idx: u32, inv_mass: f32);
|
|
454
|
+
|
|
455
|
+
// Wheeled vehicles
|
|
456
|
+
pub fn bj_vehicle_create(
|
|
457
|
+
world: bj_world, chassis_shape: bj_shape,
|
|
458
|
+
desc: *const BjVehicleDesc,
|
|
459
|
+
position: BjVec3, rotation: BjQuat,
|
|
460
|
+
) -> bj_vehicle;
|
|
461
|
+
pub fn bj_vehicle_destroy(world: bj_world, vehicle: bj_vehicle);
|
|
462
|
+
pub fn bj_vehicle_get_chassis(world: bj_world, vehicle: bj_vehicle) -> bj_body;
|
|
463
|
+
pub fn bj_vehicle_set_input(
|
|
464
|
+
world: bj_world, vehicle: bj_vehicle,
|
|
465
|
+
forward: f32, right: f32, brake: f32, handbrake: f32,
|
|
466
|
+
);
|
|
467
|
+
pub fn bj_vehicle_get_wheel_transform(
|
|
468
|
+
world: bj_world, vehicle: bj_vehicle, wheel_index: u32, axis: u32,
|
|
469
|
+
) -> f32;
|
|
470
|
+
pub fn bj_vehicle_get_engine_rpm(world: bj_world, vehicle: bj_vehicle) -> f32;
|
|
471
|
+
pub fn bj_vehicle_get_wheel_angular_velocity(world: bj_world, vehicle: bj_vehicle, wheel_index: u32) -> f32;
|
|
472
|
+
}
|
|
473
|
+
|
|
474
|
+
// ---------------------------------------------------------------------------
|
|
475
|
+
// Thin safe wrapper over version string — useful for logs / diagnostics.
|
|
476
|
+
// ---------------------------------------------------------------------------
|
|
477
|
+
|
|
478
|
+
pub fn version_string() -> &'static str {
|
|
479
|
+
// SAFETY: bj_version_string returns a pointer to a static const char[].
|
|
480
|
+
unsafe {
|
|
481
|
+
let ptr = bj_version_string();
|
|
482
|
+
if ptr.is_null() {
|
|
483
|
+
return "unknown";
|
|
484
|
+
}
|
|
485
|
+
std::ffi::CStr::from_ptr(ptr).to_str().unwrap_or("unknown")
|
|
486
|
+
}
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
// ---------------------------------------------------------------------------
|
|
490
|
+
// Runtime smoke test — verifies that the shim initialises, creates a world,
|
|
491
|
+
// steps it, and tears down cleanly. Flipped on by `cargo test --features jolt`.
|
|
492
|
+
// ---------------------------------------------------------------------------
|
|
493
|
+
|
|
494
|
+
#[cfg(test)]
|
|
495
|
+
mod tests {
|
|
496
|
+
use super::*;
|
|
497
|
+
|
|
498
|
+
#[test]
|
|
499
|
+
fn global_init_and_world_step() {
|
|
500
|
+
unsafe {
|
|
501
|
+
assert_eq!(bj_global_init(), BjResult::Ok);
|
|
502
|
+
let version = version_string();
|
|
503
|
+
assert!(version.contains("Jolt"), "got version: {}", version);
|
|
504
|
+
|
|
505
|
+
let desc = BjWorldDesc::default();
|
|
506
|
+
let world = bj_world_create(&desc);
|
|
507
|
+
assert_ne!(world, BJ_INVALID, "world creation failed");
|
|
508
|
+
|
|
509
|
+
let mut g = BjVec3::default();
|
|
510
|
+
bj_world_get_gravity(world, &mut g);
|
|
511
|
+
assert!((g.y - (-9.81)).abs() < 1e-4, "gravity.y = {}", g.y);
|
|
512
|
+
|
|
513
|
+
for _ in 0..4 {
|
|
514
|
+
assert_eq!(bj_world_step(world, 1.0 / 60.0, 1), BjResult::Ok);
|
|
515
|
+
}
|
|
516
|
+
|
|
517
|
+
assert_eq!(bj_world_body_count(world), 0);
|
|
518
|
+
assert_eq!(bj_world_active_body_count(world), 0);
|
|
519
|
+
|
|
520
|
+
bj_world_destroy(world);
|
|
521
|
+
bj_global_shutdown();
|
|
522
|
+
}
|
|
523
|
+
}
|
|
524
|
+
|
|
525
|
+
/// End-to-end: sphere at y=10 falls, lands on a static ground box.
|
|
526
|
+
/// Validates shape factories, body lifecycle, gravity, contacts, stepping.
|
|
527
|
+
#[test]
|
|
528
|
+
fn gravity_fall_and_land() {
|
|
529
|
+
unsafe {
|
|
530
|
+
assert_eq!(bj_global_init(), BjResult::Ok);
|
|
531
|
+
|
|
532
|
+
let desc = BjWorldDesc::default();
|
|
533
|
+
let world = bj_world_create(&desc);
|
|
534
|
+
assert_ne!(world, BJ_INVALID);
|
|
535
|
+
|
|
536
|
+
// Ground: static box, top surface at y=0 (half-height 0.5, centred y=-0.5).
|
|
537
|
+
let ground_shape = bj_shape_box(BjVec3 { x: 50.0, y: 0.5, z: 50.0 }, 0.05);
|
|
538
|
+
assert_ne!(ground_shape, BJ_INVALID);
|
|
539
|
+
let ground_desc = BjBodyDesc {
|
|
540
|
+
motion_type: BjMotionType::Static,
|
|
541
|
+
position: BjVec3 { x: 0.0, y: -0.5, z: 0.0 },
|
|
542
|
+
object_layer: BjDefaultLayer::NonMoving as u32,
|
|
543
|
+
..Default::default()
|
|
544
|
+
};
|
|
545
|
+
let ground = bj_body_create(world, ground_shape, &ground_desc);
|
|
546
|
+
assert_ne!(ground, BJ_INVALID);
|
|
547
|
+
|
|
548
|
+
// Sphere: dynamic, starts at y=10, radius 0.5 → expected rest near y=0.5.
|
|
549
|
+
let sphere_shape = bj_shape_sphere(0.5);
|
|
550
|
+
assert_ne!(sphere_shape, BJ_INVALID);
|
|
551
|
+
let sphere_desc = BjBodyDesc {
|
|
552
|
+
motion_type: BjMotionType::Dynamic,
|
|
553
|
+
position: BjVec3 { x: 0.0, y: 10.0, z: 0.0 },
|
|
554
|
+
object_layer: BjDefaultLayer::Moving as u32,
|
|
555
|
+
restitution: 0.0,
|
|
556
|
+
friction: 0.5,
|
|
557
|
+
..Default::default()
|
|
558
|
+
};
|
|
559
|
+
let sphere = bj_body_create(world, sphere_shape, &sphere_desc);
|
|
560
|
+
assert_ne!(sphere, BJ_INVALID);
|
|
561
|
+
|
|
562
|
+
bj_world_optimize_broadphase(world);
|
|
563
|
+
|
|
564
|
+
// Step for 2 seconds at 120 Hz so the body has time to settle.
|
|
565
|
+
for _ in 0..240 {
|
|
566
|
+
assert_eq!(bj_world_step(world, 1.0 / 120.0, 1), BjResult::Ok);
|
|
567
|
+
}
|
|
568
|
+
|
|
569
|
+
let mut xform = BjTransform::default();
|
|
570
|
+
bj_body_get_transform(world, sphere, &mut xform);
|
|
571
|
+
assert!(
|
|
572
|
+
xform.position.y >= 0.4 && xform.position.y <= 1.0,
|
|
573
|
+
"sphere landed at y={}, expected near 0.5 (radius atop ground)",
|
|
574
|
+
xform.position.y
|
|
575
|
+
);
|
|
576
|
+
|
|
577
|
+
let mut lv = BjVec3::default();
|
|
578
|
+
bj_body_get_linear_velocity(world, sphere, &mut lv);
|
|
579
|
+
assert!(
|
|
580
|
+
lv.y.abs() < 0.5,
|
|
581
|
+
"sphere should be at rest, but v.y={}",
|
|
582
|
+
lv.y
|
|
583
|
+
);
|
|
584
|
+
|
|
585
|
+
// Contacts should be populated after collision.
|
|
586
|
+
assert!(
|
|
587
|
+
bj_world_contact_count(world) > 0,
|
|
588
|
+
"expected contact events from sphere/ground collision"
|
|
589
|
+
);
|
|
590
|
+
|
|
591
|
+
// Drain at least one contact and verify shape of event.
|
|
592
|
+
let mut contact_buf: [BjContact; 8] = std::mem::zeroed();
|
|
593
|
+
let drained = bj_world_pop_contacts(world, contact_buf.as_mut_ptr(), 8);
|
|
594
|
+
assert!(drained > 0, "expected to drain at least one contact");
|
|
595
|
+
|
|
596
|
+
bj_body_destroy(world, sphere);
|
|
597
|
+
bj_body_destroy(world, ground);
|
|
598
|
+
bj_shape_release(sphere_shape);
|
|
599
|
+
bj_shape_release(ground_shape);
|
|
600
|
+
bj_world_destroy(world);
|
|
601
|
+
bj_global_shutdown();
|
|
602
|
+
}
|
|
603
|
+
}
|
|
604
|
+
|
|
605
|
+
/// Character falls from y=5 onto a triangle-mesh floor, lands grounded.
|
|
606
|
+
/// Validates mesh shapes (Tier 1 completion) + CharacterVirtual (Tier 2).
|
|
607
|
+
#[test]
|
|
608
|
+
fn character_on_mesh_ground() {
|
|
609
|
+
unsafe {
|
|
610
|
+
assert_eq!(bj_global_init(), BjResult::Ok);
|
|
611
|
+
|
|
612
|
+
let world = bj_world_create(&BjWorldDesc::default());
|
|
613
|
+
assert_ne!(world, BJ_INVALID);
|
|
614
|
+
|
|
615
|
+
// Triangle-mesh floor: two triangles forming a 20×20 quad at y=0.
|
|
616
|
+
let verts = [
|
|
617
|
+
BjVec3 { x: -10.0, y: 0.0, z: -10.0 },
|
|
618
|
+
BjVec3 { x: 10.0, y: 0.0, z: -10.0 },
|
|
619
|
+
BjVec3 { x: 10.0, y: 0.0, z: 10.0 },
|
|
620
|
+
BjVec3 { x: -10.0, y: 0.0, z: 10.0 },
|
|
621
|
+
];
|
|
622
|
+
let indices: [u32; 6] = [0, 2, 1, 0, 3, 2];
|
|
623
|
+
let ground_shape = bj_shape_mesh(
|
|
624
|
+
verts.as_ptr(), verts.len() as u32,
|
|
625
|
+
indices.as_ptr(), (indices.len() / 3) as u32,
|
|
626
|
+
);
|
|
627
|
+
assert_ne!(ground_shape, BJ_INVALID, "mesh shape creation failed");
|
|
628
|
+
|
|
629
|
+
let ground_desc = BjBodyDesc {
|
|
630
|
+
motion_type: BjMotionType::Static,
|
|
631
|
+
position: BjVec3 { x: 0.0, y: 0.0, z: 0.0 },
|
|
632
|
+
object_layer: BjDefaultLayer::NonMoving as u32,
|
|
633
|
+
..Default::default()
|
|
634
|
+
};
|
|
635
|
+
let ground = bj_body_create(world, ground_shape, &ground_desc);
|
|
636
|
+
assert_ne!(ground, BJ_INVALID);
|
|
637
|
+
|
|
638
|
+
// Character: capsule at y=5 looking down.
|
|
639
|
+
let char_shape = bj_shape_capsule(0.5, 0.3);
|
|
640
|
+
let desc = BjCharacterDesc::default();
|
|
641
|
+
let character = bj_character_create(
|
|
642
|
+
world, char_shape, &desc,
|
|
643
|
+
BjVec3 { x: 0.0, y: 5.0, z: 0.0 },
|
|
644
|
+
BjQuat::default(),
|
|
645
|
+
);
|
|
646
|
+
assert_ne!(character, BJ_INVALID);
|
|
647
|
+
|
|
648
|
+
bj_world_optimize_broadphase(world);
|
|
649
|
+
|
|
650
|
+
let gravity = BjVec3 { x: 0.0, y: -9.81, z: 0.0 };
|
|
651
|
+
for _ in 0..240 {
|
|
652
|
+
bj_character_update(world, character, 1.0 / 120.0, gravity);
|
|
653
|
+
bj_world_step(world, 1.0 / 120.0, 1);
|
|
654
|
+
}
|
|
655
|
+
|
|
656
|
+
let mut pos = BjVec3::default();
|
|
657
|
+
bj_character_get_position(world, character, &mut pos);
|
|
658
|
+
assert!(
|
|
659
|
+
pos.y < 5.0 && pos.y > -0.1,
|
|
660
|
+
"character didn't land correctly: y={}", pos.y
|
|
661
|
+
);
|
|
662
|
+
|
|
663
|
+
let state = bj_character_get_ground_state(world, character);
|
|
664
|
+
assert_eq!(
|
|
665
|
+
state, BjGroundState::OnGround,
|
|
666
|
+
"expected OnGround, got {:?}", state
|
|
667
|
+
);
|
|
668
|
+
|
|
669
|
+
bj_character_destroy(world, character);
|
|
670
|
+
bj_body_destroy(world, ground);
|
|
671
|
+
bj_shape_release(char_shape);
|
|
672
|
+
bj_shape_release(ground_shape);
|
|
673
|
+
bj_world_destroy(world);
|
|
674
|
+
bj_global_shutdown();
|
|
675
|
+
}
|
|
676
|
+
}
|
|
677
|
+
|
|
678
|
+
/// 3x3 cloth patch pinned at 4 corners: lets simulation run and verifies
|
|
679
|
+
/// center vertex drops below starting height (gravity + edge constraints working).
|
|
680
|
+
#[test]
|
|
681
|
+
fn soft_body_cloth_sags_under_gravity() {
|
|
682
|
+
unsafe {
|
|
683
|
+
assert_eq!(bj_global_init(), BjResult::Ok);
|
|
684
|
+
let world = bj_world_create(&BjWorldDesc::default());
|
|
685
|
+
assert_ne!(world, BJ_INVALID);
|
|
686
|
+
|
|
687
|
+
// 3x3 vertex grid, 2x2 quads = 8 triangles.
|
|
688
|
+
// Corners pinned (invMass=0); center and edges have mass.
|
|
689
|
+
let step = 1.0_f32;
|
|
690
|
+
let mut vertex_data: Vec<f32> = Vec::with_capacity(9 * 4);
|
|
691
|
+
for gy in 0..3 {
|
|
692
|
+
for gx in 0..3 {
|
|
693
|
+
let x = (gx as f32 - 1.0) * step;
|
|
694
|
+
let y = 5.0;
|
|
695
|
+
let z = (gy as f32 - 1.0) * step;
|
|
696
|
+
let is_corner = (gx == 0 || gx == 2) && (gy == 0 || gy == 2);
|
|
697
|
+
let inv_mass = if is_corner { 0.0 } else { 1.0 };
|
|
698
|
+
vertex_data.extend_from_slice(&[x, y, z, inv_mass]);
|
|
699
|
+
}
|
|
700
|
+
}
|
|
701
|
+
let mut indices: Vec<u32> = Vec::new();
|
|
702
|
+
for gy in 0..2u32 {
|
|
703
|
+
for gx in 0..2u32 {
|
|
704
|
+
let i0 = gy * 3 + gx;
|
|
705
|
+
let i1 = gy * 3 + gx + 1;
|
|
706
|
+
let i2 = (gy + 1) * 3 + gx;
|
|
707
|
+
let i3 = (gy + 1) * 3 + gx + 1;
|
|
708
|
+
indices.extend_from_slice(&[i0, i2, i1, i1, i2, i3]);
|
|
709
|
+
}
|
|
710
|
+
}
|
|
711
|
+
|
|
712
|
+
// Compliance 1e-3 = realistically soft cloth (stiff cloth = 1e-5).
|
|
713
|
+
let body = bj_soft_body_create(
|
|
714
|
+
world,
|
|
715
|
+
vertex_data.as_ptr(), 9,
|
|
716
|
+
indices.as_ptr(), (indices.len() / 3) as u32,
|
|
717
|
+
BjVec3::default(), BjQuat::default(),
|
|
718
|
+
BjDefaultLayer::Moving as u32,
|
|
719
|
+
1e-3, 1.0, 0.01, 0.0,
|
|
720
|
+
);
|
|
721
|
+
assert_ne!(body, BJ_INVALID, "soft body creation failed");
|
|
722
|
+
|
|
723
|
+
bj_world_optimize_broadphase(world);
|
|
724
|
+
|
|
725
|
+
// Center vertex is index 4 (middle of 3x3 grid).
|
|
726
|
+
let mut start_center = BjVec3::default();
|
|
727
|
+
bj_soft_body_get_vertex(world, body, 4, &mut start_center);
|
|
728
|
+
let start_y = start_center.y;
|
|
729
|
+
|
|
730
|
+
for _ in 0..480 {
|
|
731
|
+
bj_world_step(world, 1.0 / 120.0, 1);
|
|
732
|
+
}
|
|
733
|
+
|
|
734
|
+
let count = bj_soft_body_vertex_count(world, body);
|
|
735
|
+
assert_eq!(count, 9, "expected 9 vertices, got {}", count);
|
|
736
|
+
|
|
737
|
+
let mut end_center = BjVec3::default();
|
|
738
|
+
bj_soft_body_get_vertex(world, body, 4, &mut end_center);
|
|
739
|
+
assert!(
|
|
740
|
+
end_center.y < start_y - 0.1,
|
|
741
|
+
"cloth center should sag below starting y={}; ended at y={}",
|
|
742
|
+
start_y, end_center.y
|
|
743
|
+
);
|
|
744
|
+
|
|
745
|
+
// Corners (index 0, 2, 6, 8) should stay pinned near y=5.
|
|
746
|
+
let mut corner = BjVec3::default();
|
|
747
|
+
bj_soft_body_get_vertex(world, body, 0, &mut corner);
|
|
748
|
+
assert!(
|
|
749
|
+
(corner.y - 5.0).abs() < 0.01,
|
|
750
|
+
"corner should be pinned at y=5, got {}", corner.y
|
|
751
|
+
);
|
|
752
|
+
|
|
753
|
+
bj_body_destroy(world, body);
|
|
754
|
+
bj_world_destroy(world);
|
|
755
|
+
bj_global_shutdown();
|
|
756
|
+
}
|
|
757
|
+
}
|
|
758
|
+
|
|
759
|
+
/// Minimum-viable vehicle API smoke test: chassis spawns, engine responds
|
|
760
|
+
/// to throttle, wheels spin, API doesn't crash.
|
|
761
|
+
///
|
|
762
|
+
/// *Does not* assert car-drives-forward — getting a test car to accelerate
|
|
763
|
+
/// reliably against Jolt's default parameters requires tuning the chassis
|
|
764
|
+
/// geometry, suspension spring/damping, and wheel friction curves to match.
|
|
765
|
+
/// That's best done per-game, not in a validation test. The critical signal
|
|
766
|
+
/// this test captures is that the FFI stack (VehicleConstraint + step
|
|
767
|
+
/// listener + controller input) wires up correctly.
|
|
768
|
+
#[test]
|
|
769
|
+
fn vehicle_api_smoke() {
|
|
770
|
+
unsafe {
|
|
771
|
+
assert_eq!(bj_global_init(), BjResult::Ok);
|
|
772
|
+
let world = bj_world_create(&BjWorldDesc::default());
|
|
773
|
+
assert_ne!(world, BJ_INVALID);
|
|
774
|
+
|
|
775
|
+
let ground_shape = bj_shape_box(BjVec3 { x: 100.0, y: 0.5, z: 100.0 }, 0.05);
|
|
776
|
+
let ground_desc = BjBodyDesc {
|
|
777
|
+
motion_type: BjMotionType::Static,
|
|
778
|
+
position: BjVec3 { x: 0.0, y: -0.5, z: 0.0 },
|
|
779
|
+
object_layer: BjDefaultLayer::NonMoving as u32,
|
|
780
|
+
friction: 0.8,
|
|
781
|
+
..Default::default()
|
|
782
|
+
};
|
|
783
|
+
let ground = bj_body_create(world, ground_shape, &ground_desc);
|
|
784
|
+
|
|
785
|
+
let inner_box = bj_shape_box(BjVec3 { x: 1.0, y: 0.2, z: 1.9 }, 0.05);
|
|
786
|
+
let chassis_shape = bj_shape_offset_com(inner_box, BjVec3 { x: 0.0, y: -0.6, z: 0.0 });
|
|
787
|
+
let desc = BjVehicleDesc::default();
|
|
788
|
+
let vehicle = bj_vehicle_create(
|
|
789
|
+
world, chassis_shape, &desc,
|
|
790
|
+
BjVec3 { x: 0.0, y: 2.0, z: 0.0 },
|
|
791
|
+
BjQuat::default(),
|
|
792
|
+
);
|
|
793
|
+
assert_ne!(vehicle, BJ_INVALID, "vehicle creation failed");
|
|
794
|
+
assert_ne!(bj_vehicle_get_chassis(world, vehicle), BJ_INVALID);
|
|
795
|
+
|
|
796
|
+
bj_world_optimize_broadphase(world);
|
|
797
|
+
|
|
798
|
+
// 1 second of throttled simulation — engine should spin up.
|
|
799
|
+
for _ in 0..120 {
|
|
800
|
+
bj_vehicle_set_input(world, vehicle, 1.0, 0.0, 0.0, 0.0);
|
|
801
|
+
bj_world_step(world, 1.0 / 120.0, 1);
|
|
802
|
+
}
|
|
803
|
+
let rpm = bj_vehicle_get_engine_rpm(world, vehicle);
|
|
804
|
+
assert!(rpm > 500.0, "engine RPM should rise under throttle; got {}", rpm);
|
|
805
|
+
|
|
806
|
+
// Rear wheel should have non-zero angular velocity.
|
|
807
|
+
let rear_omega = bj_vehicle_get_wheel_angular_velocity(world, vehicle, 2);
|
|
808
|
+
assert!(rear_omega.abs() > 0.5, "rear wheel should be spinning; ω={}", rear_omega);
|
|
809
|
+
|
|
810
|
+
// Wheel transform query returns non-zero position.
|
|
811
|
+
let wheel_y = bj_vehicle_get_wheel_transform(world, vehicle, 0, 1);
|
|
812
|
+
assert!(wheel_y.abs() > 0.01, "wheel 0 world Y should be non-zero; got {}", wheel_y);
|
|
813
|
+
|
|
814
|
+
bj_vehicle_destroy(world, vehicle);
|
|
815
|
+
bj_body_destroy(world, ground);
|
|
816
|
+
bj_shape_release(chassis_shape);
|
|
817
|
+
bj_shape_release(ground_shape);
|
|
818
|
+
bj_world_destroy(world);
|
|
819
|
+
bj_global_shutdown();
|
|
820
|
+
}
|
|
821
|
+
}
|
|
822
|
+
}
|