• 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)

  • 相关阅读:
    sipp3.6对freeswitch进行压力测试
    随机四则运算
    大一暑假第八周周进度总结报告
    大一暑假第七周周进度总结报告
    学生信息管理系统java测试报告
    原码、反码、补码解读
    大一暑假第六周周进度总结报告
    01Java方法
    00java语法基础和课后实践
    验证码和判断回文(递归)
  • 原文地址:https://www.cnblogs.com/laugher/p/6845682.html
Copyright © 2020-2023  润新知