zoukankan      html  css  js  c++  java
  • 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)

  • 相关阅读:
    atom那些事儿
    浙江省和杭州市
    Web API之indexedDB和Web SQL
    绝对定位元素居中
    多列等高布局
    git生成ssh key及github ssh key对接
    vuejs模板使用方法
    css3动画图片波纹效果
    sticky footer布局,定位底部footer
    css3圆环闪烁动画
  • 原文地址:https://www.cnblogs.com/laugher/p/6845682.html
Copyright © 2011-2022 走看看