Unity3d Vuforia与Mobile Movie Texture插件结合

Mobile Movie Texture插件(以下统称MMT)重要是为播放视频,此中包含透明通道视频,尤其是AR中播放透底视频。
(一般只须要融会这个就可以,由于Xcode只会执行一个.mm文件,之所以会呈现扫描不播放视频的情形,重要是由于这个原因)。

 

整合到VuforiaNativeRendererController.mm

/*============================================================================
Copyright (c) 2014 Qualcomm Connected Experiences, Inc.
All Rights Reserved.
============================================================================*/
#import <UIKit/UIKit.h>
#import "UnityAppController.h"
#import "VuforiaRenderDelegate.h"


// Unity native rendering callback plugin mechanism is only supported
// from version 4.5 onwards
#if UNITY_VERSION>434

// Exported methods for native rendering callback
extern "C" void VuforiaSetGraphicsDevice(void* device, int deviceType, int eventType);
extern "C" void VuforiaRenderEvent(int marker);


extern "C" void MMTUnitySetGraphicsDevice(void* device, int deviceType, int eventType);
extern "C" void MMTUnityRenderEvent(int marker);

extern "C" void VuforiaSetGraphicsDeviceMerge(void* device, int deviceType, int eventType)
{
VuforiaSetGraphicsDevice(device, deviceType, eventType);
MMTUnitySetGraphicsDevice(device, deviceType, eventType);
}

extern "C" void VuforiaRenderEventMerge(int marker)
{
VuforiaRenderEvent(marker);
MMTUnityRenderEvent(marker);
}

#endif

// Controller to support native rendering callback
@interface VuforiaNativeRendererController : UnityAppController
{
}
- (void)shouldAttachRenderDelegate;
@end

@implementation VuforiaNativeRendererController

- (void)shouldAttachRenderDelegate
{
self.renderDelegate = [[VuforiaRenderDelegate alloc] init];

// Unity native rendering callback plugin mechanism is only supported
// from version 4.5 onwards
#if UNITY_VERSION>434
UnityRegisterRenderingPlugin(&VuforiaSetGraphicsDeviceMerge, &VuforiaRenderEventMerge);
#endif
}
@end


IMPL_APP_CONTROLLER_SUBCLASS(VuforiaNativeRendererController)

转载于:https://www.cnblogs.com/laugher/p/6845682.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值