Conversation
Define Kernel/Core/Standard/Application tiers with classification rules, fixed-update pipeline phases, export map, and full character-controller module spec. Update architecture, package, and physics docs to reference the new source of truth. Co-authored-by: rAI <raisaroj360@gmail.com>
Replace tiered module spec with a single boundary rule: the package provides run/draw/simulate/input. Character controllers, animation, and scene management are developer or example concerns, not engine work. Co-authored-by: rAI <raisaroj360@gmail.com>
createPhysicsForEntity() bakes collider.offset into the body's initial translation, but syncToEntities() wrote the body position straight back to entity.transform without subtracting it — any entity with a non-zero offset would jump by that offset on the first physics sync. PhysicsWorld now stores the offset per entity and getTransformForEntity() subtracts it back out. PhysicsBridge.syncToEntities() uses that entity-aware lookup instead of the raw handle-based getTransform(). Co-authored-by: rAI <raisaroj360@gmail.com>
DEFAULT and PLAYER were both 1 << 0 — composing DEFAULT into a mask silently also matched PLAYER and vice versa. Re-numbered so each preset owns a unique bit, and added a test that locks this invariant in going forward. Co-authored-by: rAI <raisaroj360@gmail.com>
…ner no-op Traced the branches: Rapier only queues events for a collider whose resolved emitEvents is true in the first place, so by the time shouldEmitAsSelf's first guard passes, every remaining branch already evaluates to true (sensor, or a solid with emitEvents explicitly set — the only way a solid's resolved emitEvents becomes true). The function reduces to returning collision.emitEvents; collisionListener currently has no effect on the outcome, which is documented as a tracked Core API cleanup rather than silently changed here. Added collisionDefaults.test.ts covering resolveCollision defaults and shouldEmitAsSelf, since neither had direct unit tests before. Co-authored-by: rAI <raisaroj360@gmail.com>
…e API The example called world.attachPhysics() and world.syncFromPhysics(), neither of which exist — physics is constructor-injected into World, and sync happens internally inside World.fixedUpdate(). It also nested collider inside rigidBody, which contradicts the actual sibling-component schema. Replaced with a runnable example matching PlayerControllerSystem and DemoScene in examples/demo. Co-authored-by: rAI <raisaroj360@gmail.com>
- Replace PlayerTag/CoinTag/CameraTargetTag/CollisionListenerTag with Entity.tags: Set<string> - CameraFollowSystem takes followTag string (game-defined) - Remove DemoAtlas, CollisionGroups presets, ColliderHandle, coord helpers, and GpuTexture from public exports - Reconcile index.ts as the single API contract; export hasPhysics, isSimulatedBody, TransformData, shape component types Co-authored-by: rAI <raisaroj360@gmail.com>
…ate demo - Remove public Engine.device; asset helpers use getGpuDevice() internally - Add uploadRgbaTexture(engine, pixels, w, h) for procedural textures - Demo owns DemoTags, DemoAtlas, DemoCollisionGroups in demoConstants.ts - Update docs (MODULES, ARCHITECTURE, PACKAGE) for Phase 2 completion Co-authored-by: rAI <raisaroj360@gmail.com>
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
Summary
Phase 2 of the engine cleanup: seal the public API so
teengineexports only engine primitives. Demo-specific concepts move toexamples/demo.Changes
Entity model
PlayerTag,CoinTag,CameraTargetTag,CollisionListenerTagfrom coretags: Set<string>onEntity/SpawnConfigCameraFollowSystemnow takes(camera, followTag)— tag is game-definedPublic API trimmed (
index.tsis the only contract)Removed from exports:
DemoAtlas,GpuTexture,CollisionGroupspresetsColliderHandle, coordinate helpers (engineToRapier, etc.)Added to exports:
hasPhysics,isSimulatedBody,TransformData, shape component typesuploadRgbaTexture(engine, pixels, w, h)Asset loading
Engine.devicegetterloadAtlasFromJson(engine, url)— engine passed instead of rawGPUDeviceuploadRgbaTexturefor procedural/custom textures (demo uses this)Demo migration
New
examples/demo/src/demoConstants.ts:DemoTags— player, coin, cameraTargetDemoAtlas— demo atlas shapeDemoCollisionGroups— PLAYER, PICKUP, GROUND, ENEMY bitsAll demo systems updated to use tags and demo-owned collision constants.
Docs
MODULES.md,ARCHITECTURE.md,PACKAGE.mdupdated — Phase 2 items marked doneVerification
npm run typecheck(engine + demo) — cleannpm run test -w teengine— 37/37 passingnpm run build -w teengine— cleanBreaking changes (intentional)
Consumers upgrading must:
tags: ["player"]etc.EnginetoloadAtlasFromJsoninstead ofGPUDevicefollowTagtoCameraFollowSystem