MBMFreeCameraOptions.h 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. // This file is generated and will be overwritten automatically.
  2. #import <Foundation/Foundation.h>
  3. #import <CoreLocation/CoreLocation.h>
  4. @class MBMVec3;
  5. @class MBMVec4;
  6. /**
  7. * Various options for accessing physical properties of the underlying camera entity.
  8. * A direct access to these properties allows more flexible and precise controlling
  9. * of the camera while also being fully compatible and interchangeable with CameraOptions.
  10. * All fields are optional.
  11. */
  12. NS_SWIFT_NAME(FreeCameraOptions)
  13. __attribute__((visibility ("default")))
  14. @interface MBMFreeCameraOptions : NSObject
  15. // This class provides custom init which should be called
  16. - (nonnull instancetype)init NS_UNAVAILABLE;
  17. // This class provides custom init which should be called
  18. + (nonnull instancetype)new NS_UNAVAILABLE;
  19. /**
  20. * Get the position of the camera in slightly modified web mercator coordinates
  21. * - The size of 1 unit is the width of the projected world instead of the "mercator meter".
  22. * Coordinate [0, 0, 0] is the north-west corner and [1, 1, 0] is the south-east corner.
  23. * - Z coordinate is conformal and must respect minimum and maximum zoom values.
  24. * - Zoom is automatically computed from the altitude (z)
  25. *
  26. * @return The position if set.
  27. */
  28. - (nullable MBMVec3 *)getPosition __attribute((ns_returns_retained));
  29. /**
  30. * Set the position of the camera in slightly modified web mercator coordinates
  31. * - The size of 1 unit is the width of the projected world instead of the "mercator meter".
  32. * Coordinate [0, 0, 0] is the north-west corner and [1, 1, 0] is the south-east corner.
  33. * - Z coordinate is conformal and must respect minimum and maximum zoom values.
  34. * - Zoom is automatically computed from the altitude (z)
  35. *
  36. * @param position The position to be set.
  37. */
  38. - (void)setPositionForPosition:(nullable MBMVec3 *)position;
  39. /**
  40. * Get the orientation of the camera represented as a unit quaternion [x, y, z, w].
  41. * The default pose of the camera is such that the forward vector is looking up the -Z axis and
  42. * the up vector is aligned with north orientation of the map:
  43. * forward: [0, 0, -1]
  44. * up: [0, -1, 0]
  45. * right [1, 0, 0]
  46. *
  47. * With the w value as the real part of the complex number
  48. *
  49. * @return The orientation if set.
  50. */
  51. - (nullable MBMVec4 *)getOrientation __attribute((ns_returns_retained));
  52. /**
  53. * Set the orientation of the camera represented as a unit quaternion [x, y, z, w].
  54. * The default pose of the camera is such that the forward vector is looking up the -Z axis and
  55. * the up vector is aligned with north orientation of the map:
  56. * forward: [0, 0, -1]
  57. * up: [0, -1, 0]
  58. * right [1, 0, 0]
  59. *
  60. * With the w value as the real part of the complex number
  61. *
  62. * Orientation can be set freely but certain constraints still apply
  63. * - Orientation must be representable with only pitch and bearing.
  64. * - Pitch has an upper limit
  65. *
  66. * @param orientation The orientation to be set.
  67. *
  68. */
  69. - (void)setOrientationForOrientation:(nullable MBMVec4 *)orientation;
  70. /**
  71. * Helper function for setting the mercator position as Lat&Lng and altitude in meters
  72. *
  73. * @param location The mercator `coordinate`.
  74. * @param altitude The altitude in meters.
  75. */
  76. - (void)setLocationForLocation:(CLLocationCoordinate2D)location
  77. altitude:(double)altitude;
  78. /**
  79. * Helper function for setting orientation of the camera by defining a focus point.
  80. * Elevation of 0.0 is used and no up vector.
  81. *
  82. * Note: Orientation can be invalid after this call, if the input leads to the camera being upside down or the quaternion has zero length.
  83. *
  84. * @param location The `coordinate` representing focal point.
  85. */
  86. - (void)lookAtPointForLocation:(CLLocationCoordinate2D)location;
  87. /**
  88. * Helper function for setting orientation of the camera by defining a focus point.
  89. * No up vector is used.
  90. *
  91. * Note: Orientation can be invalid after this call, if the input leads to the camera being upside down or the quaternion has zero length.
  92. *
  93. * @param location The `coordinate` representing focal point.
  94. * @param altitude The altitude in meters of the focal point.
  95. */
  96. - (void)lookAtPointForLocation:(CLLocationCoordinate2D)location
  97. altitude:(double)altitude;
  98. /**
  99. * Helper function for setting orientation of the camera by defining a focus point.
  100. *
  101. * Up vector is required in certain scenarios where bearing can't be deduced from
  102. * the viewing direction.
  103. *
  104. * Note: Orientation can be invalid after this call, if the input leads to the camera being upside down or the quaternion has zero length.
  105. *
  106. * @param location The `coordinate` representing focal point.
  107. * @param altitude The altitude in meters of the focal point.
  108. * @param upVector The up vector.
  109. */
  110. - (void)lookAtPointForLocation:(CLLocationCoordinate2D)location
  111. altitude:(double)altitude
  112. upVector:(nonnull MBMVec3 *)upVector;
  113. /**
  114. * Helper function for setting the orientation of the camera as a pitch and a bearing.
  115. *
  116. * @param pitch The pitch in degrees
  117. * @param bearing The bearing in degrees
  118. */
  119. - (void)setPitchBearingForPitch:(double)pitch
  120. bearing:(double)bearing;
  121. @end