@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,205 @@
|
|
|
1
|
+
// Prefab expansion and registry.
|
|
2
|
+
//
|
|
3
|
+
// A prefab is a reusable composite object — e.g. a house made of 4 walls + a
|
|
4
|
+
// roof + a door. Prefabs are authored in the editor and stored as individual
|
|
5
|
+
// `*.prefab.json` files on disk. When a world places a prefab (via an entity
|
|
6
|
+
// with `prefabRef` set), the runtime expands the prefab tree into a flat list
|
|
7
|
+
// of leaf glb placements with world-space transforms, and the loader spawns
|
|
8
|
+
// one scene node per leaf.
|
|
9
|
+
//
|
|
10
|
+
// Prefabs can nest: one prefab's child can reference another prefab. Cycles
|
|
11
|
+
// are detected at expansion time (A -> B -> A) and reported as errors; the
|
|
12
|
+
// offending child is treated as empty so the rest of the world still loads.
|
|
13
|
+
|
|
14
|
+
import { readFile } from '../core/index';
|
|
15
|
+
import {
|
|
16
|
+
mat4Identity,
|
|
17
|
+
mat4Multiply,
|
|
18
|
+
mat4Translate,
|
|
19
|
+
mat4RotateX,
|
|
20
|
+
mat4RotateY,
|
|
21
|
+
mat4RotateZ,
|
|
22
|
+
mat4Scale,
|
|
23
|
+
} from '../math/index';
|
|
24
|
+
import { Mat4, Vec3 } from '../core/types';
|
|
25
|
+
import {
|
|
26
|
+
PrefabData,
|
|
27
|
+
PrefabChild,
|
|
28
|
+
TransformData,
|
|
29
|
+
Vec4Lit,
|
|
30
|
+
} from './types';
|
|
31
|
+
import { migratePrefabData } from './version';
|
|
32
|
+
import { validatePrefab, formatValidationErrors } from './validate';
|
|
33
|
+
|
|
34
|
+
// One leaf of an expanded prefab — a single glb to spawn at a world-space
|
|
35
|
+
// matrix. The loader turns each of these into one scene node.
|
|
36
|
+
export interface PrefabLeaf {
|
|
37
|
+
modelRef: string; // Always a glb path; prefabs are fully flattened.
|
|
38
|
+
worldMatrix: Mat4; // Column-major 4x4 in world space.
|
|
39
|
+
tint: Vec4Lit | null; // Inherited from ancestor unless a child overrides.
|
|
40
|
+
tags: string[]; // Union of the leaf's own tags and ancestor tags.
|
|
41
|
+
sourcePath: string; // Dotted path for debugging: "small_house.wall_0".
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// Registry of all prefabs known to a project. The editor populates it at
|
|
45
|
+
// startup by scanning `project.prefabsDir`; games populate it from their
|
|
46
|
+
// asset bundle. Keyed by `PrefabData.id`.
|
|
47
|
+
export interface PrefabRegistry {
|
|
48
|
+
byId: Map<string, PrefabData>;
|
|
49
|
+
getPrefab: (id: string) => PrefabData | null;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export function createPrefabRegistry(): PrefabRegistry {
|
|
53
|
+
const byId = new Map<string, PrefabData>();
|
|
54
|
+
return {
|
|
55
|
+
byId: byId,
|
|
56
|
+
getPrefab: function(id: string): PrefabData | null {
|
|
57
|
+
const found = byId.get(id);
|
|
58
|
+
return found ? found : null;
|
|
59
|
+
},
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
// Register a prefab in the registry. Overwrites any existing entry with the
|
|
64
|
+
// same id (hot-reload friendly).
|
|
65
|
+
export function registerPrefab(registry: PrefabRegistry, prefab: PrefabData): void {
|
|
66
|
+
registry.byId.set(prefab.id, prefab);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
// Load a single prefab file from disk, validate, migrate, and return it.
|
|
70
|
+
// Throws on parse or validation error.
|
|
71
|
+
export function loadPrefab(path: string): PrefabData {
|
|
72
|
+
const text = readFile(path);
|
|
73
|
+
if (!text || text.length === 0) {
|
|
74
|
+
throw new Error('loadPrefab: file is empty or missing: ' + path);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
let raw: PrefabData;
|
|
78
|
+
try {
|
|
79
|
+
raw = JSON.parse(text) as PrefabData;
|
|
80
|
+
} catch (e) {
|
|
81
|
+
throw new Error('loadPrefab: invalid JSON in ' + path + ': ' + (e as Error).message);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
const migrated = migratePrefabData(raw);
|
|
85
|
+
const check = validatePrefab(migrated);
|
|
86
|
+
if (!check.ok) {
|
|
87
|
+
throw new Error('loadPrefab: ' + path + '\n' + formatValidationErrors(check.errors));
|
|
88
|
+
}
|
|
89
|
+
return migrated;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
// Recursively flatten a prefab into its leaf glb placements.
|
|
93
|
+
//
|
|
94
|
+
// @param registry Registry to look up child prefab references.
|
|
95
|
+
// @param prefabId Id of the prefab to expand.
|
|
96
|
+
// @param parentMatrix World-space matrix to apply to all children.
|
|
97
|
+
// @param parentTint Tint inherited from the placing entity (null if none).
|
|
98
|
+
// @param parentTags Tags to propagate to each leaf.
|
|
99
|
+
// @param out Output array of flattened leaves. Caller supplies.
|
|
100
|
+
// @param errors Output error list (cycles, missing references).
|
|
101
|
+
// @param visited Set of ancestor prefab ids, used for cycle detection.
|
|
102
|
+
// @param pathPrefix Debug path for error messages, e.g. "world_root".
|
|
103
|
+
export function expandPrefab(
|
|
104
|
+
registry: PrefabRegistry,
|
|
105
|
+
prefabId: string,
|
|
106
|
+
parentMatrix: Mat4,
|
|
107
|
+
parentTint: Vec4Lit | null,
|
|
108
|
+
parentTags: ReadonlyArray<string>,
|
|
109
|
+
out: PrefabLeaf[],
|
|
110
|
+
errors: string[],
|
|
111
|
+
visited: Set<string>,
|
|
112
|
+
pathPrefix: string,
|
|
113
|
+
): void {
|
|
114
|
+
if (visited.has(prefabId)) {
|
|
115
|
+
errors.push(
|
|
116
|
+
'prefab cycle detected: ' + pathPrefix + ' -> ' + prefabId +
|
|
117
|
+
' (already in chain)',
|
|
118
|
+
);
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
const prefab = registry.getPrefab(prefabId);
|
|
123
|
+
if (!prefab) {
|
|
124
|
+
errors.push('prefab not found: "' + prefabId + '" (referenced by ' + pathPrefix + ')');
|
|
125
|
+
return;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
visited.add(prefabId);
|
|
129
|
+
|
|
130
|
+
for (let i = 0; i < prefab.children.length; i++) {
|
|
131
|
+
const child = prefab.children[i];
|
|
132
|
+
const childMatrix = mat4Multiply(parentMatrix, trsToMat4(child.transform));
|
|
133
|
+
const childTint = child.tint !== null ? child.tint : parentTint;
|
|
134
|
+
const childTags = mergeTags(parentTags, child.tags);
|
|
135
|
+
const childPath = pathPrefix + '.' + child.id;
|
|
136
|
+
|
|
137
|
+
if (child.modelRef !== null && child.modelRef.length > 0) {
|
|
138
|
+
out.push({
|
|
139
|
+
modelRef: child.modelRef,
|
|
140
|
+
worldMatrix: childMatrix,
|
|
141
|
+
tint: childTint,
|
|
142
|
+
tags: childTags,
|
|
143
|
+
sourcePath: childPath,
|
|
144
|
+
});
|
|
145
|
+
} else if (child.prefabRef !== null && child.prefabRef.length > 0) {
|
|
146
|
+
expandPrefab(
|
|
147
|
+
registry,
|
|
148
|
+
child.prefabRef,
|
|
149
|
+
childMatrix,
|
|
150
|
+
childTint,
|
|
151
|
+
childTags,
|
|
152
|
+
out,
|
|
153
|
+
errors,
|
|
154
|
+
visited,
|
|
155
|
+
childPath,
|
|
156
|
+
);
|
|
157
|
+
} else {
|
|
158
|
+
errors.push('prefab child ' + childPath + ' has neither modelRef nor prefabRef');
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
visited.delete(prefabId);
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
// Build a column-major 4x4 from TRS components. Duplicated here (rather than
|
|
166
|
+
// imported from `./loader.ts`) to keep the dependency graph flat — prefab is
|
|
167
|
+
// used *by* the loader, not the other way around.
|
|
168
|
+
function trsToMat4(t: TransformData): Mat4 {
|
|
169
|
+
const pos: Vec3 = { x: t.position[0], y: t.position[1], z: t.position[2] };
|
|
170
|
+
const scl: Vec3 = { x: t.scale[0], y: t.scale[1], z: t.scale[2] };
|
|
171
|
+
|
|
172
|
+
let m = mat4Identity();
|
|
173
|
+
m = mat4Translate(m, pos);
|
|
174
|
+
m = mat4RotateZ(m, t.rotation[2]);
|
|
175
|
+
m = mat4RotateY(m, t.rotation[1]);
|
|
176
|
+
m = mat4RotateX(m, t.rotation[0]);
|
|
177
|
+
m = mat4Scale(m, scl);
|
|
178
|
+
return m;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
function mergeTags(parent: ReadonlyArray<string>, child: ReadonlyArray<string>): string[] {
|
|
182
|
+
if (parent.length === 0) return [...child];
|
|
183
|
+
if (child.length === 0) return [...parent];
|
|
184
|
+
const seen = new Set<string>();
|
|
185
|
+
const out: string[] = [];
|
|
186
|
+
for (let i = 0; i < parent.length; i++) {
|
|
187
|
+
if (!seen.has(parent[i])) { seen.add(parent[i]); out.push(parent[i]); }
|
|
188
|
+
}
|
|
189
|
+
for (let i = 0; i < child.length; i++) {
|
|
190
|
+
if (!seen.has(child[i])) { seen.add(child[i]); out.push(child[i]); }
|
|
191
|
+
}
|
|
192
|
+
return out;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
// Build an empty prefab with sensible defaults. Editor calls this from
|
|
196
|
+
// "New Prefab".
|
|
197
|
+
export function createEmptyPrefab(id: string, name: string): PrefabData {
|
|
198
|
+
return {
|
|
199
|
+
schemaVersion: 1,
|
|
200
|
+
id: id,
|
|
201
|
+
name: name,
|
|
202
|
+
children: [],
|
|
203
|
+
bounds: { min: [0, 0, 0], max: [0, 0, 0] },
|
|
204
|
+
};
|
|
205
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
// World saver — serializes a `WorldData` to disk as pretty-printed JSON.
|
|
2
|
+
// Called by the editor's File -> Save / Save As commands and by any tooling
|
|
3
|
+
// that programmatically generates worlds.
|
|
4
|
+
//
|
|
5
|
+
// The saver always validates before writing so the editor can't produce
|
|
6
|
+
// corrupt files. On validation failure, returns false and populates the
|
|
7
|
+
// `errors` array; on success, writes the file and returns true.
|
|
8
|
+
|
|
9
|
+
import { writeFile } from '../core/index';
|
|
10
|
+
import { WORLD_SCHEMA_VERSION, WorldData, PrefabData } from './types';
|
|
11
|
+
import { validateWorld, validatePrefab, formatValidationErrors } from './validate';
|
|
12
|
+
|
|
13
|
+
export interface SaveResult {
|
|
14
|
+
ok: boolean;
|
|
15
|
+
errors: string[];
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
// Write a world file. On success, returns `{ ok: true, errors: [] }`.
|
|
19
|
+
// On validation failure, returns the errors without touching the filesystem.
|
|
20
|
+
// On write failure (disk full, permissions), returns `{ ok: false, errors: [...] }`.
|
|
21
|
+
export function saveWorld(path: string, world: WorldData): SaveResult {
|
|
22
|
+
// Always stamp the current schema version on save so stale copies don't
|
|
23
|
+
// drift across editor sessions.
|
|
24
|
+
world.schemaVersion = WORLD_SCHEMA_VERSION;
|
|
25
|
+
|
|
26
|
+
const check = validateWorld(world);
|
|
27
|
+
if (!check.ok) {
|
|
28
|
+
return { ok: false, errors: check.errors };
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const json = JSON.stringify(world, null, 2);
|
|
32
|
+
const ok = writeFile(path, json);
|
|
33
|
+
if (!ok) {
|
|
34
|
+
return { ok: false, errors: ['writeFile failed for path: ' + path] };
|
|
35
|
+
}
|
|
36
|
+
return { ok: true, errors: [] };
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
// Write a prefab file. Same semantics as `saveWorld` but for prefabs.
|
|
40
|
+
export function savePrefab(path: string, prefab: PrefabData): SaveResult {
|
|
41
|
+
prefab.schemaVersion = WORLD_SCHEMA_VERSION;
|
|
42
|
+
|
|
43
|
+
const check = validatePrefab(prefab);
|
|
44
|
+
if (!check.ok) {
|
|
45
|
+
return { ok: false, errors: check.errors };
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
const json = JSON.stringify(prefab, null, 2);
|
|
49
|
+
const ok = writeFile(path, json);
|
|
50
|
+
if (!ok) {
|
|
51
|
+
return { ok: false, errors: ['writeFile failed for path: ' + path] };
|
|
52
|
+
}
|
|
53
|
+
return { ok: true, errors: [] };
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
// Convenience: format a SaveResult's errors as a single human-readable string.
|
|
57
|
+
// The editor uses this for status bar / dialog messages.
|
|
58
|
+
export function formatSaveError(result: SaveResult): string {
|
|
59
|
+
if (result.ok) return '';
|
|
60
|
+
return formatValidationErrors(result.errors);
|
|
61
|
+
}
|
|
@@ -0,0 +1,254 @@
|
|
|
1
|
+
// Terrain helpers for the shared world module.
|
|
2
|
+
//
|
|
3
|
+
// Terrain in a `WorldData` is a uniform grid heightmap: `width * depth` float
|
|
4
|
+
// heights, row-major with `z*width + x`. This file provides the operations
|
|
5
|
+
// that both the editor (to sculpt / display) and games (to render / sample)
|
|
6
|
+
// need:
|
|
7
|
+
//
|
|
8
|
+
// buildHeightmapMesh — grid floats -> flat vertex/index arrays suitable
|
|
9
|
+
// for `updateSceneNodeGeometry`. Vertex layout matches
|
|
10
|
+
// the scene graph's expected 12-float stride:
|
|
11
|
+
// [x, y, z, nx, ny, nz, r, g, b, a, u, v].
|
|
12
|
+
// sampleHeight — bilinear interpolation at arbitrary world-space xz.
|
|
13
|
+
// Used by character controllers and the place tool
|
|
14
|
+
// to drop entities onto the terrain.
|
|
15
|
+
// raycastTerrain — mouse ray -> terrain hit point + cell indices. Used
|
|
16
|
+
// by the brush tool to find where the user is painting.
|
|
17
|
+
// defaultTerrain — a flat 128x128 terrain centered at origin.
|
|
18
|
+
|
|
19
|
+
import { TerrainData, Vec3Lit } from './types';
|
|
20
|
+
|
|
21
|
+
// Vertex stride in floats (matches scene graph expectation).
|
|
22
|
+
// See `bloom/engine/src/scene/index.ts` updateSceneNodeGeometry docs.
|
|
23
|
+
const STRIDE = 12;
|
|
24
|
+
|
|
25
|
+
// Default grid size for new worlds. Large enough for meaningful terrain,
|
|
26
|
+
// small enough to rebuild in <1ms on any modern CPU.
|
|
27
|
+
const DEFAULT_WIDTH = 128;
|
|
28
|
+
const DEFAULT_DEPTH = 128;
|
|
29
|
+
|
|
30
|
+
// Build a flat-shaded triangle mesh from a heightmap. Returns two number
|
|
31
|
+
// arrays that can be passed directly to `updateSceneNodeGeometry`. Computes
|
|
32
|
+
// per-vertex normals from finite differences of the 4 neighbouring heights.
|
|
33
|
+
//
|
|
34
|
+
// Vertex count: width * depth
|
|
35
|
+
// Triangle count: (width - 1) * (depth - 1) * 2
|
|
36
|
+
//
|
|
37
|
+
// For a 128x128 grid that's 16,384 vertices and 32,258 triangles — well
|
|
38
|
+
// within what one scene node can hold.
|
|
39
|
+
export function buildHeightmapMesh(t: TerrainData): { vertices: number[]; indices: number[] } {
|
|
40
|
+
const width = t.width;
|
|
41
|
+
const depth = t.depth;
|
|
42
|
+
const cellSize = t.cellSize;
|
|
43
|
+
const originX = t.origin[0];
|
|
44
|
+
const originY = t.origin[1];
|
|
45
|
+
const originZ = t.origin[2];
|
|
46
|
+
const heights = t.heights;
|
|
47
|
+
|
|
48
|
+
const vertexCount = width * depth;
|
|
49
|
+
const vertices: number[] = new Array<number>(vertexCount * STRIDE);
|
|
50
|
+
const indices: number[] = new Array<number>((width - 1) * (depth - 1) * 6);
|
|
51
|
+
|
|
52
|
+
// Default vertex color (grayscale stone). Editor / game can tint per-layer
|
|
53
|
+
// via the splat weights once that pipeline lands.
|
|
54
|
+
const cr = 0.55;
|
|
55
|
+
const cg = 0.60;
|
|
56
|
+
const cb = 0.50;
|
|
57
|
+
const ca = 1.0;
|
|
58
|
+
|
|
59
|
+
// Vertex pass.
|
|
60
|
+
for (let z = 0; z < depth; z++) {
|
|
61
|
+
for (let x = 0; x < width; x++) {
|
|
62
|
+
const idx = z * width + x;
|
|
63
|
+
const h = heights[idx];
|
|
64
|
+
|
|
65
|
+
// World-space position.
|
|
66
|
+
const wx = originX + x * cellSize;
|
|
67
|
+
const wy = originY + h;
|
|
68
|
+
const wz = originZ + z * cellSize;
|
|
69
|
+
|
|
70
|
+
// Finite-difference normal (central differences, clamped at edges).
|
|
71
|
+
const xm = x > 0 ? heights[z * width + (x - 1)] : h;
|
|
72
|
+
const xp = x < width - 1 ? heights[z * width + (x + 1)] : h;
|
|
73
|
+
const zm = z > 0 ? heights[(z - 1) * width + x] : h;
|
|
74
|
+
const zp = z < depth - 1 ? heights[(z + 1) * width + x] : h;
|
|
75
|
+
|
|
76
|
+
const dx = (xp - xm) / (2 * cellSize);
|
|
77
|
+
const dz = (zp - zm) / (2 * cellSize);
|
|
78
|
+
// Normal of y = f(x, z) is (-df/dx, 1, -df/dz), normalized.
|
|
79
|
+
const nx = -dx;
|
|
80
|
+
const ny = 1.0;
|
|
81
|
+
const nz = -dz;
|
|
82
|
+
const invLen = 1.0 / Math.sqrt(nx * nx + ny * ny + nz * nz);
|
|
83
|
+
|
|
84
|
+
const base = idx * STRIDE;
|
|
85
|
+
vertices[base + 0] = wx;
|
|
86
|
+
vertices[base + 1] = wy;
|
|
87
|
+
vertices[base + 2] = wz;
|
|
88
|
+
vertices[base + 3] = nx * invLen;
|
|
89
|
+
vertices[base + 4] = ny * invLen;
|
|
90
|
+
vertices[base + 5] = nz * invLen;
|
|
91
|
+
vertices[base + 6] = cr;
|
|
92
|
+
vertices[base + 7] = cg;
|
|
93
|
+
vertices[base + 8] = cb;
|
|
94
|
+
vertices[base + 9] = ca;
|
|
95
|
+
vertices[base + 10] = x / (width - 1);
|
|
96
|
+
vertices[base + 11] = z / (depth - 1);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
// Index pass — two triangles per cell, wound counter-clockwise when looking
|
|
101
|
+
// down the -Y axis.
|
|
102
|
+
let idxWrite = 0;
|
|
103
|
+
for (let z = 0; z < depth - 1; z++) {
|
|
104
|
+
for (let x = 0; x < width - 1; x++) {
|
|
105
|
+
const i00 = z * width + x;
|
|
106
|
+
const i10 = i00 + 1;
|
|
107
|
+
const i01 = i00 + width;
|
|
108
|
+
const i11 = i01 + 1;
|
|
109
|
+
|
|
110
|
+
indices[idxWrite++] = i00;
|
|
111
|
+
indices[idxWrite++] = i01;
|
|
112
|
+
indices[idxWrite++] = i11;
|
|
113
|
+
|
|
114
|
+
indices[idxWrite++] = i00;
|
|
115
|
+
indices[idxWrite++] = i11;
|
|
116
|
+
indices[idxWrite++] = i10;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
return { vertices: vertices, indices: indices };
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
// Bilinear sample of the terrain at world-space (wx, wz). Returns the world
|
|
124
|
+
// Y of the surface at that point, including the terrain's origin offset.
|
|
125
|
+
// Points outside the grid clamp to the nearest edge cell.
|
|
126
|
+
//
|
|
127
|
+
// Used by:
|
|
128
|
+
// - character controllers ("what height is the player standing on?")
|
|
129
|
+
// - the place tool (drop an entity onto the terrain surface)
|
|
130
|
+
// - the brush tool (show a cursor ring at the correct height)
|
|
131
|
+
export function sampleHeight(t: TerrainData, wx: number, wz: number): number {
|
|
132
|
+
const fx = (wx - t.origin[0]) / t.cellSize;
|
|
133
|
+
const fz = (wz - t.origin[2]) / t.cellSize;
|
|
134
|
+
|
|
135
|
+
const x0 = clamp(Math.floor(fx), 0, t.width - 1);
|
|
136
|
+
const z0 = clamp(Math.floor(fz), 0, t.depth - 1);
|
|
137
|
+
const x1 = clamp(x0 + 1, 0, t.width - 1);
|
|
138
|
+
const z1 = clamp(z0 + 1, 0, t.depth - 1);
|
|
139
|
+
|
|
140
|
+
const tx = clamp(fx - x0, 0, 1);
|
|
141
|
+
const tz = clamp(fz - z0, 0, 1);
|
|
142
|
+
|
|
143
|
+
const h00 = t.heights[z0 * t.width + x0];
|
|
144
|
+
const h10 = t.heights[z0 * t.width + x1];
|
|
145
|
+
const h01 = t.heights[z1 * t.width + x0];
|
|
146
|
+
const h11 = t.heights[z1 * t.width + x1];
|
|
147
|
+
|
|
148
|
+
const h0 = h00 * (1 - tx) + h10 * tx;
|
|
149
|
+
const h1 = h01 * (1 - tx) + h11 * tx;
|
|
150
|
+
return t.origin[1] + h0 * (1 - tz) + h1 * tz;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
export interface TerrainRaycastHit {
|
|
154
|
+
hit: boolean;
|
|
155
|
+
point: Vec3Lit;
|
|
156
|
+
// Grid cell the hit falls into. -1 when there is no hit.
|
|
157
|
+
cellX: number;
|
|
158
|
+
cellZ: number;
|
|
159
|
+
distance: number;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
// March a ray through the terrain looking for the first intersection with the
|
|
163
|
+
// surface. This is not a closed-form solution — it's a simple iterative
|
|
164
|
+
// marcher that steps along the ray in small increments and samples the height
|
|
165
|
+
// at each step. Good enough for the brush tool, where the player is always
|
|
166
|
+
// looking at the ground from above.
|
|
167
|
+
//
|
|
168
|
+
// @param origin Ray origin in world space.
|
|
169
|
+
// @param dir Ray direction (should be normalized for accurate distances).
|
|
170
|
+
// @param maxDist Maximum distance to march before giving up.
|
|
171
|
+
// @param step Step size. Smaller = more accurate, larger = faster.
|
|
172
|
+
export function raycastTerrain(
|
|
173
|
+
t: TerrainData,
|
|
174
|
+
origin: Vec3Lit,
|
|
175
|
+
dir: Vec3Lit,
|
|
176
|
+
maxDist: number,
|
|
177
|
+
step: number,
|
|
178
|
+
): TerrainRaycastHit {
|
|
179
|
+
// Early-out: ray must be pointing roughly downward (negative Y component)
|
|
180
|
+
// for the heightmap to be visible from above.
|
|
181
|
+
if (dir[1] >= 0) {
|
|
182
|
+
// Still allow it in case origin is below terrain, but clamp iterations.
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
let d = 0;
|
|
186
|
+
let prevAbove = origin[1] > sampleHeight(t, origin[0], origin[2]);
|
|
187
|
+
|
|
188
|
+
while (d < maxDist) {
|
|
189
|
+
const px = origin[0] + dir[0] * d;
|
|
190
|
+
const py = origin[1] + dir[1] * d;
|
|
191
|
+
const pz = origin[2] + dir[2] * d;
|
|
192
|
+
|
|
193
|
+
const h = sampleHeight(t, px, pz);
|
|
194
|
+
const above = py > h;
|
|
195
|
+
|
|
196
|
+
if (above !== prevAbove) {
|
|
197
|
+
// Crossed the surface. Refine with one binary-search step for accuracy.
|
|
198
|
+
let lo = d - step;
|
|
199
|
+
let hi = d;
|
|
200
|
+
for (let i = 0; i < 6; i++) {
|
|
201
|
+
const mid = (lo + hi) * 0.5;
|
|
202
|
+
const mx = origin[0] + dir[0] * mid;
|
|
203
|
+
const my = origin[1] + dir[1] * mid;
|
|
204
|
+
const mz = origin[2] + dir[2] * mid;
|
|
205
|
+
const mh = sampleHeight(t, mx, mz);
|
|
206
|
+
if ((my > mh) === prevAbove) {
|
|
207
|
+
lo = mid;
|
|
208
|
+
} else {
|
|
209
|
+
hi = mid;
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
const finalD = (lo + hi) * 0.5;
|
|
213
|
+
const hitX = origin[0] + dir[0] * finalD;
|
|
214
|
+
const hitY = origin[1] + dir[1] * finalD;
|
|
215
|
+
const hitZ = origin[2] + dir[2] * finalD;
|
|
216
|
+
const cellX = clamp(Math.floor((hitX - t.origin[0]) / t.cellSize), 0, t.width - 1);
|
|
217
|
+
const cellZ = clamp(Math.floor((hitZ - t.origin[2]) / t.cellSize), 0, t.depth - 1);
|
|
218
|
+
return {
|
|
219
|
+
hit: true,
|
|
220
|
+
point: [hitX, hitY, hitZ],
|
|
221
|
+
cellX: cellX,
|
|
222
|
+
cellZ: cellZ,
|
|
223
|
+
distance: finalD,
|
|
224
|
+
};
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
d += step;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
return { hit: false, point: [0, 0, 0], cellX: -1, cellZ: -1, distance: 0 };
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
// Build a flat 128x128 terrain centered at the origin. Used by the editor's
|
|
234
|
+
// "New World" command when the user chooses a terrain-backed template.
|
|
235
|
+
export function defaultTerrain(): TerrainData {
|
|
236
|
+
const width = DEFAULT_WIDTH;
|
|
237
|
+
const depth = DEFAULT_DEPTH;
|
|
238
|
+
const cellSize = 1.0;
|
|
239
|
+
const heights: number[] = new Array<number>(width * depth);
|
|
240
|
+
for (let i = 0; i < heights.length; i++) heights[i] = 0;
|
|
241
|
+
|
|
242
|
+
return {
|
|
243
|
+
width: width,
|
|
244
|
+
depth: depth,
|
|
245
|
+
cellSize: cellSize,
|
|
246
|
+
origin: [-(width * cellSize) / 2, 0, -(depth * cellSize) / 2],
|
|
247
|
+
heights: heights,
|
|
248
|
+
layers: [],
|
|
249
|
+
};
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
function clamp(v: number, lo: number, hi: number): number {
|
|
253
|
+
return v < lo ? lo : (v > hi ? hi : v);
|
|
254
|
+
}
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
// Shared world schema — consumed by the Bloom world editor and by every game
|
|
2
|
+
// that loads `*.world.json` files. All fields are chosen to round-trip cleanly
|
|
3
|
+
// through `JSON.stringify` / `JSON.parse`, so positions, rotations, colors, and
|
|
4
|
+
// matrices are stored as plain number arrays rather than `{x,y,z}` objects.
|
|
5
|
+
// The engine's runtime `Vec3` / `Mat4` / `BoundingBox` types (in `core/types.ts`)
|
|
6
|
+
// use a different shape; the loader in `./loader.ts` does the conversion.
|
|
7
|
+
|
|
8
|
+
export const WORLD_SCHEMA_VERSION = 1;
|
|
9
|
+
|
|
10
|
+
// Literal types for JSON-friendly serialization.
|
|
11
|
+
// Use `Vec3Lit` in serialized data; convert to engine `Vec3` at load time.
|
|
12
|
+
export type Vec3Lit = [number, number, number];
|
|
13
|
+
export type Vec4Lit = [number, number, number, number];
|
|
14
|
+
|
|
15
|
+
// Column-major 4x4 matrix, same convention as `engine/src/core/types.ts` Mat4.
|
|
16
|
+
// Stored as a flat length-16 number array so it serializes as JSON.
|
|
17
|
+
export type Mat4Lit = number[];
|
|
18
|
+
|
|
19
|
+
// Top-level world document. One `*.world.json` file holds exactly one of these.
|
|
20
|
+
export interface WorldData {
|
|
21
|
+
schemaVersion: number; // Must equal WORLD_SCHEMA_VERSION on save.
|
|
22
|
+
name: string; // Human-readable display name.
|
|
23
|
+
id: string; // Stable slug, e.g. "garden_main".
|
|
24
|
+
bounds: Bounds; // Axis-aligned bounding box in world space.
|
|
25
|
+
environment: EnvironmentData;
|
|
26
|
+
terrain: TerrainData | null; // null for games that don't use terrain.
|
|
27
|
+
entities: EntityData[];
|
|
28
|
+
water: WaterVolume[];
|
|
29
|
+
rivers: RiverSpline[];
|
|
30
|
+
metadata: Record<string, string>; // Game-specific extensibility (e.g. "gameId").
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export interface Bounds {
|
|
34
|
+
min: Vec3Lit;
|
|
35
|
+
max: Vec3Lit;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// Sky, lighting, and atmospheric settings applied when the world is loaded.
|
|
39
|
+
export interface EnvironmentData {
|
|
40
|
+
skyColor: Vec3Lit; // 0..1 RGB, used as clear color.
|
|
41
|
+
ambientColor: Vec3Lit; // 0..1 RGB.
|
|
42
|
+
ambientIntensity: number; // 0..1.
|
|
43
|
+
sunDirection: Vec3Lit; // Unit vector pointing from the sun.
|
|
44
|
+
sunColor: Vec3Lit; // 0..1 RGB.
|
|
45
|
+
sunIntensity: number;
|
|
46
|
+
fogStart: number; // World-space distance where fog begins.
|
|
47
|
+
fogEnd: number; // World-space distance of full fog.
|
|
48
|
+
fogColor: Vec3Lit;
|
|
49
|
+
shadowsEnabled: boolean;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
// Heightmap terrain. Row-major grid of float heights, indexed as z*width + x.
|
|
53
|
+
// Runtime consumers build a mesh via `buildHeightmapMesh` in `./terrain.ts`
|
|
54
|
+
// and sample via `sampleHeight` (bilinear).
|
|
55
|
+
export interface TerrainData {
|
|
56
|
+
width: number; // Grid cells along X (e.g. 128).
|
|
57
|
+
depth: number; // Grid cells along Z.
|
|
58
|
+
cellSize: number; // World units per cell, e.g. 1.0.
|
|
59
|
+
origin: Vec3Lit; // World-space position of the (0,0) corner.
|
|
60
|
+
heights: number[]; // Length == width*depth, row-major, z*width + x.
|
|
61
|
+
layers: TerrainLayer[]; // Splat texture layers; empty array if unused.
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export interface TerrainLayer {
|
|
65
|
+
id: string; // "grass", "dirt", "rock".
|
|
66
|
+
textureRef: string; // Relative asset path.
|
|
67
|
+
weights: number[]; // Length == width*depth, 0..1 per cell.
|
|
68
|
+
tileScale: number; // UV tiling factor.
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
// A placed instance in the world. Exactly one of `modelRef` / `prefabRef` is
|
|
72
|
+
// non-null; the other is null. The editor enforces this invariant.
|
|
73
|
+
export interface EntityData {
|
|
74
|
+
id: string; // Stable within the world file, e.g. "ent_0001".
|
|
75
|
+
name: string; // Display name; defaults to model basename.
|
|
76
|
+
modelRef: string | null; // Relative path, e.g. "models/tree_oak.glb".
|
|
77
|
+
prefabRef: string | null; // Prefab id, e.g. "small_house".
|
|
78
|
+
transform: TransformData;
|
|
79
|
+
tint: Vec4Lit | null; // Optional per-instance RGBA color override.
|
|
80
|
+
tags: string[]; // Game-defined, e.g. "climbable", "zone_marker".
|
|
81
|
+
userData: Record<string, string>; // Arbitrary game-specific key/value data.
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
// Transform expressed as TRS with Euler rotation for diffable JSON.
|
|
85
|
+
// The loader converts Euler -> quaternion / matrix as needed.
|
|
86
|
+
export interface TransformData {
|
|
87
|
+
position: Vec3Lit;
|
|
88
|
+
rotation: Vec3Lit; // Euler radians, XYZ order.
|
|
89
|
+
scale: Vec3Lit; // Uniform scale is [s, s, s].
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
// Axis-aligned water volume with a wave-animated surface.
|
|
93
|
+
// M1 supports only `kind: "box"`; future: "mesh" for arbitrary shapes.
|
|
94
|
+
export interface WaterVolume {
|
|
95
|
+
id: string;
|
|
96
|
+
kind: "box";
|
|
97
|
+
center: Vec3Lit;
|
|
98
|
+
size: Vec3Lit; // Full extents (not half-extents).
|
|
99
|
+
surfaceHeight: number; // World Y of the water surface.
|
|
100
|
+
color: Vec4Lit; // RGBA tint.
|
|
101
|
+
waveAmplitude: number;
|
|
102
|
+
waveSpeed: number;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
// Catmull-Rom spline river with per-point width.
|
|
106
|
+
export interface RiverSpline {
|
|
107
|
+
id: string;
|
|
108
|
+
controlPoints: Vec3Lit[]; // At least 2 points.
|
|
109
|
+
widths: number[]; // Same length as controlPoints.
|
|
110
|
+
depth: number; // Below the surface.
|
|
111
|
+
flowSpeed: number;
|
|
112
|
+
color: Vec4Lit;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
// ---- Prefabs ----------------------------------------------------------------
|
|
116
|
+
|
|
117
|
+
// A prefab is a reusable composite object saved as its own `*.prefab.json`.
|
|
118
|
+
// Each child references either a raw .glb model or another prefab (nested).
|
|
119
|
+
// Cycles are detected at load time and rejected.
|
|
120
|
+
export interface PrefabData {
|
|
121
|
+
schemaVersion: number; // Must equal WORLD_SCHEMA_VERSION.
|
|
122
|
+
id: string; // Stable slug, e.g. "small_house".
|
|
123
|
+
name: string; // Display name.
|
|
124
|
+
children: PrefabChild[];
|
|
125
|
+
bounds: Bounds; // Cached AABB of the expanded prefab for previews.
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
// One child of a prefab. Exactly one of `modelRef` / `prefabRef` is non-null.
|
|
129
|
+
export interface PrefabChild {
|
|
130
|
+
id: string; // Local id within the prefab, e.g. "wall_0".
|
|
131
|
+
modelRef: string | null;
|
|
132
|
+
prefabRef: string | null; // Reference to another prefab (nested).
|
|
133
|
+
transform: TransformData;
|
|
134
|
+
tint: Vec4Lit | null;
|
|
135
|
+
tags: string[];
|
|
136
|
+
}
|