MegaTracker Class¶
Description¶
提供云定位功能。
MegaTracker占用1个camera的buffer。
isAvailable¶
检查MegaTracker是否可用。总是返回true。
- C
bool easyar_MegaTracker_isAvailable(void)
- C++
static bool isAvailable()
- Java
public static boolean isAvailable()
- Kotlin
companion object fun isAvailable(): Boolean
- Objective-C
+ (bool)isAvailable
- Swift
public static func isAvailable() -> Bool
- C#
public static bool isAvailable()
inputFrameSink¶
输入帧输入端口。MegaTracker输入帧必须包含camera参数、时间戳信息和空间信息(cameraTransform和trackingStatus)。参考 InputFrameSink 。
- C
void easyar_MegaTracker_inputFrameSink(easyar_MegaTracker * This, easyar_InputFrameSink * * Return)
- C++
std::shared_ptr<InputFrameSink> inputFrameSink()
- Java
public @Nonnull InputFrameSink inputFrameSink()
- Kotlin
fun inputFrameSink(): InputFrameSink
- Objective-C
- (easyar_InputFrameSink *)inputFrameSink
- Swift
public func inputFrameSink() -> InputFrameSink
- C#
public virtual InputFrameSink inputFrameSink()
accelerometerResultSink¶
加速度计结果输入端口。参考 AccelerometerResultSink 。
- C
void easyar_MegaTracker_accelerometerResultSink(easyar_MegaTracker * This, easyar_AccelerometerResultSink * * Return)
- C++
std::shared_ptr<AccelerometerResultSink> accelerometerResultSink()
- Java
public @Nonnull AccelerometerResultSink accelerometerResultSink()
- Kotlin
fun accelerometerResultSink(): AccelerometerResultSink
- Objective-C
- (easyar_AccelerometerResultSink *)accelerometerResultSink
- Swift
public func accelerometerResultSink() -> AccelerometerResultSink
- C#
public virtual AccelerometerResultSink accelerometerResultSink()
locationResultSink¶
可选。位置结果输入端口。参考 LocationResultSink 。
- C
void easyar_MegaTracker_locationResultSink(easyar_MegaTracker * This, easyar_LocationResultSink * * Return)
- C++
std::shared_ptr<LocationResultSink> locationResultSink()
- Java
public @Nonnull LocationResultSink locationResultSink()
- Kotlin
fun locationResultSink(): LocationResultSink
- Objective-C
- (easyar_LocationResultSink *)locationResultSink
- Swift
public func locationResultSink() -> LocationResultSink
- C#
public virtual LocationResultSink locationResultSink()
proximityLocationResultSink¶
可选。邻近位置结果输入端口。参考 ProximityLocationResultSink 。
- C
void easyar_MegaTracker_proximityLocationResultSink(easyar_MegaTracker * This, easyar_ProximityLocationResultSink * * Return)
- C++
std::shared_ptr<ProximityLocationResultSink> proximityLocationResultSink()
- Java
public @Nonnull ProximityLocationResultSink proximityLocationResultSink()
- Kotlin
fun proximityLocationResultSink(): ProximityLocationResultSink
- Objective-C
- (easyar_ProximityLocationResultSink *)proximityLocationResultSink
- Swift
public func proximityLocationResultSink() -> ProximityLocationResultSink
- C#
public virtual ProximityLocationResultSink proximityLocationResultSink()
bufferRequirement¶
当前组件占用camera buffer的数量。
- C
int easyar_MegaTracker_bufferRequirement(easyar_MegaTracker * This)
- C++
int bufferRequirement()
- Java
public int bufferRequirement()
- Kotlin
fun bufferRequirement(): Int
- Objective-C
- (int)bufferRequirement
- Swift
public func bufferRequirement() -> Int32
- C#
public virtual int bufferRequirement()
outputFrameSource¶
输出帧输出端口。参考 OutputFrameSource 。
- C
void easyar_MegaTracker_outputFrameSource(easyar_MegaTracker * This, easyar_OutputFrameSource * * Return)
- C++
std::shared_ptr<OutputFrameSource> outputFrameSource()
- Java
public @Nonnull OutputFrameSource outputFrameSource()
- Kotlin
fun outputFrameSource(): OutputFrameSource
- Objective-C
- (easyar_OutputFrameSource *)outputFrameSource
- Swift
public func outputFrameSource() -> OutputFrameSource
- C#
public virtual OutputFrameSource outputFrameSource()
create¶
创建。
- C
void easyar_MegaTracker_create(easyar_String * server, easyar_String * apiKey, easyar_String * apiSecret, easyar_String * appId, easyar_MegaTracker * * Return)
- C++
static std::shared_ptr<MegaTracker> create(std::string server, std::string apiKey, std::string apiSecret, std::string appId)
- Java
public static @Nonnull MegaTracker create(java.lang.@Nonnull String server, java.lang.@Nonnull String apiKey, java.lang.@Nonnull String apiSecret, java.lang.@Nonnull String appId)
- Kotlin
companion object fun create(server: String, apiKey: String, apiSecret: String, appId: String): MegaTracker
- Objective-C
+ (easyar_MegaTracker *)create:(NSString *)server apiKey:(NSString *)apiKey apiSecret:(NSString *)apiSecret appId:(NSString *)appId
- Swift
public static func create(_ server: String, _ apiKey: String, _ apiSecret: String, _ appId: String) -> MegaTracker
- C#
public static MegaTracker create(string server, string apiKey, string apiSecret, string appId)
switchEndPoint¶
切换远端端点。
- C
void easyar_MegaTracker_switchEndPoint(easyar_MegaTracker * This, easyar_String * server, easyar_String * apiKey, easyar_String * apiSecret, easyar_String * appId)
- C++
void switchEndPoint(std::string server, std::string apiKey, std::string apiSecret, std::string appId)
- Java
public void switchEndPoint(java.lang.@Nonnull String server, java.lang.@Nonnull String apiKey, java.lang.@Nonnull String apiSecret, java.lang.@Nonnull String appId)
- Kotlin
fun switchEndPoint(server: String, apiKey: String, apiSecret: String, appId: String): Unit
- Objective-C
- (void)switchEndPoint:(NSString *)server apiKey:(NSString *)apiKey apiSecret:(NSString *)apiSecret appId:(NSString *)appId
- Swift
public func switchEndPoint(_ server: String, _ apiKey: String, _ apiSecret: String, _ appId: String) -> Void
- C#
public virtual void switchEndPoint(string server, string apiKey, string apiSecret, string appId)
setRequestTimeParameters¶
设置请求时间参数。timeoutMilliseconds为连接超时时间。requestIntervalMilliseconds为期望的请求间隔时间,默认为1000,最小为300,值越大整体误差越大。
- C
void easyar_MegaTracker_setRequestTimeParameters(easyar_MegaTracker * This, easyar_OptionalOfInt timeoutMilliseconds, int requestIntervalMilliseconds)
- C++
void setRequestTimeParameters(std::optional<int> timeoutMilliseconds, int requestIntervalMilliseconds)
- Java
public void setRequestTimeParameters(java.lang.@Nullable Integer timeoutMilliseconds, int requestIntervalMilliseconds)
- Kotlin
fun setRequestTimeParameters(timeoutMilliseconds: Int?, requestIntervalMilliseconds: Int): Unit
- Objective-C
- (void)setRequestTimeParameters:(NSNumber *)timeoutMilliseconds requestIntervalMilliseconds:(int)requestIntervalMilliseconds
- Swift
public func setRequestTimeParameters(_ timeoutMilliseconds: Int32?, _ requestIntervalMilliseconds: Int32) -> Void
- C#
public virtual void setRequestTimeParameters(Optional<int> timeoutMilliseconds, int requestIntervalMilliseconds)
setResultPoseType¶
设置结果姿态类型。默认enableLocalization和enableStabilization均为true。
- C
void easyar_MegaTracker_setResultPoseType(easyar_MegaTracker * This, bool enableLocalization, bool enableStabilization)
- C++
void setResultPoseType(bool enableLocalization, bool enableStabilization)
- Java
public void setResultPoseType(boolean enableLocalization, boolean enableStabilization)
- Kotlin
fun setResultPoseType(enableLocalization: Boolean, enableStabilization: Boolean): Unit
- Objective-C
- (void)setResultPoseType:(bool)enableLocalization enableStabilization:(bool)enableStabilization
- Swift
public func setResultPoseType(_ enableLocalization: Bool, _ enableStabilization: Bool) -> Void
- C#
public virtual void setResultPoseType(bool enableLocalization, bool enableStabilization)
setResultAsyncMode¶
设置结果异步模式。如果结果通过outputFrameSource输出,则应设置位true,如果结果通过getSyncResult获取,则应设置为false。默认enableAsync为true。同步模式仅使用XR License时可生效。
- C
bool easyar_MegaTracker_setResultAsyncMode(easyar_MegaTracker * This, bool enableAsync)
- C++
bool setResultAsyncMode(bool enableAsync)
- Java
public boolean setResultAsyncMode(boolean enableAsync)
- Kotlin
fun setResultAsyncMode(enableAsync: Boolean): Boolean
- Objective-C
- (bool)setResultAsyncMode:(bool)enableAsync
- Swift
public func setResultAsyncMode(_ enableAsync: Bool) -> Bool
- C#
public virtual bool setResultAsyncMode(bool enableAsync)
setRequestMessage¶
- C
void easyar_MegaTracker_setRequestMessage(easyar_MegaTracker * This, easyar_String * message)
- C++
void setRequestMessage(std::string message)
- Java
public void setRequestMessage(java.lang.@Nonnull String message)
- Kotlin
fun setRequestMessage(message: String): Unit
- Objective-C
- (void)setRequestMessage:(NSString *)message
- Swift
public func setRequestMessage(_ message: String) -> Void
- C#
public virtual void setRequestMessage(string message)
setLocalizationCallback¶
设置定位回调。每次定位时,会触发此回调。
- C
void easyar_MegaTracker_setLocalizationCallback(easyar_MegaTracker * This, easyar_CallbackScheduler * callbackScheduler, easyar_OptionalOfFunctorOfVoidFromMegaTrackerLocalizationResponse callback)
- C++
void setLocalizationCallback(std::shared_ptr<CallbackScheduler> callbackScheduler, std::optional<std::function<void(std::shared_ptr<MegaTrackerLocalizationResponse>)>> callback)
- Java
public void setLocalizationCallback(@Nonnull CallbackScheduler callbackScheduler, @Nullable FunctorOfVoidFromMegaTrackerLocalizationResponse callback)
- Kotlin
fun setLocalizationCallback(callbackScheduler: CallbackScheduler, callback: FunctorOfVoidFromMegaTrackerLocalizationResponse?): Unit
- Objective-C
- (void)setLocalizationCallback:(easyar_CallbackScheduler *)callbackScheduler callback:(void (^)(easyar_MegaTrackerLocalizationResponse * response))callback
- Swift
public func setLocalizationCallback(_ callbackScheduler: CallbackScheduler, _ callback: ((MegaTrackerLocalizationResponse) -> Void)?) -> Void
- C#
public virtual void setLocalizationCallback(CallbackScheduler callbackScheduler, Optional<Action<MegaTrackerLocalizationResponse>> callback)
start¶
开始MegaTracker。
- C
bool easyar_MegaTracker_start(easyar_MegaTracker * This)
- C++
bool start()
- Java
public boolean start()
- Kotlin
fun start(): Boolean
- Objective-C
- (bool)start
- Swift
public func start() -> Bool
- C#
public virtual bool start()
stop¶
停止MegaTracker。调用start重新运行。
- C
void easyar_MegaTracker_stop(easyar_MegaTracker * This)
- C++
void stop()
- Java
public void stop()
- Kotlin
fun stop(): Unit
- Objective-C
- (void)stop
- Swift
public func stop() -> Void
- C#
public virtual void stop()
reset¶
重置MegaTracker,清除所有状态。
- C
void easyar_MegaTracker_reset(easyar_MegaTracker * This)
- C++
void reset()
- Java
public void reset()
- Kotlin
fun reset(): Unit
- Objective-C
- (void)reset
- Swift
public func reset() -> Void
- C#
public virtual void reset()
close¶
关闭MegaTracker。close之后不应继续使用。
- C
void easyar_MegaTracker_close(easyar_MegaTracker * This)
- C++
void close()
- Java
public void close()
- Kotlin
fun close(): Unit
- Objective-C
- (void)close
- Swift
public func close() -> Void
- C#
public virtual void close()
getSyncResult¶
获得同步输出结果。如果MegaTracker已暂停,或者未通过setResultAsyncMode将结果异步模式设为false,则返回值为空。
- C
void easyar_MegaTracker_getSyncResult(easyar_MegaTracker * This, double timestamp, easyar_Matrix44F cameraTransform, easyar_MotionTrackingStatus trackingStatus, easyar_OptionalOfMegaTrackerResult * Return)
- C++
std::optional<std::shared_ptr<MegaTrackerResult>> getSyncResult(double timestamp, Matrix44F cameraTransform, MotionTrackingStatus trackingStatus)
- Java
public @Nullable MegaTrackerResult getSyncResult(double timestamp, @Nonnull Matrix44F cameraTransform, int trackingStatus)
- Kotlin
fun getSyncResult(timestamp: Double, cameraTransform: Matrix44F, trackingStatus: Int): MegaTrackerResult?
- Objective-C
- (easyar_MegaTrackerResult *)getSyncResult:(double)timestamp cameraTransform:(easyar_Matrix44F *)cameraTransform trackingStatus:(easyar_MotionTrackingStatus)trackingStatus
- Swift
public func getSyncResult(_ timestamp: Double, _ cameraTransform: Matrix44F, _ trackingStatus: MotionTrackingStatus) -> MegaTrackerResult?
- C#
public virtual Optional<MegaTrackerResult> getSyncResult(double timestamp, Matrix44F cameraTransform, MotionTrackingStatus trackingStatus)