@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,2739 @@
|
|
|
1
|
+
use bloom_shared::engine::EngineState;
|
|
2
|
+
use bloom_shared::renderer::Renderer;
|
|
3
|
+
|
|
4
|
+
use wasm_bindgen::prelude::*;
|
|
5
|
+
use std::sync::OnceLock;
|
|
6
|
+
use std::sync::atomic::{AtomicBool, Ordering};
|
|
7
|
+
|
|
8
|
+
static mut ENGINE: OnceLock<EngineState> = OnceLock::new();
|
|
9
|
+
static mut LAST_PROJECT: (f64, f64) = (0.0, 0.0);
|
|
10
|
+
static mut LAST_PICK: Option<bloom_shared::picking::PickResult> = None;
|
|
11
|
+
// Guards against double wgpu init when bloom_init_window is called twice
|
|
12
|
+
// (once by the JS orchestrator before Perry boots, and once by Perry's main).
|
|
13
|
+
static INIT_STARTED: AtomicBool = AtomicBool::new(false);
|
|
14
|
+
|
|
15
|
+
fn engine() -> &'static mut EngineState {
|
|
16
|
+
unsafe { ENGINE.get_mut().expect("Engine not initialized") }
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/// Log to the browser console.
|
|
20
|
+
#[wasm_bindgen]
|
|
21
|
+
extern "C" {
|
|
22
|
+
#[wasm_bindgen(js_namespace = console, js_name = log)]
|
|
23
|
+
fn console_log(s: &str);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
// ============================================================
|
|
27
|
+
// Window
|
|
28
|
+
// ============================================================
|
|
29
|
+
|
|
30
|
+
/// Returns 1.0 once `ENGINE` has been populated by the async wgpu setup, 0.0
|
|
31
|
+
/// before then. Non-panicking — safe to call at any time. Used by the JS
|
|
32
|
+
/// orchestrator to gate Perry boot until the engine is actually usable.
|
|
33
|
+
#[wasm_bindgen]
|
|
34
|
+
pub fn bloom_is_initialized() -> f64 {
|
|
35
|
+
unsafe { if ENGINE.get().is_some() { 1.0 } else { 0.0 } }
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
#[wasm_bindgen]
|
|
39
|
+
pub fn bloom_init_window(width: f64, height: f64, _title: f64, fullscreen: f64) {
|
|
40
|
+
// Set up panic hook for better error messages in the browser console
|
|
41
|
+
console_error_panic_hook::set_once();
|
|
42
|
+
|
|
43
|
+
// Idempotent: once an init is in flight (or done), later calls are no-ops.
|
|
44
|
+
// Perry's main() typically calls initWindow after the JS orchestrator has
|
|
45
|
+
// already kicked off wgpu setup — the second call must not start a new one.
|
|
46
|
+
if INIT_STARTED.swap(true, Ordering::SeqCst) {
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
let log_w = width as u32;
|
|
51
|
+
let log_h = height as u32;
|
|
52
|
+
let _fullscreen = fullscreen != 0.0;
|
|
53
|
+
|
|
54
|
+
wasm_bindgen_futures::spawn_local(async move {
|
|
55
|
+
let window = web_sys::window().expect("no global window");
|
|
56
|
+
let document = window.document().expect("no document");
|
|
57
|
+
let canvas = document
|
|
58
|
+
.get_element_by_id("bloom-canvas")
|
|
59
|
+
.expect("no element with id 'bloom-canvas'")
|
|
60
|
+
.dyn_into::<web_sys::HtmlCanvasElement>()
|
|
61
|
+
.expect("element is not a canvas");
|
|
62
|
+
|
|
63
|
+
// HiDPI: size the canvas *backing store* (set_width/set_height,
|
|
64
|
+
// i.e. the WebGPU surface) to logical × devicePixelRatio so a
|
|
65
|
+
// 4K Retina display actually renders at 4K. CSS layout dimensions
|
|
66
|
+
// stay in logical pixels — index.html keeps `width: 100%` on
|
|
67
|
+
// the canvas — so the document layout is unchanged. Clamp to
|
|
68
|
+
// [1, 3] because higher dprs (some phones report 4) are wasted
|
|
69
|
+
// shading work and can crash low-end mobile GPUs.
|
|
70
|
+
let dpr = window.device_pixel_ratio().max(1.0).min(3.0);
|
|
71
|
+
let phys_w = ((log_w as f64) * dpr).round() as u32;
|
|
72
|
+
let phys_h = ((log_h as f64) * dpr).round() as u32;
|
|
73
|
+
canvas.set_width(phys_w);
|
|
74
|
+
canvas.set_height(phys_h);
|
|
75
|
+
|
|
76
|
+
let instance = wgpu::Instance::new(wgpu::InstanceDescriptor {
|
|
77
|
+
backends: wgpu::Backends::BROWSER_WEBGPU | wgpu::Backends::GL,
|
|
78
|
+
..wgpu::InstanceDescriptor::new_without_display_handle()
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
let surface = instance
|
|
82
|
+
.create_surface(wgpu::SurfaceTarget::Canvas(canvas))
|
|
83
|
+
.expect("Failed to create surface from canvas");
|
|
84
|
+
|
|
85
|
+
let adapter = instance
|
|
86
|
+
.request_adapter(&wgpu::RequestAdapterOptions {
|
|
87
|
+
compatible_surface: Some(&surface),
|
|
88
|
+
power_preference: wgpu::PowerPreference::HighPerformance,
|
|
89
|
+
..Default::default()
|
|
90
|
+
})
|
|
91
|
+
.await
|
|
92
|
+
.expect("No WebGPU/WebGL adapter found");
|
|
93
|
+
|
|
94
|
+
let (device, queue) = adapter
|
|
95
|
+
.request_device(
|
|
96
|
+
&wgpu::DeviceDescriptor {
|
|
97
|
+
label: Some("bloom_device"),
|
|
98
|
+
..Default::default()
|
|
99
|
+
},
|
|
100
|
+
)
|
|
101
|
+
.await
|
|
102
|
+
.expect("Failed to create device");
|
|
103
|
+
|
|
104
|
+
let surface_caps = surface.get_capabilities(&adapter);
|
|
105
|
+
let format = surface_caps
|
|
106
|
+
.formats
|
|
107
|
+
.iter()
|
|
108
|
+
.find(|f| f.is_srgb())
|
|
109
|
+
.copied()
|
|
110
|
+
.unwrap_or(surface_caps.formats[0]);
|
|
111
|
+
|
|
112
|
+
let surface_config = wgpu::SurfaceConfiguration {
|
|
113
|
+
usage: wgpu::TextureUsages::RENDER_ATTACHMENT | wgpu::TextureUsages::COPY_SRC,
|
|
114
|
+
format,
|
|
115
|
+
width: phys_w,
|
|
116
|
+
height: phys_h,
|
|
117
|
+
present_mode: wgpu::PresentMode::Fifo,
|
|
118
|
+
alpha_mode: surface_caps.alpha_modes[0],
|
|
119
|
+
view_formats: vec![],
|
|
120
|
+
desired_maximum_frame_latency: 2,
|
|
121
|
+
};
|
|
122
|
+
surface.configure(&device, &surface_config);
|
|
123
|
+
|
|
124
|
+
let renderer = Renderer::new(device, queue, surface, surface_config, log_w, log_h);
|
|
125
|
+
let engine_state = EngineState::new(renderer);
|
|
126
|
+
|
|
127
|
+
unsafe {
|
|
128
|
+
let _ = ENGINE.set(engine_state);
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
console_log("Bloom engine initialized (WebGPU)");
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
#[wasm_bindgen]
|
|
136
|
+
pub fn bloom_close_window() {
|
|
137
|
+
// TODO: Phase 3 — clean up resources if needed
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
/// Web-only resize hook. Called from index.html when a ResizeObserver
|
|
141
|
+
/// or matchMedia(`(resolution: ...)`) signals the canvas's CSS box
|
|
142
|
+
/// changed or devicePixelRatio shifted (e.g. browser zoom). The JS
|
|
143
|
+
/// glue does the dpr math; we just receive both sizes and forward to
|
|
144
|
+
/// the renderer.
|
|
145
|
+
#[wasm_bindgen]
|
|
146
|
+
pub fn bloom_resize(physical_w: f64, physical_h: f64, logical_w: f64, logical_h: f64) {
|
|
147
|
+
let pw = (physical_w as u32).max(1);
|
|
148
|
+
let ph = (physical_h as u32).max(1);
|
|
149
|
+
let lw = (logical_w as u32).max(1);
|
|
150
|
+
let lh = (logical_h as u32).max(1);
|
|
151
|
+
unsafe {
|
|
152
|
+
if let Some(eng) = ENGINE.get_mut() {
|
|
153
|
+
if pw != eng.renderer.physical_width() || ph != eng.renderer.physical_height() {
|
|
154
|
+
eng.renderer.resize(pw, ph, lw, lh);
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
#[wasm_bindgen]
|
|
161
|
+
pub fn bloom_window_should_close() -> f64 {
|
|
162
|
+
// Web windows don't close the same way; always return false
|
|
163
|
+
0.0
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
#[wasm_bindgen]
|
|
167
|
+
pub fn bloom_toggle_fullscreen() {
|
|
168
|
+
// Handled by JS glue — uses Fullscreen API on the canvas element
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
#[wasm_bindgen]
|
|
172
|
+
pub fn bloom_set_window_title(_title: f64) {
|
|
173
|
+
// TODO: Phase 3 — set document.title (need string conversion)
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
#[wasm_bindgen]
|
|
177
|
+
pub fn bloom_set_window_icon(_path: f64) {
|
|
178
|
+
// TODO: Phase 3 — set favicon (need string conversion + fetch)
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
// ============================================================
|
|
182
|
+
// Drawing
|
|
183
|
+
// ============================================================
|
|
184
|
+
|
|
185
|
+
#[wasm_bindgen]
|
|
186
|
+
pub fn bloom_begin_drawing() {
|
|
187
|
+
// No event polling needed on web — events are injected from JS via bloom_inject_*
|
|
188
|
+
engine().begin_frame();
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
#[wasm_bindgen]
|
|
192
|
+
pub fn bloom_end_drawing() {
|
|
193
|
+
engine().end_frame();
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
#[wasm_bindgen]
|
|
197
|
+
pub fn bloom_clear_background(r: f64, g: f64, b: f64, a: f64) {
|
|
198
|
+
engine().renderer.set_clear_color(r, g, b, a);
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
// ============================================================
|
|
202
|
+
// Timing
|
|
203
|
+
// ============================================================
|
|
204
|
+
|
|
205
|
+
#[wasm_bindgen]
|
|
206
|
+
pub fn bloom_set_target_fps(fps: f64) {
|
|
207
|
+
engine().target_fps = fps;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
#[wasm_bindgen]
|
|
211
|
+
pub fn bloom_set_direct_2d_mode(on: f64) {
|
|
212
|
+
engine().direct_2d_mode = on > 0.5;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
#[wasm_bindgen]
|
|
216
|
+
pub fn bloom_get_delta_time() -> f64 {
|
|
217
|
+
engine().delta_time
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
#[wasm_bindgen]
|
|
221
|
+
pub fn bloom_get_fps() -> f64 {
|
|
222
|
+
engine().get_fps()
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
#[wasm_bindgen]
|
|
226
|
+
pub fn bloom_get_screen_width() -> f64 {
|
|
227
|
+
engine().screen_width()
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
#[wasm_bindgen]
|
|
231
|
+
pub fn bloom_get_screen_height() -> f64 {
|
|
232
|
+
engine().screen_height()
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
#[wasm_bindgen]
|
|
236
|
+
pub fn bloom_get_time() -> f64 {
|
|
237
|
+
engine().get_time()
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
// ============================================================
|
|
241
|
+
// Input - Keyboard
|
|
242
|
+
// ============================================================
|
|
243
|
+
|
|
244
|
+
#[wasm_bindgen]
|
|
245
|
+
pub fn bloom_is_key_pressed(key: f64) -> f64 {
|
|
246
|
+
if engine().input.is_key_pressed(key as usize) { 1.0 } else { 0.0 }
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
#[wasm_bindgen]
|
|
250
|
+
pub fn bloom_is_key_down(key: f64) -> f64 {
|
|
251
|
+
if engine().input.is_key_down(key as usize) { 1.0 } else { 0.0 }
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
#[wasm_bindgen]
|
|
255
|
+
pub fn bloom_is_key_released(key: f64) -> f64 {
|
|
256
|
+
if engine().input.is_key_released(key as usize) { 1.0 } else { 0.0 }
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
// ============================================================
|
|
260
|
+
// Input - Mouse
|
|
261
|
+
// ============================================================
|
|
262
|
+
|
|
263
|
+
#[wasm_bindgen]
|
|
264
|
+
pub fn bloom_get_mouse_x() -> f64 {
|
|
265
|
+
engine().input.mouse_x
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
#[wasm_bindgen]
|
|
269
|
+
pub fn bloom_get_mouse_y() -> f64 {
|
|
270
|
+
engine().input.mouse_y
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
#[wasm_bindgen]
|
|
274
|
+
pub fn bloom_is_mouse_button_pressed(btn: f64) -> f64 {
|
|
275
|
+
if engine().input.is_mouse_button_pressed(btn as usize) { 1.0 } else { 0.0 }
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
#[wasm_bindgen]
|
|
279
|
+
pub fn bloom_is_mouse_button_down(btn: f64) -> f64 {
|
|
280
|
+
if engine().input.is_mouse_button_down(btn as usize) { 1.0 } else { 0.0 }
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
#[wasm_bindgen]
|
|
284
|
+
pub fn bloom_is_mouse_button_released(btn: f64) -> f64 {
|
|
285
|
+
if engine().input.is_mouse_button_released(btn as usize) { 1.0 } else { 0.0 }
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
#[wasm_bindgen]
|
|
289
|
+
pub fn bloom_get_mouse_delta_x() -> f64 {
|
|
290
|
+
engine().input.mouse_delta_x
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
#[wasm_bindgen]
|
|
294
|
+
pub fn bloom_get_mouse_delta_y() -> f64 {
|
|
295
|
+
engine().input.mouse_delta_y
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
// Accumulated scroll wheel delta since the last call. Reading consumes the
|
|
299
|
+
// value. Used by the editor's orbit camera and any scrollable UI panel.
|
|
300
|
+
#[wasm_bindgen]
|
|
301
|
+
pub fn bloom_get_mouse_wheel() -> f64 {
|
|
302
|
+
engine().input.consume_mouse_wheel()
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
#[wasm_bindgen]
|
|
306
|
+
pub fn bloom_get_char_pressed() -> f64 {
|
|
307
|
+
engine().input.pop_char() as f64
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
// Model bounds accessors. Return the axis-aligned bounding box of a loaded
|
|
311
|
+
// model in model-local coordinates.
|
|
312
|
+
#[wasm_bindgen]
|
|
313
|
+
pub fn bloom_get_model_bounds_min_x(model_handle: f64) -> f64 {
|
|
314
|
+
engine().models.get_bounds(model_handle).0[0] as f64
|
|
315
|
+
}
|
|
316
|
+
#[wasm_bindgen]
|
|
317
|
+
pub fn bloom_get_model_bounds_min_y(model_handle: f64) -> f64 {
|
|
318
|
+
engine().models.get_bounds(model_handle).0[1] as f64
|
|
319
|
+
}
|
|
320
|
+
#[wasm_bindgen]
|
|
321
|
+
pub fn bloom_get_model_bounds_min_z(model_handle: f64) -> f64 {
|
|
322
|
+
engine().models.get_bounds(model_handle).0[2] as f64
|
|
323
|
+
}
|
|
324
|
+
#[wasm_bindgen]
|
|
325
|
+
pub fn bloom_get_model_bounds_max_x(model_handle: f64) -> f64 {
|
|
326
|
+
engine().models.get_bounds(model_handle).1[0] as f64
|
|
327
|
+
}
|
|
328
|
+
#[wasm_bindgen]
|
|
329
|
+
pub fn bloom_get_model_bounds_max_y(model_handle: f64) -> f64 {
|
|
330
|
+
engine().models.get_bounds(model_handle).1[1] as f64
|
|
331
|
+
}
|
|
332
|
+
#[wasm_bindgen]
|
|
333
|
+
pub fn bloom_get_model_bounds_max_z(model_handle: f64) -> f64 {
|
|
334
|
+
engine().models.get_bounds(model_handle).1[2] as f64
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
// ============================================================
|
|
338
|
+
// Input - Gamepad
|
|
339
|
+
// ============================================================
|
|
340
|
+
|
|
341
|
+
#[wasm_bindgen]
|
|
342
|
+
pub fn bloom_is_gamepad_available(gamepad: f64) -> f64 {
|
|
343
|
+
let _ = gamepad;
|
|
344
|
+
if engine().input.is_gamepad_available() { 1.0 } else { 0.0 }
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
#[wasm_bindgen]
|
|
348
|
+
pub fn bloom_get_gamepad_axis(gamepad: f64, axis: f64) -> f64 {
|
|
349
|
+
let _ = gamepad;
|
|
350
|
+
engine().input.get_gamepad_axis(axis as usize) as f64
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
#[wasm_bindgen]
|
|
354
|
+
pub fn bloom_is_gamepad_button_pressed(gamepad: f64, button: f64) -> f64 {
|
|
355
|
+
let _ = gamepad;
|
|
356
|
+
if engine().input.is_gamepad_button_pressed(button as usize) { 1.0 } else { 0.0 }
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
#[wasm_bindgen]
|
|
360
|
+
pub fn bloom_is_gamepad_button_down(gamepad: f64, button: f64) -> f64 {
|
|
361
|
+
let _ = gamepad;
|
|
362
|
+
if engine().input.is_gamepad_button_down(button as usize) { 1.0 } else { 0.0 }
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
#[wasm_bindgen]
|
|
366
|
+
pub fn bloom_is_gamepad_button_released(gamepad: f64, button: f64) -> f64 {
|
|
367
|
+
let _ = gamepad;
|
|
368
|
+
if engine().input.is_gamepad_button_released(button as usize) { 1.0 } else { 0.0 }
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
#[wasm_bindgen]
|
|
372
|
+
pub fn bloom_get_gamepad_axis_count(gamepad: f64) -> f64 {
|
|
373
|
+
let _ = gamepad;
|
|
374
|
+
engine().input.get_gamepad_axis_count() as f64
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
// ============================================================
|
|
378
|
+
// Input - Touch
|
|
379
|
+
// ============================================================
|
|
380
|
+
|
|
381
|
+
#[wasm_bindgen]
|
|
382
|
+
pub fn bloom_get_touch_x() -> f64 {
|
|
383
|
+
engine().input.get_touch_x(0)
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
#[wasm_bindgen]
|
|
387
|
+
pub fn bloom_get_touch_y() -> f64 {
|
|
388
|
+
engine().input.get_touch_y(0)
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
#[wasm_bindgen]
|
|
392
|
+
pub fn bloom_get_touch_count() -> f64 {
|
|
393
|
+
engine().input.get_touch_count() as f64
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
// ============================================================
|
|
397
|
+
// Input injection (called from JS event listeners)
|
|
398
|
+
// ============================================================
|
|
399
|
+
|
|
400
|
+
#[wasm_bindgen]
|
|
401
|
+
pub fn bloom_inject_key_down(key: f64) {
|
|
402
|
+
engine().input.set_key_down(key as usize);
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
#[wasm_bindgen]
|
|
406
|
+
pub fn bloom_inject_key_up(key: f64) {
|
|
407
|
+
engine().input.set_key_up(key as usize);
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
#[wasm_bindgen]
|
|
411
|
+
pub fn bloom_inject_gamepad_axis(axis: f64, value: f64) {
|
|
412
|
+
engine().input.set_gamepad_axis(axis as usize, value as f32);
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
#[wasm_bindgen]
|
|
416
|
+
pub fn bloom_inject_gamepad_button_down(button: f64) {
|
|
417
|
+
engine().input.set_gamepad_button_down(button as usize);
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
#[wasm_bindgen]
|
|
421
|
+
pub fn bloom_inject_gamepad_button_up(button: f64) {
|
|
422
|
+
engine().input.set_gamepad_button_up(button as usize);
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
// ============================================================
|
|
426
|
+
// 2D Drawing - Shapes
|
|
427
|
+
// ============================================================
|
|
428
|
+
|
|
429
|
+
#[wasm_bindgen]
|
|
430
|
+
pub fn bloom_draw_line(x1: f64, y1: f64, x2: f64, y2: f64, thickness: f64, r: f64, g: f64, b: f64, a: f64) {
|
|
431
|
+
engine().renderer.draw_line(x1, y1, x2, y2, thickness, r, g, b, a);
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
#[wasm_bindgen]
|
|
435
|
+
pub fn bloom_draw_rect(x: f64, y: f64, w: f64, h: f64, r: f64, g: f64, b: f64, a: f64) {
|
|
436
|
+
engine().renderer.draw_rect(x, y, w, h, r, g, b, a);
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
#[wasm_bindgen]
|
|
440
|
+
pub fn bloom_draw_rect_lines(x: f64, y: f64, w: f64, h: f64, thickness: f64, r: f64, g: f64, b: f64, a: f64) {
|
|
441
|
+
engine().renderer.draw_rect_lines(x, y, w, h, thickness, r, g, b, a);
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
#[wasm_bindgen]
|
|
445
|
+
pub fn bloom_draw_circle(cx: f64, cy: f64, radius: f64, r: f64, g: f64, b: f64, a: f64) {
|
|
446
|
+
engine().renderer.draw_circle(cx, cy, radius, r, g, b, a);
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
#[wasm_bindgen]
|
|
450
|
+
pub fn bloom_draw_circle_lines(cx: f64, cy: f64, radius: f64, r: f64, g: f64, b: f64, a: f64) {
|
|
451
|
+
engine().renderer.draw_circle_lines(cx, cy, radius, r, g, b, a);
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
#[wasm_bindgen]
|
|
455
|
+
pub fn bloom_draw_triangle(x1: f64, y1: f64, x2: f64, y2: f64, x3: f64, y3: f64, r: f64, g: f64, b: f64, a: f64) {
|
|
456
|
+
engine().renderer.draw_triangle(x1, y1, x2, y2, x3, y3, r, g, b, a);
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
#[wasm_bindgen]
|
|
460
|
+
pub fn bloom_draw_poly(cx: f64, cy: f64, sides: f64, radius: f64, rotation: f64, r: f64, g: f64, b: f64, a: f64) {
|
|
461
|
+
engine().renderer.draw_poly(cx, cy, sides, radius, rotation, r, g, b, a);
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
// ============================================================
|
|
465
|
+
// Camera 2D
|
|
466
|
+
// ============================================================
|
|
467
|
+
|
|
468
|
+
#[wasm_bindgen]
|
|
469
|
+
pub fn bloom_begin_mode_2d(offset_x: f64, offset_y: f64, target_x: f64, target_y: f64, rotation: f64, zoom: f64) {
|
|
470
|
+
engine().renderer.begin_mode_2d(
|
|
471
|
+
offset_x as f32, offset_y as f32,
|
|
472
|
+
target_x as f32, target_y as f32,
|
|
473
|
+
rotation as f32, zoom as f32,
|
|
474
|
+
);
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
#[wasm_bindgen]
|
|
478
|
+
pub fn bloom_end_mode_2d() {
|
|
479
|
+
engine().renderer.end_mode_2d();
|
|
480
|
+
}
|
|
481
|
+
|
|
482
|
+
// ============================================================
|
|
483
|
+
// Camera 3D and 3D Drawing
|
|
484
|
+
// ============================================================
|
|
485
|
+
|
|
486
|
+
#[wasm_bindgen]
|
|
487
|
+
pub fn bloom_begin_mode_3d(
|
|
488
|
+
pos_x: f64, pos_y: f64, pos_z: f64,
|
|
489
|
+
target_x: f64, target_y: f64, target_z: f64,
|
|
490
|
+
up_x: f64, up_y: f64, up_z: f64,
|
|
491
|
+
fovy: f64, projection: f64,
|
|
492
|
+
) {
|
|
493
|
+
engine().renderer.begin_mode_3d(
|
|
494
|
+
pos_x as f32, pos_y as f32, pos_z as f32,
|
|
495
|
+
target_x as f32, target_y as f32, target_z as f32,
|
|
496
|
+
up_x as f32, up_y as f32, up_z as f32,
|
|
497
|
+
fovy as f32, projection as f32,
|
|
498
|
+
);
|
|
499
|
+
}
|
|
500
|
+
|
|
501
|
+
#[wasm_bindgen]
|
|
502
|
+
pub fn bloom_end_mode_3d() {
|
|
503
|
+
engine().renderer.end_mode_3d();
|
|
504
|
+
}
|
|
505
|
+
|
|
506
|
+
#[wasm_bindgen]
|
|
507
|
+
pub fn bloom_draw_cube(x: f64, y: f64, z: f64, w: f64, h: f64, d: f64, r: f64, g: f64, b: f64, a: f64) {
|
|
508
|
+
engine().renderer.draw_cube(x, y, z, w, h, d, r, g, b, a);
|
|
509
|
+
}
|
|
510
|
+
|
|
511
|
+
#[wasm_bindgen]
|
|
512
|
+
pub fn bloom_draw_cube_wires(x: f64, y: f64, z: f64, w: f64, h: f64, d: f64, r: f64, g: f64, b: f64, a: f64) {
|
|
513
|
+
engine().renderer.draw_cube_wires(x, y, z, w, h, d, r, g, b, a);
|
|
514
|
+
}
|
|
515
|
+
|
|
516
|
+
#[wasm_bindgen]
|
|
517
|
+
pub fn bloom_draw_sphere(cx: f64, cy: f64, cz: f64, radius: f64, r: f64, g: f64, b: f64, a: f64) {
|
|
518
|
+
engine().renderer.draw_sphere(cx, cy, cz, radius, r, g, b, a);
|
|
519
|
+
}
|
|
520
|
+
|
|
521
|
+
#[wasm_bindgen]
|
|
522
|
+
pub fn bloom_draw_sphere_wires(cx: f64, cy: f64, cz: f64, radius: f64, r: f64, g: f64, b: f64, a: f64) {
|
|
523
|
+
engine().renderer.draw_sphere_wires(cx, cy, cz, radius, r, g, b, a);
|
|
524
|
+
}
|
|
525
|
+
|
|
526
|
+
#[wasm_bindgen]
|
|
527
|
+
pub fn bloom_draw_cylinder(x: f64, y: f64, z: f64, radius_top: f64, radius_bottom: f64, height: f64, r: f64, g: f64, b: f64, a: f64) {
|
|
528
|
+
engine().renderer.draw_cylinder(x, y, z, radius_top, radius_bottom, height, r, g, b, a);
|
|
529
|
+
}
|
|
530
|
+
|
|
531
|
+
#[wasm_bindgen]
|
|
532
|
+
pub fn bloom_draw_plane(cx: f64, cy: f64, cz: f64, w: f64, d: f64, r: f64, g: f64, b: f64, a: f64) {
|
|
533
|
+
engine().renderer.draw_plane(cx, cy, cz, w, d, r, g, b, a);
|
|
534
|
+
}
|
|
535
|
+
|
|
536
|
+
#[wasm_bindgen]
|
|
537
|
+
pub fn bloom_draw_grid(slices: f64, spacing: f64) {
|
|
538
|
+
engine().renderer.draw_grid(slices as i32, spacing);
|
|
539
|
+
}
|
|
540
|
+
|
|
541
|
+
#[wasm_bindgen]
|
|
542
|
+
pub fn bloom_draw_ray(origin_x: f64, origin_y: f64, origin_z: f64, dir_x: f64, dir_y: f64, dir_z: f64, r: f64, g: f64, b: f64, a: f64) {
|
|
543
|
+
engine().renderer.draw_ray(origin_x, origin_y, origin_z, dir_x, dir_y, dir_z, r, g, b, a);
|
|
544
|
+
}
|
|
545
|
+
|
|
546
|
+
// ============================================================
|
|
547
|
+
// Text
|
|
548
|
+
// ============================================================
|
|
549
|
+
|
|
550
|
+
// The original FFI functions accept f64 (NaN-boxed string handles from Perry WASM).
|
|
551
|
+
// The JS glue intercepts these and calls the _str variants below with actual strings.
|
|
552
|
+
#[wasm_bindgen]
|
|
553
|
+
pub fn bloom_draw_text(_text: f64, _x: f64, _y: f64, _size: f64, _r: f64, _g: f64, _b: f64, _a: f64) {
|
|
554
|
+
// No-op: JS glue calls bloom_draw_text_str instead
|
|
555
|
+
}
|
|
556
|
+
|
|
557
|
+
#[wasm_bindgen]
|
|
558
|
+
pub fn bloom_draw_text_str(text: &str, x: f64, y: f64, size: f64, r: f64, g: f64, b: f64, a: f64) {
|
|
559
|
+
let eng = engine();
|
|
560
|
+
let mut text_renderer = std::mem::replace(&mut eng.text, bloom_shared::text_renderer::TextRenderer::empty());
|
|
561
|
+
text_renderer.draw_text(&mut eng.renderer, text, x, y, size as u32, r, g, b, a);
|
|
562
|
+
eng.text = text_renderer;
|
|
563
|
+
}
|
|
564
|
+
|
|
565
|
+
#[wasm_bindgen]
|
|
566
|
+
pub fn bloom_measure_text(_text: f64, _size: f64) -> f64 { 0.0 }
|
|
567
|
+
|
|
568
|
+
#[wasm_bindgen]
|
|
569
|
+
pub fn bloom_measure_text_str(text: &str, size: f64) -> f64 {
|
|
570
|
+
engine().text.measure_text(text, size as u32)
|
|
571
|
+
}
|
|
572
|
+
|
|
573
|
+
#[wasm_bindgen]
|
|
574
|
+
pub fn bloom_load_font(_path: f64, _size: f64) -> f64 { 0.0 }
|
|
575
|
+
|
|
576
|
+
/// Load a font from raw bytes (fetched by JS glue via fetch()).
|
|
577
|
+
#[wasm_bindgen]
|
|
578
|
+
pub fn bloom_load_font_bytes(data: &[u8]) -> f64 {
|
|
579
|
+
engine().text.load_font(data) as f64
|
|
580
|
+
}
|
|
581
|
+
|
|
582
|
+
#[wasm_bindgen]
|
|
583
|
+
pub fn bloom_unload_font(font_handle: f64) {
|
|
584
|
+
engine().text.unload_font(font_handle as usize);
|
|
585
|
+
}
|
|
586
|
+
|
|
587
|
+
#[wasm_bindgen]
|
|
588
|
+
pub fn bloom_draw_text_ex(_font_handle: f64, _text: f64, _x: f64, _y: f64, _size: f64, _spacing: f64, _r: f64, _g: f64, _b: f64, _a: f64) {
|
|
589
|
+
// No-op: JS glue calls bloom_draw_text_ex_str instead
|
|
590
|
+
}
|
|
591
|
+
|
|
592
|
+
#[wasm_bindgen]
|
|
593
|
+
pub fn bloom_draw_text_ex_str(font_handle: f64, text: &str, x: f64, y: f64, size: f64, spacing: f64, r: f64, g: f64, b: f64, a: f64) {
|
|
594
|
+
let eng = engine();
|
|
595
|
+
let mut text_renderer = std::mem::replace(&mut eng.text, bloom_shared::text_renderer::TextRenderer::empty());
|
|
596
|
+
text_renderer.draw_text_ex(&mut eng.renderer, font_handle as usize, text, x, y, size as u32, spacing as f32, r, g, b, a);
|
|
597
|
+
eng.text = text_renderer;
|
|
598
|
+
}
|
|
599
|
+
|
|
600
|
+
#[wasm_bindgen]
|
|
601
|
+
pub fn bloom_measure_text_ex(_font_handle: f64, _text: f64, _size: f64, _spacing: f64) -> f64 { 0.0 }
|
|
602
|
+
|
|
603
|
+
#[wasm_bindgen]
|
|
604
|
+
pub fn bloom_measure_text_ex_str(font_handle: f64, text: &str, size: f64, spacing: f64) -> f64 {
|
|
605
|
+
engine().text.measure_text_ex(font_handle as usize, text, size as u32, spacing as f32)
|
|
606
|
+
}
|
|
607
|
+
|
|
608
|
+
// --- Texture loading from bytes (fetched by JS glue) ---
|
|
609
|
+
|
|
610
|
+
/// Load a texture from raw image bytes (PNG/JPEG/etc.), fetched by JS glue via fetch().
|
|
611
|
+
#[wasm_bindgen]
|
|
612
|
+
pub fn bloom_load_texture_bytes(data: &[u8]) -> f64 {
|
|
613
|
+
let eng = engine();
|
|
614
|
+
let renderer_ptr = &mut eng.renderer as *mut bloom_shared::renderer::Renderer;
|
|
615
|
+
eng.textures.load_texture(unsafe { &mut *renderer_ptr }, data)
|
|
616
|
+
}
|
|
617
|
+
|
|
618
|
+
// ============================================================
|
|
619
|
+
// Textures
|
|
620
|
+
// ============================================================
|
|
621
|
+
|
|
622
|
+
#[wasm_bindgen]
|
|
623
|
+
pub fn bloom_load_texture(_path: f64) -> f64 {
|
|
624
|
+
// TODO: Phase 3 — need fetch() for texture file + string conversion
|
|
625
|
+
0.0
|
|
626
|
+
}
|
|
627
|
+
|
|
628
|
+
#[wasm_bindgen]
|
|
629
|
+
pub fn bloom_unload_texture(handle: f64) {
|
|
630
|
+
let eng = engine();
|
|
631
|
+
let renderer_ptr = &mut eng.renderer as *mut Renderer;
|
|
632
|
+
eng.textures.unload_texture(handle, unsafe { &mut *renderer_ptr });
|
|
633
|
+
}
|
|
634
|
+
|
|
635
|
+
#[wasm_bindgen]
|
|
636
|
+
pub fn bloom_draw_texture(handle: f64, x: f64, y: f64, tint_r: f64, tint_g: f64, tint_b: f64, tint_a: f64) {
|
|
637
|
+
let eng = engine();
|
|
638
|
+
if let Some(tex) = eng.textures.get(handle) {
|
|
639
|
+
let bind_group_idx = tex.bind_group_idx;
|
|
640
|
+
eng.renderer.draw_texture(bind_group_idx, x, y, tint_r, tint_g, tint_b, tint_a);
|
|
641
|
+
}
|
|
642
|
+
}
|
|
643
|
+
|
|
644
|
+
#[wasm_bindgen]
|
|
645
|
+
pub fn bloom_draw_texture_pro(
|
|
646
|
+
handle: f64,
|
|
647
|
+
src_x: f64, src_y: f64, src_w: f64, src_h: f64,
|
|
648
|
+
dst_x: f64, dst_y: f64, dst_w: f64, dst_h: f64,
|
|
649
|
+
origin_x: f64, origin_y: f64, rotation: f64,
|
|
650
|
+
tint_r: f64, tint_g: f64, tint_b: f64, tint_a: f64,
|
|
651
|
+
) {
|
|
652
|
+
let eng = engine();
|
|
653
|
+
if let Some(tex) = eng.textures.get(handle) {
|
|
654
|
+
let bind_group_idx = tex.bind_group_idx;
|
|
655
|
+
eng.renderer.draw_texture_pro(
|
|
656
|
+
bind_group_idx,
|
|
657
|
+
src_x, src_y, src_w, src_h,
|
|
658
|
+
dst_x, dst_y, dst_w, dst_h,
|
|
659
|
+
origin_x, origin_y, rotation,
|
|
660
|
+
tint_r, tint_g, tint_b, tint_a,
|
|
661
|
+
);
|
|
662
|
+
}
|
|
663
|
+
}
|
|
664
|
+
|
|
665
|
+
#[wasm_bindgen]
|
|
666
|
+
pub fn bloom_draw_texture_rec(
|
|
667
|
+
handle: f64,
|
|
668
|
+
src_x: f64, src_y: f64, src_w: f64, src_h: f64,
|
|
669
|
+
dst_x: f64, dst_y: f64,
|
|
670
|
+
tint_r: f64, tint_g: f64, tint_b: f64, tint_a: f64,
|
|
671
|
+
) {
|
|
672
|
+
let eng = engine();
|
|
673
|
+
if let Some(tex) = eng.textures.get(handle) {
|
|
674
|
+
let bind_group_idx = tex.bind_group_idx;
|
|
675
|
+
eng.renderer.draw_texture_rec(
|
|
676
|
+
bind_group_idx,
|
|
677
|
+
src_x, src_y, src_w, src_h,
|
|
678
|
+
dst_x, dst_y,
|
|
679
|
+
tint_r, tint_g, tint_b, tint_a,
|
|
680
|
+
);
|
|
681
|
+
}
|
|
682
|
+
}
|
|
683
|
+
|
|
684
|
+
#[wasm_bindgen]
|
|
685
|
+
pub fn bloom_get_texture_width(handle: f64) -> f64 {
|
|
686
|
+
engine().textures.get(handle).map(|t| t.width as f64).unwrap_or(0.0)
|
|
687
|
+
}
|
|
688
|
+
|
|
689
|
+
#[wasm_bindgen]
|
|
690
|
+
pub fn bloom_get_texture_height(handle: f64) -> f64 {
|
|
691
|
+
engine().textures.get(handle).map(|t| t.height as f64).unwrap_or(0.0)
|
|
692
|
+
}
|
|
693
|
+
|
|
694
|
+
#[wasm_bindgen]
|
|
695
|
+
pub fn bloom_load_image(_path: f64) -> f64 { 0.0 }
|
|
696
|
+
|
|
697
|
+
#[wasm_bindgen]
|
|
698
|
+
pub fn bloom_load_image_bytes(data: &[u8]) -> f64 {
|
|
699
|
+
engine().textures.load_image(data)
|
|
700
|
+
}
|
|
701
|
+
|
|
702
|
+
#[wasm_bindgen]
|
|
703
|
+
pub fn bloom_image_resize(handle: f64, w: f64, h: f64) {
|
|
704
|
+
engine().textures.image_resize(handle, w as u32, h as u32);
|
|
705
|
+
}
|
|
706
|
+
|
|
707
|
+
#[wasm_bindgen]
|
|
708
|
+
pub fn bloom_image_crop(handle: f64, x: f64, y: f64, w: f64, h: f64) {
|
|
709
|
+
engine().textures.image_crop(handle, x as u32, y as u32, w as u32, h as u32);
|
|
710
|
+
}
|
|
711
|
+
|
|
712
|
+
#[wasm_bindgen]
|
|
713
|
+
pub fn bloom_image_flip_h(handle: f64) {
|
|
714
|
+
engine().textures.image_flip_h(handle);
|
|
715
|
+
}
|
|
716
|
+
|
|
717
|
+
#[wasm_bindgen]
|
|
718
|
+
pub fn bloom_image_flip_v(handle: f64) {
|
|
719
|
+
engine().textures.image_flip_v(handle);
|
|
720
|
+
}
|
|
721
|
+
|
|
722
|
+
#[wasm_bindgen]
|
|
723
|
+
pub fn bloom_load_texture_from_image(handle: f64) -> f64 {
|
|
724
|
+
let eng = engine();
|
|
725
|
+
let renderer_ptr = &mut eng.renderer as *mut Renderer;
|
|
726
|
+
eng.textures.load_texture_from_image(handle, unsafe { &mut *renderer_ptr })
|
|
727
|
+
}
|
|
728
|
+
|
|
729
|
+
#[wasm_bindgen]
|
|
730
|
+
pub fn bloom_gen_texture_mipmaps(_handle: f64) {
|
|
731
|
+
// Mipmap generation is handled by the GPU texture creation pipeline
|
|
732
|
+
}
|
|
733
|
+
|
|
734
|
+
#[wasm_bindgen]
|
|
735
|
+
pub fn bloom_set_texture_filter(handle: f64, mode: f64) {
|
|
736
|
+
let eng = engine();
|
|
737
|
+
if let Some(tex) = eng.textures.get(handle) {
|
|
738
|
+
let bind_group_idx = tex.bind_group_idx;
|
|
739
|
+
eng.renderer.set_texture_filter(bind_group_idx, mode > 0.5);
|
|
740
|
+
}
|
|
741
|
+
}
|
|
742
|
+
|
|
743
|
+
// ============================================================
|
|
744
|
+
// Models
|
|
745
|
+
// ============================================================
|
|
746
|
+
|
|
747
|
+
#[wasm_bindgen]
|
|
748
|
+
pub fn bloom_load_model(_path: f64) -> f64 { 0.0 }
|
|
749
|
+
|
|
750
|
+
#[wasm_bindgen]
|
|
751
|
+
pub fn bloom_load_model_bytes(data: &[u8]) -> f64 {
|
|
752
|
+
let eng = engine();
|
|
753
|
+
eng.models.load_model_with_textures(data, &mut eng.renderer)
|
|
754
|
+
}
|
|
755
|
+
|
|
756
|
+
#[wasm_bindgen]
|
|
757
|
+
pub fn bloom_draw_model(handle: f64, x: f64, y: f64, z: f64, scale: f64, r: f64, g: f64, b: f64, a: f64) {
|
|
758
|
+
let eng = engine();
|
|
759
|
+
if let Some(model) = eng.models.get(handle) {
|
|
760
|
+
let position = [x as f32, y as f32, z as f32];
|
|
761
|
+
let scale = scale as f32;
|
|
762
|
+
let tint = [(r / 255.0) as f32, (g / 255.0) as f32, (b / 255.0) as f32, (a / 255.0) as f32];
|
|
763
|
+
let handle_bits = handle.to_bits();
|
|
764
|
+
if eng.renderer.cache_model_if_static(handle_bits, &model.meshes) {
|
|
765
|
+
eng.renderer.draw_model_cached(handle_bits, position, scale, tint);
|
|
766
|
+
} else {
|
|
767
|
+
for mesh in &model.meshes {
|
|
768
|
+
let tex_idx = mesh.texture_idx.unwrap_or(0);
|
|
769
|
+
eng.renderer.draw_model_mesh_tinted(&mesh.vertices, &mesh.indices, position, scale, tint, tex_idx);
|
|
770
|
+
}
|
|
771
|
+
}
|
|
772
|
+
}
|
|
773
|
+
}
|
|
774
|
+
|
|
775
|
+
#[wasm_bindgen]
|
|
776
|
+
pub fn bloom_draw_model_rotated(
|
|
777
|
+
handle: f64, x: f64, y: f64, z: f64,
|
|
778
|
+
scale: f64, rot_y: f64,
|
|
779
|
+
color_packed_argb: f64,
|
|
780
|
+
) {
|
|
781
|
+
let bits = color_packed_argb as u32;
|
|
782
|
+
let a = ((bits >> 24) & 0xff) as f32 / 255.0;
|
|
783
|
+
let r = ((bits >> 16) & 0xff) as f32 / 255.0;
|
|
784
|
+
let g = ((bits >> 8) & 0xff) as f32 / 255.0;
|
|
785
|
+
let b = ( bits & 0xff) as f32 / 255.0;
|
|
786
|
+
let eng = engine();
|
|
787
|
+
if let Some(model) = eng.models.get(handle) {
|
|
788
|
+
let position = [x as f32, y as f32, z as f32];
|
|
789
|
+
let scale = scale as f32;
|
|
790
|
+
let tint = [r, g, b, a];
|
|
791
|
+
for mesh in &model.meshes {
|
|
792
|
+
let tex_idx = mesh.texture_idx.unwrap_or(0);
|
|
793
|
+
eng.renderer.draw_model_mesh_tinted_rotated(
|
|
794
|
+
&mesh.vertices, &mesh.indices, position, scale, tint, tex_idx, rot_y as f32,
|
|
795
|
+
);
|
|
796
|
+
}
|
|
797
|
+
}
|
|
798
|
+
}
|
|
799
|
+
|
|
800
|
+
#[wasm_bindgen]
|
|
801
|
+
pub fn bloom_unload_model(handle: f64) {
|
|
802
|
+
engine().models.unload_model(handle);
|
|
803
|
+
}
|
|
804
|
+
|
|
805
|
+
#[wasm_bindgen]
|
|
806
|
+
pub fn bloom_gen_mesh_cube(w: f64, h: f64, d: f64) -> f64 {
|
|
807
|
+
engine().models.gen_mesh_cube(w as f32, h as f32, d as f32)
|
|
808
|
+
}
|
|
809
|
+
|
|
810
|
+
#[wasm_bindgen]
|
|
811
|
+
pub fn bloom_gen_mesh_heightmap(image_handle: f64, size_x: f64, size_y: f64, size_z: f64) -> f64 {
|
|
812
|
+
let eng = engine();
|
|
813
|
+
if let Some(img) = eng.textures.images.get(image_handle) {
|
|
814
|
+
let data = img.data.clone();
|
|
815
|
+
let w = img.width;
|
|
816
|
+
let h = img.height;
|
|
817
|
+
eng.models.gen_mesh_heightmap(&data, w, h, size_x as f32, size_y as f32, size_z as f32)
|
|
818
|
+
} else {
|
|
819
|
+
0.0
|
|
820
|
+
}
|
|
821
|
+
}
|
|
822
|
+
|
|
823
|
+
#[wasm_bindgen]
|
|
824
|
+
pub fn bloom_load_shader(_source: f64) -> f64 {
|
|
825
|
+
// TODO: Phase 4 — need string conversion from NaN-boxed f64 handle
|
|
826
|
+
0.0
|
|
827
|
+
}
|
|
828
|
+
|
|
829
|
+
#[wasm_bindgen]
|
|
830
|
+
pub fn bloom_create_mesh(_vertex_ptr: f64, _vertex_count: f64, _index_ptr: f64, _index_count: f64) -> f64 {
|
|
831
|
+
// TODO: Phase 4 — need to handle pointer passing from WASM linear memory
|
|
832
|
+
0.0
|
|
833
|
+
}
|
|
834
|
+
|
|
835
|
+
// ============================================================
|
|
836
|
+
// Phase 1c — material system FFI
|
|
837
|
+
// ============================================================
|
|
838
|
+
|
|
839
|
+
#[wasm_bindgen]
|
|
840
|
+
pub fn bloom_set_material_params(_handle: f64, _params_ptr: f64, _param_count: f64) {
|
|
841
|
+
// No-op: JS glue calls bloom_set_material_params_floats instead
|
|
842
|
+
}
|
|
843
|
+
|
|
844
|
+
#[wasm_bindgen]
|
|
845
|
+
pub fn bloom_set_material_params_floats(handle: f64, params: &[f32]) {
|
|
846
|
+
let count = params.len();
|
|
847
|
+
if count > 64 {
|
|
848
|
+
web_sys::console::error_1(&format!(
|
|
849
|
+
"[material] set_material_params: param_count {} > 64 (256-byte UBO cap)",
|
|
850
|
+
count
|
|
851
|
+
).into());
|
|
852
|
+
return;
|
|
853
|
+
}
|
|
854
|
+
let mut bytes = vec![0u8; count * 4];
|
|
855
|
+
for (i, &v) in params.iter().enumerate() {
|
|
856
|
+
bytes[i*4..i*4+4].copy_from_slice(&v.to_le_bytes());
|
|
857
|
+
}
|
|
858
|
+
let eng = engine();
|
|
859
|
+
if let Err(e) = eng.renderer.material_system.set_user_params(
|
|
860
|
+
&eng.renderer.device, &eng.renderer.queue,
|
|
861
|
+
handle as u32, &bytes,
|
|
862
|
+
) {
|
|
863
|
+
web_sys::console::error_1(&format!("[material] set_material_params failed: {}", e).into());
|
|
864
|
+
}
|
|
865
|
+
}
|
|
866
|
+
|
|
867
|
+
#[wasm_bindgen]
|
|
868
|
+
pub fn bloom_compile_material(_source: f64) -> f64 {
|
|
869
|
+
// No-op: JS glue calls bloom_compile_material_str instead
|
|
870
|
+
0.0
|
|
871
|
+
}
|
|
872
|
+
|
|
873
|
+
#[wasm_bindgen]
|
|
874
|
+
pub fn bloom_compile_material_str(source: &str) -> f64 {
|
|
875
|
+
match engine().renderer.compile_material(source) {
|
|
876
|
+
Ok(handle) => handle as f64,
|
|
877
|
+
Err(e) => {
|
|
878
|
+
web_sys::console::error_1(&format!("[material] compile failed: {:?}", e).into());
|
|
879
|
+
0.0
|
|
880
|
+
}
|
|
881
|
+
}
|
|
882
|
+
}
|
|
883
|
+
|
|
884
|
+
#[wasm_bindgen]
|
|
885
|
+
pub fn bloom_compile_material_refractive(_source: f64) -> f64 {
|
|
886
|
+
// No-op: JS glue calls bloom_compile_material_refractive_str instead
|
|
887
|
+
0.0
|
|
888
|
+
}
|
|
889
|
+
|
|
890
|
+
#[wasm_bindgen]
|
|
891
|
+
pub fn bloom_compile_material_refractive_str(source: &str) -> f64 {
|
|
892
|
+
use bloom_shared::renderer::material_pipeline::{FragmentProfile, Bucket};
|
|
893
|
+
match engine().renderer.compile_material_with_options(
|
|
894
|
+
source, FragmentProfile::Translucent, Bucket::Refractive, true, false,
|
|
895
|
+
) {
|
|
896
|
+
Ok(handle) => handle as f64,
|
|
897
|
+
Err(e) => {
|
|
898
|
+
web_sys::console::error_1(&format!("[refractive] compile failed: {:?}", e).into());
|
|
899
|
+
0.0
|
|
900
|
+
}
|
|
901
|
+
}
|
|
902
|
+
}
|
|
903
|
+
|
|
904
|
+
#[wasm_bindgen]
|
|
905
|
+
pub fn bloom_compile_material_transparent(_source: f64) -> f64 {
|
|
906
|
+
// No-op: JS glue calls bloom_compile_material_transparent_str instead
|
|
907
|
+
0.0
|
|
908
|
+
}
|
|
909
|
+
|
|
910
|
+
#[wasm_bindgen]
|
|
911
|
+
pub fn bloom_compile_material_transparent_str(source: &str) -> f64 {
|
|
912
|
+
use bloom_shared::renderer::material_pipeline::{FragmentProfile, Bucket};
|
|
913
|
+
match engine().renderer.compile_material_with_options(
|
|
914
|
+
source, FragmentProfile::Translucent, Bucket::Transparent, false, false,
|
|
915
|
+
) {
|
|
916
|
+
Ok(handle) => handle as f64,
|
|
917
|
+
Err(e) => {
|
|
918
|
+
web_sys::console::error_1(&format!("[material] compile failed: {:?}", e).into());
|
|
919
|
+
0.0
|
|
920
|
+
}
|
|
921
|
+
}
|
|
922
|
+
}
|
|
923
|
+
|
|
924
|
+
#[wasm_bindgen]
|
|
925
|
+
pub fn bloom_compile_material_additive(_source: f64) -> f64 {
|
|
926
|
+
// No-op: JS glue calls bloom_compile_material_additive_str instead
|
|
927
|
+
0.0
|
|
928
|
+
}
|
|
929
|
+
|
|
930
|
+
#[wasm_bindgen]
|
|
931
|
+
pub fn bloom_compile_material_additive_str(source: &str) -> f64 {
|
|
932
|
+
use bloom_shared::renderer::material_pipeline::{FragmentProfile, Bucket};
|
|
933
|
+
match engine().renderer.compile_material_with_options(
|
|
934
|
+
source, FragmentProfile::Translucent, Bucket::Additive, false, false,
|
|
935
|
+
) {
|
|
936
|
+
Ok(handle) => handle as f64,
|
|
937
|
+
Err(e) => {
|
|
938
|
+
web_sys::console::error_1(&format!("[material] compile failed: {:?}", e).into());
|
|
939
|
+
0.0
|
|
940
|
+
}
|
|
941
|
+
}
|
|
942
|
+
}
|
|
943
|
+
|
|
944
|
+
#[wasm_bindgen]
|
|
945
|
+
pub fn bloom_compile_material_cutout(_source: f64) -> f64 {
|
|
946
|
+
// No-op: JS glue calls bloom_compile_material_cutout_str instead
|
|
947
|
+
0.0
|
|
948
|
+
}
|
|
949
|
+
|
|
950
|
+
#[wasm_bindgen]
|
|
951
|
+
pub fn bloom_compile_material_cutout_str(source: &str) -> f64 {
|
|
952
|
+
use bloom_shared::renderer::material_pipeline::{FragmentProfile, Bucket};
|
|
953
|
+
match engine().renderer.compile_material_with_options(
|
|
954
|
+
source, FragmentProfile::Opaque, Bucket::Cutout, false, false,
|
|
955
|
+
) {
|
|
956
|
+
Ok(handle) => handle as f64,
|
|
957
|
+
Err(e) => {
|
|
958
|
+
web_sys::console::error_1(&format!("[material] compile failed: {:?}", e).into());
|
|
959
|
+
0.0
|
|
960
|
+
}
|
|
961
|
+
}
|
|
962
|
+
}
|
|
963
|
+
|
|
964
|
+
#[wasm_bindgen]
|
|
965
|
+
pub fn bloom_compile_material_instanced(_source: f64) -> f64 {
|
|
966
|
+
// No-op: JS glue calls bloom_compile_material_instanced_str instead
|
|
967
|
+
0.0
|
|
968
|
+
}
|
|
969
|
+
|
|
970
|
+
#[wasm_bindgen]
|
|
971
|
+
pub fn bloom_compile_material_instanced_str(source: &str) -> f64 {
|
|
972
|
+
match engine().renderer.compile_material_instanced(source) {
|
|
973
|
+
Ok(handle) => handle as f64,
|
|
974
|
+
Err(e) => {
|
|
975
|
+
web_sys::console::error_1(&format!("[material] instanced compile failed: {:?}", e).into());
|
|
976
|
+
0.0
|
|
977
|
+
}
|
|
978
|
+
}
|
|
979
|
+
}
|
|
980
|
+
|
|
981
|
+
#[wasm_bindgen]
|
|
982
|
+
pub fn bloom_create_instance_buffer(_data_ptr: f64, _instance_count: f64) -> f64 {
|
|
983
|
+
// No-op: JS glue calls bloom_create_instance_buffer_floats instead
|
|
984
|
+
0.0
|
|
985
|
+
}
|
|
986
|
+
|
|
987
|
+
#[wasm_bindgen]
|
|
988
|
+
pub fn bloom_create_instance_buffer_floats(data: &[f32], instance_count: f64) -> f64 {
|
|
989
|
+
if instance_count <= 0.0 { return 0.0; }
|
|
990
|
+
let count = instance_count as u32;
|
|
991
|
+
engine().renderer.create_instance_buffer(data, count) as f64
|
|
992
|
+
}
|
|
993
|
+
|
|
994
|
+
#[wasm_bindgen]
|
|
995
|
+
pub fn bloom_submit_material_draw_instanced(
|
|
996
|
+
material: f64, mesh_handle: f64, mesh_idx: f64,
|
|
997
|
+
instance_buffer: f64, instance_count: f64,
|
|
998
|
+
) {
|
|
999
|
+
let eng = engine();
|
|
1000
|
+
let handle_bits = mesh_handle.to_bits();
|
|
1001
|
+
if let Some(model) = eng.models.get(mesh_handle) {
|
|
1002
|
+
eng.renderer.cache_model_if_static(handle_bits, &model.meshes);
|
|
1003
|
+
}
|
|
1004
|
+
eng.renderer.submit_material_draw_instanced(
|
|
1005
|
+
material as u32,
|
|
1006
|
+
handle_bits,
|
|
1007
|
+
mesh_idx as usize,
|
|
1008
|
+
instance_buffer as u32,
|
|
1009
|
+
instance_count as u32,
|
|
1010
|
+
);
|
|
1011
|
+
}
|
|
1012
|
+
|
|
1013
|
+
#[wasm_bindgen]
|
|
1014
|
+
pub fn bloom_destroy_instance_buffer(handle: f64) {
|
|
1015
|
+
engine().renderer.destroy_instance_buffer(handle as u32);
|
|
1016
|
+
}
|
|
1017
|
+
|
|
1018
|
+
/// EN-011 — create a planar reflection probe. See macOS lib.rs for the
|
|
1019
|
+
/// full doc comment. Web ports the same FFI surface so a TypeScript
|
|
1020
|
+
/// game targets one API across native + browser.
|
|
1021
|
+
#[wasm_bindgen]
|
|
1022
|
+
pub fn bloom_create_planar_reflection(
|
|
1023
|
+
plane_y: f64, nx: f64, ny: f64, nz: f64, resolution: f64,
|
|
1024
|
+
) -> f64 {
|
|
1025
|
+
engine().renderer.create_planar_reflection(
|
|
1026
|
+
plane_y as f32,
|
|
1027
|
+
[nx as f32, ny as f32, nz as f32],
|
|
1028
|
+
resolution as u32,
|
|
1029
|
+
) as f64
|
|
1030
|
+
}
|
|
1031
|
+
|
|
1032
|
+
/// EN-011 — link a material to a planar reflection probe. `probe = 0`
|
|
1033
|
+
/// reverts the binding to the engine's default 1×1 black texture.
|
|
1034
|
+
#[wasm_bindgen]
|
|
1035
|
+
pub fn bloom_set_material_reflection_probe(
|
|
1036
|
+
material: f64, probe: f64,
|
|
1037
|
+
) {
|
|
1038
|
+
engine().renderer.set_material_reflection_probe(material as u32, probe as u32);
|
|
1039
|
+
}
|
|
1040
|
+
|
|
1041
|
+
/// EN-014 — pointer-shaped variant exists only so the FFI manifest
|
|
1042
|
+
/// validates against the Perry surface; JS glue calls
|
|
1043
|
+
/// `bloom_create_texture_array_bytes` with a `Uint8Array` instead.
|
|
1044
|
+
/// Same precedent as `bloom_create_instance_buffer` (see EN-001).
|
|
1045
|
+
#[wasm_bindgen]
|
|
1046
|
+
pub fn bloom_create_texture_array(
|
|
1047
|
+
_data_ptr: f64, _data_len: f64, _width: f64, _height: f64, _layer_count: f64,
|
|
1048
|
+
) -> f64 {
|
|
1049
|
+
0.0
|
|
1050
|
+
}
|
|
1051
|
+
|
|
1052
|
+
/// EN-014 — create a texture array from concatenated RGBA8 bytes.
|
|
1053
|
+
/// JS glue passes a `Uint8Array` of `layer_count × width × height × 4`
|
|
1054
|
+
/// bytes (each layer back-to-back). Layer count is capped at 16; the
|
|
1055
|
+
/// rest are silently dropped. Returns a 1-based handle (0 on failure).
|
|
1056
|
+
#[wasm_bindgen]
|
|
1057
|
+
pub fn bloom_create_texture_array_bytes(
|
|
1058
|
+
data: &[u8],
|
|
1059
|
+
width: f64, height: f64, layer_count: f64,
|
|
1060
|
+
) -> f64 {
|
|
1061
|
+
// EN-014 V2 — V1 forwards to _ex with default sRGB / no mips.
|
|
1062
|
+
bloom_create_texture_array_ex_bytes(data, width, height, layer_count, 0.0, 1.0)
|
|
1063
|
+
}
|
|
1064
|
+
|
|
1065
|
+
/// EN-014 V2 — pointer-shaped Ex variant exists only so the FFI manifest
|
|
1066
|
+
/// validates against the Perry surface; JS glue uses the `_bytes` form.
|
|
1067
|
+
#[wasm_bindgen]
|
|
1068
|
+
pub fn bloom_create_texture_array_ex(
|
|
1069
|
+
_data_ptr: f64, _data_len: f64, _width: f64, _height: f64,
|
|
1070
|
+
_layer_count: f64, _format: f64, _mip_levels: f64,
|
|
1071
|
+
) -> f64 {
|
|
1072
|
+
0.0
|
|
1073
|
+
}
|
|
1074
|
+
|
|
1075
|
+
/// EN-014 V2 — bytes form of `_ex`. See `MaterialSystem::create_texture_array_ex`
|
|
1076
|
+
/// for `format` (0 = sRGB, 1 = linear) and `mip_levels` (1 = none, 0 =
|
|
1077
|
+
/// auto-generate via point-sample copies) semantics.
|
|
1078
|
+
#[wasm_bindgen]
|
|
1079
|
+
pub fn bloom_create_texture_array_ex_bytes(
|
|
1080
|
+
data: &[u8],
|
|
1081
|
+
width: f64, height: f64, layer_count: f64,
|
|
1082
|
+
format: f64, mip_levels: f64,
|
|
1083
|
+
) -> f64 {
|
|
1084
|
+
let w = width as u32;
|
|
1085
|
+
let h = height as u32;
|
|
1086
|
+
if w == 0 || h == 0 { return 0.0; }
|
|
1087
|
+
let layers_count = (layer_count as u32)
|
|
1088
|
+
.min(bloom_shared::renderer::material_system::MAX_TEXTURE_ARRAY_LAYERS);
|
|
1089
|
+
if layers_count == 0 { return 0.0; }
|
|
1090
|
+
let layer_size = (w as usize) * (h as usize) * 4;
|
|
1091
|
+
let mut layers: Vec<(&[u8], u32, u32)> = Vec::with_capacity(layers_count as usize);
|
|
1092
|
+
for i in 0..(layers_count as usize) {
|
|
1093
|
+
let start = i * layer_size;
|
|
1094
|
+
let end = start + layer_size;
|
|
1095
|
+
if end > data.len() { break; }
|
|
1096
|
+
layers.push((&data[start..end], w, h));
|
|
1097
|
+
}
|
|
1098
|
+
engine().renderer.create_texture_array_ex(&layers, format as u32, mip_levels as u32) as f64
|
|
1099
|
+
}
|
|
1100
|
+
|
|
1101
|
+
/// EN-014 — link a texture-array handle to a material slot
|
|
1102
|
+
/// (0 = albedo / 1 = normal / 2 = MR). `array = 0` reverts to the
|
|
1103
|
+
/// engine's 1×1×1 stub.
|
|
1104
|
+
#[wasm_bindgen]
|
|
1105
|
+
pub fn bloom_set_material_texture_array(
|
|
1106
|
+
material: f64, slot: f64, array: f64,
|
|
1107
|
+
) {
|
|
1108
|
+
engine().renderer.set_material_texture_array(
|
|
1109
|
+
material as u32, slot as u32, array as u32,
|
|
1110
|
+
);
|
|
1111
|
+
}
|
|
1112
|
+
|
|
1113
|
+
/// EN-012 — set the shading model for a material (0=default lit,
|
|
1114
|
+
/// 1=foliage, 2=subsurface V2 stub).
|
|
1115
|
+
#[wasm_bindgen]
|
|
1116
|
+
pub fn bloom_set_material_shading_model(
|
|
1117
|
+
material: f64, model: f64,
|
|
1118
|
+
) {
|
|
1119
|
+
engine().renderer.set_material_shading_model(material as u32, model as u32);
|
|
1120
|
+
}
|
|
1121
|
+
|
|
1122
|
+
/// EN-012 — set the foliage shading parameters for a material.
|
|
1123
|
+
/// Only takes effect when shading_model == 1 (foliage).
|
|
1124
|
+
#[wasm_bindgen]
|
|
1125
|
+
pub fn bloom_set_material_foliage(
|
|
1126
|
+
material: f64,
|
|
1127
|
+
trans_r: f64, trans_g: f64, trans_b: f64,
|
|
1128
|
+
trans_amount: f64, wrap_factor: f64,
|
|
1129
|
+
) {
|
|
1130
|
+
engine().renderer.set_material_foliage(
|
|
1131
|
+
material as u32,
|
|
1132
|
+
[trans_r as f32, trans_g as f32, trans_b as f32],
|
|
1133
|
+
trans_amount as f32, wrap_factor as f32,
|
|
1134
|
+
);
|
|
1135
|
+
}
|
|
1136
|
+
|
|
1137
|
+
#[wasm_bindgen]
|
|
1138
|
+
pub fn bloom_compile_material_from_file(_path: f64, _bucket_kind: f64) -> f64 {
|
|
1139
|
+
// No-op: web has no filesystem — JS glue would have to fetch + call
|
|
1140
|
+
// bloom_compile_material_from_file_str instead.
|
|
1141
|
+
0.0
|
|
1142
|
+
}
|
|
1143
|
+
|
|
1144
|
+
#[wasm_bindgen]
|
|
1145
|
+
pub fn bloom_compile_material_from_file_str(path: &str, bucket_kind: f64) -> f64 {
|
|
1146
|
+
use bloom_shared::renderer::material_pipeline::{FragmentProfile, Bucket};
|
|
1147
|
+
let (profile, bucket, reads_scene) = match bucket_kind as u32 {
|
|
1148
|
+
0 => (FragmentProfile::Opaque, Bucket::Opaque, false),
|
|
1149
|
+
1 => (FragmentProfile::Translucent, Bucket::Transparent, false),
|
|
1150
|
+
2 => (FragmentProfile::Translucent, Bucket::Refractive, true),
|
|
1151
|
+
3 => (FragmentProfile::Translucent, Bucket::Additive, false),
|
|
1152
|
+
4 => (FragmentProfile::Opaque, Bucket::Cutout, false),
|
|
1153
|
+
_ => {
|
|
1154
|
+
web_sys::console::error_1(&format!(
|
|
1155
|
+
"[material] from_file: unknown bucket_kind {}", bucket_kind
|
|
1156
|
+
).into());
|
|
1157
|
+
return 0.0;
|
|
1158
|
+
}
|
|
1159
|
+
};
|
|
1160
|
+
match engine().renderer.compile_material_from_file(
|
|
1161
|
+
std::path::Path::new(path), profile, bucket, reads_scene,
|
|
1162
|
+
) {
|
|
1163
|
+
Ok(handle) => handle as f64,
|
|
1164
|
+
Err(e) => {
|
|
1165
|
+
web_sys::console::error_1(&format!("[material] from_file failed: {}", e).into());
|
|
1166
|
+
0.0
|
|
1167
|
+
}
|
|
1168
|
+
}
|
|
1169
|
+
}
|
|
1170
|
+
|
|
1171
|
+
/// EN-017 — stub: JS glue calls `bloom_set_post_pass_str` instead.
|
|
1172
|
+
#[wasm_bindgen]
|
|
1173
|
+
pub fn bloom_set_post_pass(_source: f64) -> f64 { 0.0 }
|
|
1174
|
+
|
|
1175
|
+
/// EN-017 — compile + install a fullscreen post-pass material on web.
|
|
1176
|
+
/// See `bloom-macos::bloom_set_post_pass` for the full ABI. Returns
|
|
1177
|
+
/// 1.0 on success, 0.0 on compile failure.
|
|
1178
|
+
#[wasm_bindgen]
|
|
1179
|
+
pub fn bloom_set_post_pass_str(source: &str) -> f64 {
|
|
1180
|
+
match engine().renderer.set_post_pass(source) {
|
|
1181
|
+
Ok(()) => 1.0,
|
|
1182
|
+
Err(e) => {
|
|
1183
|
+
web_sys::console::error_1(
|
|
1184
|
+
&format!("[post_pass] compile failed: {:?}", e).into(),
|
|
1185
|
+
);
|
|
1186
|
+
0.0
|
|
1187
|
+
}
|
|
1188
|
+
}
|
|
1189
|
+
}
|
|
1190
|
+
|
|
1191
|
+
/// EN-017 — uninstall the active post-pass.
|
|
1192
|
+
#[wasm_bindgen]
|
|
1193
|
+
pub fn bloom_clear_post_pass() {
|
|
1194
|
+
engine().renderer.clear_post_pass();
|
|
1195
|
+
}
|
|
1196
|
+
|
|
1197
|
+
/// EN-017 V2 — stub: JS glue calls `bloom_add_post_pass_str` instead.
|
|
1198
|
+
#[wasm_bindgen]
|
|
1199
|
+
pub fn bloom_add_post_pass(_source: f64) -> f64 { 0.0 }
|
|
1200
|
+
|
|
1201
|
+
/// EN-017 V2 — append a fullscreen post-pass to the stack on web.
|
|
1202
|
+
/// See `bloom-macos::bloom_add_post_pass` for the full ABI. Returns
|
|
1203
|
+
/// 1-based handle on success, 0.0 on compile failure.
|
|
1204
|
+
#[wasm_bindgen]
|
|
1205
|
+
pub fn bloom_add_post_pass_str(source: &str) -> f64 {
|
|
1206
|
+
match engine().renderer.add_post_pass(source) {
|
|
1207
|
+
Ok(h) => h as f64,
|
|
1208
|
+
Err(e) => {
|
|
1209
|
+
web_sys::console::error_1(
|
|
1210
|
+
&format!("[post_pass] compile failed: {:?}", e).into(),
|
|
1211
|
+
);
|
|
1212
|
+
0.0
|
|
1213
|
+
}
|
|
1214
|
+
}
|
|
1215
|
+
}
|
|
1216
|
+
|
|
1217
|
+
/// EN-017 V2 — wipe the entire post-pass stack.
|
|
1218
|
+
#[wasm_bindgen]
|
|
1219
|
+
pub fn bloom_clear_all_post_passes() {
|
|
1220
|
+
engine().renderer.clear_all_post_passes();
|
|
1221
|
+
}
|
|
1222
|
+
|
|
1223
|
+
#[wasm_bindgen]
|
|
1224
|
+
pub fn bloom_draw_material(
|
|
1225
|
+
material: f64,
|
|
1226
|
+
mesh_handle: f64,
|
|
1227
|
+
mesh_idx: f64,
|
|
1228
|
+
x: f64, y: f64, z: f64, scale: f64,
|
|
1229
|
+
r: f64, g: f64, b: f64, a: f64,
|
|
1230
|
+
) {
|
|
1231
|
+
let eng = engine();
|
|
1232
|
+
let handle_bits = mesh_handle.to_bits();
|
|
1233
|
+
if let Some(model) = eng.models.get(mesh_handle) {
|
|
1234
|
+
eng.renderer.cache_model_if_static(handle_bits, &model.meshes);
|
|
1235
|
+
}
|
|
1236
|
+
eng.renderer.submit_material_draw(
|
|
1237
|
+
material as u32,
|
|
1238
|
+
handle_bits,
|
|
1239
|
+
mesh_idx as usize,
|
|
1240
|
+
[x as f32, y as f32, z as f32],
|
|
1241
|
+
scale as f32,
|
|
1242
|
+
[(r / 255.0) as f32, (g / 255.0) as f32, (b / 255.0) as f32, (a / 255.0) as f32],
|
|
1243
|
+
);
|
|
1244
|
+
}
|
|
1245
|
+
|
|
1246
|
+
#[wasm_bindgen]
|
|
1247
|
+
pub fn bloom_load_model_animation(_path: f64) -> f64 { 0.0 }
|
|
1248
|
+
|
|
1249
|
+
#[wasm_bindgen]
|
|
1250
|
+
pub fn bloom_load_model_animation_bytes(data: &[u8]) -> f64 {
|
|
1251
|
+
engine().models.load_model_animation(data)
|
|
1252
|
+
}
|
|
1253
|
+
|
|
1254
|
+
#[wasm_bindgen]
|
|
1255
|
+
pub fn bloom_update_model_animation(_handle: f64, _anim_index: f64, _time: f64, _scale: f64, _px: f64, _py: f64, _pz: f64, _rot_sin: f64, _rot_cos: f64) {
|
|
1256
|
+
// TODO: Phase 4 — depends on bloom_load_model_animation
|
|
1257
|
+
}
|
|
1258
|
+
|
|
1259
|
+
#[wasm_bindgen]
|
|
1260
|
+
pub fn bloom_get_model_mesh_count(handle: f64) -> f64 {
|
|
1261
|
+
match engine().models.get(handle) {
|
|
1262
|
+
Some(model) => model.meshes.len() as f64,
|
|
1263
|
+
None => 0.0,
|
|
1264
|
+
}
|
|
1265
|
+
}
|
|
1266
|
+
|
|
1267
|
+
#[wasm_bindgen]
|
|
1268
|
+
pub fn bloom_get_model_material_count(handle: f64) -> f64 {
|
|
1269
|
+
match engine().models.get(handle) {
|
|
1270
|
+
Some(model) => model.meshes.len() as f64,
|
|
1271
|
+
None => 0.0,
|
|
1272
|
+
}
|
|
1273
|
+
}
|
|
1274
|
+
|
|
1275
|
+
// ============================================================
|
|
1276
|
+
// Lighting
|
|
1277
|
+
// ============================================================
|
|
1278
|
+
|
|
1279
|
+
#[wasm_bindgen]
|
|
1280
|
+
pub fn bloom_set_ambient_light(r: f64, g: f64, b: f64, intensity: f64) {
|
|
1281
|
+
engine().renderer.set_ambient_light(r, g, b, intensity);
|
|
1282
|
+
}
|
|
1283
|
+
|
|
1284
|
+
#[wasm_bindgen]
|
|
1285
|
+
pub fn bloom_set_directional_light(dx: f64, dy: f64, dz: f64, r: f64, g: f64, b: f64, intensity: f64) {
|
|
1286
|
+
engine().renderer.set_directional_light(dx, dy, dz, r, g, b, intensity);
|
|
1287
|
+
}
|
|
1288
|
+
|
|
1289
|
+
#[wasm_bindgen]
|
|
1290
|
+
pub fn bloom_set_procedural_sky(enabled: f64, rayleigh_density: f64, mie_density: f64, ground_albedo: f64) {
|
|
1291
|
+
engine().renderer.set_procedural_sky(
|
|
1292
|
+
enabled != 0.0,
|
|
1293
|
+
rayleigh_density as f32,
|
|
1294
|
+
mie_density as f32,
|
|
1295
|
+
ground_albedo as f32,
|
|
1296
|
+
);
|
|
1297
|
+
}
|
|
1298
|
+
|
|
1299
|
+
#[wasm_bindgen]
|
|
1300
|
+
pub fn bloom_set_sun_direction(dx: f64, dy: f64, dz: f64, intensity: f64) {
|
|
1301
|
+
engine().renderer.set_sun_direction(dx as f32, dy as f32, dz as f32, intensity as f32);
|
|
1302
|
+
}
|
|
1303
|
+
|
|
1304
|
+
#[wasm_bindgen]
|
|
1305
|
+
pub fn bloom_set_joint_test(joint_index: f64, angle: f64) {
|
|
1306
|
+
engine().renderer.set_joint_test(joint_index as usize, angle as f32);
|
|
1307
|
+
}
|
|
1308
|
+
|
|
1309
|
+
#[wasm_bindgen]
|
|
1310
|
+
pub fn bloom_add_directional_light(
|
|
1311
|
+
dx: f64, dy: f64, dz: f64,
|
|
1312
|
+
r: f64, g: f64, b: f64,
|
|
1313
|
+
intensity: f64,
|
|
1314
|
+
) {
|
|
1315
|
+
engine().renderer.add_directional_light(
|
|
1316
|
+
dx as f32, dy as f32, dz as f32,
|
|
1317
|
+
r as f32, g as f32, b as f32,
|
|
1318
|
+
intensity as f32,
|
|
1319
|
+
);
|
|
1320
|
+
}
|
|
1321
|
+
|
|
1322
|
+
#[wasm_bindgen]
|
|
1323
|
+
pub fn bloom_add_point_light(
|
|
1324
|
+
x: f64, y: f64, z: f64, range: f64,
|
|
1325
|
+
r: f64, g: f64, b: f64,
|
|
1326
|
+
intensity: f64,
|
|
1327
|
+
) {
|
|
1328
|
+
engine().renderer.add_point_light(
|
|
1329
|
+
x as f32, y as f32, z as f32, range as f32,
|
|
1330
|
+
r as f32, g as f32, b as f32,
|
|
1331
|
+
intensity as f32,
|
|
1332
|
+
);
|
|
1333
|
+
}
|
|
1334
|
+
|
|
1335
|
+
// ============================================================
|
|
1336
|
+
// Audio
|
|
1337
|
+
// ============================================================
|
|
1338
|
+
|
|
1339
|
+
#[wasm_bindgen]
|
|
1340
|
+
pub fn bloom_init_audio() {
|
|
1341
|
+
// Audio initialization is handled by JS glue (Web Audio API AudioContext).
|
|
1342
|
+
// The Rust AudioMixer is already initialized as part of EngineState.
|
|
1343
|
+
}
|
|
1344
|
+
|
|
1345
|
+
#[wasm_bindgen]
|
|
1346
|
+
pub fn bloom_close_audio() {
|
|
1347
|
+
// AudioContext cleanup handled by JS glue.
|
|
1348
|
+
}
|
|
1349
|
+
|
|
1350
|
+
#[wasm_bindgen]
|
|
1351
|
+
pub fn bloom_load_sound(_path: f64) -> f64 { 0.0 }
|
|
1352
|
+
|
|
1353
|
+
/// Load a sound from raw file bytes (WAV or OGG). Fetched by JS glue via fetch().
|
|
1354
|
+
#[wasm_bindgen]
|
|
1355
|
+
pub fn bloom_load_sound_bytes(data: &[u8]) -> f64 {
|
|
1356
|
+
if let Some(sound) = bloom_shared::audio::parse_wav(data)
|
|
1357
|
+
.or_else(|| bloom_shared::audio::parse_ogg(data))
|
|
1358
|
+
{
|
|
1359
|
+
engine().audio.load_sound(sound)
|
|
1360
|
+
} else {
|
|
1361
|
+
0.0
|
|
1362
|
+
}
|
|
1363
|
+
}
|
|
1364
|
+
|
|
1365
|
+
#[wasm_bindgen]
|
|
1366
|
+
pub fn bloom_play_sound(handle: f64) {
|
|
1367
|
+
engine().audio.play_sound(handle);
|
|
1368
|
+
}
|
|
1369
|
+
|
|
1370
|
+
#[wasm_bindgen]
|
|
1371
|
+
pub fn bloom_stop_sound(handle: f64) {
|
|
1372
|
+
engine().audio.stop_sound(handle);
|
|
1373
|
+
}
|
|
1374
|
+
|
|
1375
|
+
#[wasm_bindgen]
|
|
1376
|
+
pub fn bloom_set_sound_volume(handle: f64, volume: f64) {
|
|
1377
|
+
engine().audio.set_sound_volume(handle, volume as f32);
|
|
1378
|
+
}
|
|
1379
|
+
|
|
1380
|
+
#[wasm_bindgen]
|
|
1381
|
+
pub fn bloom_set_master_volume(volume: f64) {
|
|
1382
|
+
engine().audio.master_volume = volume as f32;
|
|
1383
|
+
}
|
|
1384
|
+
|
|
1385
|
+
#[wasm_bindgen]
|
|
1386
|
+
pub fn bloom_play_sound_3d(handle: f64, x: f64, y: f64, z: f64) {
|
|
1387
|
+
engine().audio.play_sound_3d(handle, x as f32, y as f32, z as f32);
|
|
1388
|
+
}
|
|
1389
|
+
|
|
1390
|
+
#[wasm_bindgen]
|
|
1391
|
+
pub fn bloom_set_listener_position(x: f64, y: f64, z: f64, fx: f64, fy: f64, fz: f64) {
|
|
1392
|
+
engine().audio.set_listener_position(x as f32, y as f32, z as f32, fx as f32, fy as f32, fz as f32);
|
|
1393
|
+
}
|
|
1394
|
+
|
|
1395
|
+
#[wasm_bindgen]
|
|
1396
|
+
pub fn bloom_load_music(_path: f64) -> f64 { 0.0 }
|
|
1397
|
+
|
|
1398
|
+
/// Load music from raw file bytes (WAV or OGG). Fetched by JS glue via fetch().
|
|
1399
|
+
#[wasm_bindgen]
|
|
1400
|
+
pub fn bloom_load_music_bytes(data: &[u8]) -> f64 {
|
|
1401
|
+
if let Some(sound) = bloom_shared::audio::parse_wav(data)
|
|
1402
|
+
.or_else(|| bloom_shared::audio::parse_ogg(data))
|
|
1403
|
+
{
|
|
1404
|
+
engine().audio.load_music(sound)
|
|
1405
|
+
} else {
|
|
1406
|
+
0.0
|
|
1407
|
+
}
|
|
1408
|
+
}
|
|
1409
|
+
|
|
1410
|
+
/// Mix audio into an interleaved stereo f32 buffer.
|
|
1411
|
+
/// Called by JS Web Audio ScriptProcessorNode/AudioWorklet each audio frame.
|
|
1412
|
+
#[wasm_bindgen]
|
|
1413
|
+
pub fn bloom_audio_mix(output: &mut [f32]) {
|
|
1414
|
+
engine().audio.mix_output(output);
|
|
1415
|
+
}
|
|
1416
|
+
|
|
1417
|
+
#[wasm_bindgen]
|
|
1418
|
+
pub fn bloom_play_music(handle: f64) {
|
|
1419
|
+
engine().audio.play_music(handle);
|
|
1420
|
+
}
|
|
1421
|
+
|
|
1422
|
+
#[wasm_bindgen]
|
|
1423
|
+
pub fn bloom_stop_music(handle: f64) {
|
|
1424
|
+
engine().audio.stop_music(handle);
|
|
1425
|
+
}
|
|
1426
|
+
|
|
1427
|
+
#[wasm_bindgen]
|
|
1428
|
+
pub fn bloom_update_music_stream(handle: f64) {
|
|
1429
|
+
engine().audio.update_music_stream(handle);
|
|
1430
|
+
}
|
|
1431
|
+
|
|
1432
|
+
#[wasm_bindgen]
|
|
1433
|
+
pub fn bloom_set_music_volume(handle: f64, volume: f64) {
|
|
1434
|
+
engine().audio.set_music_volume(handle, volume as f32);
|
|
1435
|
+
}
|
|
1436
|
+
|
|
1437
|
+
#[wasm_bindgen]
|
|
1438
|
+
pub fn bloom_is_music_playing(handle: f64) -> f64 {
|
|
1439
|
+
if engine().audio.is_music_playing(handle) { 1.0 } else { 0.0 }
|
|
1440
|
+
}
|
|
1441
|
+
|
|
1442
|
+
// ============================================================
|
|
1443
|
+
// Scene graph (retained mode)
|
|
1444
|
+
// ============================================================
|
|
1445
|
+
|
|
1446
|
+
#[wasm_bindgen]
|
|
1447
|
+
pub fn bloom_scene_create_node() -> f64 {
|
|
1448
|
+
engine().scene.create_node()
|
|
1449
|
+
}
|
|
1450
|
+
|
|
1451
|
+
#[wasm_bindgen]
|
|
1452
|
+
pub fn bloom_scene_destroy_node(handle: f64) {
|
|
1453
|
+
engine().scene.destroy_node(handle);
|
|
1454
|
+
}
|
|
1455
|
+
|
|
1456
|
+
#[wasm_bindgen]
|
|
1457
|
+
pub fn bloom_scene_set_visible(handle: f64, visible: f64) {
|
|
1458
|
+
engine().scene.set_visible(handle, visible != 0.0);
|
|
1459
|
+
}
|
|
1460
|
+
|
|
1461
|
+
#[wasm_bindgen]
|
|
1462
|
+
pub fn bloom_scene_set_cast_shadow(handle: f64, cast: f64) {
|
|
1463
|
+
engine().scene.set_cast_shadow(handle, cast != 0.0);
|
|
1464
|
+
}
|
|
1465
|
+
|
|
1466
|
+
#[wasm_bindgen]
|
|
1467
|
+
pub fn bloom_scene_set_receive_shadow(handle: f64, receive: f64) {
|
|
1468
|
+
engine().scene.set_receive_shadow(handle, receive != 0.0);
|
|
1469
|
+
}
|
|
1470
|
+
|
|
1471
|
+
#[wasm_bindgen]
|
|
1472
|
+
pub fn bloom_scene_set_parent(handle: f64, parent: f64) {
|
|
1473
|
+
engine().scene.set_parent(handle, parent);
|
|
1474
|
+
}
|
|
1475
|
+
|
|
1476
|
+
#[wasm_bindgen]
|
|
1477
|
+
pub fn bloom_scene_set_transform(
|
|
1478
|
+
handle: f64,
|
|
1479
|
+
m00: f64, m01: f64, m02: f64, m03: f64,
|
|
1480
|
+
m10: f64, m11: f64, m12: f64, m13: f64,
|
|
1481
|
+
m20: f64, m21: f64, m22: f64, m23: f64,
|
|
1482
|
+
m30: f64, m31: f64, m32: f64, m33: f64,
|
|
1483
|
+
) {
|
|
1484
|
+
// On web we pass the 16 matrix elements as individual f64 args
|
|
1485
|
+
// (no raw pointer passing from WASM)
|
|
1486
|
+
let mat = [
|
|
1487
|
+
[m00 as f32, m01 as f32, m02 as f32, m03 as f32],
|
|
1488
|
+
[m10 as f32, m11 as f32, m12 as f32, m13 as f32],
|
|
1489
|
+
[m20 as f32, m21 as f32, m22 as f32, m23 as f32],
|
|
1490
|
+
[m30 as f32, m31 as f32, m32 as f32, m33 as f32],
|
|
1491
|
+
];
|
|
1492
|
+
engine().scene.set_transform(handle, mat);
|
|
1493
|
+
}
|
|
1494
|
+
|
|
1495
|
+
#[wasm_bindgen]
|
|
1496
|
+
pub fn bloom_scene_update_geometry(
|
|
1497
|
+
_handle: f64,
|
|
1498
|
+
_vert_ptr: f64,
|
|
1499
|
+
_vert_count: f64,
|
|
1500
|
+
_idx_ptr: f64,
|
|
1501
|
+
_idx_count: f64,
|
|
1502
|
+
) {
|
|
1503
|
+
// TODO: Phase 4 — need to handle pointer/buffer passing from WASM linear memory.
|
|
1504
|
+
// On web, vertex and index data will need to be passed via a different mechanism
|
|
1505
|
+
// (e.g., typed arrays through JS interop).
|
|
1506
|
+
}
|
|
1507
|
+
|
|
1508
|
+
#[wasm_bindgen]
|
|
1509
|
+
pub fn bloom_scene_set_material_color(handle: f64, r: f64, g: f64, b: f64, a: f64) {
|
|
1510
|
+
engine().scene.set_material_color(handle, r as f32, g as f32, b as f32, a as f32);
|
|
1511
|
+
}
|
|
1512
|
+
|
|
1513
|
+
#[wasm_bindgen]
|
|
1514
|
+
pub fn bloom_scene_set_material_pbr(handle: f64, roughness: f64, metalness: f64) {
|
|
1515
|
+
engine().scene.set_material_pbr(handle, roughness as f32, metalness as f32);
|
|
1516
|
+
}
|
|
1517
|
+
|
|
1518
|
+
#[wasm_bindgen]
|
|
1519
|
+
pub fn bloom_scene_set_material_texture(handle: f64, texture_idx: f64) {
|
|
1520
|
+
engine().scene.set_material_texture(handle, texture_idx as u32);
|
|
1521
|
+
}
|
|
1522
|
+
|
|
1523
|
+
#[wasm_bindgen]
|
|
1524
|
+
pub fn bloom_scene_node_count() -> f64 {
|
|
1525
|
+
engine().scene.node_count() as f64
|
|
1526
|
+
}
|
|
1527
|
+
|
|
1528
|
+
#[wasm_bindgen]
|
|
1529
|
+
pub fn bloom_scene_node_vertex_count(handle: f64) -> f64 {
|
|
1530
|
+
match engine().scene.nodes.get(handle) {
|
|
1531
|
+
Some(node) => node.vertices.len() as f64,
|
|
1532
|
+
None => -1.0,
|
|
1533
|
+
}
|
|
1534
|
+
}
|
|
1535
|
+
|
|
1536
|
+
#[wasm_bindgen]
|
|
1537
|
+
pub fn bloom_scene_node_index_count(handle: f64) -> f64 {
|
|
1538
|
+
match engine().scene.nodes.get(handle) {
|
|
1539
|
+
Some(node) => node.indices.len() as f64,
|
|
1540
|
+
None => -1.0,
|
|
1541
|
+
}
|
|
1542
|
+
}
|
|
1543
|
+
|
|
1544
|
+
#[wasm_bindgen]
|
|
1545
|
+
pub fn bloom_scene_attach_model(node_handle: f64, model_handle: f64, mesh_index: f64) {
|
|
1546
|
+
let eng = engine();
|
|
1547
|
+
let mi = mesh_index as usize;
|
|
1548
|
+
|
|
1549
|
+
let model_data = match eng.models.models.get(model_handle) {
|
|
1550
|
+
Some(md) => md,
|
|
1551
|
+
None => return,
|
|
1552
|
+
};
|
|
1553
|
+
if mi >= model_data.meshes.len() { return; }
|
|
1554
|
+
let mesh = &model_data.meshes[mi];
|
|
1555
|
+
|
|
1556
|
+
let vertices = mesh.vertices.clone();
|
|
1557
|
+
let indices = mesh.indices.clone();
|
|
1558
|
+
let base_color_tex = mesh.texture_idx;
|
|
1559
|
+
let normal_tex = mesh.normal_texture_idx;
|
|
1560
|
+
let mr_tex = mesh.metallic_roughness_texture_idx;
|
|
1561
|
+
let emissive_tex = mesh.emissive_texture_idx;
|
|
1562
|
+
let emissive_factor = mesh.emissive_factor;
|
|
1563
|
+
eng.scene.update_geometry(node_handle, vertices, indices);
|
|
1564
|
+
|
|
1565
|
+
if let Some(tex_idx) = base_color_tex {
|
|
1566
|
+
eng.scene.set_material_texture(node_handle, tex_idx);
|
|
1567
|
+
}
|
|
1568
|
+
if let Some(tex_idx) = normal_tex {
|
|
1569
|
+
eng.scene.set_material_normal_texture(node_handle, tex_idx);
|
|
1570
|
+
}
|
|
1571
|
+
if let Some(tex_idx) = mr_tex {
|
|
1572
|
+
eng.scene.set_material_metallic_roughness_texture(node_handle, tex_idx);
|
|
1573
|
+
}
|
|
1574
|
+
if let Some(tex_idx) = emissive_tex {
|
|
1575
|
+
eng.scene.set_material_emissive_texture(node_handle, tex_idx);
|
|
1576
|
+
}
|
|
1577
|
+
eng.scene.set_material_emissive_factor(
|
|
1578
|
+
node_handle,
|
|
1579
|
+
emissive_factor[0],
|
|
1580
|
+
emissive_factor[1],
|
|
1581
|
+
emissive_factor[2],
|
|
1582
|
+
);
|
|
1583
|
+
}
|
|
1584
|
+
|
|
1585
|
+
// ============================================================
|
|
1586
|
+
// Geometry generation
|
|
1587
|
+
// ============================================================
|
|
1588
|
+
|
|
1589
|
+
#[wasm_bindgen]
|
|
1590
|
+
pub fn bloom_scene_extrude_polygon(
|
|
1591
|
+
_handle: f64,
|
|
1592
|
+
_polygon_ptr: f64,
|
|
1593
|
+
_polygon_count: f64,
|
|
1594
|
+
_depth: f64,
|
|
1595
|
+
) {
|
|
1596
|
+
// TODO: Phase 4 — need to handle pointer/buffer passing from WASM linear memory
|
|
1597
|
+
}
|
|
1598
|
+
|
|
1599
|
+
#[wasm_bindgen]
|
|
1600
|
+
pub fn bloom_scene_subtract_box(
|
|
1601
|
+
handle: f64,
|
|
1602
|
+
min_x: f64, min_y: f64, min_z: f64,
|
|
1603
|
+
max_x: f64, max_y: f64, max_z: f64,
|
|
1604
|
+
) {
|
|
1605
|
+
let eng = engine();
|
|
1606
|
+
if let Some(node) = eng.scene.nodes.get(handle) {
|
|
1607
|
+
let current = bloom_shared::geometry::GeometryData {
|
|
1608
|
+
vertices: node.vertices.clone(),
|
|
1609
|
+
indices: node.indices.clone(),
|
|
1610
|
+
};
|
|
1611
|
+
let result = bloom_shared::geometry::subtract_box(
|
|
1612
|
+
¤t,
|
|
1613
|
+
[min_x as f32, min_y as f32, min_z as f32],
|
|
1614
|
+
[max_x as f32, max_y as f32, max_z as f32],
|
|
1615
|
+
);
|
|
1616
|
+
eng.scene.update_geometry(handle, result.vertices, result.indices);
|
|
1617
|
+
}
|
|
1618
|
+
}
|
|
1619
|
+
|
|
1620
|
+
// ============================================================
|
|
1621
|
+
// Shadow mapping
|
|
1622
|
+
// ============================================================
|
|
1623
|
+
|
|
1624
|
+
#[wasm_bindgen]
|
|
1625
|
+
pub fn bloom_enable_shadows() {
|
|
1626
|
+
engine().renderer.shadow_map.enable();
|
|
1627
|
+
}
|
|
1628
|
+
|
|
1629
|
+
#[wasm_bindgen]
|
|
1630
|
+
pub fn bloom_disable_shadows() {
|
|
1631
|
+
engine().renderer.shadow_map.disable();
|
|
1632
|
+
}
|
|
1633
|
+
|
|
1634
|
+
// ============================================================
|
|
1635
|
+
// Post-processing
|
|
1636
|
+
// ============================================================
|
|
1637
|
+
|
|
1638
|
+
#[wasm_bindgen]
|
|
1639
|
+
pub fn bloom_enable_postfx() {
|
|
1640
|
+
let eng = engine();
|
|
1641
|
+
let w = eng.renderer.width();
|
|
1642
|
+
let h = eng.renderer.height();
|
|
1643
|
+
let fmt = eng.renderer.surface_format();
|
|
1644
|
+
eng.postfx = Some(bloom_shared::postfx::PostFxPipeline::new(
|
|
1645
|
+
&eng.renderer.device, w, h, fmt,
|
|
1646
|
+
));
|
|
1647
|
+
}
|
|
1648
|
+
|
|
1649
|
+
#[wasm_bindgen]
|
|
1650
|
+
pub fn bloom_disable_postfx() {
|
|
1651
|
+
engine().postfx = None;
|
|
1652
|
+
}
|
|
1653
|
+
|
|
1654
|
+
#[wasm_bindgen]
|
|
1655
|
+
pub fn bloom_postfx_set_selected(handle: f64) {
|
|
1656
|
+
if let Some(pfx) = &mut engine().postfx {
|
|
1657
|
+
if handle == 0.0 {
|
|
1658
|
+
pfx.set_selected(Vec::new());
|
|
1659
|
+
} else {
|
|
1660
|
+
pfx.set_selected(vec![handle]);
|
|
1661
|
+
}
|
|
1662
|
+
}
|
|
1663
|
+
}
|
|
1664
|
+
|
|
1665
|
+
#[wasm_bindgen]
|
|
1666
|
+
pub fn bloom_postfx_set_hovered(handle: f64) {
|
|
1667
|
+
if let Some(pfx) = &mut engine().postfx {
|
|
1668
|
+
pfx.set_hovered(handle);
|
|
1669
|
+
}
|
|
1670
|
+
}
|
|
1671
|
+
|
|
1672
|
+
#[wasm_bindgen]
|
|
1673
|
+
pub fn bloom_postfx_set_outline_color(r: f64, g: f64, b: f64, a: f64) {
|
|
1674
|
+
if let Some(pfx) = &mut engine().postfx {
|
|
1675
|
+
pfx.outline_params.color_selected = [r as f32, g as f32, b as f32, a as f32];
|
|
1676
|
+
}
|
|
1677
|
+
}
|
|
1678
|
+
|
|
1679
|
+
#[wasm_bindgen]
|
|
1680
|
+
pub fn bloom_postfx_set_outline_thickness(thickness: f64) {
|
|
1681
|
+
if let Some(pfx) = &mut engine().postfx {
|
|
1682
|
+
pfx.outline_params.thickness[0] = thickness as f32;
|
|
1683
|
+
}
|
|
1684
|
+
}
|
|
1685
|
+
|
|
1686
|
+
// ============================================================
|
|
1687
|
+
// Picking
|
|
1688
|
+
// ============================================================
|
|
1689
|
+
|
|
1690
|
+
#[wasm_bindgen]
|
|
1691
|
+
pub fn bloom_scene_pick(screen_x: f64, screen_y: f64) -> f64 {
|
|
1692
|
+
let eng = engine();
|
|
1693
|
+
let inv_vp = eng.renderer.inverse_vp_matrix();
|
|
1694
|
+
let cam_pos = eng.renderer.camera_pos();
|
|
1695
|
+
let w = eng.renderer.width() as f32;
|
|
1696
|
+
let h = eng.renderer.height() as f32;
|
|
1697
|
+
|
|
1698
|
+
let (origin, direction) = bloom_shared::picking::screen_to_ray(
|
|
1699
|
+
screen_x as f32, screen_y as f32,
|
|
1700
|
+
w, h, &inv_vp, &cam_pos,
|
|
1701
|
+
);
|
|
1702
|
+
|
|
1703
|
+
let result = bloom_shared::picking::raycast_scene(&eng.scene, &origin, &direction);
|
|
1704
|
+
let hit = result.hit;
|
|
1705
|
+
unsafe { LAST_PICK = Some(result); }
|
|
1706
|
+
if hit { 1.0 } else { 0.0 }
|
|
1707
|
+
}
|
|
1708
|
+
|
|
1709
|
+
#[wasm_bindgen]
|
|
1710
|
+
pub fn bloom_pick_hit_handle() -> f64 {
|
|
1711
|
+
unsafe { LAST_PICK.as_ref().map(|r| r.handle).unwrap_or(0.0) }
|
|
1712
|
+
}
|
|
1713
|
+
|
|
1714
|
+
#[wasm_bindgen]
|
|
1715
|
+
pub fn bloom_pick_hit_distance() -> f64 {
|
|
1716
|
+
unsafe { LAST_PICK.as_ref().map(|r| r.distance as f64).unwrap_or(0.0) }
|
|
1717
|
+
}
|
|
1718
|
+
|
|
1719
|
+
#[wasm_bindgen]
|
|
1720
|
+
pub fn bloom_pick_hit_x() -> f64 {
|
|
1721
|
+
unsafe { LAST_PICK.as_ref().map(|r| r.point[0] as f64).unwrap_or(0.0) }
|
|
1722
|
+
}
|
|
1723
|
+
|
|
1724
|
+
#[wasm_bindgen]
|
|
1725
|
+
pub fn bloom_pick_hit_y() -> f64 {
|
|
1726
|
+
unsafe { LAST_PICK.as_ref().map(|r| r.point[1] as f64).unwrap_or(0.0) }
|
|
1727
|
+
}
|
|
1728
|
+
|
|
1729
|
+
#[wasm_bindgen]
|
|
1730
|
+
pub fn bloom_pick_hit_z() -> f64 {
|
|
1731
|
+
unsafe { LAST_PICK.as_ref().map(|r| r.point[2] as f64).unwrap_or(0.0) }
|
|
1732
|
+
}
|
|
1733
|
+
|
|
1734
|
+
#[wasm_bindgen]
|
|
1735
|
+
pub fn bloom_pick_hit_normal_x() -> f64 {
|
|
1736
|
+
unsafe { LAST_PICK.as_ref().map(|r| r.normal[0] as f64).unwrap_or(0.0) }
|
|
1737
|
+
}
|
|
1738
|
+
|
|
1739
|
+
#[wasm_bindgen]
|
|
1740
|
+
pub fn bloom_pick_hit_normal_y() -> f64 {
|
|
1741
|
+
unsafe { LAST_PICK.as_ref().map(|r| r.normal[1] as f64).unwrap_or(0.0) }
|
|
1742
|
+
}
|
|
1743
|
+
|
|
1744
|
+
#[wasm_bindgen]
|
|
1745
|
+
pub fn bloom_pick_hit_normal_z() -> f64 {
|
|
1746
|
+
unsafe { LAST_PICK.as_ref().map(|r| r.normal[2] as f64).unwrap_or(0.0) }
|
|
1747
|
+
}
|
|
1748
|
+
|
|
1749
|
+
// ============================================================
|
|
1750
|
+
// 3D -> 2D Projection
|
|
1751
|
+
// ============================================================
|
|
1752
|
+
|
|
1753
|
+
#[wasm_bindgen]
|
|
1754
|
+
pub fn bloom_project_to_screen(wx: f64, wy: f64, wz: f64) -> f64 {
|
|
1755
|
+
let eng = engine();
|
|
1756
|
+
let vp = eng.renderer.vp_matrix();
|
|
1757
|
+
let w = eng.renderer.width() as f32;
|
|
1758
|
+
let h = eng.renderer.height() as f32;
|
|
1759
|
+
|
|
1760
|
+
let x = wx as f32;
|
|
1761
|
+
let y = wy as f32;
|
|
1762
|
+
let z = wz as f32;
|
|
1763
|
+
let clip_x = vp[0][0]*x + vp[1][0]*y + vp[2][0]*z + vp[3][0];
|
|
1764
|
+
let clip_y = vp[0][1]*x + vp[1][1]*y + vp[2][1]*z + vp[3][1];
|
|
1765
|
+
let clip_w = vp[0][3]*x + vp[1][3]*y + vp[2][3]*z + vp[3][3];
|
|
1766
|
+
|
|
1767
|
+
if clip_w <= 0.0 {
|
|
1768
|
+
unsafe { LAST_PROJECT = (-9999.0, -9999.0); }
|
|
1769
|
+
return -9999.0;
|
|
1770
|
+
}
|
|
1771
|
+
|
|
1772
|
+
let ndc_x = clip_x / clip_w;
|
|
1773
|
+
let ndc_y = clip_y / clip_w;
|
|
1774
|
+
let screen_x = ((ndc_x + 1.0) * 0.5 * w) as f64;
|
|
1775
|
+
let screen_y = ((1.0 - ndc_y) * 0.5 * h) as f64;
|
|
1776
|
+
|
|
1777
|
+
unsafe { LAST_PROJECT = (screen_x, screen_y); }
|
|
1778
|
+
screen_x
|
|
1779
|
+
}
|
|
1780
|
+
|
|
1781
|
+
#[wasm_bindgen]
|
|
1782
|
+
pub fn bloom_project_screen_y() -> f64 {
|
|
1783
|
+
unsafe { LAST_PROJECT.1 }
|
|
1784
|
+
}
|
|
1785
|
+
|
|
1786
|
+
// ============================================================
|
|
1787
|
+
// File I/O
|
|
1788
|
+
// ============================================================
|
|
1789
|
+
|
|
1790
|
+
#[wasm_bindgen]
|
|
1791
|
+
pub fn bloom_write_file(_path: f64, _data: f64) -> f64 {
|
|
1792
|
+
// Handled by JS glue — uses localStorage
|
|
1793
|
+
0.0
|
|
1794
|
+
}
|
|
1795
|
+
|
|
1796
|
+
#[wasm_bindgen]
|
|
1797
|
+
pub fn bloom_file_exists(_path: f64) -> f64 {
|
|
1798
|
+
// Handled by JS glue — checks localStorage
|
|
1799
|
+
0.0
|
|
1800
|
+
}
|
|
1801
|
+
|
|
1802
|
+
#[wasm_bindgen]
|
|
1803
|
+
pub fn bloom_read_file(_path: f64) -> f64 {
|
|
1804
|
+
// Handled by JS glue — reads from localStorage
|
|
1805
|
+
0.0
|
|
1806
|
+
}
|
|
1807
|
+
|
|
1808
|
+
// ============================================================
|
|
1809
|
+
// Cursor
|
|
1810
|
+
// ============================================================
|
|
1811
|
+
|
|
1812
|
+
#[wasm_bindgen]
|
|
1813
|
+
pub fn bloom_disable_cursor() {
|
|
1814
|
+
let input = &mut engine().input;
|
|
1815
|
+
input.cursor_disabled = true;
|
|
1816
|
+
input.clear_mouse_delta();
|
|
1817
|
+
// JS glue also calls canvas.requestPointerLock()
|
|
1818
|
+
}
|
|
1819
|
+
|
|
1820
|
+
#[wasm_bindgen]
|
|
1821
|
+
pub fn bloom_enable_cursor() {
|
|
1822
|
+
engine().input.cursor_disabled = false;
|
|
1823
|
+
// JS glue also calls document.exitPointerLock()
|
|
1824
|
+
}
|
|
1825
|
+
|
|
1826
|
+
// ============================================================
|
|
1827
|
+
// Frame callbacks & game loop
|
|
1828
|
+
// ============================================================
|
|
1829
|
+
|
|
1830
|
+
#[wasm_bindgen]
|
|
1831
|
+
pub fn bloom_register_frame_callback(_priority: f64, _callback: f64) -> f64 {
|
|
1832
|
+
// On web, frame callbacks are managed by the JS glue layer (bloom_glue.js)
|
|
1833
|
+
// since the callback is a Perry WASM closure that can only be invoked
|
|
1834
|
+
// through Perry's runtime. The JS glue intercepts this call.
|
|
1835
|
+
0.0
|
|
1836
|
+
}
|
|
1837
|
+
|
|
1838
|
+
#[wasm_bindgen]
|
|
1839
|
+
pub fn bloom_unregister_frame_callback(_id: f64) {
|
|
1840
|
+
// Managed by JS glue layer
|
|
1841
|
+
}
|
|
1842
|
+
|
|
1843
|
+
/// Emscripten-style game loop entry point.
|
|
1844
|
+
/// On native: blocks in a while loop calling begin_drawing/callback/end_drawing.
|
|
1845
|
+
/// On web: returns immediately. The JS glue layer (bloom_glue.js) intercepts
|
|
1846
|
+
/// this call and drives the game loop via requestAnimationFrame.
|
|
1847
|
+
#[wasm_bindgen]
|
|
1848
|
+
pub fn bloom_run_game(_callback: f64) {
|
|
1849
|
+
// On web, this is a no-op — the JS glue intercepts the FFI call
|
|
1850
|
+
// before it reaches here and sets up the rAF loop with the callback.
|
|
1851
|
+
// The game's while(!windowShouldClose()) loop should exit after this
|
|
1852
|
+
// (bloom_glue.js makes windowShouldClose return 1.0 once runGame is called).
|
|
1853
|
+
}
|
|
1854
|
+
|
|
1855
|
+
// ============================================================
|
|
1856
|
+
// Staging (async asset loading)
|
|
1857
|
+
// ============================================================
|
|
1858
|
+
|
|
1859
|
+
#[wasm_bindgen]
|
|
1860
|
+
pub fn bloom_stage_texture(_path: f64) -> f64 {
|
|
1861
|
+
// TODO: Phase 4 — fetch() texture then decode_and_stage_texture
|
|
1862
|
+
0.0
|
|
1863
|
+
}
|
|
1864
|
+
|
|
1865
|
+
#[wasm_bindgen]
|
|
1866
|
+
pub fn bloom_stage_model(_path: f64) -> f64 {
|
|
1867
|
+
// TODO: Phase 4 — fetch() model then stage
|
|
1868
|
+
0.0
|
|
1869
|
+
}
|
|
1870
|
+
|
|
1871
|
+
#[wasm_bindgen]
|
|
1872
|
+
pub fn bloom_stage_sound(_path: f64) -> f64 {
|
|
1873
|
+
// TODO: Phase 4 — fetch() sound then stage
|
|
1874
|
+
0.0
|
|
1875
|
+
}
|
|
1876
|
+
|
|
1877
|
+
#[wasm_bindgen]
|
|
1878
|
+
pub fn bloom_commit_texture(staging_handle: f64) -> f64 {
|
|
1879
|
+
let staged = match bloom_shared::staging::take_texture(staging_handle) {
|
|
1880
|
+
Some(s) => s,
|
|
1881
|
+
None => return 0.0,
|
|
1882
|
+
};
|
|
1883
|
+
let eng = engine();
|
|
1884
|
+
let bind_group_idx = eng.renderer.register_texture(staged.width, staged.height, &staged.data);
|
|
1885
|
+
eng.textures.textures.alloc(bloom_shared::textures::TextureData {
|
|
1886
|
+
bind_group_idx, width: staged.width, height: staged.height,
|
|
1887
|
+
})
|
|
1888
|
+
}
|
|
1889
|
+
|
|
1890
|
+
#[wasm_bindgen]
|
|
1891
|
+
pub fn bloom_commit_model(staging_handle: f64) -> f64 {
|
|
1892
|
+
let staged = match bloom_shared::staging::take_model(staging_handle) {
|
|
1893
|
+
Some(s) => s,
|
|
1894
|
+
None => return 0.0,
|
|
1895
|
+
};
|
|
1896
|
+
let eng = engine();
|
|
1897
|
+
let mut tex_map: Vec<u32> = Vec::with_capacity(staged.textures.len());
|
|
1898
|
+
for tex in &staged.textures {
|
|
1899
|
+
tex_map.push(eng.renderer.register_texture(tex.width, tex.height, &tex.data));
|
|
1900
|
+
}
|
|
1901
|
+
let mut model = staged.model;
|
|
1902
|
+
for mesh in &mut model.meshes {
|
|
1903
|
+
if let Some(ref mut idx) = mesh.texture_idx {
|
|
1904
|
+
let staged_idx = *idx as usize;
|
|
1905
|
+
if staged_idx > 0 && staged_idx <= tex_map.len() {
|
|
1906
|
+
*idx = tex_map[staged_idx - 1];
|
|
1907
|
+
} else {
|
|
1908
|
+
mesh.texture_idx = None;
|
|
1909
|
+
}
|
|
1910
|
+
}
|
|
1911
|
+
}
|
|
1912
|
+
eng.models.models.alloc(model)
|
|
1913
|
+
}
|
|
1914
|
+
|
|
1915
|
+
#[wasm_bindgen]
|
|
1916
|
+
pub fn bloom_commit_sound(staging_handle: f64) -> f64 {
|
|
1917
|
+
match bloom_shared::staging::take_sound(staging_handle) {
|
|
1918
|
+
Some(sd) => engine().audio.load_sound(sd),
|
|
1919
|
+
None => 0.0,
|
|
1920
|
+
}
|
|
1921
|
+
}
|
|
1922
|
+
|
|
1923
|
+
#[wasm_bindgen]
|
|
1924
|
+
pub fn bloom_commit_music(staging_handle: f64) -> f64 {
|
|
1925
|
+
match bloom_shared::staging::take_sound(staging_handle) {
|
|
1926
|
+
Some(sd) => engine().audio.load_music(sd),
|
|
1927
|
+
None => 0.0,
|
|
1928
|
+
}
|
|
1929
|
+
}
|
|
1930
|
+
|
|
1931
|
+
// ============================================================
|
|
1932
|
+
// Platform detection
|
|
1933
|
+
// ============================================================
|
|
1934
|
+
|
|
1935
|
+
#[wasm_bindgen]
|
|
1936
|
+
pub fn bloom_get_platform() -> f64 {
|
|
1937
|
+
7.0 // Web platform ID
|
|
1938
|
+
}
|
|
1939
|
+
|
|
1940
|
+
#[wasm_bindgen]
|
|
1941
|
+
pub fn bloom_is_any_input_pressed() -> f64 {
|
|
1942
|
+
if engine().input.is_any_input_pressed() { 1.0 } else { 0.0 }
|
|
1943
|
+
}
|
|
1944
|
+
|
|
1945
|
+
#[wasm_bindgen]
|
|
1946
|
+
pub fn bloom_get_crown_rotation() -> f64 {
|
|
1947
|
+
engine().input.consume_crown_rotation()
|
|
1948
|
+
}
|
|
1949
|
+
|
|
1950
|
+
|
|
1951
|
+
// Scene graph QoL — Q4/Q5/Q6/Q7
|
|
1952
|
+
#[wasm_bindgen]
|
|
1953
|
+
pub fn bloom_scene_get_transform(handle: f64, index: f64) -> f64 {
|
|
1954
|
+
let mat = engine().scene.get_transform(handle);
|
|
1955
|
+
let i = index as usize;
|
|
1956
|
+
let col = i / 4;
|
|
1957
|
+
let row = i % 4;
|
|
1958
|
+
if col < 4 && row < 4 { mat[col][row] as f64 } else { 0.0 }
|
|
1959
|
+
}
|
|
1960
|
+
#[wasm_bindgen]
|
|
1961
|
+
pub fn bloom_scene_get_bounds_min_x(handle: f64) -> f64 { engine().scene.get_bounds(handle).0[0] as f64 }
|
|
1962
|
+
#[wasm_bindgen]
|
|
1963
|
+
pub fn bloom_scene_get_bounds_min_y(handle: f64) -> f64 { engine().scene.get_bounds(handle).0[1] as f64 }
|
|
1964
|
+
#[wasm_bindgen]
|
|
1965
|
+
pub fn bloom_scene_get_bounds_min_z(handle: f64) -> f64 { engine().scene.get_bounds(handle).0[2] as f64 }
|
|
1966
|
+
#[wasm_bindgen]
|
|
1967
|
+
pub fn bloom_scene_get_bounds_max_x(handle: f64) -> f64 { engine().scene.get_bounds(handle).1[0] as f64 }
|
|
1968
|
+
#[wasm_bindgen]
|
|
1969
|
+
pub fn bloom_scene_get_bounds_max_y(handle: f64) -> f64 { engine().scene.get_bounds(handle).1[1] as f64 }
|
|
1970
|
+
#[wasm_bindgen]
|
|
1971
|
+
pub fn bloom_scene_get_bounds_max_z(handle: f64) -> f64 { engine().scene.get_bounds(handle).1[2] as f64 }
|
|
1972
|
+
#[wasm_bindgen]
|
|
1973
|
+
pub fn bloom_scene_set_user_data(handle: f64, data: f64) { engine().scene.set_user_data(handle, data as i64); }
|
|
1974
|
+
#[wasm_bindgen]
|
|
1975
|
+
pub fn bloom_scene_get_user_data(handle: f64) -> f64 { engine().scene.get_user_data(handle) as f64 }
|
|
1976
|
+
|
|
1977
|
+
// Q1: Render texture FFI (stub)
|
|
1978
|
+
#[wasm_bindgen]
|
|
1979
|
+
pub fn bloom_load_render_texture(width: f64, height: f64) -> f64 {
|
|
1980
|
+
engine().textures.load_render_texture(width as u32, height as u32)
|
|
1981
|
+
}
|
|
1982
|
+
#[wasm_bindgen]
|
|
1983
|
+
pub fn bloom_unload_render_texture(handle: f64) { engine().textures.unload_render_texture(handle); }
|
|
1984
|
+
#[wasm_bindgen]
|
|
1985
|
+
pub fn bloom_begin_texture_mode(_handle: f64) { /* stub */ }
|
|
1986
|
+
#[wasm_bindgen]
|
|
1987
|
+
pub fn bloom_end_texture_mode() { /* stub */ }
|
|
1988
|
+
#[wasm_bindgen]
|
|
1989
|
+
pub fn bloom_get_render_texture_texture(handle: f64) -> f64 { engine().textures.get_render_texture_texture(handle) }
|
|
1990
|
+
|
|
1991
|
+
// Q8: Water material
|
|
1992
|
+
#[wasm_bindgen]
|
|
1993
|
+
pub fn bloom_scene_set_material_water(handle: f64, wave_amp: f64, wave_speed: f64, r: f64, g: f64, b: f64, a: f64) {
|
|
1994
|
+
engine().scene.set_material_water(handle, wave_amp as f32, wave_speed as f32, r as f32, g as f32, b as f32, a as f32);
|
|
1995
|
+
}
|
|
1996
|
+
|
|
1997
|
+
// Q9: Spline ribbon mesh
|
|
1998
|
+
#[wasm_bindgen]
|
|
1999
|
+
pub fn bloom_gen_mesh_spline_ribbon(points_ptr: *const u8, point_count: f64, widths_ptr: *const u8, width_count: f64) -> f64 {
|
|
2000
|
+
let n = point_count as usize;
|
|
2001
|
+
let wn = width_count as usize;
|
|
2002
|
+
let points = unsafe { std::slice::from_raw_parts(points_ptr as *const f32, n * 3) };
|
|
2003
|
+
let widths = unsafe { std::slice::from_raw_parts(widths_ptr as *const f32, wn) };
|
|
2004
|
+
engine().models.gen_mesh_spline_ribbon(points, widths)
|
|
2005
|
+
}
|
|
2006
|
+
|
|
2007
|
+
// Q6: Multi-hit picking
|
|
2008
|
+
static mut LAST_PICK_ALL: Vec<bloom_shared::picking::PickResult> = Vec::new();
|
|
2009
|
+
|
|
2010
|
+
#[wasm_bindgen]
|
|
2011
|
+
pub fn bloom_scene_pick_all(screen_x: f64, screen_y: f64, max_results: f64) -> f64 {
|
|
2012
|
+
let eng = engine();
|
|
2013
|
+
let inv_vp = eng.renderer.inverse_vp_matrix();
|
|
2014
|
+
let cam_pos = eng.renderer.camera_pos();
|
|
2015
|
+
let w = eng.renderer.width() as f32;
|
|
2016
|
+
let h = eng.renderer.height() as f32;
|
|
2017
|
+
let (origin, direction) = bloom_shared::picking::screen_to_ray(
|
|
2018
|
+
screen_x as f32, screen_y as f32, w, h, &inv_vp, &cam_pos,
|
|
2019
|
+
);
|
|
2020
|
+
let results = bloom_shared::picking::raycast_scene_all(&eng.scene, &origin, &direction, max_results as usize);
|
|
2021
|
+
let count = results.len();
|
|
2022
|
+
unsafe { LAST_PICK_ALL = results; }
|
|
2023
|
+
count as f64
|
|
2024
|
+
}
|
|
2025
|
+
#[wasm_bindgen]
|
|
2026
|
+
pub fn bloom_pick_all_handle(index: f64) -> f64 {
|
|
2027
|
+
let i = index as usize;
|
|
2028
|
+
unsafe { LAST_PICK_ALL.get(i).map(|r| r.handle).unwrap_or(0.0) }
|
|
2029
|
+
}
|
|
2030
|
+
#[wasm_bindgen]
|
|
2031
|
+
pub fn bloom_pick_all_distance(index: f64) -> f64 {
|
|
2032
|
+
let i = index as usize;
|
|
2033
|
+
unsafe { LAST_PICK_ALL.get(i).map(|r| r.distance as f64).unwrap_or(0.0) }
|
|
2034
|
+
}
|
|
2035
|
+
|
|
2036
|
+
// Q2: Cursor shape
|
|
2037
|
+
#[wasm_bindgen]
|
|
2038
|
+
pub fn bloom_set_cursor_shape(shape: f64) {
|
|
2039
|
+
engine().input.cursor_shape = shape as u32;
|
|
2040
|
+
}
|
|
2041
|
+
|
|
2042
|
+
// E4: Clipboard (stub)
|
|
2043
|
+
#[wasm_bindgen]
|
|
2044
|
+
pub fn bloom_set_clipboard_text(_text_ptr: *const u8) {}
|
|
2045
|
+
#[wasm_bindgen]
|
|
2046
|
+
pub fn bloom_get_clipboard_text() -> f64 { 0.0 }
|
|
2047
|
+
|
|
2048
|
+
// E5b: File dialogs (stub)
|
|
2049
|
+
#[wasm_bindgen]
|
|
2050
|
+
pub fn bloom_open_file_dialog(_filter_ptr: *const u8, _title_ptr: *const u8) -> f64 { 0.0 }
|
|
2051
|
+
#[wasm_bindgen]
|
|
2052
|
+
pub fn bloom_save_file_dialog(_default_name_ptr: *const u8, _title_ptr: *const u8) -> f64 { 0.0 }
|
|
2053
|
+
|
|
2054
|
+
// ============================================================
|
|
2055
|
+
// Render quality toggles (individual + preset) — ticket 011
|
|
2056
|
+
// Mirror of the macOS FFI surface added in commit 95da6af, exposed to
|
|
2057
|
+
// the browser via wasm_bindgen. Without these the TS API's
|
|
2058
|
+
// setQualityPreset / setShadowsEnabled / etc. would fail with
|
|
2059
|
+
// "bloom_set_quality_preset is not a function" on the web target.
|
|
2060
|
+
// ============================================================
|
|
2061
|
+
|
|
2062
|
+
#[wasm_bindgen]
|
|
2063
|
+
pub fn bloom_set_quality_preset(preset: f64) {
|
|
2064
|
+
engine().renderer.apply_quality_preset(preset as u32);
|
|
2065
|
+
}
|
|
2066
|
+
#[wasm_bindgen]
|
|
2067
|
+
pub fn bloom_set_shadows_enabled(on: f64) {
|
|
2068
|
+
engine().renderer.set_shadows_enabled(on != 0.0);
|
|
2069
|
+
}
|
|
2070
|
+
#[wasm_bindgen]
|
|
2071
|
+
pub fn bloom_set_shadows_always_fresh(on: f64) {
|
|
2072
|
+
engine().renderer.set_shadows_always_fresh(on != 0.0);
|
|
2073
|
+
}
|
|
2074
|
+
#[wasm_bindgen]
|
|
2075
|
+
pub fn bloom_set_bloom_enabled(on: f64) {
|
|
2076
|
+
engine().renderer.set_bloom_enabled(on != 0.0);
|
|
2077
|
+
}
|
|
2078
|
+
#[wasm_bindgen]
|
|
2079
|
+
pub fn bloom_set_ssao_enabled(on: f64) {
|
|
2080
|
+
engine().renderer.set_ssao_enabled(on != 0.0);
|
|
2081
|
+
}
|
|
2082
|
+
#[wasm_bindgen]
|
|
2083
|
+
pub fn bloom_set_ssao_intensity(value: f64) {
|
|
2084
|
+
engine().renderer.set_ssao_strength(value as f32);
|
|
2085
|
+
}
|
|
2086
|
+
#[wasm_bindgen]
|
|
2087
|
+
pub fn bloom_set_ssao_radius(world_radius: f64) {
|
|
2088
|
+
engine().renderer.set_ssao_radius(world_radius as f32);
|
|
2089
|
+
}
|
|
2090
|
+
#[wasm_bindgen]
|
|
2091
|
+
pub fn bloom_set_wind(dir_x: f64, dir_z: f64, amplitude: f64, frequency: f64) {
|
|
2092
|
+
engine().renderer.set_wind(dir_x as f32, dir_z as f32, amplitude as f32, frequency as f32);
|
|
2093
|
+
}
|
|
2094
|
+
#[wasm_bindgen]
|
|
2095
|
+
pub fn bloom_set_ssr_enabled(on: f64) {
|
|
2096
|
+
engine().renderer.set_ssr_enabled(on != 0.0);
|
|
2097
|
+
}
|
|
2098
|
+
#[wasm_bindgen]
|
|
2099
|
+
pub fn bloom_set_motion_blur_enabled(on: f64) {
|
|
2100
|
+
engine().renderer.set_motion_blur_enabled(on != 0.0);
|
|
2101
|
+
}
|
|
2102
|
+
#[wasm_bindgen]
|
|
2103
|
+
pub fn bloom_set_sss_enabled(on: f64) {
|
|
2104
|
+
engine().renderer.set_sss_enabled(on != 0.0);
|
|
2105
|
+
}
|
|
2106
|
+
|
|
2107
|
+
// ============================================================
|
|
2108
|
+
// Profiler — CPU phase timings (always available). TIMESTAMP_QUERY
|
|
2109
|
+
// is not part of the WebGPU spec as of wgpu 29, so the GPU path
|
|
2110
|
+
// returns 0 on web regardless of adapter — the profiler stays
|
|
2111
|
+
// CPU-only, which is still useful for frame-phase profiling.
|
|
2112
|
+
// ============================================================
|
|
2113
|
+
|
|
2114
|
+
#[wasm_bindgen]
|
|
2115
|
+
pub fn bloom_set_profiler_enabled(on: f64) {
|
|
2116
|
+
engine().profiler.set_enabled(on != 0.0);
|
|
2117
|
+
}
|
|
2118
|
+
#[wasm_bindgen]
|
|
2119
|
+
pub fn bloom_get_profiler_frame_cpu_us() -> f64 {
|
|
2120
|
+
engine().profiler.avg_frame_cpu_us()
|
|
2121
|
+
}
|
|
2122
|
+
#[wasm_bindgen]
|
|
2123
|
+
pub fn bloom_get_profiler_frame_gpu_us() -> f64 {
|
|
2124
|
+
engine().profiler.avg_frame_gpu_us()
|
|
2125
|
+
}
|
|
2126
|
+
#[wasm_bindgen]
|
|
2127
|
+
pub fn bloom_print_profiler_summary() {
|
|
2128
|
+
// No stdout in the browser — route through the existing
|
|
2129
|
+
// console_log binding so the summary lands in devtools.
|
|
2130
|
+
console_log(&engine().profiler.summary());
|
|
2131
|
+
}
|
|
2132
|
+
// ============================================================
|
|
2133
|
+
|
|
2134
|
+
// ============================================================
|
|
2135
|
+
// Physics (Jolt 5.x via JoltPhysics.js) — web FFI surface
|
|
2136
|
+
// ============================================================
|
|
2137
|
+
//
|
|
2138
|
+
// Every bloom_physics_* call is a thin wrapper around a JS function defined
|
|
2139
|
+
// in jolt_bridge.js. Block is generated from package.json manifest.
|
|
2140
|
+
|
|
2141
|
+
// 117 physics FFI entries — generated from package.json
|
|
2142
|
+
#[cfg(feature = "jolt")]
|
|
2143
|
+
#[wasm_bindgen(module = "/jolt_bridge.js")]
|
|
2144
|
+
extern "C" {
|
|
2145
|
+
#[wasm_bindgen(js_name = initJolt, catch)]
|
|
2146
|
+
async fn jb_init_jolt(factory: JsValue) -> Result<JsValue, JsValue>;
|
|
2147
|
+
#[wasm_bindgen(js_name = createWorld)]
|
|
2148
|
+
fn jb_create_world(a0: f64, a1: f64, a2: f64, a3: f64, a4: f64) -> f64;
|
|
2149
|
+
#[wasm_bindgen(js_name = destroyWorld)]
|
|
2150
|
+
fn jb_destroy_world(a0: f64);
|
|
2151
|
+
#[wasm_bindgen(js_name = setGravity)]
|
|
2152
|
+
fn jb_set_gravity(a0: f64, a1: f64, a2: f64, a3: f64);
|
|
2153
|
+
#[wasm_bindgen(js_name = getGravity)]
|
|
2154
|
+
fn jb_get_gravity(a0: f64, a1: f64) -> f64;
|
|
2155
|
+
#[wasm_bindgen(js_name = optimizeBroadphase)]
|
|
2156
|
+
fn jb_optimize_broadphase(a0: f64);
|
|
2157
|
+
#[wasm_bindgen(js_name = step)]
|
|
2158
|
+
fn jb_step(a0: f64, a1: f64, a2: f64);
|
|
2159
|
+
#[wasm_bindgen(js_name = setLayerCollides)]
|
|
2160
|
+
fn jb_set_layer_collides(a0: f64, a1: f64, a2: f64, a3: f64);
|
|
2161
|
+
#[wasm_bindgen(js_name = getLayerCollides)]
|
|
2162
|
+
fn jb_get_layer_collides(a0: f64, a1: f64, a2: f64) -> f64;
|
|
2163
|
+
#[wasm_bindgen(js_name = bodyCount)]
|
|
2164
|
+
fn jb_body_count(a0: f64) -> f64;
|
|
2165
|
+
#[wasm_bindgen(js_name = activeBodyCount)]
|
|
2166
|
+
fn jb_active_body_count(a0: f64) -> f64;
|
|
2167
|
+
#[wasm_bindgen(js_name = shapeBox)]
|
|
2168
|
+
fn jb_shape_box(a0: f64, a1: f64, a2: f64, a3: f64) -> f64;
|
|
2169
|
+
#[wasm_bindgen(js_name = shapeSphere)]
|
|
2170
|
+
fn jb_shape_sphere(a0: f64) -> f64;
|
|
2171
|
+
#[wasm_bindgen(js_name = shapeCapsule)]
|
|
2172
|
+
fn jb_shape_capsule(a0: f64, a1: f64) -> f64;
|
|
2173
|
+
#[wasm_bindgen(js_name = shapeCylinder)]
|
|
2174
|
+
fn jb_shape_cylinder(a0: f64, a1: f64, a2: f64) -> f64;
|
|
2175
|
+
#[wasm_bindgen(js_name = shapeScaled)]
|
|
2176
|
+
fn jb_shape_scaled(a0: f64, a1: f64, a2: f64, a3: f64) -> f64;
|
|
2177
|
+
#[wasm_bindgen(js_name = shapeOffsetCom)]
|
|
2178
|
+
fn jb_shape_offset_com(a0: f64, a1: f64, a2: f64, a3: f64) -> f64;
|
|
2179
|
+
#[wasm_bindgen(js_name = shapeRelease)]
|
|
2180
|
+
fn jb_shape_release(a0: f64);
|
|
2181
|
+
#[wasm_bindgen(js_name = scratchReset)]
|
|
2182
|
+
fn jb_scratch_reset();
|
|
2183
|
+
#[wasm_bindgen(js_name = scratchPushF32)]
|
|
2184
|
+
fn jb_scratch_push_f32(a0: f64);
|
|
2185
|
+
#[wasm_bindgen(js_name = scratchPushU32)]
|
|
2186
|
+
fn jb_scratch_push_u32(a0: f64);
|
|
2187
|
+
#[wasm_bindgen(js_name = shapeConvexHull)]
|
|
2188
|
+
fn jb_shape_convex_hull(a0: f64, a1: f64) -> f64;
|
|
2189
|
+
#[wasm_bindgen(js_name = shapeMesh)]
|
|
2190
|
+
fn jb_shape_mesh(a0: f64, a1: f64) -> f64;
|
|
2191
|
+
#[wasm_bindgen(js_name = shapeHeightfield)]
|
|
2192
|
+
fn jb_shape_heightfield(a0: f64, a1: f64, a2: f64, a3: f64, a4: f64, a5: f64, a6: f64, a7: f64) -> f64;
|
|
2193
|
+
#[wasm_bindgen(js_name = compoundBegin)]
|
|
2194
|
+
fn jb_compound_begin();
|
|
2195
|
+
#[wasm_bindgen(js_name = compoundAddChild)]
|
|
2196
|
+
fn jb_compound_add_child(a0: f64, a1: f64, a2: f64, a3: f64, a4: f64, a5: f64, a6: f64, a7: f64);
|
|
2197
|
+
#[wasm_bindgen(js_name = compoundEnd)]
|
|
2198
|
+
fn jb_compound_end() -> f64;
|
|
2199
|
+
#[wasm_bindgen(js_name = shapeBounds)]
|
|
2200
|
+
fn jb_shape_bounds(a0: f64, a1: f64) -> f64;
|
|
2201
|
+
#[wasm_bindgen(js_name = shapeVolume)]
|
|
2202
|
+
fn jb_shape_volume(a0: f64) -> f64;
|
|
2203
|
+
#[wasm_bindgen(js_name = bodyCreate)]
|
|
2204
|
+
fn jb_body_create(a0: f64, a1: f64, a2: f64, a3: f64, a4: f64, a5: f64, a6: f64, a7: f64, a8: f64, a9: f64, a10: f64) -> f64;
|
|
2205
|
+
#[wasm_bindgen(js_name = bodyDestroy)]
|
|
2206
|
+
fn jb_body_destroy(a0: f64);
|
|
2207
|
+
#[wasm_bindgen(js_name = bodyActivate)]
|
|
2208
|
+
fn jb_body_activate(a0: f64);
|
|
2209
|
+
#[wasm_bindgen(js_name = bodyDeactivate)]
|
|
2210
|
+
fn jb_body_deactivate(a0: f64);
|
|
2211
|
+
#[wasm_bindgen(js_name = bodyIsActive)]
|
|
2212
|
+
fn jb_body_is_active(a0: f64) -> f64;
|
|
2213
|
+
#[wasm_bindgen(js_name = bodyIsValid)]
|
|
2214
|
+
fn jb_body_is_valid(a0: f64) -> f64;
|
|
2215
|
+
#[wasm_bindgen(js_name = bodyGetPosition)]
|
|
2216
|
+
fn jb_body_get_position(a0: f64, a1: f64) -> f64;
|
|
2217
|
+
#[wasm_bindgen(js_name = bodyGetRotation)]
|
|
2218
|
+
fn jb_body_get_rotation(a0: f64, a1: f64) -> f64;
|
|
2219
|
+
#[wasm_bindgen(js_name = bodySetPosition)]
|
|
2220
|
+
fn jb_body_set_position(a0: f64, a1: f64, a2: f64, a3: f64, a4: f64);
|
|
2221
|
+
#[wasm_bindgen(js_name = bodySetRotation)]
|
|
2222
|
+
fn jb_body_set_rotation(a0: f64, a1: f64, a2: f64, a3: f64, a4: f64, a5: f64);
|
|
2223
|
+
#[wasm_bindgen(js_name = bodySetTransform)]
|
|
2224
|
+
fn jb_body_set_transform(a0: f64, a1: f64, a2: f64, a3: f64, a4: f64, a5: f64, a6: f64, a7: f64, a8: f64);
|
|
2225
|
+
#[wasm_bindgen(js_name = bodyMoveKinematic)]
|
|
2226
|
+
fn jb_body_move_kinematic(a0: f64, a1: f64, a2: f64, a3: f64, a4: f64, a5: f64, a6: f64, a7: f64, a8: f64);
|
|
2227
|
+
#[wasm_bindgen(js_name = bodyGetLinearVelocity)]
|
|
2228
|
+
fn jb_body_get_linear_velocity(a0: f64, a1: f64) -> f64;
|
|
2229
|
+
#[wasm_bindgen(js_name = bodyGetAngularVelocity)]
|
|
2230
|
+
fn jb_body_get_angular_velocity(a0: f64, a1: f64) -> f64;
|
|
2231
|
+
#[wasm_bindgen(js_name = bodyGetPointVelocity)]
|
|
2232
|
+
fn jb_body_get_point_velocity(a0: f64, a1: f64, a2: f64, a3: f64, a4: f64) -> f64;
|
|
2233
|
+
#[wasm_bindgen(js_name = bodySetLinearVelocity)]
|
|
2234
|
+
fn jb_body_set_linear_velocity(a0: f64, a1: f64, a2: f64, a3: f64);
|
|
2235
|
+
#[wasm_bindgen(js_name = bodySetAngularVelocity)]
|
|
2236
|
+
fn jb_body_set_angular_velocity(a0: f64, a1: f64, a2: f64, a3: f64);
|
|
2237
|
+
#[wasm_bindgen(js_name = bodyAddForce)]
|
|
2238
|
+
fn jb_body_add_force(a0: f64, a1: f64, a2: f64, a3: f64);
|
|
2239
|
+
#[wasm_bindgen(js_name = bodyAddImpulse)]
|
|
2240
|
+
fn jb_body_add_impulse(a0: f64, a1: f64, a2: f64, a3: f64);
|
|
2241
|
+
#[wasm_bindgen(js_name = bodyAddTorque)]
|
|
2242
|
+
fn jb_body_add_torque(a0: f64, a1: f64, a2: f64, a3: f64);
|
|
2243
|
+
#[wasm_bindgen(js_name = bodyAddAngularImpulse)]
|
|
2244
|
+
fn jb_body_add_angular_impulse(a0: f64, a1: f64, a2: f64, a3: f64);
|
|
2245
|
+
#[wasm_bindgen(js_name = bodyAddForceAt)]
|
|
2246
|
+
fn jb_body_add_force_at(a0: f64, a1: f64, a2: f64, a3: f64, a4: f64, a5: f64, a6: f64);
|
|
2247
|
+
#[wasm_bindgen(js_name = bodyAddImpulseAt)]
|
|
2248
|
+
fn jb_body_add_impulse_at(a0: f64, a1: f64, a2: f64, a3: f64, a4: f64, a5: f64, a6: f64);
|
|
2249
|
+
#[wasm_bindgen(js_name = bodySetFriction)]
|
|
2250
|
+
fn jb_body_set_friction(a0: f64, a1: f64);
|
|
2251
|
+
#[wasm_bindgen(js_name = bodySetRestitution)]
|
|
2252
|
+
fn jb_body_set_restitution(a0: f64, a1: f64);
|
|
2253
|
+
#[wasm_bindgen(js_name = bodySetLinearDamping)]
|
|
2254
|
+
fn jb_body_set_linear_damping(a0: f64, a1: f64);
|
|
2255
|
+
#[wasm_bindgen(js_name = bodySetAngularDamping)]
|
|
2256
|
+
fn jb_body_set_angular_damping(a0: f64, a1: f64);
|
|
2257
|
+
#[wasm_bindgen(js_name = bodySetGravityFactor)]
|
|
2258
|
+
fn jb_body_set_gravity_factor(a0: f64, a1: f64);
|
|
2259
|
+
#[wasm_bindgen(js_name = bodySetCcd)]
|
|
2260
|
+
fn jb_body_set_ccd(a0: f64, a1: f64);
|
|
2261
|
+
#[wasm_bindgen(js_name = bodySetMotionType)]
|
|
2262
|
+
fn jb_body_set_motion_type(a0: f64, a1: f64, a2: f64);
|
|
2263
|
+
#[wasm_bindgen(js_name = bodySetObjectLayer)]
|
|
2264
|
+
fn jb_body_set_object_layer(a0: f64, a1: f64);
|
|
2265
|
+
#[wasm_bindgen(js_name = bodySetIsSensor)]
|
|
2266
|
+
fn jb_body_set_is_sensor(a0: f64, a1: f64);
|
|
2267
|
+
#[wasm_bindgen(js_name = bodySetAllowSleeping)]
|
|
2268
|
+
fn jb_body_set_allow_sleeping(a0: f64, a1: f64);
|
|
2269
|
+
#[wasm_bindgen(js_name = bodySetShape)]
|
|
2270
|
+
fn jb_body_set_shape(a0: f64, a1: f64, a2: f64, a3: f64);
|
|
2271
|
+
#[wasm_bindgen(js_name = bodyLockRotationAxes)]
|
|
2272
|
+
fn jb_body_lock_rotation_axes(a0: f64, a1: f64, a2: f64, a3: f64);
|
|
2273
|
+
#[wasm_bindgen(js_name = bodyLockTranslationAxes)]
|
|
2274
|
+
fn jb_body_lock_translation_axes(a0: f64, a1: f64, a2: f64, a3: f64);
|
|
2275
|
+
#[wasm_bindgen(js_name = bodyGetMass)]
|
|
2276
|
+
fn jb_body_get_mass(a0: f64) -> f64;
|
|
2277
|
+
#[wasm_bindgen(js_name = bodyGetFriction)]
|
|
2278
|
+
fn jb_body_get_friction(a0: f64) -> f64;
|
|
2279
|
+
#[wasm_bindgen(js_name = bodyGetRestitution)]
|
|
2280
|
+
fn jb_body_get_restitution(a0: f64) -> f64;
|
|
2281
|
+
#[wasm_bindgen(js_name = bodyGetObjectLayer)]
|
|
2282
|
+
fn jb_body_get_object_layer(a0: f64) -> f64;
|
|
2283
|
+
#[wasm_bindgen(js_name = bodySetUserData)]
|
|
2284
|
+
fn jb_body_set_user_data(a0: f64, a1: f64, a2: f64);
|
|
2285
|
+
#[wasm_bindgen(js_name = bodyGetUserData)]
|
|
2286
|
+
fn jb_body_get_user_data(a0: f64, a1: f64) -> f64;
|
|
2287
|
+
#[wasm_bindgen(js_name = raycast)]
|
|
2288
|
+
fn jb_raycast(a0: f64, a1: f64, a2: f64, a3: f64, a4: f64, a5: f64, a6: f64, a7: f64, a8: f64) -> f64;
|
|
2289
|
+
#[wasm_bindgen(js_name = raycastAll)]
|
|
2290
|
+
fn jb_raycast_all(a0: f64, a1: f64, a2: f64, a3: f64, a4: f64, a5: f64, a6: f64, a7: f64, a8: f64, a9: f64) -> f64;
|
|
2291
|
+
#[wasm_bindgen(js_name = rayHitCount)]
|
|
2292
|
+
fn jb_ray_hit_count() -> f64;
|
|
2293
|
+
#[wasm_bindgen(js_name = rayHitBody)]
|
|
2294
|
+
fn jb_ray_hit_body(a0: f64) -> f64;
|
|
2295
|
+
#[wasm_bindgen(js_name = rayHitAxis)]
|
|
2296
|
+
fn jb_ray_hit_axis(a0: f64, a1: f64) -> f64;
|
|
2297
|
+
#[wasm_bindgen(js_name = rayHitFraction)]
|
|
2298
|
+
fn jb_ray_hit_fraction(a0: f64) -> f64;
|
|
2299
|
+
#[wasm_bindgen(js_name = rayHitSubShape)]
|
|
2300
|
+
fn jb_ray_hit_sub_shape(a0: f64) -> f64;
|
|
2301
|
+
#[wasm_bindgen(js_name = overlapSphere)]
|
|
2302
|
+
fn jb_overlap_sphere(a0: f64, a1: f64, a2: f64, a3: f64, a4: f64, a5: f64, a6: f64) -> f64;
|
|
2303
|
+
#[wasm_bindgen(js_name = overlapPoint)]
|
|
2304
|
+
fn jb_overlap_point(a0: f64, a1: f64, a2: f64, a3: f64, a4: f64, a5: f64) -> f64;
|
|
2305
|
+
#[wasm_bindgen(js_name = overlapBox)]
|
|
2306
|
+
fn jb_overlap_box(a0: f64, a1: f64, a2: f64, a3: f64, a4: f64, a5: f64, a6: f64, a7: f64, a8: f64, a9: f64, a10: f64, a11: f64, a12: f64) -> f64;
|
|
2307
|
+
#[wasm_bindgen(js_name = overlapBody)]
|
|
2308
|
+
fn jb_overlap_body(a0: f64) -> f64;
|
|
2309
|
+
#[wasm_bindgen(js_name = constraintFixed)]
|
|
2310
|
+
fn jb_constraint_fixed(a0: f64, a1: f64, a2: f64, a3: f64, a4: f64, a5: f64, a6: f64, a7: f64, a8: f64) -> f64;
|
|
2311
|
+
#[wasm_bindgen(js_name = constraintPoint)]
|
|
2312
|
+
fn jb_constraint_point(a0: f64, a1: f64, a2: f64, a3: f64, a4: f64, a5: f64, a6: f64, a7: f64, a8: f64) -> f64;
|
|
2313
|
+
#[wasm_bindgen(js_name = constraintHinge)]
|
|
2314
|
+
fn jb_constraint_hinge(a0: f64, a1: f64, a2: f64, a3: f64, a4: f64, a5: f64, a6: f64, a7: f64, a8: f64, a9: f64, a10: f64, a11: f64, a12: f64, a13: f64) -> f64;
|
|
2315
|
+
#[wasm_bindgen(js_name = constraintSlider)]
|
|
2316
|
+
fn jb_constraint_slider(a0: f64, a1: f64, a2: f64, a3: f64, a4: f64, a5: f64, a6: f64, a7: f64, a8: f64, a9: f64, a10: f64, a11: f64, a12: f64, a13: f64) -> f64;
|
|
2317
|
+
#[wasm_bindgen(js_name = constraintDistance)]
|
|
2318
|
+
fn jb_constraint_distance(a0: f64, a1: f64, a2: f64, a3: f64, a4: f64, a5: f64, a6: f64, a7: f64, a8: f64, a9: f64, a10: f64) -> f64;
|
|
2319
|
+
#[wasm_bindgen(js_name = constraintDestroy)]
|
|
2320
|
+
fn jb_constraint_destroy(a0: f64);
|
|
2321
|
+
#[wasm_bindgen(js_name = constraintSetEnabled)]
|
|
2322
|
+
fn jb_constraint_set_enabled(a0: f64, a1: f64);
|
|
2323
|
+
#[wasm_bindgen(js_name = contactCount)]
|
|
2324
|
+
fn jb_contact_count() -> f64;
|
|
2325
|
+
#[wasm_bindgen(js_name = contactField)]
|
|
2326
|
+
fn jb_contact_field(a0: f64, a1: f64) -> f64;
|
|
2327
|
+
#[wasm_bindgen(js_name = clearContacts)]
|
|
2328
|
+
fn jb_clear_contacts(a0: f64);
|
|
2329
|
+
#[wasm_bindgen(js_name = characterCreate)]
|
|
2330
|
+
fn jb_character_create(a0: f64, a1: f64, a2: f64, a3: f64, a4: f64, a5: f64, a6: f64, a7: f64, a8: f64, a9: f64, a10: f64, a11: f64, a12: f64, a13: f64, a14: f64, a15: f64, a16: f64, a17: f64, a18: f64) -> f64;
|
|
2331
|
+
#[wasm_bindgen(js_name = characterDestroy)]
|
|
2332
|
+
fn jb_character_destroy(a0: f64);
|
|
2333
|
+
#[wasm_bindgen(js_name = characterUpdate)]
|
|
2334
|
+
fn jb_character_update(a0: f64, a1: f64, a2: f64, a3: f64, a4: f64);
|
|
2335
|
+
#[wasm_bindgen(js_name = characterGetPosition)]
|
|
2336
|
+
fn jb_character_get_position(a0: f64, a1: f64) -> f64;
|
|
2337
|
+
#[wasm_bindgen(js_name = characterGetRotation)]
|
|
2338
|
+
fn jb_character_get_rotation(a0: f64, a1: f64) -> f64;
|
|
2339
|
+
#[wasm_bindgen(js_name = characterSetPosition)]
|
|
2340
|
+
fn jb_character_set_position(a0: f64, a1: f64, a2: f64, a3: f64);
|
|
2341
|
+
#[wasm_bindgen(js_name = characterSetRotation)]
|
|
2342
|
+
fn jb_character_set_rotation(a0: f64, a1: f64, a2: f64, a3: f64, a4: f64);
|
|
2343
|
+
#[wasm_bindgen(js_name = characterGetLinearVelocity)]
|
|
2344
|
+
fn jb_character_get_linear_velocity(a0: f64, a1: f64) -> f64;
|
|
2345
|
+
#[wasm_bindgen(js_name = characterSetLinearVelocity)]
|
|
2346
|
+
fn jb_character_set_linear_velocity(a0: f64, a1: f64, a2: f64, a3: f64);
|
|
2347
|
+
#[wasm_bindgen(js_name = characterGetGroundState)]
|
|
2348
|
+
fn jb_character_get_ground_state(a0: f64) -> f64;
|
|
2349
|
+
#[wasm_bindgen(js_name = characterGetGroundNormal)]
|
|
2350
|
+
fn jb_character_get_ground_normal(a0: f64, a1: f64) -> f64;
|
|
2351
|
+
#[wasm_bindgen(js_name = characterGetGroundPosition)]
|
|
2352
|
+
fn jb_character_get_ground_position(a0: f64, a1: f64) -> f64;
|
|
2353
|
+
#[wasm_bindgen(js_name = characterGetGroundBody)]
|
|
2354
|
+
fn jb_character_get_ground_body(a0: f64) -> f64;
|
|
2355
|
+
#[wasm_bindgen(js_name = characterSetShape)]
|
|
2356
|
+
fn jb_character_set_shape(a0: f64, a1: f64);
|
|
2357
|
+
#[wasm_bindgen(js_name = softBodyCreate)]
|
|
2358
|
+
fn jb_soft_body_create(a0: f64, a1: f64, a2: f64, a3: f64, a4: f64, a5: f64, a6: f64, a7: f64, a8: f64, a9: f64, a10: f64, a11: f64, a12: f64, a13: f64, a14: f64) -> f64;
|
|
2359
|
+
#[wasm_bindgen(js_name = softBodyVertexCount)]
|
|
2360
|
+
fn jb_soft_body_vertex_count(a0: f64) -> f64;
|
|
2361
|
+
#[wasm_bindgen(js_name = softBodyGetVertex)]
|
|
2362
|
+
fn jb_soft_body_get_vertex(a0: f64, a1: f64, a2: f64) -> f64;
|
|
2363
|
+
#[wasm_bindgen(js_name = softBodySetVertex)]
|
|
2364
|
+
fn jb_soft_body_set_vertex(a0: f64, a1: f64, a2: f64, a3: f64, a4: f64);
|
|
2365
|
+
#[wasm_bindgen(js_name = softBodySetVertexInvMass)]
|
|
2366
|
+
fn jb_soft_body_set_vertex_inv_mass(a0: f64, a1: f64, a2: f64);
|
|
2367
|
+
#[wasm_bindgen(js_name = vehicleCreate)]
|
|
2368
|
+
fn jb_vehicle_create(a0: f64, a1: f64, a2: f64, a3: f64, a4: f64, a5: f64, a6: f64, a7: f64, a8: f64, a9: f64, a10: f64, a11: f64, a12: f64, a13: f64, a14: f64, a15: f64, a16: f64, a17: f64, a18: f64, a19: f64, a20: f64, a21: f64, a22: f64, a23: f64, a24: f64, a25: f64, a26: f64, a27: f64, a28: f64, a29: f64, a30: f64, a31: f64, a32: f64, a33: f64, a34: f64, a35: f64, a36: f64, a37: f64) -> f64;
|
|
2369
|
+
#[wasm_bindgen(js_name = vehicleDestroy)]
|
|
2370
|
+
fn jb_vehicle_destroy(a0: f64);
|
|
2371
|
+
#[wasm_bindgen(js_name = vehicleGetChassis)]
|
|
2372
|
+
fn jb_vehicle_get_chassis(a0: f64) -> f64;
|
|
2373
|
+
#[wasm_bindgen(js_name = vehicleSetInput)]
|
|
2374
|
+
fn jb_vehicle_set_input(a0: f64, a1: f64, a2: f64, a3: f64, a4: f64);
|
|
2375
|
+
#[wasm_bindgen(js_name = vehicleGetWheelTransform)]
|
|
2376
|
+
fn jb_vehicle_get_wheel_transform(a0: f64, a1: f64, a2: f64) -> f64;
|
|
2377
|
+
#[wasm_bindgen(js_name = vehicleGetEngineRpm)]
|
|
2378
|
+
fn jb_vehicle_get_engine_rpm(a0: f64) -> f64;
|
|
2379
|
+
#[wasm_bindgen(js_name = vehicleGetWheelAngularVelocity)]
|
|
2380
|
+
fn jb_vehicle_get_wheel_angular_velocity(a0: f64, a1: f64) -> f64;
|
|
2381
|
+
}
|
|
2382
|
+
|
|
2383
|
+
#[cfg(feature = "jolt")]
|
|
2384
|
+
#[wasm_bindgen]
|
|
2385
|
+
pub fn bloom_physics_create_world(a0: f64, a1: f64, a2: f64, a3: f64, a4: f64) -> f64 { jb_create_world(a0, a1, a2, a3, a4) }
|
|
2386
|
+
#[cfg(feature = "jolt")]
|
|
2387
|
+
#[wasm_bindgen]
|
|
2388
|
+
pub fn bloom_physics_destroy_world(a0: f64) { jb_destroy_world(a0) }
|
|
2389
|
+
#[cfg(feature = "jolt")]
|
|
2390
|
+
#[wasm_bindgen]
|
|
2391
|
+
pub fn bloom_physics_set_gravity(a0: f64, a1: f64, a2: f64, a3: f64) { jb_set_gravity(a0, a1, a2, a3) }
|
|
2392
|
+
#[cfg(feature = "jolt")]
|
|
2393
|
+
#[wasm_bindgen]
|
|
2394
|
+
pub fn bloom_physics_get_gravity(a0: f64, a1: f64) -> f64 { jb_get_gravity(a0, a1) }
|
|
2395
|
+
#[cfg(feature = "jolt")]
|
|
2396
|
+
#[wasm_bindgen]
|
|
2397
|
+
pub fn bloom_physics_optimize_broadphase(a0: f64) { jb_optimize_broadphase(a0) }
|
|
2398
|
+
#[cfg(feature = "jolt")]
|
|
2399
|
+
#[wasm_bindgen]
|
|
2400
|
+
pub fn bloom_physics_step(a0: f64, a1: f64, a2: f64) { jb_step(a0, a1, a2) }
|
|
2401
|
+
#[cfg(feature = "jolt")]
|
|
2402
|
+
#[wasm_bindgen]
|
|
2403
|
+
pub fn bloom_physics_set_layer_collides(a0: f64, a1: f64, a2: f64, a3: f64) { jb_set_layer_collides(a0, a1, a2, a3) }
|
|
2404
|
+
#[cfg(feature = "jolt")]
|
|
2405
|
+
#[wasm_bindgen]
|
|
2406
|
+
pub fn bloom_physics_get_layer_collides(a0: f64, a1: f64, a2: f64) -> f64 { jb_get_layer_collides(a0, a1, a2) }
|
|
2407
|
+
#[cfg(feature = "jolt")]
|
|
2408
|
+
#[wasm_bindgen]
|
|
2409
|
+
pub fn bloom_physics_body_count(a0: f64) -> f64 { jb_body_count(a0) }
|
|
2410
|
+
#[cfg(feature = "jolt")]
|
|
2411
|
+
#[wasm_bindgen]
|
|
2412
|
+
pub fn bloom_physics_active_body_count(a0: f64) -> f64 { jb_active_body_count(a0) }
|
|
2413
|
+
#[cfg(feature = "jolt")]
|
|
2414
|
+
#[wasm_bindgen]
|
|
2415
|
+
pub fn bloom_physics_shape_box(a0: f64, a1: f64, a2: f64, a3: f64) -> f64 { jb_shape_box(a0, a1, a2, a3) }
|
|
2416
|
+
#[cfg(feature = "jolt")]
|
|
2417
|
+
#[wasm_bindgen]
|
|
2418
|
+
pub fn bloom_physics_shape_sphere(a0: f64) -> f64 { jb_shape_sphere(a0) }
|
|
2419
|
+
#[cfg(feature = "jolt")]
|
|
2420
|
+
#[wasm_bindgen]
|
|
2421
|
+
pub fn bloom_physics_shape_capsule(a0: f64, a1: f64) -> f64 { jb_shape_capsule(a0, a1) }
|
|
2422
|
+
#[cfg(feature = "jolt")]
|
|
2423
|
+
#[wasm_bindgen]
|
|
2424
|
+
pub fn bloom_physics_shape_cylinder(a0: f64, a1: f64, a2: f64) -> f64 { jb_shape_cylinder(a0, a1, a2) }
|
|
2425
|
+
#[cfg(feature = "jolt")]
|
|
2426
|
+
#[wasm_bindgen]
|
|
2427
|
+
pub fn bloom_physics_shape_scaled(a0: f64, a1: f64, a2: f64, a3: f64) -> f64 { jb_shape_scaled(a0, a1, a2, a3) }
|
|
2428
|
+
#[cfg(feature = "jolt")]
|
|
2429
|
+
#[wasm_bindgen]
|
|
2430
|
+
pub fn bloom_physics_shape_offset_com(a0: f64, a1: f64, a2: f64, a3: f64) -> f64 { jb_shape_offset_com(a0, a1, a2, a3) }
|
|
2431
|
+
#[cfg(feature = "jolt")]
|
|
2432
|
+
#[wasm_bindgen]
|
|
2433
|
+
pub fn bloom_physics_shape_release(a0: f64) { jb_shape_release(a0) }
|
|
2434
|
+
#[cfg(feature = "jolt")]
|
|
2435
|
+
#[wasm_bindgen]
|
|
2436
|
+
pub fn bloom_physics_scratch_reset() { jb_scratch_reset() }
|
|
2437
|
+
#[cfg(feature = "jolt")]
|
|
2438
|
+
#[wasm_bindgen]
|
|
2439
|
+
pub fn bloom_physics_scratch_push_f32(a0: f64) { jb_scratch_push_f32(a0) }
|
|
2440
|
+
#[cfg(feature = "jolt")]
|
|
2441
|
+
#[wasm_bindgen]
|
|
2442
|
+
pub fn bloom_physics_scratch_push_u32(a0: f64) { jb_scratch_push_u32(a0) }
|
|
2443
|
+
#[cfg(feature = "jolt")]
|
|
2444
|
+
#[wasm_bindgen]
|
|
2445
|
+
pub fn bloom_physics_shape_convex_hull(a0: f64, a1: f64) -> f64 { jb_shape_convex_hull(a0, a1) }
|
|
2446
|
+
#[cfg(feature = "jolt")]
|
|
2447
|
+
#[wasm_bindgen]
|
|
2448
|
+
pub fn bloom_physics_shape_mesh(a0: f64, a1: f64) -> f64 { jb_shape_mesh(a0, a1) }
|
|
2449
|
+
#[cfg(feature = "jolt")]
|
|
2450
|
+
#[wasm_bindgen]
|
|
2451
|
+
pub fn bloom_physics_shape_heightfield(a0: f64, a1: f64, a2: f64, a3: f64, a4: f64, a5: f64, a6: f64, a7: f64) -> f64 { jb_shape_heightfield(a0, a1, a2, a3, a4, a5, a6, a7) }
|
|
2452
|
+
#[cfg(feature = "jolt")]
|
|
2453
|
+
#[wasm_bindgen]
|
|
2454
|
+
pub fn bloom_physics_compound_begin() { jb_compound_begin() }
|
|
2455
|
+
#[cfg(feature = "jolt")]
|
|
2456
|
+
#[wasm_bindgen]
|
|
2457
|
+
pub fn bloom_physics_compound_add_child(a0: f64, a1: f64, a2: f64, a3: f64, a4: f64, a5: f64, a6: f64, a7: f64) { jb_compound_add_child(a0, a1, a2, a3, a4, a5, a6, a7) }
|
|
2458
|
+
#[cfg(feature = "jolt")]
|
|
2459
|
+
#[wasm_bindgen]
|
|
2460
|
+
pub fn bloom_physics_compound_end() -> f64 { jb_compound_end() }
|
|
2461
|
+
#[cfg(feature = "jolt")]
|
|
2462
|
+
#[wasm_bindgen]
|
|
2463
|
+
pub fn bloom_physics_shape_bounds(a0: f64, a1: f64) -> f64 { jb_shape_bounds(a0, a1) }
|
|
2464
|
+
#[cfg(feature = "jolt")]
|
|
2465
|
+
#[wasm_bindgen]
|
|
2466
|
+
pub fn bloom_physics_shape_volume(a0: f64) -> f64 { jb_shape_volume(a0) }
|
|
2467
|
+
#[cfg(feature = "jolt")]
|
|
2468
|
+
#[wasm_bindgen]
|
|
2469
|
+
pub fn bloom_physics_body_create(a0: f64, a1: f64, a2: f64, a3: f64, a4: f64, a5: f64, a6: f64, a7: f64, a8: f64, a9: f64, a10: f64) -> f64 { jb_body_create(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10) }
|
|
2470
|
+
#[cfg(feature = "jolt")]
|
|
2471
|
+
#[wasm_bindgen]
|
|
2472
|
+
pub fn bloom_physics_body_destroy(a0: f64) { jb_body_destroy(a0) }
|
|
2473
|
+
#[cfg(feature = "jolt")]
|
|
2474
|
+
#[wasm_bindgen]
|
|
2475
|
+
pub fn bloom_physics_body_activate(a0: f64) { jb_body_activate(a0) }
|
|
2476
|
+
#[cfg(feature = "jolt")]
|
|
2477
|
+
#[wasm_bindgen]
|
|
2478
|
+
pub fn bloom_physics_body_deactivate(a0: f64) { jb_body_deactivate(a0) }
|
|
2479
|
+
#[cfg(feature = "jolt")]
|
|
2480
|
+
#[wasm_bindgen]
|
|
2481
|
+
pub fn bloom_physics_body_is_active(a0: f64) -> f64 { jb_body_is_active(a0) }
|
|
2482
|
+
#[cfg(feature = "jolt")]
|
|
2483
|
+
#[wasm_bindgen]
|
|
2484
|
+
pub fn bloom_physics_body_is_valid(a0: f64) -> f64 { jb_body_is_valid(a0) }
|
|
2485
|
+
#[cfg(feature = "jolt")]
|
|
2486
|
+
#[wasm_bindgen]
|
|
2487
|
+
pub fn bloom_physics_body_get_position(a0: f64, a1: f64) -> f64 { jb_body_get_position(a0, a1) }
|
|
2488
|
+
#[cfg(feature = "jolt")]
|
|
2489
|
+
#[wasm_bindgen]
|
|
2490
|
+
pub fn bloom_physics_body_get_rotation(a0: f64, a1: f64) -> f64 { jb_body_get_rotation(a0, a1) }
|
|
2491
|
+
#[cfg(feature = "jolt")]
|
|
2492
|
+
#[wasm_bindgen]
|
|
2493
|
+
pub fn bloom_physics_body_set_position(a0: f64, a1: f64, a2: f64, a3: f64, a4: f64) { jb_body_set_position(a0, a1, a2, a3, a4) }
|
|
2494
|
+
#[cfg(feature = "jolt")]
|
|
2495
|
+
#[wasm_bindgen]
|
|
2496
|
+
pub fn bloom_physics_body_set_rotation(a0: f64, a1: f64, a2: f64, a3: f64, a4: f64, a5: f64) { jb_body_set_rotation(a0, a1, a2, a3, a4, a5) }
|
|
2497
|
+
#[cfg(feature = "jolt")]
|
|
2498
|
+
#[wasm_bindgen]
|
|
2499
|
+
pub fn bloom_physics_body_set_transform(a0: f64, a1: f64, a2: f64, a3: f64, a4: f64, a5: f64, a6: f64, a7: f64, a8: f64) { jb_body_set_transform(a0, a1, a2, a3, a4, a5, a6, a7, a8) }
|
|
2500
|
+
#[cfg(feature = "jolt")]
|
|
2501
|
+
#[wasm_bindgen]
|
|
2502
|
+
pub fn bloom_physics_body_move_kinematic(a0: f64, a1: f64, a2: f64, a3: f64, a4: f64, a5: f64, a6: f64, a7: f64, a8: f64) { jb_body_move_kinematic(a0, a1, a2, a3, a4, a5, a6, a7, a8) }
|
|
2503
|
+
#[cfg(feature = "jolt")]
|
|
2504
|
+
#[wasm_bindgen]
|
|
2505
|
+
pub fn bloom_physics_body_get_linear_velocity(a0: f64, a1: f64) -> f64 { jb_body_get_linear_velocity(a0, a1) }
|
|
2506
|
+
#[cfg(feature = "jolt")]
|
|
2507
|
+
#[wasm_bindgen]
|
|
2508
|
+
pub fn bloom_physics_body_get_angular_velocity(a0: f64, a1: f64) -> f64 { jb_body_get_angular_velocity(a0, a1) }
|
|
2509
|
+
#[cfg(feature = "jolt")]
|
|
2510
|
+
#[wasm_bindgen]
|
|
2511
|
+
pub fn bloom_physics_body_get_point_velocity(a0: f64, a1: f64, a2: f64, a3: f64, a4: f64) -> f64 { jb_body_get_point_velocity(a0, a1, a2, a3, a4) }
|
|
2512
|
+
#[cfg(feature = "jolt")]
|
|
2513
|
+
#[wasm_bindgen]
|
|
2514
|
+
pub fn bloom_physics_body_set_linear_velocity(a0: f64, a1: f64, a2: f64, a3: f64) { jb_body_set_linear_velocity(a0, a1, a2, a3) }
|
|
2515
|
+
#[cfg(feature = "jolt")]
|
|
2516
|
+
#[wasm_bindgen]
|
|
2517
|
+
pub fn bloom_physics_body_set_angular_velocity(a0: f64, a1: f64, a2: f64, a3: f64) { jb_body_set_angular_velocity(a0, a1, a2, a3) }
|
|
2518
|
+
#[cfg(feature = "jolt")]
|
|
2519
|
+
#[wasm_bindgen]
|
|
2520
|
+
pub fn bloom_physics_body_add_force(a0: f64, a1: f64, a2: f64, a3: f64) { jb_body_add_force(a0, a1, a2, a3) }
|
|
2521
|
+
#[cfg(feature = "jolt")]
|
|
2522
|
+
#[wasm_bindgen]
|
|
2523
|
+
pub fn bloom_physics_body_add_impulse(a0: f64, a1: f64, a2: f64, a3: f64) { jb_body_add_impulse(a0, a1, a2, a3) }
|
|
2524
|
+
#[cfg(feature = "jolt")]
|
|
2525
|
+
#[wasm_bindgen]
|
|
2526
|
+
pub fn bloom_physics_body_add_torque(a0: f64, a1: f64, a2: f64, a3: f64) { jb_body_add_torque(a0, a1, a2, a3) }
|
|
2527
|
+
#[cfg(feature = "jolt")]
|
|
2528
|
+
#[wasm_bindgen]
|
|
2529
|
+
pub fn bloom_physics_body_add_angular_impulse(a0: f64, a1: f64, a2: f64, a3: f64) { jb_body_add_angular_impulse(a0, a1, a2, a3) }
|
|
2530
|
+
#[cfg(feature = "jolt")]
|
|
2531
|
+
#[wasm_bindgen]
|
|
2532
|
+
pub fn bloom_physics_body_add_force_at(a0: f64, a1: f64, a2: f64, a3: f64, a4: f64, a5: f64, a6: f64) { jb_body_add_force_at(a0, a1, a2, a3, a4, a5, a6) }
|
|
2533
|
+
#[cfg(feature = "jolt")]
|
|
2534
|
+
#[wasm_bindgen]
|
|
2535
|
+
pub fn bloom_physics_body_add_impulse_at(a0: f64, a1: f64, a2: f64, a3: f64, a4: f64, a5: f64, a6: f64) { jb_body_add_impulse_at(a0, a1, a2, a3, a4, a5, a6) }
|
|
2536
|
+
#[cfg(feature = "jolt")]
|
|
2537
|
+
#[wasm_bindgen]
|
|
2538
|
+
pub fn bloom_physics_body_set_friction(a0: f64, a1: f64) { jb_body_set_friction(a0, a1) }
|
|
2539
|
+
#[cfg(feature = "jolt")]
|
|
2540
|
+
#[wasm_bindgen]
|
|
2541
|
+
pub fn bloom_physics_body_set_restitution(a0: f64, a1: f64) { jb_body_set_restitution(a0, a1) }
|
|
2542
|
+
#[cfg(feature = "jolt")]
|
|
2543
|
+
#[wasm_bindgen]
|
|
2544
|
+
pub fn bloom_physics_body_set_linear_damping(a0: f64, a1: f64) { jb_body_set_linear_damping(a0, a1) }
|
|
2545
|
+
#[cfg(feature = "jolt")]
|
|
2546
|
+
#[wasm_bindgen]
|
|
2547
|
+
pub fn bloom_physics_body_set_angular_damping(a0: f64, a1: f64) { jb_body_set_angular_damping(a0, a1) }
|
|
2548
|
+
#[cfg(feature = "jolt")]
|
|
2549
|
+
#[wasm_bindgen]
|
|
2550
|
+
pub fn bloom_physics_body_set_gravity_factor(a0: f64, a1: f64) { jb_body_set_gravity_factor(a0, a1) }
|
|
2551
|
+
#[cfg(feature = "jolt")]
|
|
2552
|
+
#[wasm_bindgen]
|
|
2553
|
+
pub fn bloom_physics_body_set_ccd(a0: f64, a1: f64) { jb_body_set_ccd(a0, a1) }
|
|
2554
|
+
#[cfg(feature = "jolt")]
|
|
2555
|
+
#[wasm_bindgen]
|
|
2556
|
+
pub fn bloom_physics_body_set_motion_type(a0: f64, a1: f64, a2: f64) { jb_body_set_motion_type(a0, a1, a2) }
|
|
2557
|
+
#[cfg(feature = "jolt")]
|
|
2558
|
+
#[wasm_bindgen]
|
|
2559
|
+
pub fn bloom_physics_body_set_object_layer(a0: f64, a1: f64) { jb_body_set_object_layer(a0, a1) }
|
|
2560
|
+
#[cfg(feature = "jolt")]
|
|
2561
|
+
#[wasm_bindgen]
|
|
2562
|
+
pub fn bloom_physics_body_set_is_sensor(a0: f64, a1: f64) { jb_body_set_is_sensor(a0, a1) }
|
|
2563
|
+
#[cfg(feature = "jolt")]
|
|
2564
|
+
#[wasm_bindgen]
|
|
2565
|
+
pub fn bloom_physics_body_set_allow_sleeping(a0: f64, a1: f64) { jb_body_set_allow_sleeping(a0, a1) }
|
|
2566
|
+
#[cfg(feature = "jolt")]
|
|
2567
|
+
#[wasm_bindgen]
|
|
2568
|
+
pub fn bloom_physics_body_set_shape(a0: f64, a1: f64, a2: f64, a3: f64) { jb_body_set_shape(a0, a1, a2, a3) }
|
|
2569
|
+
#[cfg(feature = "jolt")]
|
|
2570
|
+
#[wasm_bindgen]
|
|
2571
|
+
pub fn bloom_physics_body_lock_rotation_axes(a0: f64, a1: f64, a2: f64, a3: f64) { jb_body_lock_rotation_axes(a0, a1, a2, a3) }
|
|
2572
|
+
#[cfg(feature = "jolt")]
|
|
2573
|
+
#[wasm_bindgen]
|
|
2574
|
+
pub fn bloom_physics_body_lock_translation_axes(a0: f64, a1: f64, a2: f64, a3: f64) { jb_body_lock_translation_axes(a0, a1, a2, a3) }
|
|
2575
|
+
#[cfg(feature = "jolt")]
|
|
2576
|
+
#[wasm_bindgen]
|
|
2577
|
+
pub fn bloom_physics_body_get_mass(a0: f64) -> f64 { jb_body_get_mass(a0) }
|
|
2578
|
+
#[cfg(feature = "jolt")]
|
|
2579
|
+
#[wasm_bindgen]
|
|
2580
|
+
pub fn bloom_physics_body_get_friction(a0: f64) -> f64 { jb_body_get_friction(a0) }
|
|
2581
|
+
#[cfg(feature = "jolt")]
|
|
2582
|
+
#[wasm_bindgen]
|
|
2583
|
+
pub fn bloom_physics_body_get_restitution(a0: f64) -> f64 { jb_body_get_restitution(a0) }
|
|
2584
|
+
#[cfg(feature = "jolt")]
|
|
2585
|
+
#[wasm_bindgen]
|
|
2586
|
+
pub fn bloom_physics_body_get_object_layer(a0: f64) -> f64 { jb_body_get_object_layer(a0) }
|
|
2587
|
+
#[cfg(feature = "jolt")]
|
|
2588
|
+
#[wasm_bindgen]
|
|
2589
|
+
pub fn bloom_physics_body_set_user_data(a0: f64, a1: f64, a2: f64) { jb_body_set_user_data(a0, a1, a2) }
|
|
2590
|
+
#[cfg(feature = "jolt")]
|
|
2591
|
+
#[wasm_bindgen]
|
|
2592
|
+
pub fn bloom_physics_body_get_user_data(a0: f64, a1: f64) -> f64 { jb_body_get_user_data(a0, a1) }
|
|
2593
|
+
#[cfg(feature = "jolt")]
|
|
2594
|
+
#[wasm_bindgen]
|
|
2595
|
+
pub fn bloom_physics_raycast(a0: f64, a1: f64, a2: f64, a3: f64, a4: f64, a5: f64, a6: f64, a7: f64, a8: f64) -> f64 { jb_raycast(a0, a1, a2, a3, a4, a5, a6, a7, a8) }
|
|
2596
|
+
#[cfg(feature = "jolt")]
|
|
2597
|
+
#[wasm_bindgen]
|
|
2598
|
+
pub fn bloom_physics_raycast_all(a0: f64, a1: f64, a2: f64, a3: f64, a4: f64, a5: f64, a6: f64, a7: f64, a8: f64, a9: f64) -> f64 { jb_raycast_all(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9) }
|
|
2599
|
+
#[cfg(feature = "jolt")]
|
|
2600
|
+
#[wasm_bindgen]
|
|
2601
|
+
pub fn bloom_physics_ray_hit_count() -> f64 { jb_ray_hit_count() }
|
|
2602
|
+
#[cfg(feature = "jolt")]
|
|
2603
|
+
#[wasm_bindgen]
|
|
2604
|
+
pub fn bloom_physics_ray_hit_body(a0: f64) -> f64 { jb_ray_hit_body(a0) }
|
|
2605
|
+
#[cfg(feature = "jolt")]
|
|
2606
|
+
#[wasm_bindgen]
|
|
2607
|
+
pub fn bloom_physics_ray_hit_axis(a0: f64, a1: f64) -> f64 { jb_ray_hit_axis(a0, a1) }
|
|
2608
|
+
#[cfg(feature = "jolt")]
|
|
2609
|
+
#[wasm_bindgen]
|
|
2610
|
+
pub fn bloom_physics_ray_hit_fraction(a0: f64) -> f64 { jb_ray_hit_fraction(a0) }
|
|
2611
|
+
#[cfg(feature = "jolt")]
|
|
2612
|
+
#[wasm_bindgen]
|
|
2613
|
+
pub fn bloom_physics_ray_hit_sub_shape(a0: f64) -> f64 { jb_ray_hit_sub_shape(a0) }
|
|
2614
|
+
#[cfg(feature = "jolt")]
|
|
2615
|
+
#[wasm_bindgen]
|
|
2616
|
+
pub fn bloom_physics_overlap_sphere(a0: f64, a1: f64, a2: f64, a3: f64, a4: f64, a5: f64, a6: f64) -> f64 { jb_overlap_sphere(a0, a1, a2, a3, a4, a5, a6) }
|
|
2617
|
+
#[cfg(feature = "jolt")]
|
|
2618
|
+
#[wasm_bindgen]
|
|
2619
|
+
pub fn bloom_physics_overlap_point(a0: f64, a1: f64, a2: f64, a3: f64, a4: f64, a5: f64) -> f64 { jb_overlap_point(a0, a1, a2, a3, a4, a5) }
|
|
2620
|
+
#[cfg(feature = "jolt")]
|
|
2621
|
+
#[wasm_bindgen]
|
|
2622
|
+
pub fn bloom_physics_overlap_box(a0: f64, a1: f64, a2: f64, a3: f64, a4: f64, a5: f64, a6: f64, a7: f64, a8: f64, a9: f64, a10: f64, a11: f64, a12: f64) -> f64 { jb_overlap_box(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12) }
|
|
2623
|
+
#[cfg(feature = "jolt")]
|
|
2624
|
+
#[wasm_bindgen]
|
|
2625
|
+
pub fn bloom_physics_overlap_body(a0: f64) -> f64 { jb_overlap_body(a0) }
|
|
2626
|
+
#[cfg(feature = "jolt")]
|
|
2627
|
+
#[wasm_bindgen]
|
|
2628
|
+
pub fn bloom_physics_constraint_fixed(a0: f64, a1: f64, a2: f64, a3: f64, a4: f64, a5: f64, a6: f64, a7: f64, a8: f64) -> f64 { jb_constraint_fixed(a0, a1, a2, a3, a4, a5, a6, a7, a8) }
|
|
2629
|
+
#[cfg(feature = "jolt")]
|
|
2630
|
+
#[wasm_bindgen]
|
|
2631
|
+
pub fn bloom_physics_constraint_point(a0: f64, a1: f64, a2: f64, a3: f64, a4: f64, a5: f64, a6: f64, a7: f64, a8: f64) -> f64 { jb_constraint_point(a0, a1, a2, a3, a4, a5, a6, a7, a8) }
|
|
2632
|
+
#[cfg(feature = "jolt")]
|
|
2633
|
+
#[wasm_bindgen]
|
|
2634
|
+
pub fn bloom_physics_constraint_hinge(a0: f64, a1: f64, a2: f64, a3: f64, a4: f64, a5: f64, a6: f64, a7: f64, a8: f64, a9: f64, a10: f64, a11: f64, a12: f64, a13: f64) -> f64 { jb_constraint_hinge(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13) }
|
|
2635
|
+
#[cfg(feature = "jolt")]
|
|
2636
|
+
#[wasm_bindgen]
|
|
2637
|
+
pub fn bloom_physics_constraint_slider(a0: f64, a1: f64, a2: f64, a3: f64, a4: f64, a5: f64, a6: f64, a7: f64, a8: f64, a9: f64, a10: f64, a11: f64, a12: f64, a13: f64) -> f64 { jb_constraint_slider(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13) }
|
|
2638
|
+
#[cfg(feature = "jolt")]
|
|
2639
|
+
#[wasm_bindgen]
|
|
2640
|
+
pub fn bloom_physics_constraint_distance(a0: f64, a1: f64, a2: f64, a3: f64, a4: f64, a5: f64, a6: f64, a7: f64, a8: f64, a9: f64, a10: f64) -> f64 { jb_constraint_distance(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10) }
|
|
2641
|
+
#[cfg(feature = "jolt")]
|
|
2642
|
+
#[wasm_bindgen]
|
|
2643
|
+
pub fn bloom_physics_constraint_destroy(a0: f64) { jb_constraint_destroy(a0) }
|
|
2644
|
+
#[cfg(feature = "jolt")]
|
|
2645
|
+
#[wasm_bindgen]
|
|
2646
|
+
pub fn bloom_physics_constraint_set_enabled(a0: f64, a1: f64) { jb_constraint_set_enabled(a0, a1) }
|
|
2647
|
+
#[cfg(feature = "jolt")]
|
|
2648
|
+
#[wasm_bindgen]
|
|
2649
|
+
pub fn bloom_physics_contact_count() -> f64 { jb_contact_count() }
|
|
2650
|
+
#[cfg(feature = "jolt")]
|
|
2651
|
+
#[wasm_bindgen]
|
|
2652
|
+
pub fn bloom_physics_contact_field(a0: f64, a1: f64) -> f64 { jb_contact_field(a0, a1) }
|
|
2653
|
+
#[cfg(feature = "jolt")]
|
|
2654
|
+
#[wasm_bindgen]
|
|
2655
|
+
pub fn bloom_physics_clear_contacts(a0: f64) { jb_clear_contacts(a0) }
|
|
2656
|
+
#[cfg(feature = "jolt")]
|
|
2657
|
+
#[wasm_bindgen]
|
|
2658
|
+
pub fn bloom_physics_character_create(a0: f64, a1: f64, a2: f64, a3: f64, a4: f64, a5: f64, a6: f64, a7: f64, a8: f64, a9: f64, a10: f64, a11: f64, a12: f64, a13: f64, a14: f64, a15: f64, a16: f64, a17: f64, a18: f64) -> f64 { jb_character_create(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18) }
|
|
2659
|
+
#[cfg(feature = "jolt")]
|
|
2660
|
+
#[wasm_bindgen]
|
|
2661
|
+
pub fn bloom_physics_character_destroy(a0: f64) { jb_character_destroy(a0) }
|
|
2662
|
+
#[cfg(feature = "jolt")]
|
|
2663
|
+
#[wasm_bindgen]
|
|
2664
|
+
pub fn bloom_physics_character_update(a0: f64, a1: f64, a2: f64, a3: f64, a4: f64) { jb_character_update(a0, a1, a2, a3, a4) }
|
|
2665
|
+
#[cfg(feature = "jolt")]
|
|
2666
|
+
#[wasm_bindgen]
|
|
2667
|
+
pub fn bloom_physics_character_get_position(a0: f64, a1: f64) -> f64 { jb_character_get_position(a0, a1) }
|
|
2668
|
+
#[cfg(feature = "jolt")]
|
|
2669
|
+
#[wasm_bindgen]
|
|
2670
|
+
pub fn bloom_physics_character_get_rotation(a0: f64, a1: f64) -> f64 { jb_character_get_rotation(a0, a1) }
|
|
2671
|
+
#[cfg(feature = "jolt")]
|
|
2672
|
+
#[wasm_bindgen]
|
|
2673
|
+
pub fn bloom_physics_character_set_position(a0: f64, a1: f64, a2: f64, a3: f64) { jb_character_set_position(a0, a1, a2, a3) }
|
|
2674
|
+
#[cfg(feature = "jolt")]
|
|
2675
|
+
#[wasm_bindgen]
|
|
2676
|
+
pub fn bloom_physics_character_set_rotation(a0: f64, a1: f64, a2: f64, a3: f64, a4: f64) { jb_character_set_rotation(a0, a1, a2, a3, a4) }
|
|
2677
|
+
#[cfg(feature = "jolt")]
|
|
2678
|
+
#[wasm_bindgen]
|
|
2679
|
+
pub fn bloom_physics_character_get_linear_velocity(a0: f64, a1: f64) -> f64 { jb_character_get_linear_velocity(a0, a1) }
|
|
2680
|
+
#[cfg(feature = "jolt")]
|
|
2681
|
+
#[wasm_bindgen]
|
|
2682
|
+
pub fn bloom_physics_character_set_linear_velocity(a0: f64, a1: f64, a2: f64, a3: f64) { jb_character_set_linear_velocity(a0, a1, a2, a3) }
|
|
2683
|
+
#[cfg(feature = "jolt")]
|
|
2684
|
+
#[wasm_bindgen]
|
|
2685
|
+
pub fn bloom_physics_character_get_ground_state(a0: f64) -> f64 { jb_character_get_ground_state(a0) }
|
|
2686
|
+
#[cfg(feature = "jolt")]
|
|
2687
|
+
#[wasm_bindgen]
|
|
2688
|
+
pub fn bloom_physics_character_get_ground_normal(a0: f64, a1: f64) -> f64 { jb_character_get_ground_normal(a0, a1) }
|
|
2689
|
+
#[cfg(feature = "jolt")]
|
|
2690
|
+
#[wasm_bindgen]
|
|
2691
|
+
pub fn bloom_physics_character_get_ground_position(a0: f64, a1: f64) -> f64 { jb_character_get_ground_position(a0, a1) }
|
|
2692
|
+
#[cfg(feature = "jolt")]
|
|
2693
|
+
#[wasm_bindgen]
|
|
2694
|
+
pub fn bloom_physics_character_get_ground_body(a0: f64) -> f64 { jb_character_get_ground_body(a0) }
|
|
2695
|
+
#[cfg(feature = "jolt")]
|
|
2696
|
+
#[wasm_bindgen]
|
|
2697
|
+
pub fn bloom_physics_character_set_shape(a0: f64, a1: f64) { jb_character_set_shape(a0, a1) }
|
|
2698
|
+
#[cfg(feature = "jolt")]
|
|
2699
|
+
#[wasm_bindgen]
|
|
2700
|
+
pub fn bloom_physics_soft_body_create(a0: f64, a1: f64, a2: f64, a3: f64, a4: f64, a5: f64, a6: f64, a7: f64, a8: f64, a9: f64, a10: f64, a11: f64, a12: f64, a13: f64, a14: f64) -> f64 { jb_soft_body_create(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14) }
|
|
2701
|
+
#[cfg(feature = "jolt")]
|
|
2702
|
+
#[wasm_bindgen]
|
|
2703
|
+
pub fn bloom_physics_soft_body_vertex_count(a0: f64) -> f64 { jb_soft_body_vertex_count(a0) }
|
|
2704
|
+
#[cfg(feature = "jolt")]
|
|
2705
|
+
#[wasm_bindgen]
|
|
2706
|
+
pub fn bloom_physics_soft_body_get_vertex(a0: f64, a1: f64, a2: f64) -> f64 { jb_soft_body_get_vertex(a0, a1, a2) }
|
|
2707
|
+
#[cfg(feature = "jolt")]
|
|
2708
|
+
#[wasm_bindgen]
|
|
2709
|
+
pub fn bloom_physics_soft_body_set_vertex(a0: f64, a1: f64, a2: f64, a3: f64, a4: f64) { jb_soft_body_set_vertex(a0, a1, a2, a3, a4) }
|
|
2710
|
+
#[cfg(feature = "jolt")]
|
|
2711
|
+
#[wasm_bindgen]
|
|
2712
|
+
pub fn bloom_physics_soft_body_set_vertex_inv_mass(a0: f64, a1: f64, a2: f64) { jb_soft_body_set_vertex_inv_mass(a0, a1, a2) }
|
|
2713
|
+
#[cfg(feature = "jolt")]
|
|
2714
|
+
#[wasm_bindgen]
|
|
2715
|
+
pub fn bloom_physics_vehicle_create(a0: f64, a1: f64, a2: f64, a3: f64, a4: f64, a5: f64, a6: f64, a7: f64, a8: f64, a9: f64, a10: f64, a11: f64, a12: f64, a13: f64, a14: f64, a15: f64, a16: f64, a17: f64, a18: f64, a19: f64, a20: f64, a21: f64, a22: f64, a23: f64, a24: f64, a25: f64, a26: f64, a27: f64, a28: f64, a29: f64, a30: f64, a31: f64, a32: f64, a33: f64, a34: f64, a35: f64, a36: f64, a37: f64) -> f64 { jb_vehicle_create(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20, a21, a22, a23, a24, a25, a26, a27, a28, a29, a30, a31, a32, a33, a34, a35, a36, a37) }
|
|
2716
|
+
#[cfg(feature = "jolt")]
|
|
2717
|
+
#[wasm_bindgen]
|
|
2718
|
+
pub fn bloom_physics_vehicle_destroy(a0: f64) { jb_vehicle_destroy(a0) }
|
|
2719
|
+
#[cfg(feature = "jolt")]
|
|
2720
|
+
#[wasm_bindgen]
|
|
2721
|
+
pub fn bloom_physics_vehicle_get_chassis(a0: f64) -> f64 { jb_vehicle_get_chassis(a0) }
|
|
2722
|
+
#[cfg(feature = "jolt")]
|
|
2723
|
+
#[wasm_bindgen]
|
|
2724
|
+
pub fn bloom_physics_vehicle_set_input(a0: f64, a1: f64, a2: f64, a3: f64, a4: f64) { jb_vehicle_set_input(a0, a1, a2, a3, a4) }
|
|
2725
|
+
#[cfg(feature = "jolt")]
|
|
2726
|
+
#[wasm_bindgen]
|
|
2727
|
+
pub fn bloom_physics_vehicle_get_wheel_transform(a0: f64, a1: f64, a2: f64) -> f64 { jb_vehicle_get_wheel_transform(a0, a1, a2) }
|
|
2728
|
+
#[cfg(feature = "jolt")]
|
|
2729
|
+
#[wasm_bindgen]
|
|
2730
|
+
pub fn bloom_physics_vehicle_get_engine_rpm(a0: f64) -> f64 { jb_vehicle_get_engine_rpm(a0) }
|
|
2731
|
+
#[cfg(feature = "jolt")]
|
|
2732
|
+
#[wasm_bindgen]
|
|
2733
|
+
pub fn bloom_physics_vehicle_get_wheel_angular_velocity(a0: f64, a1: f64) -> f64 { jb_vehicle_get_wheel_angular_velocity(a0, a1) }
|
|
2734
|
+
|
|
2735
|
+
#[cfg(feature = "jolt")]
|
|
2736
|
+
#[wasm_bindgen]
|
|
2737
|
+
pub async fn bloom_physics_init_jolt(factory: JsValue) -> Result<(), JsValue> {
|
|
2738
|
+
jb_init_jolt(factory).await.map(|_| ())
|
|
2739
|
+
}
|