ARCore is back at Google I/O on May 10! Register now.
Stay organized with collections Save and categorize content based on your preferences.

C++ type conversions

These functions expose allowable type conversions as C++ helper functions.

Summary

This avoids having to explicitly reinterpret_cast in most cases.

Note: These functions only change the type of a pointer; they do not change the reference count of the referenced objects.

Note: There is no runtime checking that casts are correct. Call ArTrackable_getType beforehand to figure out the correct cast.

Functions

ArAsAugmentedImage(ArTrackable *trackable)
Downcasts to ArAugmentedImage.
ArAsFace(ArTrackable *trackable)
Downcasts to ArAugmentedFace.
ArAsInstantPlacementPoint(ArTrackable *trackable)
ArAsPlane(ArTrackable *trackable)
Downcasts to ArPlane.
ArAsPoint(ArTrackable *trackable)
Downcasts to ArPoint.
ArAsTrackable(ArPlane *plane)
Upcasts to ArTrackable.
ArAsTrackable(ArPoint *point)
Upcasts to ArTrackable.
ArAsTrackable(ArAugmentedImage *augmented_image)
Upcasts to ArTrackable.
ArAsTrackable(ArInstantPlacementPoint *instant_placement_point)
Upcasts to ArTrackable.
ArAsTrackable(ArAugmentedFace *face)
Upcasts to ArTrackable.

Functions

ArAsAugmentedImage

ArAugmentedImage * ArAsAugmentedImage(
  ArTrackable *trackable
)

Downcasts to ArAugmentedImage.

ArAsFace

ArAugmentedFace * ArAsFace(
  ArTrackable *trackable
)

Downcasts to ArAugmentedFace.

ArAsInstantPlacementPoint

ArInstantPlacementPoint * ArAsInstantPlacementPoint(
  ArTrackable *trackable
)

Downcasts to ArInstantPlacementPoint.

ArAsPlane

ArPlane * ArAsPlane(
  ArTrackable *trackable
)

Downcasts to ArPlane.

ArAsPoint

ArPoint * ArAsPoint(
  ArTrackable *trackable
)

Downcasts to ArPoint.

ArAsTrackable

ArTrackable * ArAsTrackable(
  ArPlane *plane
)

Upcasts to ArTrackable.

ArAsTrackable

ArTrackable * ArAsTrackable(
  ArPoint *point
)

Upcasts to ArTrackable.

ArAsTrackable

ArTrackable * ArAsTrackable(
  ArAugmentedImage *augmented_image
)

Upcasts to ArTrackable.

ArAsTrackable

ArTrackable * ArAsTrackable(
  ArInstantPlacementPoint *instant_placement_point
)

Upcasts to ArTrackable.

ArAsTrackable

ArTrackable * ArAsTrackable(
  ArAugmentedFace *face
)

Upcasts to ArTrackable.