-
Notifications
You must be signed in to change notification settings - Fork 0
Add ECS architecture and plugin system with source capture plugins #4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
kalwalt
merged 63 commits into
dev-arjs-next
from
copilot/add-ecs-architecture-and-plugins
Nov 4, 2025
Merged
Add ECS architecture and plugin system with source capture plugins #4
kalwalt
merged 63 commits into
dev-arjs-next
from
copilot/add-ecs-architecture-and-plugins
Nov 4, 2025
+21,754
−2,146
Conversation
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
Co-authored-by: kalwalt <[email protected]>
Co-authored-by: kalwalt <[email protected]>
Co-authored-by: kalwalt <[email protected]>
Co-authored-by: kalwalt <[email protected]>
Co-authored-by: kalwalt <[email protected]>
Copilot
AI
changed the title
[WIP] Introduce modular data-oriented core to AR.js-core using ECS
Add ECS architecture and plugin system with source capture plugins
Oct 30, 2025
Copilot finished work on behalf of
kalwalt
October 30, 2025 14:12
kalwalt
requested changes
Oct 30, 2025
Co-authored-by: kalwalt <[email protected]>
Copilot finished work on behalf of
kalwalt
October 30, 2025 16:13
kalwalt
requested changes
Oct 30, 2025
Co-authored-by: kalwalt <[email protected]>
Copilot finished work on behalf of
kalwalt
October 30, 2025 16:22
…replace-static-device-profiles
Co-authored-by: kalwalt <[email protected]>
…ard compatibility; refactor default policy plugin and enhance test coverage
Co-authored-by: kalwalt <[email protected]>
…replace-static-device-profiles
….gitattributes for line endings
…replace-static-device-profiles
…ofiles Replace static device profiles with runtime capability-based profiling
…d engine version assertion
…ement Co-authored-by: kalwalt <[email protected]>
Co-authored-by: kalwalt <[email protected]>
Co-authored-by: kalwalt <[email protected]>
Co-authored-by: kalwalt <[email protected]>
Co-authored-by: kalwalt <[email protected]>
* feat(example): add AR.js Core ECS + ArtoolkitPlugin example with HTML and JS files * feat(frame-pump): implement FramePumpSystem for efficient video frame handling * feat(readme): add detailed documentation for AR.js Core ECS + ArtoolkitPlugin example * feat(example): enhance UI and functionality with webcam controls and improved layout * feat(example): enhance UI and functionality with webcam controls and layout * feat(example vite): add video viewport and attach video element for improved display * feat(frame-pump): improve frame handling and cleanup logic for video elements * feat(example): refactor HTML structure and improve styling for video viewport * feat(example): update README with improved instructions for webcam and frame pump integration * feat(example): add troubleshooting section to README for improved integration guidance
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.
ECS Architecture and Plugin System Implementation — COMPLETE ✅
Summary
This PR implements a modular, data‑oriented ECS (Entity‑Component‑System) core with a plugin system for AR.js Core and keeps backward compatibility. It now also integrates a working ArtoolkitPlugin example with UI controls, a frame pump to stream ImageBitmaps to the worker, a visible video viewport, and new docs/troubleshooting.
Highlights
engine:updatefor reliable detectionar:markerFound/ar:markerUpdated/ar:markerLostglobalThisguardsWhat Was Delivered
Core ECS Infrastructure ✅
src/core/ecs.js— Minimal ECS with entities, components, resources, and queriessrc/core/event-bus.js— Lightweight pub/subsrc/core/plugin-manager.js— Plugin registration + lifecyclesrc/core/engine.js— Orchestrates ECS, events, plugins, loopsrc/core/components.js— Standard component/resource/event keysSystems ✅
src/systems/capture-system.js— Unified capture interface and lifecyclesrc/systems/frame-pump-system.js— Emitsengine:updatewithImageBitmapframesHTMLVideoElement.requestVideoFrameCallbackrequestAnimationFrameglobalThis.createImageBitmap(video)fast path; canvas fallbackvideo.cancelVideoFrameCallback(id)orglobalThis.cancelAnimationFramePlugins ✅
plugins/source/webcam.js— getUserMedia capture (+ torch)plugins/source/video.js— Video file/URL playbackplugins/source/image.js— Static image sourceplugins/profile/default-policy.js— Device profile/policyExample Applications ✅
examples/minimal/— Base demo (status, FPS, error handling)examples/vite-artoolkit/— AR.js Core ECS + ArtoolkitPlugin example<video id="arjs-video">to a visible viewportar:workerReady,ar:getMarker, and marker eventsDocumentation ✅
examples/vite-artoolkit/README.md— How to run, buttons, viewport, troubleshootingREADME.mddocs/ECS_ARCHITECTURE.md— Architecture guidedocs/IMPLEMENTATION_SUMMARY.md— Implementation summaryplugins/README.md— Plugin development guideBuild & Configuration ✅
.gitignorearjs-core.js(library nameARJSCore)Why This Matters
How to Run the Artoolkit Example
/examplesand vendor assets resolve):python3 -m http.server 8080npx http-server -p 8080ar:getMarkerlogs and markerFound/Updated/Lost eventsNotes
assets/folder (worker + ARToolKit chunks), or import from CDN:Troubleshooting (quick)
assets/folder are colocated or use the CDN importcamera_para.dat/patt.hiromust return 200engine:updatewithImageBitmap)<video id="arjs-video">to a visible container and override offscreen stylesglobalThisand cancel rVFC viavideo.cancelVideoFrameCallback(id)Backward Compatibility
Original prompt
This pull request was created as a result of the following prompt from Copilot chat.
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.