Skip to content

Add BoneAttachment3D node and runtime follow pass - #8

Closed
TiernanDeFranco wants to merge 1 commit into
mainfrom
codex/add-boneattachment3d-support-in-perro-engine
Closed

TiernanDeFranco wants to merge 1 commit into
mainfrom
codex/add-boneattachment3d-support-in-perro-engine

Conversation

@TiernanDeFranco

Copy link
Copy Markdown
Collaborator

Motivation

  • Add a lightweight Node3D-derived attachment node that follows a specific bone on a Skeleton3D so child nodes can inherit final solved bone transforms without mutating skeleton pose.

Description

  • Add BoneAttachment3D node type with fields and APIs: base: Node3D, skeleton: Option<NodeID>, bone_index: BoneIndex, enabled: bool, plus setters/getters and Default in perro_nodes (node_3d/bone_attachment_3d.rs).
  • Register and export BoneAttachment3D in the 3D node module and node registry so it participates as a Node3D descendant (node_3d/mod.rs, node_registry.rs).
  • Extend scene field model and scene loader to parse/apply skeleton, bone_index (alias bone), and enabled for BoneAttachment3D (perro_scene::node_fields.rs, scene loader prepare code).
  • Add runtime pass update_bone_attachments that collects enabled attachments, validates skeleton target/type and bone index bounds, copies final bone transform (read-only) into the attachment Node3D transform, marks global transform dirty, and leaves TODO for local offsets; wire the pass to run after internal updates (runtime/internal_updates.rs, runtime.rs).
  • Add unit tests covering creation/setters, binding to Skeleton3D, invalid index and disabled safety, and runtime pass transform update (perro_runtime tests).

Testing

  • Ran cargo fmt which completed successfully.
  • Ran cargo test -p perro_runtime bone_attachment_3d -- --nocapture but the test run was blocked during build by a missing system dependency (alsa.pc) from alsa-sys, so unit tests could not be fully executed in this environment; compilation progressed to dependent crates before failing on the system pkg-config error.
  • The new unit tests were added and compile-time issues observed earlier (missing import) were fixed in this rollout prior to the system-level failure.

Codex Task

@TiernanDeFranco
TiernanDeFranco deleted the codex/add-boneattachment3d-support-in-perro-engine branch May 9, 2026 00:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant