Flutter Engine
The Flutter Engine
|
High-Level concepts of ARCore
ARCore has two categories of objects: "value types" and "reference types".
create
/ destroy
methods, and are populated by ARCore using methods with get
in the method name.acquire
methods. For each call to the acquire
method, the application must call the matching release
method. Note that even if last reference is released, ARCore may continue to hold a reference to the object at ARCore's discretion.Reference types are further split into:
acquire
call may fail if the resource is exhausted (too many are currently held), deadline exceeded (the target of the acquire was already released), or the resource is not yet available.Note: Lists are value types (owned by application), but can hold references to long-lived objects. This means that the references held by a list are not released until either the list is destroyed, or is re-populated by another api call.
For example, ArAnchorList, which is a value type, will hold references to Anchors, which are long-lived objects.
An ArPose
describes an rigid transformation from one coordinate space to another. As provided from all ARCore APIs, Poses always describe the transformation from object's local coordinate space to the world coordinate space (see below). That is, Poses from ARCore APIs can be thought of as equivalent to OpenGL model matrices.
The transformation is defined using a quaternion rotation about the origin followed by a translation.
The coordinate system is right-handed, like OpenGL conventions.
Translation units are meters.
As ARCore's understanding of the environment changes, it adjusts its model of the world to keep things consistent. When this happens, the numerical location (coordinates) of the camera and anchors can change significantly to maintain appropriate relative positions of the physical locations they represent.
These changes mean that every frame should be considered to be in a completely unique world coordinate space. The numerical coordinates of anchors and the camera should never be used outside the rendering frame during which they were retrieved. If a position needs to be considered beyond the scope of a single rendering frame, either an anchor should be created or a position relative to a nearby existing anchor should be used.