feat: billboard target entity#948
Merged
Merged
Conversation
Implement PBBillboard.target_entity (protocol#436): a billboard can face a target scene entity instead of the camera. Unset, or the camera reserved entity (2), faces the camera as before; a missing or deleted target disables reorientation until it exists again. Drive-by fix a one-frame lag when facing the camera: the system runs after CameraUpdate but before transform propagation, so read the camera's live local Transform instead of its stale GlobalTransform (the camera is a root entity). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
Implements
PBBillboard.target_entity(protocol#436). A billboard can now reorient to face a target scene entity instead of the camera.Closes #946.
Behavior
target_entity→ faces the main camera (unchanged).target_entity= camera reserved entity (2) → normalized to unset; faces the camera.target_entity= another entity → faces that entity, resolved per-scene viaRendererSceneContext::bevy_entity.All three modes (
BM_ALL,BM_Y,BM_YX) face the resolved target uniformly. ForBM_ALLthe roll now follows the target's Z roll (previously the camera's), matching the reference client and sdk7-test-scenes#73 station D.Drive-by
Fixes a one-frame lag when facing the camera.
update_billboardsruns afterCameraUpdatebut before transform propagation, so the camera'sGlobalTransformwas a frame stale. Since the camera is a root entity, we now read its live localTransform.Related: js-sdk-toolchain#1438, #1445, sdk7-test-scenes#73.