Skip to content

rust: Port the scene group transform in obs-scene.c to obs-scene #1719

Closed

Description

@nathan-v

Unit

transform_val, get_ungrouped_transform, and apply_group_transform in libobs/obs-scene.c.h, to obs-scene.

Phase and position

Phase 6, tracked by #444. After scene coordinates (#1645) and bounds placement (#1637). Those ports left this math in the scene. It folds a group's draw transform into a child's position, scale, and rotation.

Dependencies and existing tests

Depends on matrix4_mul, vec3_transform, and vec4_len, already in libobs. Absolute versus relative conversion stays in the scene, because it reads the canvas. apply_group_transform still inverts the group's draw transform and still calls update_item_transform. No cmocka test covers this math. The characterization lands first: move the matrix math into its own C file and pin the current behavior. No Rust in that PR.

transform_val is also what resize_group uses to measure a group's position. It moves with this unit.

Notes

No SIMD in this file. The graphics calls it makes are the existing ones. A zero scale becomes negative zero, because a scale that is not greater than zero keeps a minus sign and the length of a zero column is positive zero. A rotation in the matrix moves the position and does not change the scale. The child's rotation changes only by the group's rotation, added when leaving a group and subtracted when joining one. No intentional differences in the characterization. The Rust port follows in a later PR.

Activity

  1. nathan-v commented on Oct 22, 2026

    @nathan-v
    ContributorAuthor

    Claiming: the scene group transform (transform_val, get_ungrouped_transform, apply_group_transform)

    1. Characterization PR, opening today: move the matrix math into libobs/obs-scene-group-transform.c.h and pin it with test_scene_group_transform. The scene still reads the item, still converts absolute versus relative coordinates, still inverts the draw transform when an item joins a group, and still calls update_item_transform. No Rust.
    2. The Rust port into obs-scene, after that PR merges.
  2. added
    claimed
    on Oct 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    claimed

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions