ARSession.ARCenterMode Enum

Description

AR center mode.

NOTE: In EasyAR Sense Unity Plugin, there are four different types of center modes. Similar concept may not exist in some other AR frameworks like AR Foundation, and the behavior of object relationships is usually equal to ARSession.ARCenterMode.SessionOrigin mode here.

Relative transform between ARAssembly.Camera and a few AR components are controlled by the session, one of those objects is called ARSession.CenterObject , it stays still in the scene, while other objects move relatively to ARSession.CenterObject . This object is selected according to the value of ARSession.CenterMode .

ARSession.CenterObject represents an object or parent of object that do not move in Unity space. It can be ARSession.Origin , ARAssembly.Camera or some target. A target could be object containing one of the following component: TargetController , SparseSpatialMapRootController or Scene.BlockRootController . While in the context of sparse spatial map or EasyAR Mega, the exact center GameObject is the localized map or block object under the root, and ARSession.CenterObject is parent of this object.

ARSession.CenterObject may change to other target in ARSession.ARCenterMode.FirstTarget or ARSession.ARCenterMode.SpecificTarget mode when target is not found or lost in a frame. If no target is found in this frame, the ARSession.CenterObject will fallback to the center of first available mode in the order of ARSession.ARCenterMode.SessionOrigin and ARSession.ARCenterMode.Camera .

The relative transform between target and ARAssembly.Camera is controlled by this session according to ARAssembly.OutputFrame data every frame. The relative transform between ARSession.Origin and ARAssembly.Camera is also controlled by this session according to ARAssembly.OutputFrame data every frame when FrameSource.IsCameraUnderControl is true. When FrameSource.IsCameraUnderControl is false, the relative transform between ARSession.Origin and ARAssembly.Camera is not controlled by this session and is usually controlled by other AR Frameworks like AR Foundation.

Constant

Value

Description

FirstTarget

0

The session will use the first tracked target as center.

You can move or rotate the target and ARAssembly.Camera will follow. You cannot manually change the transform of ARAssembly.Camera in this mode. ARSession.Origin will also follow if any type of motion tracking is running, and its transform cannot be manually changed.

When the target is lost, the center object will be recalculated. While in the context of sparse spatial map or EasyAR Mega, the exact center GameObject is the localized map or block object under the root. Start localizing another map is treated as lost from localizing the previous one, and the center object will be recalculated.

Camera

1

The session is ARAssembly.Camera centered.

You can move or rotate the ARAssembly.Camera and target will follow. You cannot manually change the transform of target. ARSession.Origin will also follow if any type of motion tracking is running, and its transform cannot be manually changed.

SpecificTarget

2

The session will use ARSession.SpecificTargetCenter as center.

You can move or rotate the target and ARAssembly.Camera will follow. You cannot manually change the transform of ARAssembly.Camera in this mode. ARSession.Origin will also follow if any type of motion tracking is running, and its transform cannot be manually changed.

SessionOrigin

3

The session will use ARSession.Origin as center.

You can move or rotate the ARSession.Origin and the ARAssembly.Camera will follow. You cannot manually change the ARAssembly.Camera ‘s transform in this mode. If there are any target being tracked, it will also follow, and its transform cannot be manually changed.