Class ARHitResult
java.lang.Object
com.codename1.ar.ARHitResult
One intersection returned by
ARSession#hitTest(float, float): the world
pose where the ray from the screen point met real-world geometry. Call
#createAnchor() to place content at the hit.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumThe kind of real-world geometry the hit ray intersected. -
Constructor Summary
ConstructorsConstructorDescriptionARHitResult(ARPose pose, float distance, ARHitResult.Type type, ARPlane plane, Object nativeHandle) Creates a hit result. -
Method Summary
Modifier and TypeMethodDescriptionCreates an anchor at this hit, letting the platform anchor to the exact native raycast result when available.floatThe distance from the camera to the hit in meters.The opaque platform token backing this hit.getPlane()The plane that was hit, or null for non-plane hits.getPose()The world pose of the intersection.getType()The kind of geometry the ray intersected.
-
Constructor Details
-
ARHitResult
public ARHitResult(ARPose pose, float distance, ARHitResult.Type type, ARPlane plane, Object nativeHandle) Creates a hit result. Intended for platform implementations and tests; applications receive hit results from
ARSession#hitTest(float, float).Parameters
-
pose: the world pose of the intersection, local Y along the surface normal -
distance: the distance from the camera in meters -
type: the kind of geometry hit -
plane: the plane that was hit, or null for non-plane hits -
nativeHandle: an opaque platform token that lets#createAnchor()anchor to the exact native hit, or null
-
-
-
Method Details
-
getPose
The world pose of the intersection. Local Y points along the surface normal. -
getDistance
public float getDistance()The distance from the camera to the hit in meters. -
getType
The kind of geometry the ray intersected. -
getPlane
The plane that was hit, or null for non-plane hits. -
getNativeHandle
The opaque platform token backing this hit. Intended for platform implementations. -
createAnchor
Creates an anchor at this hit, letting the platform anchor to the exact native raycast result when available.
Returns
the new anchor, registered with the session
-