Where you used `ref` and where not seems ok as far as I can tell. However, usually you start with the non-ref version and then only if either performance is bad (copies) or else the logic requires shared mutable state to work properly things are changed to `ref`.
`result.headPose = state.riderHead.pose` is very bad code that will be flagged as wrong in upcoming versions, you really should use `result = PlayerPose(headPose: ..., ...)` instead.