public void Create() { m_handle = Types.INVALID_HANDLE; if (!HvrHelper.Support.IsApplicationStateSupported()) { return; } try { UnityInterface.Lock(); if (HvrPlayerInterface.Initialise()) { m_handle = HvrPlayerInterfaceAPI.Actor_Create(); #if VERBOSE_LOGGING Debug.Log("Create " + GetType().Name + " Handle:" + handle); #endif UnityInterface.SceneObjectsAdd(m_handle, GetType().Name + m_handle, GetType().FullName); } } catch (Exception e) { Debug.LogError(e.Message); } finally { UnityInterface.Unlock(); } }
public void Delete() { if (m_handle == Types.INVALID_HANDLE) { return; } try { UnityInterface.Lock(); HvrPlayerInterfaceAPI.Actor_Delete(m_handle); #if VERBOSE_LOGGING Debug.Log("Delete " + GetType().Name + " Handle:" + handle); #endif UnityInterface.SceneObjectsRemove(m_handle); } catch (Exception e) { Debug.LogError(e.Message); } finally { m_handle = Types.INVALID_HANDLE; UnityInterface.Unlock(); } }
public static string RenderMethod_GetDefaultMethodType() { StringBuilder stringBuilder = new StringBuilder(256); if (HvrPlayerInterfaceAPI.Interface_GetRenderMethodDefault(stringBuilder, stringBuilder.Capacity)) { return(stringBuilder.ToString()); } Debug.LogError("[HVR] Unable to get default rendermethod from interface"); if (m_supportedRenderMethodTypes == null) { RenderMethod_UpdateSupportedTypes(); } try { return(m_supportedRenderMethodTypes[0]); } catch (Exception e) { throw new Exception(e.Message); } }
public static void CheckConnection() { if (m_connection_check_lastTime + CONNECTION_CHECK_WAIT_TIME < Helper.GetCurrentTime()) { m_connection_check_lastTime = Helper.GetCurrentTime(); HvrPlayerInterfaceAPI.Interface_Reconnect(); } }
public static void Update() { if (IsInitialized()) { HvrPlayerInterfaceAPI.Interface_Update(); UnityInterface.Update(); } }
public bool IsValid() { if (handle == Types.INVALID_HANDLE) { return(false); } return(HvrPlayerInterfaceAPI.RenderMethod_IsValid(handle)); }
public void Seek(float time) { if (handle == Types.INVALID_HANDLE) { return; } HvrPlayerInterfaceAPI.Asset_Seek(handle, time); }
public void SetRenderMethod(int _renderMethodHandle) { if (m_handle == Types.INVALID_HANDLE) { return; } HvrPlayerInterfaceAPI.Actor_SetRenderMethod(m_handle, _renderMethodHandle); }
public void SetReverseDepthEnabled(bool reverseDepthEnabled) { if (handle == Types.INVALID_HANDLE) { return; } HvrPlayerInterfaceAPI.Viewport_SetReverseDepthEnabled(handle, reverseDepthEnabled ? 1 : 0); }
public void SetDimensions(float x, float y, float width, float height) { if (handle == Types.INVALID_HANDLE) { return; } HvrPlayerInterfaceAPI.Viewport_SetDimensions(handle, x, y, width, height); }
public float GetActualTime() { if (handle == Types.INVALID_HANDLE) { return(0); } return(HvrPlayerInterfaceAPI.Asset_GetActualTime(handle)); }
public void SetShaderSubroutines(string code) { if (handle == Types.INVALID_HANDLE) { return; } HvrPlayerInterfaceAPI.RenderMethod_SetShaderSubroutines(handle, code); }
public void Update(float absoluteTime) { if (handle == Types.INVALID_HANDLE) { return; } HvrPlayerInterfaceAPI.Asset_Update(handle, absoluteTime); }
public void SetSubroutineUniformFloat(string uniformName, float value) { if (m_handle == HVR.Interface.Types.INVALID_HANDLE) { return; } HvrPlayerInterfaceAPI.Actor_SetSubroutineUniformFloat(handle, uniformName, value); }
public float GetDuration() { if (handle == Types.INVALID_HANDLE) { return(0); } return(HvrPlayerInterfaceAPI.Asset_GetDuration(handle)); }
public bool IsValid() { if (m_handle == Types.INVALID_HANDLE) { return(false); } return(HvrPlayerInterfaceAPI.Actor_IsValid(m_handle)); }
public void SetShaderSubroutinesArray(string[] code) { if (handle == HVR.Interface.Types.INVALID_HANDLE) { return; } HvrPlayerInterfaceAPI.RenderMethod_SetShaderSubroutinesArray(handle, code, code.Length); }
public void SetAsset(int _assethandle) { if (m_handle == Types.INVALID_HANDLE) { return; } HvrPlayerInterfaceAPI.Actor_SetAsset(m_handle, _assethandle); }
public int GetVoxelCount() { if (handle == Types.INVALID_HANDLE) { return(0); } return(HvrPlayerInterfaceAPI.Asset_GetVoxelCount(handle)); }
public void SetProjMatrix(Matrix4x4 proj) { if (handle == Types.INVALID_HANDLE) { return; } var apiMat44 = HvrPlayerInterfaceHelper.GetMat44FromMatrix4x4(proj); HvrPlayerInterfaceAPI.Viewport_SetProjMatrix(handle, apiMat44); }
public void SetLooping(bool looping) { if (handle == Types.INVALID_HANDLE) { return; } m_isLooping = looping; HvrPlayerInterfaceAPI.Asset_SetLooping(handle, looping); }
public static bool IsInitialized() { if (!HvrHelper.Support.IsApplicationStateSupported()) { return(false); } bool initialized = HvrPlayerInterfaceAPI.Interface_IsInitialised(); return(initialized); }
public bool IsValid() { if (handle == Types.INVALID_HANDLE) { return(false); } bool valid = HvrPlayerInterfaceAPI.Viewport_IsValid(handle); return(valid); }
public static string RenderMethod_GetTypeAtIndex(int idx) { StringBuilder stringBuilder = new StringBuilder(256); if (HvrPlayerInterfaceAPI.Interface_GetRenderMethodType(idx, stringBuilder, stringBuilder.Capacity)) { return(stringBuilder.ToString()); } return(""); }
public void SetSubroutineUniformTexture2D(string uniformName, Texture texture) { if (m_handle == HVR.Interface.Types.INVALID_HANDLE) { return; } IntPtr nativePtr = texture.GetNativeTexturePtr(); HvrPlayerInterfaceAPI.Actor_SetSubroutineUniformTexture2D(handle, uniformName, HvrScene.ScenePlayerHandle(), nativePtr); }
public void SetSubroutineUniformVec2(string uniformName, Vector2 value) { if (m_handle == HVR.Interface.Types.INVALID_HANDLE) { return; } CommonTypes.Vec2 vec2 = new CommonTypes.Vec2 { x = value.x, y = value.y }; HvrPlayerInterfaceAPI.Actor_SetSubroutineUniformVec2(handle, uniformName, ref vec2); }
private void Create() { if (!HvrHelper.Support.IsApplicationStateSupported()) { return; } try { UnityInterface.Lock(); if (HvrPlayerInterface.Initialise()) { m_handle = HvrPlayerInterfaceAPI.Viewport_Create(); #if VERBOSE_LOGGING Debug.Log("Create " + GetType().Name + " Handle:" + handle); #endif UnityInterface.SceneObjectsAdd(handle, GetType().Name + handle, GetType().FullName); #if UNITY_5_5_OR_NEWER // No C# macro for reversed depth configuration. The only reference is: https://docs.unity3d.com/Manual/SL-PlatformDifferences.html if (SystemInfo.graphicsDeviceType == GraphicsDeviceType.Direct3D11 || SystemInfo.graphicsDeviceType == GraphicsDeviceType.Direct3D12 || SystemInfo.graphicsDeviceType == GraphicsDeviceType.PlayStation4 || SystemInfo.graphicsDeviceType == GraphicsDeviceType.XboxOne || SystemInfo.graphicsDeviceType == GraphicsDeviceType.Metal) { SetReverseDepthEnabled(true); } else { SetReverseDepthEnabled(false); } #else SetReverseDepthEnabled(false); #endif SetColorSpace(QualitySettings.activeColorSpace); } } catch (Exception e) { Debug.LogError(e.Message); } finally { UnityInterface.Unlock(); } }
public void Pause() { if (handle == Types.INVALID_HANDLE) { return; } HvrPlayerInterfaceAPI.Asset_Pause(handle); if (onPause != null) { onPause(); } }
public void Step(int frames) { if (handle == Types.INVALID_HANDLE) { return; } HvrPlayerInterfaceAPI.Asset_Step(handle, frames); if (onStop != null) { onStop(); } }
public void Stop() { if (handle == Types.INVALID_HANDLE) { return; } HvrPlayerInterfaceAPI.Asset_Pause(handle); HvrPlayerInterfaceAPI.Asset_Seek(handle, 0); if (onStop != null) { onStop(); } }