GoogleARCore. Frame
Provides a snapshot of the state of ARCore at a specific timestamp associated with the current frame.
Summary
Frame holds information about ARCore's state including the pose of the camera relative to the world, estimated lighting parameters, and information on updates to objects (like Planes or Point Clouds) that ARCore is tracking.
Properties |
|
---|---|
LightEstimate
|
static LightEstimate
Gets the current light estimate for this frame.
|
Pose
|
static Pose
Gets the pose of the ARCore device for the frame in Unity world coordinates.
|
Timestamp
|
static long
Gets the timestamp of the frame.
|
Public static functions |
|
---|---|
GetUpdatedTrackData(Guid trackId)
|
List< TrackData >
Gets the set of data recorded to the given track available during playback on this
Frame . |
Raycast(float x, float y, TrackableHitFlags filter, out TrackableHit hitResult)
|
bool
Performs a raycast against objects being tracked by ARCore.
|
Raycast(Vector3 origin, Vector3 direction, out TrackableHit hitResult, float maxDistance, TrackableHitFlags filter)
|
bool
Performs a raycast against objects being tracked by ARCore.
|
RaycastAll(float x, float y, TrackableHitFlags filter, List< TrackableHit > hitResults)
|
bool
Performs a raycast against objects being tracked by ARCore.
|
RaycastAll(Vector3 origin, Vector3 direction, List< TrackableHit > hitResults, float maxDistance, TrackableHitFlags filter)
|
bool
Performs a raycast against objects being tracked by ARCore.
|
RaycastInstantPlacement(float x, float y, float approximateDistanceMeters, out TrackableHit hitResult)
|
bool
Performs a ray cast that can return a result before ARCore establishes full tracking.
|
RecordTrackData(Guid trackId, byte[] data)
|
Writes a data sample in the specified external data track.
|
Classes |
|
---|---|
GoogleARCore. |
Container for state related to the ARCore camera for the frame. |
GoogleARCore. |
Container for state related to the ARCore camera image metadata for the frame. |
GoogleARCore. |
Container for state related to the ARCore point cloud for the frame. |
Properties
Pose
static Pose Pose
Gets the pose of the ARCore device for the frame in Unity world coordinates.
Timestamp
static long Timestamp
Gets the timestamp of the frame.
Public static functions
GetUpdatedTrackData
List< TrackData > GetUpdatedTrackData( Guid trackId )
Gets the set of data recorded to the given track available during playback on this Frame
.
Note, currently playback continues internally while the session is paused. Therefore, on pause/resume track data discovered internally will be discarded to prevent stale track data from flowing through when the session resumed. Note, if the app's frame rate is higher than ARCore's frame rate, subsequent Frame
objects may reference the same underlying ARCore Frame, which would mean the list of TrackData
returned on those Frame objects would be the same. Use TrackData.FrameTimestamp
to determine whether two Frame objects represent the same underlying ARCore frame.
Details | |||
---|---|---|---|
Parameters |
|
||
Returns |
Returns a list of TrackData. Will be empty if none are available.
|
Raycast
bool Raycast( float x, float y, TrackableHitFlags filter, out TrackableHit hitResult )
Performs a raycast against objects being tracked by ARCore.
Output the closest hit from the camera. Note that the Unity's screen coordinate (0, 0) starts from bottom left.
Details | |||||||||
---|---|---|---|---|---|---|---|---|---|
Parameters |
|
||||||||
Returns |
true if the raycast had a hit, otherwise false . |
Raycast
bool Raycast( Vector3 origin, Vector3 direction, out TrackableHit hitResult, float maxDistance, TrackableHitFlags filter )
Performs a raycast against objects being tracked by ARCore.
Output the closest hit from the origin.
Details | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Parameters |
|
||||||||||
Returns |
true if the raycast had a hit, otherwise false . |
RaycastAll
bool RaycastAll( float x, float y, TrackableHitFlags filter, List< TrackableHit > hitResults )
Performs a raycast against objects being tracked by ARCore.
Output all hits from the camera. Note that the Unity's screen coordinate (0, 0) starts from bottom left.
Details | |||||||||
---|---|---|---|---|---|---|---|---|---|
Parameters |
|
||||||||
Returns |
true if the raycast had a hit, otherwise false . |
RaycastAll
bool RaycastAll( Vector3 origin, Vector3 direction, List< TrackableHit > hitResults, float maxDistance, TrackableHitFlags filter )
Performs a raycast against objects being tracked by ARCore.
Output all hits from the origin.
Details | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Parameters |
|
||||||||||
Returns |
true if the raycast had a hit, otherwise false . |
RaycastInstantPlacement
bool RaycastInstantPlacement( float x, float y, float approximateDistanceMeters, out TrackableHit hitResult )
Performs a ray cast that can return a result before ARCore establishes full tracking.
The pose and apparent scale of attached objects depends on the InstantPlacementPoint tracking method and the provided approximateDistanceMeters. A discussion of the different tracking methods and the effects of apparent object scale are described in InstantPlacementPoint
.
This function will succeed only if InstantPlacementMode
is InstantPlacementMode.LocalYUp
in the ARCore session configuration, the ARCore session status is SessionStatus
.Tracking
, and there are sufficient feature points to track the point in screen space.
Details | |||||||||
---|---|---|---|---|---|---|---|---|---|
Parameters |
|
||||||||
Returns |
true if successful, otherwise false . |
RecordTrackData
RecordingResult RecordTrackData( Guid trackId, byte[] data )
Writes a data sample in the specified external data track.
The external samples recorded using this API will be muxed into the recorded MP4 dataset in a corresponding additional MP4 stream.
For smooth playback of the MP4 on video players and for future compatibility of the MP4 datasets with ARCore's playback of external data tracks it is recommended that the external samples are recorded at a frequency no higher than 90kHz.
Additionally, if the external samples are recorded at a frequency lower than 1Hz, empty padding samples will be automatically recorded at approximately one second intervals to fill in the gaps.
Recording external samples introduces additional CPU and/or I/O overhead and may affect app performance.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Returns |
RecordingResult.
OK if the data was recorded successfully, or a different RecordingResult if there was an error. |