addAnchorAtHit method
Anchors to the surface of a hit, so the content follows plane refinements.
Implementation
Future<UArAnchor> addAnchorAtHit(UArHitResult hit, {String? id, bool faceCamera = true}) {
UArPose pose = hit.pose;
if (faceCamera && !hit.isWall) {
final UArVector3 toCamera = value.frame.camera.position - hit.pose.position;
pose = UArPose(position: hit.pose.position, rotation: UArQuaternion.yaw(atan2(toCamera.x, toCamera.z)));
}
return addAnchor(pose, id: id, trackableId: hit.trackableId);
}