生活随笔
收集整理的這篇文章主要介紹了
ARKit从入门到精通(6)-ARSession介绍
小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
-
轉(zhuǎn)載請(qǐng)注明出處:ARKit從入門(mén)到精通(6)-ARSession介紹
-
ARSession是一個(gè)連接底層與AR視圖之間的橋梁,其實(shí)ARSCNView內(nèi)部所有的代理方法都是由ARSession來(lái)提供的
-
ARSession與ARScnView之間的關(guān)系看起來(lái)是這樣的:
0701.png
@interface ARSession : NSObject
@property (
nonatomic,
weak)
id <ARSessionDelegate> delegate;
@property (
nonatomic,
strong,
nullable)
dispatch_queue_t delegateQueue;
@property (
nonatomic,
copy,
nullable,
readonly) ARFrame *currentFrame;
@property (
nonatomic,
copy,
nullable,
readonly) ARSessionConfiguration *configuration;
- (
void)runWithConfiguration:(ARSessionConfiguration *)configuration
NS_SWIFT_UNAVAILABLE(
"Use run(_:options:)");
- (
void)runWithConfiguration:(ARSessionConfiguration *)configuration options:(ARSessionRunOptions)options
NS_SWIFT_NAME(run(_:options:));
- (
void)pause;
- (
void)addAnchor:(ARAnchor *)anchor
NS_SWIFT_NAME(add(anchor:));
- (
void)removeAnchor:(ARAnchor *)anchor
NS_SWIFT_NAME(remove(anchor:));
@end
#pragma mark - ARSessionObserver
@protocol ARSessionObserver <NSObject>@optional
- (
void)session:(ARSession *)session didFailWithError:(
NSError *)error;
- (
void)session:(ARSession *)session cameraDidChangeTrackingState:(ARCamera *)camera;
- (
void)sessionWasInterrupted:(ARSession *)session;
- (
void)sessionInterruptionEnded:(ARSession *)session;
@end#pragma mark - ARSessionDelegate@protocol ARSessionDelegate <ARSessionObserver>@optional
- (
void)session:(ARSession *)session didUpdateFrame:(ARFrame *)frame;
- (
void)session:(ARSession *)session didAddAnchors:(
NSArray<ARAnchor*>*)anchors;
- (
void)session:(ARSession *)session didUpdateAnchors:(
NSArray<ARAnchor*>*)anchors;
- (
void)session:(ARSession *)session didRemoveAnchors:(
NSArray<ARAnchor*>*)anchors;
@end
總結(jié)
以上是生活随笔為你收集整理的ARKit从入门到精通(6)-ARSession介绍的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
如果覺(jué)得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。