Skip to content

Improve clientside transform logic#189

Open
CrosRoad95 wants to merge 3 commits intoMafiaHub:developfrom
CrosRoad95:feature/update-transform-improvments
Open

Improve clientside transform logic#189
CrosRoad95 wants to merge 3 commits intoMafiaHub:developfrom
CrosRoad95:feature/update-transform-improvments

Conversation

@CrosRoad95
Copy link
Copy Markdown
Contributor

@CrosRoad95 CrosRoad95 commented Mar 28, 2026

This pr makes logic related to updating transform of entities more robust. getting rid of unnecessary callback, replaces potentially crashing code with simple method that make sure updating transform never crash, removed unnecessary method to update transform.

Now if you want to listen for transform changes create flecs system that listen for "Transform" being changed.

Summary by CodeRabbit

  • Refactor
    • Streamlined how remote transform and frame updates are applied, consolidating handling paths for more consistent processing.
  • Breaking Changes
    • Removed a legacy local update callback and a now-unused public update API, reducing surface area for transform update hooks.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 28, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 06c136d9-8203-40e1-ab79-762ca0f1774e

📥 Commits

Reviewing files that changed from the base of the PR and between 9ad8f61 and e479df7.

📒 Files selected for processing (3)
  • code/framework/src/world/client.cpp
  • code/framework/src/world/client.h
  • code/framework/src/world/modules/base.hpp
💤 Files with no reviewable changes (2)
  • code/framework/src/world/client.h
  • code/framework/src/world/modules/base.hpp
🚧 Files skipped from review as they are similar to previous changes (1)
  • code/framework/src/world/client.cpp

Walkthrough

RPC handlers for SetTransform and SetFrame were changed to always resolve the target entity and apply received state directly; the ClientEngine::UpdateEntityTransform API and the Streamable::Events::updateTransformProc callback type/field were removed.

Changes

Cohort / File(s) Summary
Client RPC & API
code/framework/src/world/client.cpp, code/framework/src/world/client.h
Removed ClientEngine::UpdateEntityTransform declaration/implementation. RPC handlers now resolve entities via GetEntityByServerID(...) and apply state with e.set(...) instead of early-returning or mutating components directly.
Streamable events
code/framework/src/world/modules/base.hpp
Removed Streamable::OnUpdateTransformProc type alias and Streamable::Events::updateTransformProc field, eliminating the local transform-update callback slot.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 I hopped through code both bright and spry,
Resolved each server ID, no more "why?"
A proc unpacked, now gone from view,
I set the state and watched it true. 🥕

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Improve clientside transform logic' accurately summarizes the main objective of the pull request, which refactors client-side transform update logic, removes unnecessary callbacks, and simplifies the transform update method.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

…ransform-improvments

# Conflicts:
#	code/framework/src/world/client.cpp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant