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)

  • 相关阅读:
    java实现获取当前年月日 小时 分钟 秒 毫秒
    四种常见的 POST 提交数据方式(application/x-www-form-urlencoded,multipart/form-data,application/json,text/xml)
    Cannot send, channel has already failed:
    Java 枚举(enum) 详解7种常见的用法
    C语言指针详解(经典,非常详细)
    ActiveMQ进阶配置
    Frame size of 257 MB larger than max allowed 100 MB
    SpringJMS解析--监听器
    SpringJMS解析-JmsTemplate
    delphi 修改代码补全的快捷键(由Ctrl+Space 改为 Ctrl + alt + Space)
  • 原文地址:https://www.cnblogs.com/laugher/p/6845682.html
Copyright © 2011-2022 走看看