[compat-sync] More physics support#335
Draft
ryantrem wants to merge 2 commits into
Draft
Conversation
Lab - Static SiteBuild 20260629.6 - merge @ c1b0987 |
Contributor
There was a problem hiding this comment.
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+PhysicsEnginecompat surface (and matching enum exports) backed by Lite’screateHavokWorld/setPhysicsTimestepAPIs. - 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
HavokPluginfrom 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 on lines
+158
to
+164
| /** Release the native physics world. */ | ||
| public dispose(): void { | ||
| if (this.world) { | ||
| disposePhysics(this.world); | ||
| this.world = null; | ||
| } | ||
| } |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Lab - Static SiteBuild 20260629.12 - merge @ 8d28ce4 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Automated sync of
@babylonjs/lite-compatagainst the latest Babylon.js and Babylon Lite changes,produced by the
update-compat-layerskill.Addresses #332.
Synced against BJS commit:
e997d5b66675ec8f8dc212a002aa40fe0d4ec646Validation (run independently by the pipeline)
Changed files
ackages/babylon-lite-compat/COMPAT-STATUS.mdpackages/babylon-lite-compat/README.mdpackages/babylon-lite-compat/src/index.tspackages/babylon-lite-compat/src/scene/scene.tspackages/babylon-lite-compat/src/unsupported/unsupported-extended.tspackages/babylon-lite-compat/tests/unsupported-extended.test.tspackages/babylon-lite-compat/src/physics/packages/babylon-lite-compat/tests/physics.test.ts