Skip to content

rust: Port libobs/graphics/plane.c to obs-graphics #335

Closed

Description

@nathan-v

Unit

libobs/graphics/plane.c to obs-graphics.

Phase and position

Phase 5 graphics math, the next file after matrix4.c and before bounds.c and math-extra.c. Tracking issue #45 (the checklist there is stale and still shows quat, matrix3, and matrix4 as open).

Dependencies and existing tests

Depends on vec3, matrix3, and matrix4, all merged. No cmocka characterization test exists; it lands as the first commit. Header-inline helpers in plane.h (plane_copy, plane_set, plane_setf, plane_close, plane_coplanar) stay C.

Notes

plane.c calls the header-inline SSE vec3_cross and vec3_norm. Parity should be bit-exact, including the w lane. plane_intersection_line leaves *t unchanged when it returns false. plane_intersection_ray writes *t = 0 on a parallel miss (fabs(c) < 1e-4). plane_transform runs the normal through vec3_transform, so a direction is transformed as a point. No intentional differences expected.

Activity

  1. nathan-v commented on Oct 12, 2026

    @nathan-v
    ContributorAuthor

    Claiming: libobs/graphics/plane.c

    1. Characterization: cmocka test_plane for the seven exports. Pins the point-transform of a normal, a parallel ray miss that writes *t = 0, and a line miss that leaves *t unchanged.
    2. RED: Tier 1 port of that test against an empty plane (zero dir, dist 0, false, t 0).
    3. GREEN: safe core, C shims, layout test, proptest parity, and ENABLE_RUST_LIBOBS drops graphics/plane.c.

    First PR today. I cannot add the claimed label; please add it.

  2. added 3 commits that reference this issue on Oct 12, 2026
    dc7573f
    a72cb37
    e21514a
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

    No labels
    No labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions