iOS
Overview
This capability processes the OpenGL textures of the camera and outputs 3D body data. You can pass the data to Unity to drive your model or use the data to implement other features.
Integration (iOS)
API calls
1. Enable the feature (XMagic.h).
ļ»æ- (void)setFeatureEnableDisable:(NSString *_Nonnull)featureName enable:(BOOL)enable;
Set
featureName
to XmagicConstant.FeatureName.BODY_3D_POINT
.2. Configure the data callback (XMagic.h).
Version 2.6.0 and earlier versions use the following method.
//XMagic.h- (void)registerSDKEventListener:(id<YTSDKEventListener> _Nullable)listener;ļ»æ@implementation listener- (void)onYTDataEvent:(id)event{NSLog(@"YTData %@", event);}@end
onYTDataEvent
returns a JSON string.face_info
is facial data, which is not used by this capability.For the meanings of fields in
body_3d_info
, see below. Version 3.0.0 uses the following method.
//XMagic.h- (void)registerSDKEventListener:(id<YTSDKEventListener> _Nullable)listener;ļ»æ- (void)onAIEvent:(id)event{NSDictionary *eventDict = (NSDictionary *)event;if (eventDict[@"ai_info"] != nil) {NSLog(@"ai_info %@",eventDict[@"ai_info"]);}}
eventDict[@"ai_info"]
returns a JSON string.face_info
is facial data, which is not used by this capability.For the meanings of fields in
body_3d_info
, see below.