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

Orientation


Declaration​

enum class Orientation

Summary​

Device orientation when capturing camera frames. Orientation affects how ARDK interprets camera data and poses. Ensure the correct orientation is set in [FrameData.screenOrientation] for accurate tracking and localization.

See also​

  • FrameData.screenOrientation

Cases​

NameTypeSummary
LANDSCAPE_LEFTLANDSCAPE_LEFT
Device rotated 90° counter-clockwise from portrait (landscape)
LANDSCAPE_RIGHTLANDSCAPE_RIGHT
Device rotated 90° clockwise from portrait (landscape)
PORTRAITPORTRAIT
Device held upright in portrait mode
PORTRAIT_UPSIDE_DOWNPORTRAIT_UPSIDE_DOWN
Device held upside-down in portrait mode
UNKNOWNUNKNOWN
Orientation is unknown or not yet determined

Functions​

NameTypeSummary
FromOrientation?
-
fromSurfaceRotationOrientation
Converts an Android display rotation into the corresponding device [Orientation].
Pass the value returned by Display.rotation — one of [Surface.ROTATION_0],
[Surface.ROTATION_90], [Surface.ROTATION_180], or [Surface.ROTATION_270].
Any unrecognized value maps to [UNKNOWN].
This produces the device/UI orientation expected by
[FrameData.screenOrientation] and by the orientationProvider of
createLiveDataSource. It is the inverse-free, sensor-agnostic mapping;
renderers that need the flipped landscape convention should additionally
apply their own rendering transform rather than swapping here.