Unity-Technologies / arfoundation-samples

Example content for Unity projects based on AR Foundation
Other
3.07k stars 1.15k forks source link

ARFoundation architecture #771

Closed AdrianGodlewski closed 3 years ago

AdrianGodlewski commented 3 years ago

Hello,

I'm trying to understand the ARFoundation architecture.

image

As I understand subsystems are just some kind of interfaces that providers (provides - ARCore, ARKit) implement. So I would call ARFoundation a wrapper of those providers that talks to multiplatform API. The thing I'm wondering and I'm not 100% sure yet is the manager classes. Am I correct that the managers classes are bound to ARFoundation and they are talking to concrete providers and trackables? Why would we need subsystems then if we got manager classes? If You could please explain me how the architecture works, I would love to understand it.

Greetings!

tdmowrer commented 3 years ago

As I understand subsystems are just some kind of interfaces that providers (provides - ARCore, ARKit) implement. So I would call ARFoundation a wrapper of those providers that talks to multiplatform API.

Yes, that's right.

Am I correct that the managers classes are bound to ARFoundation and they are talking to concrete providers and trackables?

I'm not sure what you mean by "bound to ARFoundation". Let's take an example:

The ARPlaneManager is a MonoBehaviour in AR Foundation. It manages ARPlanes (another AR Foundation type) by talking to the XRPlaneSubsystem. The XRPlaneSubsystem is the interface that providers like ARCore & ARKit implement.

Why would we need subsystems then if we got manager classes?

Put another way, the subsystems are the interfaces implemented by providers while the "manager classes" are MonoBehaviours you can add in your scene.

AdrianGodlewski commented 3 years ago

Thanks alot, I think I understand it.

Have a great day!