@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,179 @@
|
|
|
1
|
+
// BloomWatchAudio — AVAudioPlayer-backed implementation of bloom's audio FFI.
|
|
2
|
+
//
|
|
3
|
+
// The Rust side of bloom-watchos calls into these C-exported functions via
|
|
4
|
+
// extern "C" so sound/music paths stay string-based at the Perry/Rust boundary
|
|
5
|
+
// but decoding, decoding, and playback happen on the Swift side where we
|
|
6
|
+
// have AVAudioPlayer (and, on watchOS, no obvious Rust-native audio path).
|
|
7
|
+
//
|
|
8
|
+
// Handles are 1-based to match the rest of bloom-watchos's texture/font
|
|
9
|
+
// registries — 0 signals "none / not loaded".
|
|
10
|
+
|
|
11
|
+
import Foundation
|
|
12
|
+
import AVFoundation
|
|
13
|
+
|
|
14
|
+
// MARK: - Registry
|
|
15
|
+
|
|
16
|
+
final class BloomAudioManager {
|
|
17
|
+
static let shared = BloomAudioManager()
|
|
18
|
+
|
|
19
|
+
private var sounds: [AVAudioPlayer] = []
|
|
20
|
+
private var musics: [AVAudioPlayer] = []
|
|
21
|
+
private var masterVolume: Float = 1.0
|
|
22
|
+
private let lock = NSLock()
|
|
23
|
+
private var sessionStarted = false
|
|
24
|
+
|
|
25
|
+
func initAudio() {
|
|
26
|
+
guard !sessionStarted else { return }
|
|
27
|
+
sessionStarted = true
|
|
28
|
+
// AVAudioSession on watchOS requires explicit activation. Ambient
|
|
29
|
+
// category = play alongside other audio without interruption; good
|
|
30
|
+
// default for games.
|
|
31
|
+
let session = AVAudioSession.sharedInstance()
|
|
32
|
+
try? session.setCategory(.ambient, mode: .default, options: [.mixWithOthers])
|
|
33
|
+
try? session.setActive(true, options: [])
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
func closeAudio() {
|
|
37
|
+
lock.lock()
|
|
38
|
+
sounds.forEach { $0.stop() }
|
|
39
|
+
musics.forEach { $0.stop() }
|
|
40
|
+
sounds.removeAll()
|
|
41
|
+
musics.removeAll()
|
|
42
|
+
lock.unlock()
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/// Load a sound from a filesystem path. Returns a 1-based handle or 0 on
|
|
46
|
+
/// failure. The path is expected to be already bundle-resolved on the
|
|
47
|
+
/// Rust side (textures::resolve_bundle_path).
|
|
48
|
+
func loadSound(path: String) -> UInt32 {
|
|
49
|
+
guard let player = try? AVAudioPlayer(contentsOf: URL(fileURLWithPath: path)) else {
|
|
50
|
+
return 0
|
|
51
|
+
}
|
|
52
|
+
player.prepareToPlay()
|
|
53
|
+
lock.lock()
|
|
54
|
+
sounds.append(player)
|
|
55
|
+
let handle = UInt32(sounds.count)
|
|
56
|
+
lock.unlock()
|
|
57
|
+
return handle
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
func playSound(_ handle: UInt32) {
|
|
61
|
+
guard let p = sound(handle) else { return }
|
|
62
|
+
p.volume = masterVolume
|
|
63
|
+
p.currentTime = 0
|
|
64
|
+
p.play()
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
func stopSound(_ handle: UInt32) {
|
|
68
|
+
sound(handle)?.stop()
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
func setSoundVolume(_ handle: UInt32, _ v: Float) {
|
|
72
|
+
sound(handle)?.volume = v * masterVolume
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
func setMasterVolume(_ v: Float) {
|
|
76
|
+
lock.lock()
|
|
77
|
+
masterVolume = v
|
|
78
|
+
sounds.forEach { $0.volume = v }
|
|
79
|
+
musics.forEach { $0.volume = v }
|
|
80
|
+
lock.unlock()
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
func loadMusic(path: String) -> UInt32 {
|
|
84
|
+
guard let player = try? AVAudioPlayer(contentsOf: URL(fileURLWithPath: path)) else {
|
|
85
|
+
return 0
|
|
86
|
+
}
|
|
87
|
+
player.numberOfLoops = -1 // loop forever
|
|
88
|
+
player.prepareToPlay()
|
|
89
|
+
lock.lock()
|
|
90
|
+
musics.append(player)
|
|
91
|
+
let handle = UInt32(musics.count)
|
|
92
|
+
lock.unlock()
|
|
93
|
+
return handle
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
func playMusic(_ handle: UInt32) {
|
|
97
|
+
guard let p = music(handle) else { return }
|
|
98
|
+
p.volume = masterVolume
|
|
99
|
+
p.play()
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
func stopMusic(_ handle: UInt32) { music(handle)?.stop() }
|
|
103
|
+
func setMusicVolume(_ handle: UInt32, _ v: Float) { music(handle)?.volume = v * masterVolume }
|
|
104
|
+
func isMusicPlaying(_ handle: UInt32) -> Bool { music(handle)?.isPlaying ?? false }
|
|
105
|
+
|
|
106
|
+
private func sound(_ handle: UInt32) -> AVAudioPlayer? {
|
|
107
|
+
lock.lock(); defer { lock.unlock() }
|
|
108
|
+
let i = Int(handle)
|
|
109
|
+
return (i >= 1 && i <= sounds.count) ? sounds[i - 1] : nil
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
private func music(_ handle: UInt32) -> AVAudioPlayer? {
|
|
113
|
+
lock.lock(); defer { lock.unlock() }
|
|
114
|
+
let i = Int(handle)
|
|
115
|
+
return (i >= 1 && i <= musics.count) ? musics[i - 1] : nil
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
// MARK: - C-ABI exports (called from bloom-watchos Rust crate)
|
|
120
|
+
|
|
121
|
+
@_cdecl("bloom_watchos_audio_init")
|
|
122
|
+
public func bloom_watchos_audio_init() {
|
|
123
|
+
BloomAudioManager.shared.initAudio()
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
@_cdecl("bloom_watchos_audio_close")
|
|
127
|
+
public func bloom_watchos_audio_close() {
|
|
128
|
+
BloomAudioManager.shared.closeAudio()
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
@_cdecl("bloom_watchos_sound_load")
|
|
132
|
+
public func bloom_watchos_sound_load(_ path: UnsafePointer<CChar>) -> UInt32 {
|
|
133
|
+
BloomAudioManager.shared.loadSound(path: String(cString: path))
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
@_cdecl("bloom_watchos_sound_play")
|
|
137
|
+
public func bloom_watchos_sound_play(_ handle: UInt32) {
|
|
138
|
+
BloomAudioManager.shared.playSound(handle)
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
@_cdecl("bloom_watchos_sound_stop")
|
|
142
|
+
public func bloom_watchos_sound_stop(_ handle: UInt32) {
|
|
143
|
+
BloomAudioManager.shared.stopSound(handle)
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
@_cdecl("bloom_watchos_sound_volume")
|
|
147
|
+
public func bloom_watchos_sound_volume(_ handle: UInt32, _ v: Float) {
|
|
148
|
+
BloomAudioManager.shared.setSoundVolume(handle, v)
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
@_cdecl("bloom_watchos_master_volume")
|
|
152
|
+
public func bloom_watchos_master_volume(_ v: Float) {
|
|
153
|
+
BloomAudioManager.shared.setMasterVolume(v)
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
@_cdecl("bloom_watchos_music_load")
|
|
157
|
+
public func bloom_watchos_music_load(_ path: UnsafePointer<CChar>) -> UInt32 {
|
|
158
|
+
BloomAudioManager.shared.loadMusic(path: String(cString: path))
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
@_cdecl("bloom_watchos_music_play")
|
|
162
|
+
public func bloom_watchos_music_play(_ handle: UInt32) {
|
|
163
|
+
BloomAudioManager.shared.playMusic(handle)
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
@_cdecl("bloom_watchos_music_stop")
|
|
167
|
+
public func bloom_watchos_music_stop(_ handle: UInt32) {
|
|
168
|
+
BloomAudioManager.shared.stopMusic(handle)
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
@_cdecl("bloom_watchos_music_volume")
|
|
172
|
+
public func bloom_watchos_music_volume(_ handle: UInt32, _ v: Float) {
|
|
173
|
+
BloomAudioManager.shared.setMusicVolume(handle, v)
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
@_cdecl("bloom_watchos_music_is_playing")
|
|
177
|
+
public func bloom_watchos_music_is_playing(_ handle: UInt32) -> UInt32 {
|
|
178
|
+
BloomAudioManager.shared.isMusicPlaying(handle) ? 1 : 0
|
|
179
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
//! Rust-side audio FFI that forwards to the Swift `BloomAudioManager`.
|
|
2
|
+
//!
|
|
3
|
+
//! The Swift shell owns AVAudioPlayer + AVAudioSession; this module is a
|
|
4
|
+
//! thin pass-through that decodes Perry string args + resolves bundle-relative
|
|
5
|
+
//! paths the same way textures does.
|
|
6
|
+
|
|
7
|
+
use std::ffi::CString;
|
|
8
|
+
use std::os::raw::c_char;
|
|
9
|
+
|
|
10
|
+
use crate::textures;
|
|
11
|
+
|
|
12
|
+
extern "C" {
|
|
13
|
+
fn bloom_watchos_audio_init();
|
|
14
|
+
fn bloom_watchos_audio_close();
|
|
15
|
+
fn bloom_watchos_sound_load(path: *const c_char) -> u32;
|
|
16
|
+
fn bloom_watchos_sound_play(handle: u32);
|
|
17
|
+
fn bloom_watchos_sound_stop(handle: u32);
|
|
18
|
+
fn bloom_watchos_sound_volume(handle: u32, volume: f32);
|
|
19
|
+
fn bloom_watchos_master_volume(volume: f32);
|
|
20
|
+
fn bloom_watchos_music_load(path: *const c_char) -> u32;
|
|
21
|
+
fn bloom_watchos_music_play(handle: u32);
|
|
22
|
+
fn bloom_watchos_music_stop(handle: u32);
|
|
23
|
+
fn bloom_watchos_music_volume(handle: u32, volume: f32);
|
|
24
|
+
fn bloom_watchos_music_is_playing(handle: u32) -> u32;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
fn load_with<F>(path: &str, load_fn: F) -> u32
|
|
28
|
+
where F: FnOnce(*const c_char) -> u32
|
|
29
|
+
{
|
|
30
|
+
if path.is_empty() { return 0; }
|
|
31
|
+
let full = if path.starts_with('/') { path.to_string() } else { textures::resolve_bundle_path(path) };
|
|
32
|
+
let Ok(c) = CString::new(full) else { return 0 };
|
|
33
|
+
unsafe { load_fn(c.as_ptr()) }
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
pub fn init_audio() { unsafe { bloom_watchos_audio_init(); } }
|
|
37
|
+
pub fn close_audio() { unsafe { bloom_watchos_audio_close(); } }
|
|
38
|
+
|
|
39
|
+
pub fn load_sound(path: &str) -> u32 {
|
|
40
|
+
load_with(path, |p| unsafe { bloom_watchos_sound_load(p) })
|
|
41
|
+
}
|
|
42
|
+
pub fn play_sound(handle: u32) { unsafe { bloom_watchos_sound_play(handle); } }
|
|
43
|
+
pub fn stop_sound(handle: u32) { unsafe { bloom_watchos_sound_stop(handle); } }
|
|
44
|
+
pub fn set_sound_volume(handle: u32, v: f32) { unsafe { bloom_watchos_sound_volume(handle, v); } }
|
|
45
|
+
pub fn set_master_volume(v: f32) { unsafe { bloom_watchos_master_volume(v); } }
|
|
46
|
+
|
|
47
|
+
pub fn load_music(path: &str) -> u32 {
|
|
48
|
+
load_with(path, |p| unsafe { bloom_watchos_music_load(p) })
|
|
49
|
+
}
|
|
50
|
+
pub fn play_music(handle: u32) { unsafe { bloom_watchos_music_play(handle); } }
|
|
51
|
+
pub fn stop_music(handle: u32) { unsafe { bloom_watchos_music_stop(handle); } }
|
|
52
|
+
pub fn set_music_volume(handle: u32, v: f32) { unsafe { bloom_watchos_music_volume(handle, v); } }
|
|
53
|
+
pub fn is_music_playing(handle: u32) -> bool {
|
|
54
|
+
unsafe { bloom_watchos_music_is_playing(handle) != 0 }
|
|
55
|
+
}
|
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
//! Thread-safe draw-command list the Swift Canvas reads each frame.
|
|
2
|
+
//!
|
|
3
|
+
//! Game thread (spawned by the Swift shell calling `_perry_user_main`) pushes
|
|
4
|
+
//! commands via `push()` between `begin()` / `end()`. At `end()`, the frame
|
|
5
|
+
//! counter increments. Swift side calls `snapshot()` to atomically copy the
|
|
6
|
+
//! current commands into a static buffer it can then iterate via `cmd_at()`
|
|
7
|
+
//! without holding any lock. The snapshot is valid until the next `snapshot()`
|
|
8
|
+
//! call — Swift drains it synchronously inside a single Canvas closure.
|
|
9
|
+
|
|
10
|
+
use std::sync::atomic::{AtomicU64, Ordering};
|
|
11
|
+
use std::sync::Mutex;
|
|
12
|
+
|
|
13
|
+
/// Inline text capacity — long enough for HUD / menu strings; games needing
|
|
14
|
+
/// longer text should split across commands.
|
|
15
|
+
pub const TEXT_CAP: usize = 256;
|
|
16
|
+
|
|
17
|
+
/// Command kinds. Kept stable across Swift + Rust — don't renumber without
|
|
18
|
+
/// updating BloomWatchApp.swift.
|
|
19
|
+
#[allow(dead_code)]
|
|
20
|
+
pub mod kind {
|
|
21
|
+
pub const CLEAR: i32 = 0;
|
|
22
|
+
pub const RECT: i32 = 1;
|
|
23
|
+
pub const RECT_LINES: i32 = 2;
|
|
24
|
+
pub const CIRCLE: i32 = 3;
|
|
25
|
+
pub const CIRCLE_LINES: i32 = 4;
|
|
26
|
+
pub const LINE: i32 = 5;
|
|
27
|
+
pub const TRIANGLE: i32 = 6;
|
|
28
|
+
pub const TEXTURE: i32 = 7; // whole texture at (x,y)
|
|
29
|
+
pub const TEXTURE_REC: i32 = 8; // source rect → dest rect, no rotation
|
|
30
|
+
pub const TEXTURE_PRO: i32 = 9; // full: source, dest, origin, rotation
|
|
31
|
+
pub const TEXT: i32 = 10;
|
|
32
|
+
|
|
33
|
+
// 3D immediate-mode primitives (pos = x,y,z; w,h = scale; src_x,y,z = secondary).
|
|
34
|
+
pub const CUBE: i32 = 20; // pos (x,y,z), size (w,h,size=depth)
|
|
35
|
+
pub const CUBE_WIRES: i32 = 21;
|
|
36
|
+
pub const SPHERE: i32 = 22; // pos (x,y,z), radius (w)
|
|
37
|
+
pub const SPHERE_WIRES: i32 = 23;
|
|
38
|
+
pub const CYLINDER: i32 = 24; // pos (x,y,z), radius (w), height (h)
|
|
39
|
+
pub const PLANE: i32 = 25; // pos (x,y,z), size (w,h)
|
|
40
|
+
pub const GRID: i32 = 26; // slices (w), spacing (h)
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
#[repr(C)]
|
|
44
|
+
#[derive(Clone, Copy)]
|
|
45
|
+
pub struct DrawCmd {
|
|
46
|
+
pub kind: i32,
|
|
47
|
+
pub _pad0: i32,
|
|
48
|
+
pub tex: u32,
|
|
49
|
+
pub _pad1: u32,
|
|
50
|
+
|
|
51
|
+
// Destination geometry.
|
|
52
|
+
pub x: f64,
|
|
53
|
+
pub y: f64,
|
|
54
|
+
pub w: f64,
|
|
55
|
+
pub h: f64,
|
|
56
|
+
|
|
57
|
+
// Source sub-rectangle (textures) or secondary point (lines).
|
|
58
|
+
pub src_x: f64,
|
|
59
|
+
pub src_y: f64,
|
|
60
|
+
pub src_w: f64,
|
|
61
|
+
pub src_h: f64,
|
|
62
|
+
|
|
63
|
+
// Origin / pivot for rotation + scale (relative to dest).
|
|
64
|
+
pub ox: f64,
|
|
65
|
+
pub oy: f64,
|
|
66
|
+
|
|
67
|
+
// Color, 0-255 per channel.
|
|
68
|
+
pub r: f64,
|
|
69
|
+
pub g: f64,
|
|
70
|
+
pub b: f64,
|
|
71
|
+
pub a: f64,
|
|
72
|
+
|
|
73
|
+
// rotation (degrees), size (font), thickness (lines), pad.
|
|
74
|
+
pub rot: f64,
|
|
75
|
+
pub size: f64,
|
|
76
|
+
pub thickness: f64,
|
|
77
|
+
pub _pad2: f64,
|
|
78
|
+
|
|
79
|
+
// Inline UTF-8 for text commands; text_len == 0 otherwise.
|
|
80
|
+
pub text: [u8; TEXT_CAP],
|
|
81
|
+
pub text_len: u64,
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
impl DrawCmd {
|
|
85
|
+
pub const fn zero() -> Self {
|
|
86
|
+
Self {
|
|
87
|
+
kind: 0,
|
|
88
|
+
_pad0: 0,
|
|
89
|
+
tex: 0,
|
|
90
|
+
_pad1: 0,
|
|
91
|
+
x: 0.0, y: 0.0, w: 0.0, h: 0.0,
|
|
92
|
+
src_x: 0.0, src_y: 0.0, src_w: 0.0, src_h: 0.0,
|
|
93
|
+
ox: 0.0, oy: 0.0,
|
|
94
|
+
r: 255.0, g: 255.0, b: 255.0, a: 255.0,
|
|
95
|
+
rot: 0.0, size: 0.0, thickness: 1.0, _pad2: 0.0,
|
|
96
|
+
text: [0; TEXT_CAP],
|
|
97
|
+
text_len: 0,
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
pub fn set_text(&mut self, s: &str) {
|
|
102
|
+
let bytes = s.as_bytes();
|
|
103
|
+
let n = bytes.len().min(TEXT_CAP);
|
|
104
|
+
self.text[..n].copy_from_slice(&bytes[..n]);
|
|
105
|
+
self.text_len = n as u64;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
struct Inner {
|
|
110
|
+
// The "building" list — game thread pushes into this between begin/end.
|
|
111
|
+
building: Vec<DrawCmd>,
|
|
112
|
+
// The "ready" list — snapshot target, what Swift reads.
|
|
113
|
+
ready: Vec<DrawCmd>,
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
static INNER: Mutex<Inner> = Mutex::new(Inner {
|
|
117
|
+
building: Vec::new(),
|
|
118
|
+
ready: Vec::new(),
|
|
119
|
+
});
|
|
120
|
+
|
|
121
|
+
/// Monotonic frame counter — Swift polls this and invalidates Canvas when it
|
|
122
|
+
/// changes. Game thread bumps it on `end()`.
|
|
123
|
+
static FRAME: AtomicU64 = AtomicU64::new(0);
|
|
124
|
+
|
|
125
|
+
/// Clear color packed as f64 bits for the current frame (r,g,b,a).
|
|
126
|
+
static CLEAR: [AtomicU64; 4] = [
|
|
127
|
+
AtomicU64::new(0),
|
|
128
|
+
AtomicU64::new(0),
|
|
129
|
+
AtomicU64::new(0),
|
|
130
|
+
AtomicU64::new(255f64.to_bits()),
|
|
131
|
+
];
|
|
132
|
+
|
|
133
|
+
/// 3D camera state — pos (xyz), target (xyz), up (xyz), fovy, proj (0=ortho, 1=persp).
|
|
134
|
+
/// Written by bloom_begin_mode_3d, read once per frame by the Swift SceneView.
|
|
135
|
+
static CAMERA: [AtomicU64; 11] = {
|
|
136
|
+
const INIT: AtomicU64 = AtomicU64::new(0);
|
|
137
|
+
[INIT; 11]
|
|
138
|
+
};
|
|
139
|
+
/// Non-zero when a 3D section has ever been opened — tells the Swift shell
|
|
140
|
+
/// it needs to host a SceneView, not just a Canvas.
|
|
141
|
+
static HAS_3D: std::sync::atomic::AtomicBool = std::sync::atomic::AtomicBool::new(false);
|
|
142
|
+
|
|
143
|
+
pub fn begin() {
|
|
144
|
+
let mut g = INNER.lock().unwrap();
|
|
145
|
+
g.building.clear();
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
pub fn end() {
|
|
149
|
+
{
|
|
150
|
+
let mut g = INNER.lock().unwrap();
|
|
151
|
+
// Move building → ready via take; clear the building list for the
|
|
152
|
+
// next frame. Can't use mem::swap on two fields of the same borrow.
|
|
153
|
+
let done = std::mem::take(&mut g.building);
|
|
154
|
+
g.ready = done;
|
|
155
|
+
}
|
|
156
|
+
FRAME.fetch_add(1, Ordering::Release);
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
pub fn push(cmd: DrawCmd) {
|
|
160
|
+
let mut g = INNER.lock().unwrap();
|
|
161
|
+
g.building.push(cmd);
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
pub fn set_clear(r: f64, g: f64, b: f64, a: f64) {
|
|
165
|
+
CLEAR[0].store(r.to_bits(), Ordering::Relaxed);
|
|
166
|
+
CLEAR[1].store(g.to_bits(), Ordering::Relaxed);
|
|
167
|
+
CLEAR[2].store(b.to_bits(), Ordering::Relaxed);
|
|
168
|
+
CLEAR[3].store(a.to_bits(), Ordering::Relaxed);
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
pub fn clear_rgba() -> [f64; 4] {
|
|
172
|
+
[
|
|
173
|
+
f64::from_bits(CLEAR[0].load(Ordering::Relaxed)),
|
|
174
|
+
f64::from_bits(CLEAR[1].load(Ordering::Relaxed)),
|
|
175
|
+
f64::from_bits(CLEAR[2].load(Ordering::Relaxed)),
|
|
176
|
+
f64::from_bits(CLEAR[3].load(Ordering::Relaxed)),
|
|
177
|
+
]
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
pub fn frame() -> u64 {
|
|
181
|
+
FRAME.load(Ordering::Acquire)
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
pub fn set_camera(px: f64, py: f64, pz: f64,
|
|
185
|
+
tx: f64, ty: f64, tz: f64,
|
|
186
|
+
ux: f64, uy: f64, uz: f64,
|
|
187
|
+
fovy: f64, proj: f64) {
|
|
188
|
+
let vals = [px, py, pz, tx, ty, tz, ux, uy, uz, fovy, proj];
|
|
189
|
+
for (i, v) in vals.iter().enumerate() {
|
|
190
|
+
CAMERA[i].store(v.to_bits(), Ordering::Relaxed);
|
|
191
|
+
}
|
|
192
|
+
HAS_3D.store(true, std::sync::atomic::Ordering::Release);
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
pub fn camera_snapshot(out: *mut f64) {
|
|
196
|
+
if out.is_null() { return; }
|
|
197
|
+
unsafe {
|
|
198
|
+
for i in 0..11 {
|
|
199
|
+
*out.add(i) = f64::from_bits(CAMERA[i].load(Ordering::Relaxed));
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
pub fn has_3d() -> bool {
|
|
205
|
+
HAS_3D.load(std::sync::atomic::Ordering::Acquire)
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
/// Bulk-copy the ready list into a Swift-supplied buffer. Returns the number
|
|
209
|
+
/// of commands actually copied (never more than `max`). Swift allocates a
|
|
210
|
+
/// single buffer once and reuses it each frame.
|
|
211
|
+
pub fn copy_into(dst: *mut DrawCmd, max: i64) -> i64 {
|
|
212
|
+
if dst.is_null() || max <= 0 {
|
|
213
|
+
return 0;
|
|
214
|
+
}
|
|
215
|
+
let g = INNER.lock().unwrap();
|
|
216
|
+
let n = g.ready.len().min(max as usize);
|
|
217
|
+
// SAFETY: caller guarantees `dst` points to at least `max` DrawCmds of
|
|
218
|
+
// writable memory with the same #[repr(C)] layout.
|
|
219
|
+
unsafe {
|
|
220
|
+
std::ptr::copy_nonoverlapping(g.ready.as_ptr(), dst, n);
|
|
221
|
+
}
|
|
222
|
+
n as i64
|
|
223
|
+
}
|