Skip to content

[compat-sync] More physics support#335

Draft
ryantrem wants to merge 2 commits into
masterfrom
compat-sync/2026-06-29-55496
Draft

[compat-sync] More physics support#335
ryantrem wants to merge 2 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
Comment on lines +158 to +164
/** Release the native physics world. */
public dispose(): void {
if (this.world) {
disposePhysics(this.world);
this.world = null;
}
}
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
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.

3 participants