Draw a type-appropriate wireframe gizmo for every UsdLux light in the stage,
mirroring the existing camera-wireframe overlay (dedicated VAO/VBO reusing the
bbox shader, drawn on top with depth-test off).
Shapes, built in the light's local space and pushed through its local-to-world
transform:
- SphereLight 3 orthogonal circles (radius); axis-cross when treatAsPoint
- RectLight width x height rectangle + emission direction line
- DiskLight circle + direction line
- CylinderLight two end-cap circles + connectors (radius/length)
- DistantLight sun disc + parallel rays
- DomeLight 3 large display-scaled circles
Selected lights draw accent orange, others warm yellow.
Verified by creating a SphereLight (3-circle sphere) and a RectLight
(rectangle) in-app: distinct shapes, correct selected/deselected colours,
gizmos visible over geometry.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Two issues caused the camera orientation to flip when tumbling a custom
USD camera:
1. Write-back decomposed the camera matrix to XYZ-euler via
Decompose(X,Y,Z) and re-authored it as a rotateXYZ op. That round-trip
is lossy — the angles Decompose returns do not reconstruct the same
matrix as a rotateXYZ op, so the orientation read back from the prim
differed from the free-camera view shown during the drag. The view
jumped every time a drag finished and snapped back on the next drag.
Now author the full camera-to-world transform as a single matrix op,
which round-trips exactly through UsdGeomCamera::GetCamera().
2. Orbit init relied on PullFromCameraTransform's Euler decomposition for
theta/phi, which is gimbal-affected. Added
ViewportCamera::InitOrbitFromEyeAndCenter to derive theta/phi directly
from the eye->center vector (zero roll), respecting the Z-up matrix.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
When switching to a USD camera, the orbit pivot was set from
GfCamera::GetFocusDistance() which is a depth-of-field attribute
that defaults to 5 scene units regardless of scene scale.
InitCameraNavigation() now computes the scene bounding box centroid,
projects it onto the camera view ray to get a proper orbit distance,
and calls SetFocalPoint/SetDist to place the pivot correctly.
Added SetDist() setter on ViewportCamera to support this.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Rotate manipulator — correct axis bug:
- Object-space delta axis was set to initRot.GetRow3(axis) (a parent-space
vector) then applied in the prim's local frame via deltaM * initRot.
These frames are mismatched: the axis must be the canonical e_a so that
Rot(e_a) fixes e_a and the prim rotates purely about its own axis.
Fixed to use the canonical axis for both spaces; only composition order
differs (deltaM * initRot for object, initRot * deltaM for world).
Gizmo pivot placement:
- ComputeGizmoPivot() used the bounding-box centre (geometry centroid),
placing the gizmo at the wrong location for any non-centred prim.
Replaced with parentToWorld.Transform(translate + pivot) from
XformCommonAPI::GetXformVectors — the authored pivot point in world space.
Fallback for incompatible op stacks uses worldMatrix.ExtractTranslation().
Property panel:
- Show pivot (X/Y/Z) as read-only row below Scale, populated from
XformCommonAPI::GetXformVectors each frame.
- Removed active-rotate-axis display (was added and then removed per request).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>