Skip to main content
←API Reference ←com.nianticspatial.nsdk.playback

PlaybackCamera


Declaration​

class PlaybackCamera

Summary​

Camera representation for playback, built from frame [metadata]. Exposes transform, intrinsics, resolution, tracking state, and orientation. Use [toArCorePose] to build a [Pose] for [FrameData.cameraPose]. Use [getViewMatrix] and [getProjectionMatrix] to drive a virtual camera for playback rendering.


Properties​

NameTypeSummary
imageResolutionPair<Int, Int>
Image resolution (width, height) in pixels.
intrinsicsCameraIntrinsics
Camera intrinsics (focal length, principal point, dimensions).
orientationOrientation
Screen orientation from metadata.
trackingStateTrackingState
ARCore tracking state for this frame.
transformFloatArray
Camera-to-world 4×4 transform (column-major) as FloatArray of 16 elements.

Functions​

NameTypeSummary
displayOrientedTransformFloatArray
Display-oriented camera-to-world transform with Z rotation applied for the given orientation.
Sensor frame is landscape-right; portrait adds π/2, portrait-upside-down adds -π/2, landscape-left adds π.
Use for rendering so the camera matches on-screen orientation.
getDisplayOrientedPosePose
Display-oriented camera pose (Z rotation applied for the given orientation).
Use for VPS2 and UI that need heading aligned with the display.
getProjectionMatrixFloatArray
OpenGL-style projection matrix (column-major) from intrinsics for the given viewport and near/far.
Use with [getViewMatrix] to render 3D content aligned with the playback camera.
The frustum is cropped to the viewport's aspect ratio the same way
[com.nianticspatial.nsdk.utils.ImageMath.displayTransform] crops the camera image, so 3D content
lines up with the displayed image. Passing the image resolution as the viewport gives the
uncropped projection.
getViewMatrixFloatArray
World-to-camera view matrix (column-major) for the given display orientation.
Inverse of [displayOrientedTransform]. Pass to OpenGL/GLES as the view matrix.
orientationForRenderingOrientation
Converts device display orientation (Android UI convention: ROTATION_90 → LANDSCAPE_LEFT)
to the internal sensor convention. Used by [getDisplayOrientedPose], [getViewMatrix], and
[getProjectionMatrix] when a non-null orientation is passed. Exposed for use with
[displayOrientedTransform] if needed. Keep [FrameData.screenOrientation] in UI convention
for meshing and other NSDK consumers.
toArCorePosePose
Builds an ARCore [Pose] from this frame's 4×4 transform (column-major).
Use for [FrameData.cameraPose] when building frame data from playback.