Skip to content

[compat-sync] More physics support#335

Merged
ryantrem merged 5 commits into
masterfrom
compat-sync/2026-06-29-55496
Jul 7, 2026
Merged

[compat-sync] More physics support#335
ryantrem merged 5 commits into
masterfrom
compat-sync/2026-06-29-55496

Conversation

@ryantrem

Copy link
Copy Markdown
Member

Automated sync of @babylonjs/lite-compat against the latest Babylon.js and Babylon Lite changes,
produced by the update-compat-layer skill.

Addresses #332.

Synced against BJS commit: e997d5b66675ec8f8dc212a002aa40fe0d4ec646

Validation (run independently by the pipeline)

  • ✅ compat unit tests
  • ✅ compat typecheck

Changed files

  • ackages/babylon-lite-compat/COMPAT-STATUS.md
  • packages/babylon-lite-compat/README.md
  • packages/babylon-lite-compat/src/index.ts
  • packages/babylon-lite-compat/src/scene/scene.ts
  • packages/babylon-lite-compat/src/unsupported/unsupported-extended.ts
  • packages/babylon-lite-compat/tests/unsupported-extended.test.ts
  • packages/babylon-lite-compat/src/physics/
  • packages/babylon-lite-compat/tests/physics.test.ts

Validation passed. Please review the wrapper changes and the updated COMPAT-STATUS.md before merging.

Opened as a draft by the compat-sync pipeline. Review and mark ready when satisfied.

@ryantrem ryantrem added automation compat Missing or broken feature in the compatibility layer (@babylonjs/lite-compat) labels Jun 29, 2026
@bjsplat

bjsplat commented Jun 29, 2026

Copy link
Copy Markdown

Lab - Static Site

Open deployed site

Build 20260629.6 - merge @ c1b0987

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR syncs the @babylonjs/lite-compat layer against a newer Babylon.js commit and, in response to issue #332, introduces a real HavokPlugin / PhysicsEngine compat wrapper over Babylon Lite’s existing Havok V2 APIs so Babylon.js-style physics wiring can work through scene.enablePhysics().

Changes:

  • Add a HavokPlugin + PhysicsEngine compat surface (and matching enum exports) backed by Lite’s createHavokWorld / setPhysicsTimestep APIs.
  • Wire Babylon.js-style physics lifecycle methods onto compat Scene (enablePhysics, getPhysicsEngine, isPhysicsEnabled, disablePhysicsEngine).
  • Update docs/status and tests to reflect physics being partially supported (and remove HavokPlugin from the “unsupported” stubs list).

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
packages/babylon-lite-compat/src/physics/physics.ts New Havok V2 plugin/engine/enums compat wrapper over Babylon Lite physics factories.
packages/babylon-lite-compat/src/scene/scene.ts Adds Babylon.js-like physics enable/query/disable hooks on compat Scene.
packages/babylon-lite-compat/src/index.ts Re-exports the new physics compat surface from the package entrypoint.
packages/babylon-lite-compat/src/unsupported/unsupported-extended.ts Removes HavokPlugin from unsupported stubs; clarifies what remains unsupported.
packages/babylon-lite-compat/tests/physics.test.ts Adds unit tests for the plugin/engine surface and enum values.
packages/babylon-lite-compat/tests/unsupported-extended.test.ts Stops asserting HavokPlugin is an unsupported throwing stub.
packages/babylon-lite-compat/README.md Updates support matrix to reflect partial physics compat support.
packages/babylon-lite-compat/COMPAT-STATUS.md Updates sync SHA/date and documents the new physics compat status.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/babylon-lite-compat/src/physics/physics.ts Outdated
Comment thread packages/babylon-lite-compat/src/physics/physics.ts
Comment thread packages/babylon-lite-compat/src/physics/physics.ts
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@bjsplat

bjsplat commented Jun 29, 2026

Copy link
Copy Markdown

Lab - Static Site

Open deployed site

Build 20260629.12 - merge @ 8d28ce4

@ryantrem ryantrem changed the title [compat-sync] Babylon.js compat-layer sync [compat-sync] More physics support Jun 29, 2026
ryantrem and others added 3 commits June 30, 2026 09:28
…-29-55496

Incorporates the PR #349 physics delta-time fixes now in master: Lite steps a
world by the live per-frame delta natively when no fixed step is set. As a
result the branch's compat physics wrapper can be much thinner:
- Drop the branch's redundant _timestepProvider / setPhysicsTimestepProvider
  from Lite core and the dead provider block in _stepWorld. This makes
  packages/babylon-lite identical to master again (the branch's only core
  change was the now-removed provider).
- Slim the compat HavokPlugin to defer to Lite's native frame-delta stepping
  (remove _computeTimestep); only pin a fixed step when useDeltaForWorldStep
  is false.
- Fix Scene.enablePhysics headless guard to read this._engine._headless
  (the NullEngine flag lives on the engine after master's NullEngine work).
- Resolve COMPAT-STATUS/README doc conflicts.

Bundle manifests are unchanged from master: the compat layer does not affect
lab scene bundles, and babylon-lite core now matches master, so no manifest
regeneration is warranted.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@ryantrem ryantrem marked this pull request as ready for review July 6, 2026 20:32
@ryantrem ryantrem requested a review from CedricGuillemet July 6, 2026 20:33
@ryantrem ryantrem enabled auto-merge (squash) July 6, 2026 20:33
@bjsplat

bjsplat commented Jul 6, 2026

Copy link
Copy Markdown

Lab - Static Site

Open deployed site

Build 20260706.19 - merge @ eabc5d4

@ryantrem ryantrem merged commit da22b90 into master Jul 7, 2026
11 checks passed
@ryantrem ryantrem deleted the compat-sync/2026-06-29-55496 branch July 7, 2026 08:20
VicenteCartas pushed a commit to VicenteCartas/Babylon-Lite that referenced this pull request Jul 7, 2026
…eam/master

Merge with upstream/master (BabylonJS#370 hardened bundle-size measurement + loadGltf union/morph WGSL fix; BabylonJS#335 physics). Regenerate my picking scenes with the new measurement: 94/114/115/118/126 shifted, all pass. 114/115 conflicts resolved to master then rebuilt. Full bundle-size gate: 209/209.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

automation compat Missing or broken feature in the compatibility layer (@babylonjs/lite-compat)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants