@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,903 @@
|
|
|
1
|
+
import { Color, Camera2D, Camera3D } from './types';
|
|
2
|
+
|
|
3
|
+
export type { Color, Vec2, Vec3, Vec4, Rect, Camera2D, Camera3D, Texture, Font, Sound, Music, Quat, Ray, BoundingBox, Model, Mat4, RayHit, FrustumPlanes } from './types';
|
|
4
|
+
export { ColorConstants, Colors } from './colors';
|
|
5
|
+
export { ColorConstants as Color } from './colors';
|
|
6
|
+
export { Key, MouseButton } from './keys';
|
|
7
|
+
|
|
8
|
+
// FFI declarations
|
|
9
|
+
declare function bloom_init_window(width: number, height: number, title: number, fullscreen: number): void;
|
|
10
|
+
declare function bloom_close_window(): void;
|
|
11
|
+
declare function bloom_window_should_close(): number;
|
|
12
|
+
declare function bloom_begin_drawing(): void;
|
|
13
|
+
declare function bloom_end_drawing(): void;
|
|
14
|
+
declare function bloom_take_screenshot(path: number): void;
|
|
15
|
+
declare function bloom_clear_background(r: number, g: number, b: number, a: number): void;
|
|
16
|
+
declare function bloom_set_env_clear_from_hdr(path: number): void;
|
|
17
|
+
declare function bloom_set_fog(r: number, g: number, b: number, density: number, height_ref: number, height_falloff: number): void;
|
|
18
|
+
declare function bloom_set_chromatic_aberration(strength: number): void;
|
|
19
|
+
declare function bloom_set_vignette(strength: number, softness: number): void;
|
|
20
|
+
declare function bloom_set_film_grain(strength: number): void;
|
|
21
|
+
declare function bloom_set_sun_shafts(strength: number, decay: number, r: number, g: number, b: number): void;
|
|
22
|
+
declare function bloom_set_auto_exposure(on: number): void;
|
|
23
|
+
declare function bloom_set_taa_enabled(on: number): void;
|
|
24
|
+
declare function bloom_set_render_scale(scale: number): void;
|
|
25
|
+
declare function bloom_get_render_scale(): number;
|
|
26
|
+
declare function bloom_set_upscale_mode(mode: number): void;
|
|
27
|
+
declare function bloom_set_cas_strength(strength: number): void;
|
|
28
|
+
declare function bloom_get_physical_width(): number;
|
|
29
|
+
declare function bloom_get_physical_height(): number;
|
|
30
|
+
declare function bloom_set_auto_resolution(targetHz: number, enabled: number): void;
|
|
31
|
+
declare function bloom_set_manual_exposure(value: number): void;
|
|
32
|
+
declare function bloom_set_env_intensity(intensity: number): void;
|
|
33
|
+
declare function bloom_set_ssgi_enabled(on: number): void;
|
|
34
|
+
declare function bloom_set_ssgi_intensity(intensity: number): void;
|
|
35
|
+
declare function bloom_set_ssgi_radius(radius: number): void;
|
|
36
|
+
declare function bloom_set_dof(enabled: number, focusDistance: number, aperture: number): void;
|
|
37
|
+
declare function bloom_set_quality_preset(preset: number): void;
|
|
38
|
+
declare function bloom_set_shadows_enabled(on: number): void;
|
|
39
|
+
declare function bloom_set_shadows_always_fresh(on: number): void;
|
|
40
|
+
declare function bloom_set_bloom_enabled(on: number): void;
|
|
41
|
+
declare function bloom_set_ssao_enabled(on: number): void;
|
|
42
|
+
declare function bloom_set_post_pass(source: number): number;
|
|
43
|
+
declare function bloom_clear_post_pass(): void;
|
|
44
|
+
declare function bloom_add_post_pass(source: number): number;
|
|
45
|
+
declare function bloom_clear_all_post_passes(): void;
|
|
46
|
+
declare function bloom_set_ssao_intensity(intensity: number): void;
|
|
47
|
+
declare function bloom_set_ssao_radius(worldRadius: number): void;
|
|
48
|
+
declare function bloom_set_wind(dirX: number, dirZ: number, amplitude: number, frequency: number): void;
|
|
49
|
+
declare function bloom_set_ssr_enabled(on: number): void;
|
|
50
|
+
declare function bloom_set_motion_blur_enabled(on: number): void;
|
|
51
|
+
declare function bloom_set_sss_enabled(on: number): void;
|
|
52
|
+
declare function bloom_set_profiler_enabled(on: number): void;
|
|
53
|
+
declare function bloom_get_profiler_frame_cpu_us(): number;
|
|
54
|
+
declare function bloom_get_profiler_frame_gpu_us(): number;
|
|
55
|
+
declare function bloom_print_profiler_summary(): void;
|
|
56
|
+
declare function bloom_profiler_overlay_text(): string;
|
|
57
|
+
declare function bloom_profiler_frame_history(): string;
|
|
58
|
+
declare function bloom_splat_impulse(x: number, z: number, radius: number, strength: number): void;
|
|
59
|
+
declare function bloom_set_material_params(handle: number, paramsPtr: any, paramCount: number): void;
|
|
60
|
+
declare function bloom_set_target_fps(fps: number): void;
|
|
61
|
+
declare function bloom_set_direct_2d_mode(on: number): void;
|
|
62
|
+
declare function bloom_get_delta_time(): number;
|
|
63
|
+
declare function bloom_get_fps(): number;
|
|
64
|
+
declare function bloom_get_screen_width(): number;
|
|
65
|
+
declare function bloom_get_screen_height(): number;
|
|
66
|
+
declare function bloom_is_key_pressed(key: number): number;
|
|
67
|
+
declare function bloom_is_key_down(key: number): number;
|
|
68
|
+
declare function bloom_is_key_released(key: number): number;
|
|
69
|
+
declare function bloom_get_mouse_x(): number;
|
|
70
|
+
declare function bloom_get_mouse_y(): number;
|
|
71
|
+
declare function bloom_is_mouse_button_pressed(btn: number): number;
|
|
72
|
+
declare function bloom_is_mouse_button_down(btn: number): number;
|
|
73
|
+
declare function bloom_is_mouse_button_released(btn: number): number;
|
|
74
|
+
|
|
75
|
+
// Camera FFI
|
|
76
|
+
declare function bloom_begin_mode_2d(ox: number, oy: number, tx: number, ty: number, rot: number, zoom: number): void;
|
|
77
|
+
declare function bloom_end_mode_2d(): void;
|
|
78
|
+
declare function bloom_begin_mode_3d(px: number, py: number, pz: number, tx: number, ty: number, tz: number, ux: number, uy: number, uz: number, fovy: number, proj: number): void;
|
|
79
|
+
declare function bloom_end_mode_3d(): void;
|
|
80
|
+
|
|
81
|
+
// Gamepad FFI
|
|
82
|
+
declare function bloom_is_gamepad_available(): number;
|
|
83
|
+
declare function bloom_get_gamepad_axis(axis: number): number;
|
|
84
|
+
declare function bloom_is_gamepad_button_pressed(btn: number): number;
|
|
85
|
+
declare function bloom_is_gamepad_button_down(btn: number): number;
|
|
86
|
+
declare function bloom_is_gamepad_button_released(btn: number): number;
|
|
87
|
+
declare function bloom_get_gamepad_axis_count(): number;
|
|
88
|
+
|
|
89
|
+
// Touch FFI
|
|
90
|
+
declare function bloom_get_touch_x(index: number): number;
|
|
91
|
+
declare function bloom_get_touch_y(index: number): number;
|
|
92
|
+
declare function bloom_get_touch_count(): number;
|
|
93
|
+
|
|
94
|
+
// Input injection FFI
|
|
95
|
+
declare function bloom_inject_key_down(key: number): void;
|
|
96
|
+
declare function bloom_inject_key_up(key: number): void;
|
|
97
|
+
declare function bloom_inject_gamepad_axis(axis: number, value: number): void;
|
|
98
|
+
declare function bloom_inject_gamepad_button_down(button: number): void;
|
|
99
|
+
declare function bloom_inject_gamepad_button_up(button: number): void;
|
|
100
|
+
declare function bloom_get_platform(): number;
|
|
101
|
+
declare function bloom_is_any_input_pressed(): number;
|
|
102
|
+
declare function bloom_get_crown_rotation(): number;
|
|
103
|
+
|
|
104
|
+
// Utility FFI
|
|
105
|
+
declare function bloom_toggle_fullscreen(): void;
|
|
106
|
+
declare function bloom_set_window_title(title: number): void;
|
|
107
|
+
declare function bloom_get_time(): number;
|
|
108
|
+
declare function bloom_set_window_icon(path: number): void;
|
|
109
|
+
declare function bloom_disable_cursor(): void;
|
|
110
|
+
declare function bloom_enable_cursor(): void;
|
|
111
|
+
declare function bloom_get_mouse_delta_x(): number;
|
|
112
|
+
declare function bloom_get_mouse_delta_y(): number;
|
|
113
|
+
declare function bloom_get_mouse_wheel(): number;
|
|
114
|
+
declare function bloom_get_char_pressed(): number;
|
|
115
|
+
declare function bloom_set_cursor_shape(shape: number): void;
|
|
116
|
+
declare function bloom_set_clipboard_text(text: number): void;
|
|
117
|
+
declare function bloom_get_clipboard_text(): number;
|
|
118
|
+
declare function bloom_open_file_dialog(filter: number, title: number): number;
|
|
119
|
+
declare function bloom_save_file_dialog(defaultName: number, title: number): number;
|
|
120
|
+
declare function bloom_write_file(path: number, data: number): number;
|
|
121
|
+
declare function bloom_file_exists(path: number): number;
|
|
122
|
+
declare function bloom_read_file(path: number): number;
|
|
123
|
+
declare function bloom_run_game(callback: number): void;
|
|
124
|
+
|
|
125
|
+
// Window management
|
|
126
|
+
|
|
127
|
+
export function initWindow(width: number, height: number, title: string, fullscreen: boolean = false): void {
|
|
128
|
+
bloom_init_window(width, height, title as any, fullscreen ? 1.0 : 0.0);
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
export function closeWindow(): void {
|
|
132
|
+
bloom_close_window();
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
export function windowShouldClose(): boolean {
|
|
136
|
+
return bloom_window_should_close() !== 0;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
// Drawing lifecycle
|
|
140
|
+
|
|
141
|
+
export function beginDrawing(): void {
|
|
142
|
+
bloom_begin_drawing();
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
export function endDrawing(): void {
|
|
146
|
+
bloom_end_drawing();
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* Capture the next rendered frame and write it as a PNG to `path`.
|
|
151
|
+
* The actual capture happens during the next `endDrawing()` call —
|
|
152
|
+
* call this immediately before that endDrawing(), and the file will
|
|
153
|
+
* be on disk afterwards.
|
|
154
|
+
*
|
|
155
|
+
* Used by `bloom-diff` and CI image regression workflows.
|
|
156
|
+
*/
|
|
157
|
+
export function takeScreenshot(path: string): void {
|
|
158
|
+
bloom_take_screenshot(path as any);
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
export function clearBackground(color: Color): void {
|
|
162
|
+
bloom_clear_background(color.r, color.g, color.b, color.a);
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
/**
|
|
166
|
+
* Set the clear color from the average luminance-weighted color of
|
|
167
|
+
* an HDR environment map (.hdr / Radiance format). A stand-in for
|
|
168
|
+
* proper equirect-sky-pass rendering until that lands — lets us
|
|
169
|
+
* immediately close most of the background-color gap between Bloom's
|
|
170
|
+
* realtime output and the path-traced reference.
|
|
171
|
+
*/
|
|
172
|
+
export function setEnvClearFromHdr(path: string): void {
|
|
173
|
+
bloom_set_env_clear_from_hdr(path as any);
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
// ---- Post-FX knobs ----
|
|
177
|
+
// All default to off. Calling these turns the corresponding
|
|
178
|
+
// composite-pass / TAA-pass effect on for the rest of the run
|
|
179
|
+
// (or until called again with 0 / disabled values).
|
|
180
|
+
|
|
181
|
+
/** Height-based exponential fog. Density 0 = off. */
|
|
182
|
+
export function setFog(r: number, g: number, b: number, density: number, heightRef: number, heightFalloff: number): void {
|
|
183
|
+
bloom_set_fog(r, g, b, density, heightRef, heightFalloff);
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
/** Radial RGB-channel split at the screen edges. 0 = off. */
|
|
187
|
+
export function setChromaticAberration(strength: number): void {
|
|
188
|
+
bloom_set_chromatic_aberration(strength);
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
/** Smooth radial darkening of the corners. strength 0..1, softness 0..1. */
|
|
192
|
+
export function setVignette(strength: number, softness: number): void {
|
|
193
|
+
bloom_set_vignette(strength, softness);
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
/** Animated film grain post-tonemap. 0 = off. */
|
|
197
|
+
export function setFilmGrain(strength: number): void {
|
|
198
|
+
bloom_set_film_grain(strength);
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
/** Screen-space sun shafts (god rays). strength 0 = off. */
|
|
202
|
+
export function setSunShafts(strength: number, decay: number, r: number, g: number, b: number): void {
|
|
203
|
+
bloom_set_sun_shafts(strength, decay, r, g, b);
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
/** Toggle physically-based auto-exposure. 18% gray target, log-average metered. */
|
|
207
|
+
export function setAutoExposure(on: boolean): void {
|
|
208
|
+
bloom_set_auto_exposure(on ? 1 : 0);
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
/** Toggle temporal anti-aliasing (sub-pixel jitter + reprojected history blend). */
|
|
212
|
+
export function setTaaEnabled(on: boolean): void {
|
|
213
|
+
bloom_set_taa_enabled(on ? 1 : 0);
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
/**
|
|
217
|
+
* Render-resolution multiplier. 0.5 = quarter-pixel shading (cheap, soft);
|
|
218
|
+
* 1.0 = native (sharp, expensive). Clamped to [0.5, 1.0]. Once called
|
|
219
|
+
* explicitly, the choice sticks across `setTaaEnabled` toggles instead of
|
|
220
|
+
* being overridden by the legacy 0.5↔1.0 coupling.
|
|
221
|
+
*
|
|
222
|
+
* On a 4K display: 0.75 hits a quality/perf sweet spot for 3D scenes.
|
|
223
|
+
* Catmull-Rom is the default upscale filter (see `setUpscaleMode`).
|
|
224
|
+
*/
|
|
225
|
+
export function setRenderScale(scale: number): void {
|
|
226
|
+
bloom_set_render_scale(Math.min(1.0, Math.max(0.5, scale)));
|
|
227
|
+
}
|
|
228
|
+
export function getRenderScale(): number { return bloom_get_render_scale(); }
|
|
229
|
+
|
|
230
|
+
/** Upscale filter when render_scale < 1 and TAA is off. "bilinear" = cheap/soft, "catmull-rom" = sharper (default). */
|
|
231
|
+
export type UpscaleMode = "bilinear" | "catmull-rom";
|
|
232
|
+
export function setUpscaleMode(mode: UpscaleMode): void {
|
|
233
|
+
bloom_set_upscale_mode(mode === "catmull-rom" ? 1 : 0);
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
/**
|
|
237
|
+
* Contrast-adaptive sharpen strength. 0 = off (default, pass skipped);
|
|
238
|
+
* 0.3 subtle; 0.6 punchy; 1.0 max. Useful at any render_scale — pairs
|
|
239
|
+
* particularly well with TAA-softened native or Catmull-Rom upscale.
|
|
240
|
+
*/
|
|
241
|
+
export function setCasStrength(strength: number): void {
|
|
242
|
+
bloom_set_cas_strength(strength);
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
/** Physical-pixel size of the GPU surface (HiDPI-aware on macOS today). */
|
|
246
|
+
export function getPhysicalWidth(): number { return bloom_get_physical_width(); }
|
|
247
|
+
export function getPhysicalHeight(): number { return bloom_get_physical_height(); }
|
|
248
|
+
|
|
249
|
+
/**
|
|
250
|
+
* Dynamic resolution scaling. When enabled, the engine self-tunes
|
|
251
|
+
* `render_scale` toward the given target framerate using a 6-rung
|
|
252
|
+
* ladder (0.50–1.00) with EMA-smoothed frame time, asymmetric
|
|
253
|
+
* hysteresis, and a 30-frame cooldown between steps.
|
|
254
|
+
*
|
|
255
|
+
* Call with `enabled = false` to disarm. Manual `setRenderScale`
|
|
256
|
+
* still works while DRS is on (DRS will simply step away from the
|
|
257
|
+
* value on its next eligible frame).
|
|
258
|
+
*/
|
|
259
|
+
export function setAutoResolution(targetHz: number, enabled: boolean = true): void {
|
|
260
|
+
bloom_set_auto_resolution(targetHz, enabled ? 1 : 0);
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
/** Manual exposure multiplier (ignored when auto-exposure is on). 1.0 = default. */
|
|
264
|
+
export function setManualExposure(value: number): void {
|
|
265
|
+
bloom_set_manual_exposure(value);
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
/** Env-map intensity multiplier for IBL + sky pass. 1.0 = reference, 0.2–0.5 typical for bright outdoor HDRs. */
|
|
269
|
+
export function setEnvIntensity(intensity: number): void {
|
|
270
|
+
bloom_set_env_intensity(intensity);
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
/** Toggle screen-space global illumination (single-bounce indirect diffuse). Default on. */
|
|
274
|
+
export function setSsgiEnabled(on: boolean): void {
|
|
275
|
+
bloom_set_ssgi_enabled(on ? 1 : 0);
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
/** SSGI intensity multiplier. 0 = off, 0.5 = default, 1+ = strong. */
|
|
279
|
+
export function setSsgiIntensity(intensity: number): void {
|
|
280
|
+
bloom_set_ssgi_intensity(intensity);
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
/** SSGI max view-space march distance in meters. Default 20. Tune to scene scale. */
|
|
284
|
+
export function setSsgiRadius(radius: number): void {
|
|
285
|
+
bloom_set_ssgi_radius(radius);
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
/** Depth of field. focusDistance = view-space distance in world units. aperture = blur strength (0 = off, 0.03 = subtle, 0.1 = heavy). */
|
|
289
|
+
export function setDepthOfField(focusDistance: number, aperture: number): void {
|
|
290
|
+
bloom_set_dof(aperture > 0 ? 1 : 0, focusDistance, aperture);
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
// ============================================================
|
|
294
|
+
// Render quality — let games pick a preset for the target device
|
|
295
|
+
// or toggle individual effects. Presets apply a known-good set of
|
|
296
|
+
// flags; individual setters can override afterward.
|
|
297
|
+
// ============================================================
|
|
298
|
+
|
|
299
|
+
export enum QualityPreset {
|
|
300
|
+
/** Bare minimum — no shadows, no SSAO, no bloom, no TAA, no SSR/SSGI/DoF/MB/SSS. */
|
|
301
|
+
Off = 0,
|
|
302
|
+
/** Base pipeline only: HDR tonemap + bloom. No shadows/SSAO/TAA. */
|
|
303
|
+
Low = 1,
|
|
304
|
+
/** Balanced default: shadows + SSAO + bloom + TAA. No SSR/SSGI/cinematic FX. */
|
|
305
|
+
Medium = 2,
|
|
306
|
+
/** + SSR, SSGI, subtle chromatic aberration. */
|
|
307
|
+
High = 3,
|
|
308
|
+
/** Everything on (plus DoF if aperture > 0). */
|
|
309
|
+
Ultra = 4,
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
/** Apply a quality preset in one call. Call individual setters after for fine-tuning. */
|
|
313
|
+
export function setQualityPreset(preset: QualityPreset): void {
|
|
314
|
+
bloom_set_quality_preset(preset);
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
/** Toggle cascaded shadow maps. Default on. Disable on low-end GPUs — biggest single win. */
|
|
318
|
+
export function setShadowsEnabled(on: boolean): void {
|
|
319
|
+
bloom_set_shadows_enabled(on ? 1 : 0);
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
/**
|
|
323
|
+
* Force cascaded shadow maps to re-render every frame, bypassing the
|
|
324
|
+
* static-caster cache (ticket 004). Default off. Turn on for games
|
|
325
|
+
* with continuously-changing light state (day/night cycles set from
|
|
326
|
+
* native code, heavily-deformable casters) where the cache hit rate
|
|
327
|
+
* would be ~zero anyway, so skipping the check saves a few µs.
|
|
328
|
+
*/
|
|
329
|
+
export function setShadowsAlwaysFresh(on: boolean): void {
|
|
330
|
+
bloom_set_shadows_always_fresh(on ? 1 : 0);
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
/** Toggle the bloom down/upsample chain (~10 passes). Default on. */
|
|
334
|
+
export function setBloomEnabled(on: boolean): void {
|
|
335
|
+
bloom_set_bloom_enabled(on ? 1 : 0);
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
/** Toggle screen-space ambient occlusion + its bilateral blur. Default on. */
|
|
339
|
+
export function setSsaoEnabled(on: boolean): void {
|
|
340
|
+
bloom_set_ssao_enabled(on ? 1 : 0);
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
/** SSAO strength. 0 disables corner darkening, 1 is default, 2 is heavy. */
|
|
344
|
+
export function setSsaoIntensity(intensity: number): void {
|
|
345
|
+
bloom_set_ssao_intensity(intensity);
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
/** SSAO sampling radius in world units. 0.1..2.0 m is the sane range. */
|
|
349
|
+
export function setSsaoRadius(worldRadius: number): void {
|
|
350
|
+
bloom_set_ssao_radius(worldRadius);
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
/// EN-017 — install a game-supplied fullscreen WGSL post-pass.
|
|
354
|
+
/// Runs after composite + tonemapping, before the 2D overlay, so
|
|
355
|
+
/// the HUD stays crisp. The fragment shader sees scene_color_tex
|
|
356
|
+
/// (LDR, post-tonemap) and scene_depth_tex at @group(0).
|
|
357
|
+
///
|
|
358
|
+
/// Example — underwater tint:
|
|
359
|
+
/// setPostPass(`
|
|
360
|
+
/// @fragment fn fs_main(@location(0) uv: vec2<f32>) -> @location(0) vec4<f32> {
|
|
361
|
+
/// let scene = textureSample(scene_color_tex, scene_color_samp, uv);
|
|
362
|
+
/// return vec4<f32>(scene.rgb * vec3<f32>(0.4, 0.7, 0.9), 1.0);
|
|
363
|
+
/// }
|
|
364
|
+
/// `);
|
|
365
|
+
///
|
|
366
|
+
/// Returns true on successful compile, false on shader error.
|
|
367
|
+
/// In V2 this is shorthand for `clearAllPostPasses()` followed by
|
|
368
|
+
/// `addPostPass(wgsl)` — the existing stack is wiped before the new
|
|
369
|
+
/// pass is installed, matching V1 single-slot semantics.
|
|
370
|
+
export function setPostPass(wgslSource: string): boolean {
|
|
371
|
+
return bloom_set_post_pass(wgslSource as any) > 0;
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
/// EN-017 — uninstall the active post-pass. The composite output
|
|
375
|
+
/// goes directly to the swapchain again (zero post-pass cost).
|
|
376
|
+
/// V2 alias for `clearAllPostPasses()`.
|
|
377
|
+
export function clearPostPass(): void {
|
|
378
|
+
bloom_clear_post_pass();
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
/// EN-017 V2 — append a fullscreen WGSL post-pass to the stack.
|
|
382
|
+
/// Each pass samples the previous pass's output (or scene_color_tex
|
|
383
|
+
/// for the first pass) and writes either to the next intermediate
|
|
384
|
+
/// (if more passes follow) or to the swapchain (if last).
|
|
385
|
+
///
|
|
386
|
+
/// Stack order matters: addPostPass(A); addPostPass(B); means A
|
|
387
|
+
/// runs first, then B sees A's output. Compose effects (e.g.
|
|
388
|
+
/// underwater tint, then damage flash, then scope vignette) in the
|
|
389
|
+
/// order they should apply.
|
|
390
|
+
///
|
|
391
|
+
/// Returns the 0-based index of the newly added pass on success,
|
|
392
|
+
/// or -1 if the shader failed to compile (existing stack untouched).
|
|
393
|
+
export function addPostPass(wgslSource: string): number {
|
|
394
|
+
const r = bloom_add_post_pass(wgslSource as any);
|
|
395
|
+
return r > 0 ? (r - 1) : -1;
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
/// EN-017 V2 — wipe the entire post-pass stack. The composite
|
|
399
|
+
/// output goes directly to the swapchain again (zero post-pass cost).
|
|
400
|
+
export function clearAllPostPasses(): void {
|
|
401
|
+
bloom_clear_all_post_passes();
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
/// Set the global wind field used by foliage materials.
|
|
405
|
+
/// dirX/dirZ define the wind direction in the XZ plane (need not be
|
|
406
|
+
/// normalised; magnitude scales effective amplitude).
|
|
407
|
+
/// amplitude is the displacement scale (~0.1 m typical for grass).
|
|
408
|
+
/// frequency is in Hz (~1.0 typical).
|
|
409
|
+
export function setWind(dirX: number, dirZ: number, amplitude: number, frequency: number): void {
|
|
410
|
+
bloom_set_wind(dirX, dirZ, amplitude, frequency);
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
/** Toggle screen-space reflections. Default on. */
|
|
414
|
+
export function setSsrEnabled(on: boolean): void {
|
|
415
|
+
bloom_set_ssr_enabled(on ? 1 : 0);
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
/** Toggle per-object motion blur. Default off. */
|
|
419
|
+
export function setMotionBlurEnabled(on: boolean): void {
|
|
420
|
+
bloom_set_motion_blur_enabled(on ? 1 : 0);
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
/** Toggle subsurface scattering (for skin/wax materials). Default off. */
|
|
424
|
+
export function setSssEnabled(on: boolean): void {
|
|
425
|
+
bloom_set_sss_enabled(on ? 1 : 0);
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
// ============================================================
|
|
429
|
+
// Profiler — measure CPU phase timings and (on supported GPUs)
|
|
430
|
+
// per-pass GPU times. Off by default; enable at runtime.
|
|
431
|
+
// ============================================================
|
|
432
|
+
|
|
433
|
+
/** Enable/disable the frame profiler. When off, it has zero per-frame cost. */
|
|
434
|
+
export function setProfilerEnabled(on: boolean): void {
|
|
435
|
+
bloom_set_profiler_enabled(on ? 1 : 0);
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
/** Average total CPU frame time (sum of all phases) over the rolling window, in microseconds. */
|
|
439
|
+
export function getProfilerFrameCpuUs(): number {
|
|
440
|
+
return bloom_get_profiler_frame_cpu_us();
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
/** Average total GPU frame time over the rolling window, in microseconds. 0 if GPU timing unavailable. */
|
|
444
|
+
export function getProfilerFrameGpuUs(): number {
|
|
445
|
+
return bloom_get_profiler_frame_gpu_us();
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
/** Print a per-phase CPU/GPU timing table to stdout. Useful for quick diagnostics. */
|
|
449
|
+
export function printProfilerSummary(): void {
|
|
450
|
+
bloom_print_profiler_summary();
|
|
451
|
+
}
|
|
452
|
+
|
|
453
|
+
/**
|
|
454
|
+
* Phase 7 — submit a world-space impulse splat. Per-frame compute
|
|
455
|
+
* accumulates + decays into a 256×256 top-down field covering a 128m
|
|
456
|
+
* centred square. Refractive/translucent materials sampling
|
|
457
|
+
* `impulse_tex` (group 4 binding 4) see the result. Up to 16 splats
|
|
458
|
+
* per frame; excess is dropped. Typical uses:
|
|
459
|
+
* - Footsteps in mud / wet pavement
|
|
460
|
+
* - Splashes when the player enters water
|
|
461
|
+
* - Explosion rings, impact ripples
|
|
462
|
+
*/
|
|
463
|
+
export function splatImpulse(x: number, z: number, radius: number, strength: number): void {
|
|
464
|
+
bloom_splat_impulse(x, z, radius, strength);
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
/**
|
|
468
|
+
* Phase 5 — set per-material `user_params` (ABI §1.4). Bytes are
|
|
469
|
+
* uploaded to `@group(2) @binding(11)` for the next dispatch of the
|
|
470
|
+
* given material. The shader casts them to whatever struct it
|
|
471
|
+
* declared. Up to 64 floats (256-byte ABI cap).
|
|
472
|
+
*
|
|
473
|
+
* Pass an empty array to revert to the default zero-initialised UBO.
|
|
474
|
+
*
|
|
475
|
+
* Example: a water material with a dynamic tint + wave amplitude
|
|
476
|
+
* `setMaterialParams(matWater, [0.10, 0.30, 0.40, 1.0, 0.20])`
|
|
477
|
+
* lets game code change colour per-zone without recompiling WGSL.
|
|
478
|
+
*/
|
|
479
|
+
export function setMaterialParams(handle: number, params: number[]): void {
|
|
480
|
+
bloom_set_material_params(handle, params as any, params.length);
|
|
481
|
+
}
|
|
482
|
+
|
|
483
|
+
/**
|
|
484
|
+
* Per-pass timings, sorted descending by CPU time. Each row:
|
|
485
|
+
* `{ label, cpuUs, gpuUs }` (gpuUs = -1 when the device has no
|
|
486
|
+
* TIMESTAMP_QUERY feature).
|
|
487
|
+
* Intended for an in-game overlay — games call it at draw time and
|
|
488
|
+
* render one `drawText` per entry.
|
|
489
|
+
*/
|
|
490
|
+
export function getProfilerOverlay(): { label: string, cpuUs: number, gpuUs: number }[] {
|
|
491
|
+
const raw = bloom_profiler_overlay_text();
|
|
492
|
+
if (!raw || raw.length === 0) return [];
|
|
493
|
+
const out: { label: string, cpuUs: number, gpuUs: number }[] = [];
|
|
494
|
+
const lines = raw.split('\n');
|
|
495
|
+
for (let i = 0; i < lines.length; i++) {
|
|
496
|
+
const line = lines[i];
|
|
497
|
+
if (line.length === 0) continue;
|
|
498
|
+
const parts = line.split('|');
|
|
499
|
+
if (parts.length < 3) continue;
|
|
500
|
+
out.push({
|
|
501
|
+
label: parts[0],
|
|
502
|
+
cpuUs: parseFloat(parts[1]),
|
|
503
|
+
gpuUs: parseFloat(parts[2]),
|
|
504
|
+
});
|
|
505
|
+
}
|
|
506
|
+
return out;
|
|
507
|
+
}
|
|
508
|
+
|
|
509
|
+
/**
|
|
510
|
+
* Phase 8 — last ~120 frames' CPU + GPU totals, oldest first.
|
|
511
|
+
* Useful for an overlay bar-chart of frame-time variance. GPU time
|
|
512
|
+
* is 0 when the device lacks TIMESTAMP_QUERY.
|
|
513
|
+
*/
|
|
514
|
+
export function getProfilerFrameHistory(): { cpuUs: number, gpuUs: number }[] {
|
|
515
|
+
const raw = bloom_profiler_frame_history();
|
|
516
|
+
if (!raw || raw.length === 0) return [];
|
|
517
|
+
const out: { cpuUs: number, gpuUs: number }[] = [];
|
|
518
|
+
const lines = raw.split('\n');
|
|
519
|
+
for (let i = 0; i < lines.length; i++) {
|
|
520
|
+
const line = lines[i];
|
|
521
|
+
if (line.length === 0) continue;
|
|
522
|
+
const parts = line.split('|');
|
|
523
|
+
if (parts.length < 2) continue;
|
|
524
|
+
out.push({ cpuUs: parseFloat(parts[0]), gpuUs: parseFloat(parts[1]) });
|
|
525
|
+
}
|
|
526
|
+
return out;
|
|
527
|
+
}
|
|
528
|
+
|
|
529
|
+
// Timing
|
|
530
|
+
|
|
531
|
+
export function setTargetFPS(fps: number): void {
|
|
532
|
+
bloom_set_target_fps(fps);
|
|
533
|
+
}
|
|
534
|
+
|
|
535
|
+
/**
|
|
536
|
+
* Enable direct-to-swapchain 2D mode. Skips scene prep, shadow maps,
|
|
537
|
+
* HDR/tonemap, SSAO, bloom, SDF/WSRC bakes and mesh-card passes —
|
|
538
|
+
* rendering goes straight through the batched 2D pipeline. Intended
|
|
539
|
+
* for pure-2D games that never populate the scene graph; on mobile
|
|
540
|
+
* GPUs this is the difference between ~15 fps and 60 fps.
|
|
541
|
+
*
|
|
542
|
+
* Call once after initWindow(). Off by default.
|
|
543
|
+
*/
|
|
544
|
+
export function setDirect2DMode(on: boolean): void {
|
|
545
|
+
bloom_set_direct_2d_mode(on ? 1.0 : 0.0);
|
|
546
|
+
}
|
|
547
|
+
|
|
548
|
+
export function getDeltaTime(): number {
|
|
549
|
+
return bloom_get_delta_time();
|
|
550
|
+
}
|
|
551
|
+
|
|
552
|
+
export function getFPS(): number {
|
|
553
|
+
return bloom_get_fps();
|
|
554
|
+
}
|
|
555
|
+
|
|
556
|
+
export function getTime(): number {
|
|
557
|
+
return bloom_get_time();
|
|
558
|
+
}
|
|
559
|
+
|
|
560
|
+
// Screen
|
|
561
|
+
|
|
562
|
+
export function getScreenWidth(): number {
|
|
563
|
+
return bloom_get_screen_width();
|
|
564
|
+
}
|
|
565
|
+
|
|
566
|
+
export function getScreenHeight(): number {
|
|
567
|
+
return bloom_get_screen_height();
|
|
568
|
+
}
|
|
569
|
+
|
|
570
|
+
// Keyboard input
|
|
571
|
+
|
|
572
|
+
export function isKeyPressed(key: number): boolean {
|
|
573
|
+
return bloom_is_key_pressed(key) !== 0;
|
|
574
|
+
}
|
|
575
|
+
|
|
576
|
+
export function isKeyDown(key: number): boolean {
|
|
577
|
+
return bloom_is_key_down(key) !== 0;
|
|
578
|
+
}
|
|
579
|
+
|
|
580
|
+
export function isKeyReleased(key: number): boolean {
|
|
581
|
+
return bloom_is_key_released(key) !== 0;
|
|
582
|
+
}
|
|
583
|
+
|
|
584
|
+
// Mouse input
|
|
585
|
+
|
|
586
|
+
export function getMouseX(): number {
|
|
587
|
+
return bloom_get_mouse_x();
|
|
588
|
+
}
|
|
589
|
+
|
|
590
|
+
export function getMouseY(): number {
|
|
591
|
+
return bloom_get_mouse_y();
|
|
592
|
+
}
|
|
593
|
+
|
|
594
|
+
export function isMouseButtonPressed(button: number): boolean {
|
|
595
|
+
return bloom_is_mouse_button_pressed(button) !== 0;
|
|
596
|
+
}
|
|
597
|
+
|
|
598
|
+
export function isMouseButtonDown(button: number): boolean {
|
|
599
|
+
return bloom_is_mouse_button_down(button) !== 0;
|
|
600
|
+
}
|
|
601
|
+
|
|
602
|
+
export function isMouseButtonReleased(button: number): boolean {
|
|
603
|
+
return bloom_is_mouse_button_released(button) !== 0;
|
|
604
|
+
}
|
|
605
|
+
|
|
606
|
+
// Convenience wrappers
|
|
607
|
+
|
|
608
|
+
export function getMousePosition(): { x: number; y: number } {
|
|
609
|
+
return { x: bloom_get_mouse_x(), y: bloom_get_mouse_y() };
|
|
610
|
+
}
|
|
611
|
+
|
|
612
|
+
export function getTouchPosition(index: number): { x: number; y: number } {
|
|
613
|
+
return { x: bloom_get_touch_x(index), y: bloom_get_touch_y(index) };
|
|
614
|
+
}
|
|
615
|
+
|
|
616
|
+
// Camera 2D
|
|
617
|
+
|
|
618
|
+
export function beginMode2D(camera: Camera2D): void {
|
|
619
|
+
bloom_begin_mode_2d(camera.offset.x, camera.offset.y, camera.target.x, camera.target.y, camera.rotation, camera.zoom);
|
|
620
|
+
}
|
|
621
|
+
|
|
622
|
+
// Raw variant: takes primitives directly. Workaround for aarch64 Android
|
|
623
|
+
// Perry miscompilation where obj.field reads feeding f64 FFI args arrive as NaN.
|
|
624
|
+
export function beginMode2DRaw(offsetX: number, offsetY: number, targetX: number, targetY: number, rotation: number, zoom: number): void {
|
|
625
|
+
bloom_begin_mode_2d(offsetX, offsetY, targetX, targetY, rotation, zoom);
|
|
626
|
+
}
|
|
627
|
+
|
|
628
|
+
export function endMode2D(): void {
|
|
629
|
+
bloom_end_mode_2d();
|
|
630
|
+
}
|
|
631
|
+
|
|
632
|
+
// Camera 3D
|
|
633
|
+
|
|
634
|
+
export function beginMode3D(camera: Camera3D): void {
|
|
635
|
+
const proj = camera.projection === "orthographic" ? 1 : 0;
|
|
636
|
+
bloom_begin_mode_3d(
|
|
637
|
+
camera.position.x, camera.position.y, camera.position.z,
|
|
638
|
+
camera.target.x, camera.target.y, camera.target.z,
|
|
639
|
+
camera.up.x, camera.up.y, camera.up.z,
|
|
640
|
+
camera.fovy, proj,
|
|
641
|
+
);
|
|
642
|
+
}
|
|
643
|
+
|
|
644
|
+
export function endMode3D(): void {
|
|
645
|
+
bloom_end_mode_3d();
|
|
646
|
+
}
|
|
647
|
+
|
|
648
|
+
// Gamepad — spec-compliant signatures with gamepad ID
|
|
649
|
+
|
|
650
|
+
export function isGamepadAvailable(id?: number): boolean {
|
|
651
|
+
return bloom_is_gamepad_available() !== 0;
|
|
652
|
+
}
|
|
653
|
+
|
|
654
|
+
export function getGamepadAxisValue(id: number, axis: number): number {
|
|
655
|
+
return bloom_get_gamepad_axis(axis);
|
|
656
|
+
}
|
|
657
|
+
|
|
658
|
+
export function getGamepadAxis(axis: number): number {
|
|
659
|
+
return bloom_get_gamepad_axis(axis);
|
|
660
|
+
}
|
|
661
|
+
|
|
662
|
+
export function isGamepadButtonPressed(button: number): boolean {
|
|
663
|
+
return bloom_is_gamepad_button_pressed(button) !== 0;
|
|
664
|
+
}
|
|
665
|
+
|
|
666
|
+
export function isGamepadButtonDown(button: number): boolean {
|
|
667
|
+
return bloom_is_gamepad_button_down(button) !== 0;
|
|
668
|
+
}
|
|
669
|
+
|
|
670
|
+
export function isGamepadButtonReleased(button: number): boolean {
|
|
671
|
+
return bloom_is_gamepad_button_released(button) !== 0;
|
|
672
|
+
}
|
|
673
|
+
|
|
674
|
+
export function getGamepadAxisCount(): number {
|
|
675
|
+
return bloom_get_gamepad_axis_count();
|
|
676
|
+
}
|
|
677
|
+
|
|
678
|
+
// Touch
|
|
679
|
+
|
|
680
|
+
export function getTouchX(index: number): number {
|
|
681
|
+
return bloom_get_touch_x(index);
|
|
682
|
+
}
|
|
683
|
+
|
|
684
|
+
export function getTouchY(index: number): number {
|
|
685
|
+
return bloom_get_touch_y(index);
|
|
686
|
+
}
|
|
687
|
+
|
|
688
|
+
export function getTouchCount(): number {
|
|
689
|
+
return bloom_get_touch_count();
|
|
690
|
+
}
|
|
691
|
+
|
|
692
|
+
export function getTouchPointCount(): number {
|
|
693
|
+
return bloom_get_touch_count();
|
|
694
|
+
}
|
|
695
|
+
|
|
696
|
+
// Utility
|
|
697
|
+
|
|
698
|
+
export function toggleFullscreen(): void {
|
|
699
|
+
bloom_toggle_fullscreen();
|
|
700
|
+
}
|
|
701
|
+
|
|
702
|
+
export function setWindowTitle(title: string): void {
|
|
703
|
+
bloom_set_window_title(title as any);
|
|
704
|
+
}
|
|
705
|
+
|
|
706
|
+
export function setWindowIcon(path: string): void {
|
|
707
|
+
bloom_set_window_icon(path as any);
|
|
708
|
+
}
|
|
709
|
+
|
|
710
|
+
export function disableCursor(): void {
|
|
711
|
+
bloom_disable_cursor();
|
|
712
|
+
}
|
|
713
|
+
|
|
714
|
+
export function enableCursor(): void {
|
|
715
|
+
bloom_enable_cursor();
|
|
716
|
+
}
|
|
717
|
+
|
|
718
|
+
export function getMouseDeltaX(): number {
|
|
719
|
+
return bloom_get_mouse_delta_x();
|
|
720
|
+
}
|
|
721
|
+
|
|
722
|
+
export function getMouseDeltaY(): number {
|
|
723
|
+
return bloom_get_mouse_delta_y();
|
|
724
|
+
}
|
|
725
|
+
|
|
726
|
+
/**
|
|
727
|
+
* Accumulated vertical scroll-wheel delta since the last call to this
|
|
728
|
+
* function. Positive values mean scrolling up (away from user on macOS);
|
|
729
|
+
* use this for camera zoom and scrollable UI panels. Reading consumes
|
|
730
|
+
* the value, so call it exactly once per frame.
|
|
731
|
+
*/
|
|
732
|
+
export function getMouseWheel(): number {
|
|
733
|
+
return bloom_get_mouse_wheel();
|
|
734
|
+
}
|
|
735
|
+
|
|
736
|
+
/**
|
|
737
|
+
* Dequeue the next typed character as a Unicode codepoint. Returns 0 when
|
|
738
|
+
* the queue is empty. Call in a loop each frame to consume all pending
|
|
739
|
+
* characters:
|
|
740
|
+
*
|
|
741
|
+
* let c = getCharPressed();
|
|
742
|
+
* while (c !== 0) {
|
|
743
|
+
* // handle character c
|
|
744
|
+
* c = getCharPressed();
|
|
745
|
+
* }
|
|
746
|
+
*
|
|
747
|
+
* Printable characters (codepoint >= 32) plus backspace (8), return (13),
|
|
748
|
+
* and tab (9) are enqueued. Platform-specific text input methods (NSEvent
|
|
749
|
+
* characters on macOS, WM_CHAR on Windows, etc.) feed this queue.
|
|
750
|
+
*/
|
|
751
|
+
export function getCharPressed(): number {
|
|
752
|
+
return bloom_get_char_pressed();
|
|
753
|
+
}
|
|
754
|
+
|
|
755
|
+
/**
|
|
756
|
+
* Set the mouse cursor shape. Values:
|
|
757
|
+
* 0 = default (arrow), 1 = hand, 2 = move, 3 = text (I-beam),
|
|
758
|
+
* 4 = resize horizontal, 5 = resize vertical, 6 = crosshair.
|
|
759
|
+
* Applied per-frame by the platform event loop.
|
|
760
|
+
*/
|
|
761
|
+
export const CursorShape = { Default: 0, Hand: 1, Move: 2, Text: 3, ResizeH: 4, ResizeV: 5, Crosshair: 6 } as const;
|
|
762
|
+
|
|
763
|
+
export function setCursorShape(shape: number): void {
|
|
764
|
+
bloom_set_cursor_shape(shape);
|
|
765
|
+
}
|
|
766
|
+
|
|
767
|
+
/**
|
|
768
|
+
* Copy text to the system clipboard.
|
|
769
|
+
*/
|
|
770
|
+
export function setClipboardText(text: string): void {
|
|
771
|
+
bloom_set_clipboard_text(text as any);
|
|
772
|
+
}
|
|
773
|
+
|
|
774
|
+
/**
|
|
775
|
+
* Read text from the system clipboard. Returns empty string on failure.
|
|
776
|
+
*/
|
|
777
|
+
export function getClipboardText(): string {
|
|
778
|
+
return bloom_get_clipboard_text() as any;
|
|
779
|
+
}
|
|
780
|
+
|
|
781
|
+
/**
|
|
782
|
+
* Open a native file-open dialog. Returns the selected file path, or
|
|
783
|
+
* empty string if the user cancelled. `filter` is a file extension
|
|
784
|
+
* (e.g. "world.json") or empty for all files.
|
|
785
|
+
*/
|
|
786
|
+
export function openFileDialog(filter: string, title: string): string {
|
|
787
|
+
return bloom_open_file_dialog(filter as any, title as any) as any;
|
|
788
|
+
}
|
|
789
|
+
|
|
790
|
+
/**
|
|
791
|
+
* Open a native file-save dialog. Returns the chosen save path, or
|
|
792
|
+
* empty string if cancelled.
|
|
793
|
+
*/
|
|
794
|
+
export function saveFileDialog(defaultName: string, title: string): string {
|
|
795
|
+
return bloom_save_file_dialog(defaultName as any, title as any) as any;
|
|
796
|
+
}
|
|
797
|
+
|
|
798
|
+
// File I/O
|
|
799
|
+
|
|
800
|
+
export function writeFile(path: string, data: string): boolean {
|
|
801
|
+
return bloom_write_file(path as any, data as any) !== 0.0;
|
|
802
|
+
}
|
|
803
|
+
|
|
804
|
+
export function fileExists(path: string): boolean {
|
|
805
|
+
return bloom_file_exists(path as any) !== 0.0;
|
|
806
|
+
}
|
|
807
|
+
|
|
808
|
+
export function readFile(path: string): string {
|
|
809
|
+
return bloom_read_file(path as any) as any;
|
|
810
|
+
}
|
|
811
|
+
|
|
812
|
+
// Input injection
|
|
813
|
+
|
|
814
|
+
export function injectKeyDown(key: number): void { bloom_inject_key_down(key); }
|
|
815
|
+
export function injectKeyUp(key: number): void { bloom_inject_key_up(key); }
|
|
816
|
+
export function injectGamepadAxis(axis: number, value: number): void { bloom_inject_gamepad_axis(axis, value); }
|
|
817
|
+
export function injectGamepadButtonDown(button: number): void { bloom_inject_gamepad_button_down(button); }
|
|
818
|
+
export function injectGamepadButtonUp(button: number): void { bloom_inject_gamepad_button_up(button); }
|
|
819
|
+
|
|
820
|
+
// Platform detection
|
|
821
|
+
|
|
822
|
+
export const Platform = { UNKNOWN: 0, MACOS: 1, IOS: 2, WINDOWS: 3, LINUX: 4, ANDROID: 5, TVOS: 6, WEB: 7, WATCHOS: 8 } as const;
|
|
823
|
+
|
|
824
|
+
export function getPlatform(): number { return bloom_get_platform(); }
|
|
825
|
+
|
|
826
|
+
export function isMobile(): boolean {
|
|
827
|
+
const p = bloom_get_platform();
|
|
828
|
+
return p === 2 || p === 5;
|
|
829
|
+
}
|
|
830
|
+
|
|
831
|
+
export function isTV(): boolean {
|
|
832
|
+
return bloom_get_platform() === 6;
|
|
833
|
+
}
|
|
834
|
+
|
|
835
|
+
export function isWatch(): boolean {
|
|
836
|
+
return bloom_get_platform() === 8;
|
|
837
|
+
}
|
|
838
|
+
|
|
839
|
+
/**
|
|
840
|
+
* Digital Crown rotation accumulated since the last call, in radians.
|
|
841
|
+
* Positive values = clockwise (scrolling away from the user).
|
|
842
|
+
* Returns 0 on platforms without a crown. Reading consumes the accumulator.
|
|
843
|
+
*/
|
|
844
|
+
export function getCrownRotation(): number {
|
|
845
|
+
return bloom_get_crown_rotation();
|
|
846
|
+
}
|
|
847
|
+
|
|
848
|
+
export function isAnyInputPressed(): boolean {
|
|
849
|
+
return bloom_is_any_input_pressed() !== 0;
|
|
850
|
+
}
|
|
851
|
+
|
|
852
|
+
/**
|
|
853
|
+
* Cross-platform game loop entry point (Emscripten-style).
|
|
854
|
+
*
|
|
855
|
+
* On native: blocks in a while loop calling beginDrawing/update/endDrawing each frame.
|
|
856
|
+
* On web: passes the callback to the JS runtime which drives it via requestAnimationFrame.
|
|
857
|
+
*
|
|
858
|
+
* Usage:
|
|
859
|
+
* initWindow(800, 600, "My Game");
|
|
860
|
+
* runGame((dt) => {
|
|
861
|
+
* clearBackground({ r: 0, g: 0, b: 0, a: 255 });
|
|
862
|
+
* // game logic + draw calls
|
|
863
|
+
* });
|
|
864
|
+
*/
|
|
865
|
+
export function runGame(update: (dt: number) => void): void {
|
|
866
|
+
const platform = bloom_get_platform();
|
|
867
|
+
if (platform === 7) {
|
|
868
|
+
// Web: delegate to JS glue layer via FFI.
|
|
869
|
+
// bloom_glue.js intercepts this call and sets up requestAnimationFrame.
|
|
870
|
+
bloom_run_game(update as any);
|
|
871
|
+
} else {
|
|
872
|
+
// Native: blocking game loop
|
|
873
|
+
while (!windowShouldClose()) {
|
|
874
|
+
beginDrawing();
|
|
875
|
+
update(getDeltaTime());
|
|
876
|
+
endDrawing();
|
|
877
|
+
}
|
|
878
|
+
}
|
|
879
|
+
}
|
|
880
|
+
|
|
881
|
+
// Pure TS camera helpers
|
|
882
|
+
|
|
883
|
+
export function getScreenToWorld2D(position: { x: number; y: number }, camera: Camera2D): { x: number; y: number } {
|
|
884
|
+
const cos = Math.cos(camera.rotation * Math.PI / 180);
|
|
885
|
+
const sin = Math.sin(camera.rotation * Math.PI / 180);
|
|
886
|
+
const dx = (position.x - camera.offset.x) / camera.zoom;
|
|
887
|
+
const dy = (position.y - camera.offset.y) / camera.zoom;
|
|
888
|
+
return {
|
|
889
|
+
x: cos * dx + sin * dy + camera.target.x,
|
|
890
|
+
y: -sin * dx + cos * dy + camera.target.y,
|
|
891
|
+
};
|
|
892
|
+
}
|
|
893
|
+
|
|
894
|
+
export function getWorldToScreen2D(position: { x: number; y: number }, camera: Camera2D): { x: number; y: number } {
|
|
895
|
+
const cos = Math.cos(camera.rotation * Math.PI / 180);
|
|
896
|
+
const sin = Math.sin(camera.rotation * Math.PI / 180);
|
|
897
|
+
const dx = position.x - camera.target.x;
|
|
898
|
+
const dy = position.y - camera.target.y;
|
|
899
|
+
return {
|
|
900
|
+
x: (cos * dx - sin * dy) * camera.zoom + camera.offset.x,
|
|
901
|
+
y: (sin * dx + cos * dy) * camera.zoom + camera.offset.y,
|
|
902
|
+
};
|
|
903
|
+
}
|