Commit 47a51cfd authored by Fonseka W.M.D.R's avatar Fonseka W.M.D.R

Update

parent 50ea03f9
fileFormatVersion: 2
guid: b9da22a96aa2b42d98498bb88b1338d3
folderAsset: yes
timeCreated: 1522854863
licenseType: Pro
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 5e182918f0b8c4929a3d4b0af0ed6f56
timeCreated: 1523391965
licenseType: Pro
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: e1e9a08d000a446c9ad506ecb3a4d083
folderAsset: yes
timeCreated: 1513969093
licenseType: Pro
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: b2c4e904b5e6b425f8ab111db67d7908
folderAsset: yes
timeCreated: 1497981256
licenseType: Pro
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: ARBackground
m_Shader: {fileID: 4800000, guid: 025775b2b3616154f9eec0261bb8a581, type: 3}
m_ShaderKeywords:
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _BumpMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailAlbedoMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMask:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailNormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MetallicGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
- _BumpScale: 1
- _Cutoff: 0.5
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _GlossMapScale: 1
- _Glossiness: 0.5
- _GlossyReflections: 1
- _Metallic: 0
- _Mode: 0
- _OcclusionStrength: 1
- _Parallax: 0.02
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _UVSec: 0
- _ZWrite: 1
m_Colors:
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _UvBottomLeftRight: {r: 0, g: 0, b: 1, a: 0}
- _UvTopLeftRight: {r: 0, g: 1, b: 1, a: 1}
fileFormatVersion: 2
guid: 03ad0130a037647aeb60218f61aca114
timeCreated: 1498003566
licenseType: Pro
NativeFormatImporter:
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:
Shader "ARCore/ARBackground"
{
Properties {
_MainTex ("Main Texture", 2D) = "white" {}
_UvTopLeftRight ("UV of top corners", Vector) = (0, 1, 1, 1)
_UvBottomLeftRight ("UV of bottom corners", Vector) = (0 , 0, 1, 0)
}
// For GLES3 or GLES2 on device
SubShader
{
Pass
{
ZWrite Off
Cull Off
GLSLPROGRAM
#pragma only_renderers gles3 gles
#ifdef SHADER_API_GLES3
#extension GL_OES_EGL_image_external_essl3 : require
#else
#extension GL_OES_EGL_image_external : require
#endif
uniform vec4 _UvTopLeftRight;
uniform vec4 _UvBottomLeftRight;
// Use the same method in UnityCG.cginc to convert from gamma to linear space in glsl.
vec3 GammaToLinearSpace(vec3 color)
{
return color * (color * (color * 0.305306011 + 0.682171111) + 0.012522878);
}
#ifdef VERTEX
varying vec2 textureCoord;
varying vec2 uvCoord;
void main()
{
vec2 uvTop = mix(_UvTopLeftRight.xy, _UvTopLeftRight.zw, gl_MultiTexCoord0.x);
vec2 uvBottom = mix(_UvBottomLeftRight.xy, _UvBottomLeftRight.zw, gl_MultiTexCoord0.x);
textureCoord = mix(uvTop, uvBottom, gl_MultiTexCoord0.y);
uvCoord = vec2(gl_MultiTexCoord0.x, gl_MultiTexCoord0.y);
gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
}
#endif
#ifdef FRAGMENT
varying vec2 textureCoord;
varying vec2 uvCoord;
uniform samplerExternalOES _MainTex;
uniform sampler2D _TransitionIconTex;
uniform vec4 _TransitionIconTexTransform;
uniform float _Brightness;
void main()
{
vec3 mainTexColor;
#ifdef SHADER_API_GLES3
mainTexColor = texture(_MainTex, textureCoord).rgb;
#else
mainTexColor = textureExternal(_MainTex, textureCoord).rgb;
#endif
if (_Brightness < 1.0)
{
mainTexColor = mainTexColor * _Brightness;
if (_TransitionIconTexTransform.x > 0.0 && _TransitionIconTexTransform.z > 0.0)
{
vec2 uvCoordTex = vec2(uvCoord.x * _TransitionIconTexTransform.x + _TransitionIconTexTransform.y,
uvCoord.y * _TransitionIconTexTransform.z + _TransitionIconTexTransform.w);
vec4 transitionColor = vec4(0.0);
if (uvCoordTex.x >= 0.0 && uvCoordTex.x <= 1.0 && uvCoordTex.y >= 0.0 && uvCoordTex.y <= 1.0)
{
transitionColor = texture2D(_TransitionIconTex, uvCoordTex);
}
if (transitionColor.a > 0.0)
{
mainTexColor = mix(transitionColor.rgb, mainTexColor, _Brightness);
}
}
}
#ifndef UNITY_COLORSPACE_GAMMA
mainTexColor = GammaToLinearSpace(mainTexColor);
#endif
gl_FragColor = vec4(mainTexColor, 1.0);
}
#endif
ENDGLSL
}
}
// For Instant Preview
Subshader
{
Pass
{
ZWrite Off
CGPROGRAM
#pragma exclude_renderers gles3 gles
#pragma vertex vert
#pragma fragment frag
#include "UnityCG.cginc"
uniform float4 _UvTopLeftRight;
uniform float4 _UvBottomLeftRight;
struct appdata
{
float4 vertex : POSITION;
float2 uv : TEXCOORD0;
};
struct v2f
{
float2 uv : TEXCOORD0;
float4 vertex : SV_POSITION;
};
v2f vert(appdata v)
{
float2 uvTop = lerp(_UvTopLeftRight.xy, _UvTopLeftRight.zw, v.uv.x);
float2 uvBottom = lerp(_UvBottomLeftRight.xy, _UvBottomLeftRight.zw, v.uv.x);
v2f o;
o.vertex = UnityObjectToClipPos(v.vertex);
o.uv = lerp(uvTop, uvBottom, v.uv.y);
// Instant preview's texture is transformed differently.
o.uv = o.uv.yx;
o.uv.x = 1.0 - o.uv.x;
return o;
}
sampler2D _MainTex;
fixed4 frag(v2f i) : SV_Target
{
return tex2D(_MainTex, i.uv);
}
ENDCG
}
}
FallBack Off
}
fileFormatVersion: 2
guid: 025775b2b3616154f9eec0261bb8a581
timeCreated: 1510285086
licenseType: Pro
ShaderImporter:
externalObjects: {}
defaultTextures: []
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 93be2b9777c348648a2d9151b7e233fc
folderAsset: yes
timeCreated: 1501825151
licenseType: Free
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 0ccae430f209841809a6e35e22b8a746
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
isPreloaded: 0
isOverridable: 0
platformData:
- first:
'': Any
second:
enabled: 0
settings:
Exclude Android: 1
Exclude Editor: 0
Exclude Linux: 1
Exclude Linux64: 1
Exclude LinuxUniversal: 1
Exclude OSXUniversal: 1
Exclude Win: 1
Exclude Win64: 1
Exclude iOS: 1
- first:
Android: Android
second:
enabled: 0
settings:
CPU: ARMv7
- first:
Any:
second:
enabled: 0
settings: {}
- first:
Editor: Editor
second:
enabled: 1
settings:
CPU: AnyCPU
DefaultValueInitialized: true
OS: AnyOS
- first:
Facebook: Win
second:
enabled: 0
settings:
CPU: AnyCPU
- first:
Facebook: Win64
second:
enabled: 0
settings:
CPU: AnyCPU
- first:
Standalone: Linux
second:
enabled: 0
settings:
CPU: x86
- first:
Standalone: Linux64
second:
enabled: 0
settings:
CPU: x86_64
- first:
Standalone: LinuxUniversal
second:
enabled: 0
settings:
CPU: None
- first:
Standalone: OSXUniversal
second:
enabled: 0
settings:
CPU: AnyCPU
- first:
Standalone: Win
second:
enabled: 0
settings:
CPU: AnyCPU
- first:
Standalone: Win64
second:
enabled: 0
settings:
CPU: AnyCPU
- first:
Windows Store Apps: WindowsStoreApps
second:
enabled: 0
settings:
CPU: AnyCPU
- first:
iPhone: iOS
second:
enabled: 0
settings:
CompileFlags:
FrameworkDependencies:
userData:
assetBundleName:
assetBundleVariant:
#import <ARKit/ARKit.h>
@interface ARSessionCast : NSObject <ARSessionDelegate>
{
@public
ARSession* _session;
}
@end
@implementation ARSessionCast
extern "C" ARSession* ARCoreARKitIntegration_castUnitySessionToARKitSession(void* sessionToCast)
{
ARSessionCast *nativeSession = (__bridge ARSessionCast*)(sessionToCast);
ARSession* session = nativeSession->_session;
return session;
}
extern "C" ARFrame* ARCoreARKitIntegration_getCurrentFrame(ARSession* arkitSession)
{
return arkitSession.currentFrame;
}
@end
fileFormatVersion: 2
guid: df35767d8f34c46728297c632ecf7137
timeCreated: 1524446113
licenseType: Pro
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
isPreloaded: 0
isOverridable: 0
platformData:
- first:
Any:
second:
enabled: 0
settings: {}
- first:
Editor: Editor
second:
enabled: 0
settings:
DefaultValueInitialized: true
- first:
iPhone: iOS
second:
enabled: 1
settings: {}
- first:
tvOS: tvOS
second:
enabled: 1
settings: {}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 19eddef6ceb6961489b26fb8bf19f1e5
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
isPreloaded: 0
isOverridable: 0
platformData:
- first:
'': Any
second:
enabled: 0
settings:
Exclude Android: 1
Exclude Editor: 1
Exclude Linux: 1
Exclude Linux64: 1
Exclude LinuxUniversal: 1
Exclude OSXUniversal: 1
Exclude Win: 1
Exclude Win64: 1
- first:
Android: Android
second:
enabled: 1
settings:
CPU: ARMv7
- first:
Any:
second:
enabled: 0
settings: {}
- first:
Editor: Editor
second:
enabled: 0
settings:
CPU: AnyCPU
DefaultValueInitialized: true
OS: AnyOS
- first:
Facebook: Win
second:
enabled: 0
settings:
CPU: AnyCPU
- first:
Facebook: Win64
second:
enabled: 0
settings:
CPU: AnyCPU
- first:
Standalone: Linux
second:
enabled: 0
settings:
CPU: x86
- first:
Standalone: Linux64
second:
enabled: 0
settings:
CPU: x86_64
- first:
Standalone: OSXUniversal
second:
enabled: 0
settings:
CPU: AnyCPU
- first:
Standalone: Win
second:
enabled: 0
settings:
CPU: AnyCPU
- first:
Standalone: Win64
second:
enabled: 0
settings:
CPU: AnyCPU
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 8b5f241daea88403ca45c401c716a96e
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
isPreloaded: 0
isOverridable: 0
platformData:
- first:
Android: Android
second:
enabled: 1
settings: {}
- first:
Any:
second:
enabled: 0
settings: {}
- first:
Editor: Editor
second:
enabled: 0
settings:
DefaultValueInitialized: true
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: e7fd0eeb9fc68483682cd9e3012d15a5
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
isPreloaded: 0
isOverridable: 0
platformData:
- first:
'': Any
second:
enabled: 0
settings:
Exclude Android: 1
Exclude Editor: 1
Exclude Linux: 1
Exclude Linux64: 1
Exclude LinuxUniversal: 1
Exclude OSXUniversal: 1
Exclude Win: 1
Exclude Win64: 1
Exclude iOS: 1
- first:
Android: Android
second:
enabled: 1
settings:
CPU: ARMv7
- first:
Any:
second:
enabled: 0
settings: {}
- first:
Editor: Editor
second:
enabled: 0
settings:
CPU: AnyCPU
DefaultValueInitialized: true
OS: AnyOS
- first:
Facebook: Win
second:
enabled: 0
settings:
CPU: AnyCPU
- first:
Facebook: Win64
second:
enabled: 0
settings:
CPU: AnyCPU
- first:
Standalone: Linux
second:
enabled: 0
settings:
CPU: x86
- first:
Standalone: Linux64
second:
enabled: 0
settings:
CPU: x86_64
- first:
Standalone: OSXUniversal
second:
enabled: 0
settings:
CPU: AnyCPU
- first:
Standalone: Win
second:
enabled: 0
settings:
CPU: AnyCPU
- first:
Standalone: Win64
second:
enabled: 0
settings:
CPU: AnyCPU
- first:
iPhone: iOS
second:
enabled: 0
settings:
CompileFlags:
FrameworkDependencies:
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: e2fd4640a9f7349438a5920ea2fb35f2
timeCreated: 1518222616
licenseType: Pro
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
isPreloaded: 0
isOverridable: 0
platformData:
- first:
Android: Android
second:
enabled: 1
settings: {}
- first:
Any:
second:
enabled: 0
settings: {}
- first:
Editor: Editor
second:
enabled: 0
settings:
DefaultValueInitialized: true
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: cb4b89ba21eac484797cfca938a1a5ea
timeCreated: 1518222591
licenseType: Pro
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
isPreloaded: 0
isOverridable: 0
platformData:
- first:
Android: Android
second:
enabled: 1
settings: {}
- first:
Any:
second:
enabled: 0
settings: {}
- first:
Editor: Editor
second:
enabled: 0
settings:
DefaultValueInitialized: true
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: bd091fc8013c942f586c1672b8ee2b27
timeCreated: 1500400815
licenseType: Free
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
isPreloaded: 0
isOverridable: 0
platformData:
- first:
Android: Android
second:
enabled: 1
settings: {}
- first:
Any:
second:
enabled: 0
settings: {}
- first:
Editor: Editor
second:
enabled: 0
settings:
DefaultValueInitialized: true
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: f62612db4b24deb43ada3a769754a2f7
timeCreated: 1503511556
licenseType: Free
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
isPreloaded: 0
isOverridable: 0
platformData:
- first:
Android: Android
second:
enabled: 1
settings: {}
- first:
Any:
second:
enabled: 0
settings: {}
- first:
Editor: Editor
second:
enabled: 0
settings:
DefaultValueInitialized: true
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: bc343a1493a8b4f7497b9e075fc86957
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 3d39dfe2aa0c94827bb1460f2cdced63
TextureImporter:
fileIDToRecycleName: {}
externalObjects: {}
serializedVersion: 4
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: -1
aniso: -1
mipBias: -1
wrapU: -1
wrapV: -1
wrapW: -1
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
platformSettings:
- buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
spritePackingTag:
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 8f3875959d8dd4bdeb9620e0eb96fb3b
folderAsset: yes
timeCreated: 1501446012
licenseType: Free
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
//-----------------------------------------------------------------------
// <copyright file="ARCoreBackgroundRenderer.cs" company="Google">
//
// Copyright 2017 Google Inc. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// </copyright>
//-----------------------------------------------------------------------
namespace GoogleARCore
{
using System.Collections;
using System.Collections.Generic;
using GoogleARCoreInternal;
using UnityEngine;
using UnityEngine.Rendering;
/// <summary>
/// Renders the device's camera as a background to the attached Unity camera component.
/// When using the front-facing (selfie) camera, this temporarily inverts culling when
/// rendering.
/// </summary>
[RequireComponent(typeof(Camera))]
[HelpURL("https://developers.google.com/ar/reference/unity/class/GoogleARCore/" +
"ARCoreBackgroundRenderer")]
public class ARCoreBackgroundRenderer : MonoBehaviour
{
/// <summary>
/// A material used to render the AR background image.
/// </summary>
[Tooltip("A material used to render the AR background image.")]
public Material BackgroundMaterial;
private static readonly float k_BlackScreenDuration = 0.5f;
private static readonly float k_FadingInDuration = 0.5f;
private Camera m_Camera;
private Texture m_TransitionImageTexture;
private BackgroundTransitionState m_TransitionState = BackgroundTransitionState.BlackScreen;
private float m_CurrentStateElapsed = 0.0f;
private bool m_SessionEnabled = false;
private bool m_UserInvertCullingValue = false;
private CameraClearFlags m_CameraClearFlags = CameraClearFlags.Skybox;
private CommandBuffer m_CommandBuffer = null;
private enum BackgroundTransitionState
{
BlackScreen = 0,
FadingIn = 1,
CameraImage = 2,
}
private void OnEnable()
{
if (BackgroundMaterial == null)
{
Debug.LogError("ArCameraBackground:: No material assigned.");
return;
}
LifecycleManager.Instance.OnSessionSetEnabled += _OnSessionSetEnabled;
m_Camera = GetComponent<Camera>();
m_TransitionImageTexture = Resources.Load<Texture2D>("ViewInARIcon");
BackgroundMaterial.SetTexture("_TransitionIconTex", m_TransitionImageTexture);
EnableARBackgroundRendering();
}
private void OnDisable()
{
LifecycleManager.Instance.OnSessionSetEnabled -= _OnSessionSetEnabled;
m_TransitionState = BackgroundTransitionState.BlackScreen;
m_CurrentStateElapsed = 0.0f;
m_Camera.ResetProjectionMatrix();
DisableARBackgroundRendering();
}
private void OnPreRender()
{
m_UserInvertCullingValue = GL.invertCulling;
var sessionComponent = LifecycleManager.Instance.SessionComponent;
if (sessionComponent != null &&
sessionComponent.DeviceCameraDirection == DeviceCameraDirection.FrontFacing)
{
GL.invertCulling = true;
}
}
private void OnPostRender()
{
GL.invertCulling = m_UserInvertCullingValue;
}
private void Update()
{
m_CurrentStateElapsed += Time.deltaTime;
_UpdateState();
_UpdateShaderVariables();
}
private void _UpdateState()
{
if (!m_SessionEnabled && m_TransitionState != BackgroundTransitionState.BlackScreen)
{
m_TransitionState = BackgroundTransitionState.BlackScreen;
m_CurrentStateElapsed = 0.0f;
}
else if (m_SessionEnabled &&
m_TransitionState == BackgroundTransitionState.BlackScreen &&
m_CurrentStateElapsed > k_BlackScreenDuration)
{
m_TransitionState = BackgroundTransitionState.FadingIn;
m_CurrentStateElapsed = 0.0f;
}
else if (m_SessionEnabled &&
m_TransitionState == BackgroundTransitionState.FadingIn &&
m_CurrentStateElapsed > k_FadingInDuration)
{
m_TransitionState = BackgroundTransitionState.CameraImage;
m_CurrentStateElapsed = 0.0f;
}
}
private void _UpdateShaderVariables()
{
const string brightnessVar = "_Brightness";
if (m_TransitionState == BackgroundTransitionState.BlackScreen)
{
BackgroundMaterial.SetFloat(brightnessVar, 0.0f);
}
else if (m_TransitionState == BackgroundTransitionState.FadingIn)
{
BackgroundMaterial.SetFloat(
brightnessVar,
_CosineLerp(m_CurrentStateElapsed, k_FadingInDuration));
}
else
{
BackgroundMaterial.SetFloat(brightnessVar, 1.0f);
}
// Set transform of the transition image texture, it may be visible or invisible based
// on lerp value.
const string transformVar = "_TransitionIconTexTransform";
BackgroundMaterial.SetVector(transformVar, _TextureTransform());
// Background texture should not be rendered when the session is disabled or
// there is no camera image texture available.
if (m_TransitionState == BackgroundTransitionState.BlackScreen ||
Frame.CameraImage.Texture == null)
{
return;
}
const string mainTexVar = "_MainTex";
const string topLeftRightVar = "_UvTopLeftRight";
const string bottomLeftRightVar = "_UvBottomLeftRight";
BackgroundMaterial.SetTexture(mainTexVar, Frame.CameraImage.Texture);
var uvQuad = Frame.CameraImage.TextureDisplayUvs;
BackgroundMaterial.SetVector(
topLeftRightVar,
new Vector4(
uvQuad.TopLeft.x, uvQuad.TopLeft.y, uvQuad.TopRight.x, uvQuad.TopRight.y));
BackgroundMaterial.SetVector(
bottomLeftRightVar,
new Vector4(uvQuad.BottomLeft.x, uvQuad.BottomLeft.y, uvQuad.BottomRight.x,
uvQuad.BottomRight.y));
m_Camera.projectionMatrix = Frame.CameraImage.GetCameraProjectionMatrix(
m_Camera.nearClipPlane, m_Camera.farClipPlane);
}
private void _OnSessionSetEnabled(bool sessionEnabled)
{
m_SessionEnabled = sessionEnabled;
if (!m_SessionEnabled)
{
_UpdateState();
_UpdateShaderVariables();
}
}
private float _CosineLerp(float elapsed, float duration)
{
float clampedElapsed = Mathf.Clamp(elapsed, 0.0f, duration);
return Mathf.Cos(((clampedElapsed / duration) - 1) * (Mathf.PI / 2));
}
/// <summary>
/// Textures transform used in background shader to get texture uv coordinates based on
/// screen uv.
/// The transformation follows these equations:
/// textureUv.x = transform[0] * screenUv.x + transform[1],
/// textureUv.y = transform[2] * screenUv.y + transform[3].
/// </summary>
/// <returns>The transform.</returns>
private Vector4 _TextureTransform()
{
float transitionWidthTransform = (m_TransitionImageTexture.width - Screen.width) /
(2.0f * m_TransitionImageTexture.width);
float transitionHeightTransform = (m_TransitionImageTexture.height - Screen.height) /
(2.0f * m_TransitionImageTexture.height);
return new Vector4(
(float)Screen.width / m_TransitionImageTexture.width,
transitionWidthTransform,
(float)Screen.height / m_TransitionImageTexture.height,
transitionHeightTransform);
}
private void EnableARBackgroundRendering()
{
if (BackgroundMaterial == null || m_Camera == null)
{
return;
}
m_CameraClearFlags = m_Camera.clearFlags;
m_Camera.clearFlags = CameraClearFlags.Depth;
m_CommandBuffer = new CommandBuffer();
m_CommandBuffer.Blit(BackgroundMaterial.mainTexture,
BuiltinRenderTextureType.CameraTarget, BackgroundMaterial);
m_Camera.AddCommandBuffer(CameraEvent.BeforeForwardOpaque, m_CommandBuffer);
m_Camera.AddCommandBuffer(CameraEvent.BeforeGBuffer, m_CommandBuffer);
}
private void DisableARBackgroundRendering()
{
if (m_CommandBuffer == null || m_Camera == null)
{
return;
}
m_Camera.clearFlags = m_CameraClearFlags;
m_Camera.RemoveCommandBuffer(CameraEvent.BeforeForwardOpaque, m_CommandBuffer);
m_Camera.RemoveCommandBuffer(CameraEvent.BeforeGBuffer, m_CommandBuffer);
}
}
}
fileFormatVersion: 2
guid: eb172c260d42e4f62945afda50892c0c
timeCreated: 1510461368
licenseType: Free
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
//-----------------------------------------------------------------------
// <copyright file="ARCoreCameraConfigFilter.cs" company="Google">
//
// Copyright 2019 Google Inc. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// </copyright>
//-----------------------------------------------------------------------
namespace GoogleARCore
{
using System;
using UnityEngine;
/// <summary>
/// The ARCoreCameraConfigFilter class defines the set of features and device capabilities
/// an app would like to have available. This is used to derive a list of camera configurations
/// available on the device at runtime to select from.
///
/// NOTE: It is possible to select options in such a way that some devices will
/// have no available configurations at runtime. In this case your app will not run.
///
/// An app may adjust its capabilities at runtime by selecting a wider range of config filters
/// and using <see cref="ARCoreSession.RegisterChooseCameraConfigurationCallback(
/// ARCoreSession.OnChooseCameraConfigurationDelegate)"/> to specify a selection function.
/// In that function the app may then adjust its runtime settings and select an appropriate
/// camera configuration. If no callback is registered, ARCore will use the first
/// CameraConfig in the list of available configurations.
/// </summary>
[CreateAssetMenu(
fileName = "ARCoreCameraConfigFilter",
menuName = "Google ARCore/CameraConfigFilter",
order = 2)]
public class ARCoreCameraConfigFilter : ScriptableObject
{
/// <summary>
/// Camera Frame Rates Filter.
/// </summary>
public TargetCameraFramerateFilter TargetCameraFramerate;
/// <summary>
/// Depth Sensor Usage Filter.
/// </summary>
public DepthSensorUsageFilter DepthSensorUsage;
/// <summary>
/// Unity OnValidate().
/// </summary>
public void OnValidate()
{
if (!TargetCameraFramerate.Target30FPS && !TargetCameraFramerate.Target60FPS)
{
Debug.LogError("No options in Target Camera Framerate are selected, " +
"there will be no camera configs and this app will fail to run.");
}
else if (!TargetCameraFramerate.Target30FPS)
{
Debug.LogWarning("Framerate30FPS is not selected, this may cause " +
"no camera config be available for this filter and " +
"the app may not run on all devices.");
}
if (!DepthSensorUsage.DoNotUse && !DepthSensorUsage.RequireAndUse)
{
Debug.LogError("No options in Depth Senor Usage are selected, " +
"there will be no camera configs and this app will fail to run.");
}
else if (!DepthSensorUsage.DoNotUse)
{
Debug.LogWarning("DoNotUseDepthSensor is not selected, this may cause " +
"no camera config be available for this filter and " +
"the app may not run on all devices.");
}
}
/// <summary>
/// Target Camera Frame Rates.
/// </summary>
[Serializable]
public class TargetCameraFramerateFilter
{
/// <summary>
/// Target 30fps camera capture frame rate.
///
/// Available on all ARCore supported devices.
/// </summary>
[Tooltip("Target 30fps camera capture frame rate. " +
"Available on all ARCore supported devices.")]
public bool Target30FPS = true;
/// <summary>
/// Target 60fps camera capture frame rate.
///
/// Increases power consumption and may increase app memory usage.
///
/// See the ARCore Supported Devices
/// (https://developers.google.com/ar/discover/supported-devices) page for a list of
/// devices that currently support 60fps.
/// </summary>
[Tooltip("Target 60fps camera capture frame rate on supported devices.")]
public bool Target60FPS = true;
}
/// <summary>
/// Depth Sensor Usage.
/// </summary>
[Serializable]
public class DepthSensorUsageFilter
{
/// <summary>
/// Filters for camera configs that require a depth sensor to be present on the device,
/// and that will be used by ARCore.
///
/// See the ARCore Supported Devices
/// (https://developers.google.com/ar/discover/supported-devices) page for a list of
/// devices that currently have supported depth sensors.
/// </summary>
[Tooltip("ARCore requires a depth sensor to be present and will use it. " +
"Not supported on all devices.")]
public bool RequireAndUse = true;
/// <summary>
/// Filters for camera configs where a depth sensor is not present, or is present but
/// will not be used by ARCore.
///
/// Most commonly used to filter camera configurations when the app requires exclusive
/// access to the depth sensor outside of ARCore, for example to support 3D mesh
/// reconstruction. Available on all ARCore supported devices.
/// </summary>
[Tooltip("ARCore will not use the depth sensor, even if it is present. " +
"Available on all supported devices.")]
public bool DoNotUse = true;
}
}
}
fileFormatVersion: 2
guid: b83ecd5d5b839470785ea023279af3c5
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
//-----------------------------------------------------------------------
// <copyright file="ARCoreSession.cs" company="Google">
//
// Copyright 2017 Google Inc. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// </copyright>
//-----------------------------------------------------------------------
namespace GoogleARCore
{
using System.Collections.Generic;
using GoogleARCoreInternal;
using UnityEngine;
/// <summary>
/// A component that manages the ARCore Session in a Unity scene.
/// </summary>
[HelpURL("https://developers.google.com/ar/reference/unity/class/GoogleARCore/ARCoreSession")]
public class ARCoreSession : MonoBehaviour
{
/// <summary>
/// The direction of the device camera used by the session.
/// </summary>
/// <remarks>
/// Note that changing this value will trigger a re-initialization of session. ARCore
/// tracking data (e.g. Trackables) are not shared between cameras.
/// </remarks>
[Tooltip("The direction of the device camera used by the session.")]
public DeviceCameraDirection DeviceCameraDirection = DeviceCameraDirection.BackFacing;
/// <summary>
/// A scriptable object specifying the ARCore session configuration.
/// </summary>
[Tooltip("A scriptable object specifying the ARCore session configuration.")]
public ARCoreSessionConfig SessionConfig;
/// <summary>
/// The camera configuration filter object that defines the set of
/// properties desired or required by the app to run.
/// </summary>
[Tooltip("Configuration options to select the camera mode and features.")]
public ARCoreCameraConfigFilter CameraConfigFilter;
private OnChooseCameraConfigurationDelegate m_OnChooseCameraConfiguration;
/// <summary>
/// Selects a camera configuration for the ARCore session being resumed.
/// </summary>
/// <param name="supportedConfigurations">
/// A list of supported camera configurations. Currently it contains 3 camera configs.
/// The GPU texture resolutions are the same in all three configs.
/// Currently, most devices provide GPU texture resolution of 1920 x 1080,
/// but devices might provide higher or lower resolution textures, depending
/// on device capabilities. The CPU image resolutions returned are VGA, 720p,
/// and a resolution matching the GPU texture.</param>
/// <returns>The index of the camera configuration in <c>supportedConfigurations</c> to be
/// used for the ARCore session. If the return value is not a valid index (e.g. the value
/// -1), then no camera configuration will be set and the ARCore session will use the
/// previously selected camera configuration or a default configuration if no previous
/// selection exists.</returns>
public delegate int OnChooseCameraConfigurationDelegate(
List<CameraConfig> supportedConfigurations);
/// <summary>
/// Unity Awake.
/// </summary>
[SuppressMemoryAllocationError(Reason = "Could create new LifecycleManager")]
public virtual void Awake()
{
if (SessionConfig != null &&
SessionConfig.LightEstimationMode != LightEstimationMode.Disabled &&
Object.FindObjectsOfType<EnvironmentalLight>().Length == 0)
{
Debug.Log("Light Estimation may not work properly when EnvironmentalLight is not" +
" attached to the scene.");
}
LifecycleManager.Instance.CreateSession(this);
}
/// <summary>
/// Unity OnDestroy.
/// </summary>
[SuppressMemoryAllocationError(
IsWarning = true, Reason = "Requires further investigation.")]
public virtual void OnDestroy()
{
LifecycleManager.Instance.ResetSession();
}
/// <summary>
/// Unity OnEnable.
/// </summary>
[SuppressMemoryAllocationError(
Reason = "Enabling session creates a new ARSessionConfiguration")]
public void OnEnable()
{
LifecycleManager.Instance.EnableSession();
}
/// <summary>
/// Unity OnDisable.
/// </summary>
[SuppressMemoryAllocationError(
IsWarning = true, Reason = "Requires further investigation.")]
public void OnDisable()
{
LifecycleManager.Instance.DisableSession();
}
/// <summary>
/// Unity OnValidate.
/// </summary>
public void OnValidate()
{
if (DeviceCameraDirection == DeviceCameraDirection.FrontFacing && SessionConfig != null)
{
if (SessionConfig.PlaneFindingMode != DetectedPlaneFindingMode.Disabled)
{
Debug.LogErrorFormat("Plane Finding requires back-facing camera.");
}
if (SessionConfig.LightEstimationMode ==
LightEstimationMode.EnvironmentalHDRWithoutReflections ||
SessionConfig.LightEstimationMode ==
LightEstimationMode.EnvironmentalHDRWithReflections)
{
Debug.LogErrorFormat("LightEstimationMode.{0} is incompatible with" +
"front-facing (selfie) camera.", SessionConfig.LightEstimationMode);
}
if (SessionConfig.EnableCloudAnchor)
{
Debug.LogErrorFormat("Cloud Anchors require back-facing camera.");
}
if (SessionConfig.AugmentedImageDatabase != null)
{
Debug.LogErrorFormat("Augmented Images require back-facing camera.");
}
}
if (DeviceCameraDirection == DeviceCameraDirection.BackFacing &&
SessionConfig != null && SessionConfig.AugmentedFaceMode !=
AugmentedFaceMode.Disabled)
{
Debug.LogErrorFormat("AugmentedFaceMode.{0} requires front-facing (selfie) camera.",
SessionConfig.AugmentedFaceMode);
}
if (SessionConfig == null)
{
Debug.LogError("SessionConfig is required by ARCoreSession.");
}
if (CameraConfigFilter == null)
{
Debug.LogError("CameraConfigFilter is required by ARCoreSession. " +
"To get all available configurations, set CameraConfigFilter to " +
"a filter with all options selected.");
}
}
/// <summary>
/// Registers a callback that allows a camera configuration to be selected from a list of
/// valid configurations.
/// The callback should be registered before the ARCore session is enabled
/// to ensure it is triggered on the first frame update.
/// The callback will then be invoked each time the ARCore session is resumed
/// which can happen when the ARCoreSession component becomes enabled or the Android
/// application moves from 'paused' to 'resumed' state.
/// Note: Starting in ARCore 1.12, changing the active camera config will make existing
/// anchors and trackables fail to regain tracking.
/// </summary>
/// <param name="onChooseCameraConfiguration">The callback to register for selecting a
/// camera configuration.</param>
public void RegisterChooseCameraConfigurationCallback(
OnChooseCameraConfigurationDelegate onChooseCameraConfiguration)
{
m_OnChooseCameraConfiguration = onChooseCameraConfiguration;
}
internal OnChooseCameraConfigurationDelegate GetChooseCameraConfigurationCallback()
{
return m_OnChooseCameraConfiguration;
}
}
}
fileFormatVersion: 2
guid: d4ca0c6a3af6b4635b7e98c6ea0a0cf9
timeCreated: 1510461671
licenseType: Free
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
//-----------------------------------------------------------------------
// <copyright file="ARCoreSessionConfig.cs" company="Google">
//
// Copyright 2017 Google Inc. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// </copyright>
//-----------------------------------------------------------------------
namespace GoogleARCore
{
using GoogleARCoreInternal;
using UnityEngine;
using UnityEngine.Serialization;
/// <summary>
/// Holds settings that are used to configure the session.
/// </summary>
[CreateAssetMenu(
fileName = "ARCoreSessionConfig", menuName = "Google ARCore/SessionConfig", order = 1)]
[HelpURL(
"https://developers.google.com/ar/reference/unity/class/GoogleARCore/ARCoreSessionConfig")]
public class ARCoreSessionConfig : ScriptableObject
{
[Header("Performance")]
/// <summary>
/// Toggles whether ARCore may introduce a delay into Unity's frame update to
/// match the rate that the camera sensor is delivering frames (this is 30 frames-per-second
/// on most devices). Enabling this setting can reduce power consumption caused by
/// rendering the same background texture more than once. Since enabling this setting also
/// sets QualitySetting.vSyncCount to 0 the entire Unity application (e.g animations, UI)
/// will also update at the camera sensor frame rate.
///
/// Note that enabling this setting does not guarentee each Unity frame will have a new and
/// unique camera background texture. This is because the period of time ARCore will wait
/// for a new camera frame to become available is capped (currently at 66ms) to avoid a
/// deadlock.
/// </summary>
[Tooltip(
"Toggles whether the rendering frame rate matches the background camera frame rate")]
public bool MatchCameraFramerate = true;
[Header("Plane Finding")]
/// <summary>
/// Chooses which plane finding mode will be used.
/// </summary>
[Tooltip("Chooses which plane finding mode will be used.")]
[FormerlySerializedAs("EnablePlaneFinding")]
public DetectedPlaneFindingMode PlaneFindingMode =
DetectedPlaneFindingMode.HorizontalAndVertical;
[Header("Light Estimation")]
/// <summary>
/// Choose which light estimation mode will be used.
/// </summary>
[Tooltip("Chooses which light estimation mode will be used in ARCore session.")]
[FormerlySerializedAs("EnableLightEstimation")]
[Help("When \"Environmental HDR Without Reflections\" light is selected, ARCore:\n" +
"1. Updates rotation and color of the directional light on the " +
"EnvironmentalLight component.\n" +
"2. Updates Skybox ambient lighting Spherical Harmonics.\n\n" +
"When \"Environmental HDR With Reflections\" light is selected, ARCore also:\n" +
"3. Overrides the environmental reflections in the scene with a " +
"realtime reflections cubemap.")]
public LightEstimationMode LightEstimationMode =
LightEstimationMode.EnvironmentalHDRWithReflections;
[Header("Cloud Anchors")]
/// <summary>
/// Toggles whether the Cloud Anchors are enabled.
/// </summary>
[Tooltip("Toggles whether the Cloud Anchors are enabled.")]
public bool EnableCloudAnchor = false;
[Header("Augmented Images")]
/// <summary>
/// The database to use for detecting AugmentedImage Trackables.
/// When this value is null, Augmented Image detection is disabled.
/// </summary>
[Tooltip("The database to use for detecting AugmentedImage Trackables.")]
public AugmentedImageDatabase AugmentedImageDatabase;
[Header("Camera")]
/// <summary>
/// Chooses the desired focus mode to be used by the ARCore camera.
/// </summary>
/// <remarks>
/// Currently, the default focus mode is <see cref="CameraFocusMode"/>.<c>Fixed</c>, but this
/// default might change in the future. Note, on devices where ARCore does not support auto
/// focus due to the use of a fixed focus camera, focus mode will remain
/// <see cref="CameraFocusMode"/>.<c>Fixed</c>. See the
/// <a href="https://developers.google.com/ar/discover/supported-devices">
/// ARCore Supported Devices</a> page for a list of affected devices.
/// </remarks>
[Tooltip("Chooses the desired focus mode to be used by the ARCore camera.")]
public CameraFocusMode CameraFocusMode = CameraFocusMode.Fixed;
/// <summary>
/// Chooses which <see cref="GoogleARCore.AugmentedFaceMode"/> the ARCore session uses.
/// </summary>
public AugmentedFaceMode AugmentedFaceMode = AugmentedFaceMode.Disabled;
/// <summary>
/// Gets or sets a value indicating whether PlaneFinding is enabled.
/// </summary>
[System.Obsolete(
"This field has be replaced by ARCoreSessionConfig.DetectedPlaneFindingMode. See " +
"https://github.com/google-ar/arcore-unity-sdk/releases/tag/v1.2.0")]
public bool EnablePlaneFinding
{
get
{
return PlaneFindingMode != DetectedPlaneFindingMode.Disabled;
}
set
{
PlaneFindingMode = value ? DetectedPlaneFindingMode.HorizontalAndVertical :
DetectedPlaneFindingMode.Disabled;
}
}
/// <summary>
/// Gets or sets a value indicating whether light estimation is enabled.
/// </summary>
/// <value><c>true</c> if enable light estimation; otherwise, <c>false</c>.</value>
/// @deprecated Please use ARCoreSessionConfig.LightEstimationMode instead.
[System.Obsolete(
"This field has been replaced by ARCoreSessionConfig.LightEstimationMode. See " +
"https://github.com/google-ar/arcore-unity-sdk/releases/tag/v1.10.0")]
public bool EnableLightEstimation
{
get
{
return LightEstimationMode != LightEstimationMode.Disabled;
}
set
{
LightEstimationMode = value ? LightEstimationMode.AmbientIntensity :
LightEstimationMode.Disabled;
}
}
/// <summary>
/// ValueType check if two SessionConfig objects are equal.
/// </summary>
/// <param name="other">The other SessionConfig.</param>
/// <returns>True if the two SessionConfig objects are value-type equal, otherwise
/// false.</returns>
public override bool Equals(object other)
{
ARCoreSessionConfig otherConfig = other as ARCoreSessionConfig;
if (other == null)
{
return false;
}
if (MatchCameraFramerate != otherConfig.MatchCameraFramerate ||
PlaneFindingMode != otherConfig.PlaneFindingMode ||
LightEstimationMode != otherConfig.LightEstimationMode ||
EnableCloudAnchor != otherConfig.EnableCloudAnchor ||
AugmentedImageDatabase != otherConfig.AugmentedImageDatabase ||
CameraFocusMode != otherConfig.CameraFocusMode ||
AugmentedFaceMode != otherConfig.AugmentedFaceMode)
{
return false;
}
return true;
}
/// <summary>
/// Return a hash code for this object.
/// </summary>
/// <returns>A hash code value.</returns>
public override int GetHashCode()
{
return base.GetHashCode();
}
/// <summary>
/// ValueType copy from another SessionConfig object into this one.
/// </summary>
/// <param name="other">The SessionConfig to copy from.</param>
public void CopyFrom(ARCoreSessionConfig other)
{
MatchCameraFramerate = other.MatchCameraFramerate;
PlaneFindingMode = other.PlaneFindingMode;
LightEstimationMode = other.LightEstimationMode;
EnableCloudAnchor = other.EnableCloudAnchor;
AugmentedImageDatabase = other.AugmentedImageDatabase;
CameraFocusMode = other.CameraFocusMode;
AugmentedFaceMode = other.AugmentedFaceMode;
}
/// <summary>
/// Unity OnValidate.
/// </summary>
public void OnValidate()
{
if ((LightEstimationMode == LightEstimationMode.EnvironmentalHDRWithoutReflections ||
LightEstimationMode == LightEstimationMode.EnvironmentalHDRWithReflections) &&
AugmentedFaceMode != AugmentedFaceMode.Disabled)
{
Debug.LogErrorFormat("LightEstimationMode.{0} is incompatible with " +
"AugmentedFaceMode.{1}, please use other LightEstimationMode or disable " +
"Augmented Face.", LightEstimationMode, AugmentedFaceMode);
}
}
}
}
fileFormatVersion: 2
guid: 53ac32fab2599402fb6d154adf4c1e40
timeCreated: 1510876906
licenseType: Pro
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
//-----------------------------------------------------------------------
// <copyright file="Anchor.cs" company="Google">
//
// Copyright 2017 Google Inc. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// </copyright>
//-----------------------------------------------------------------------
namespace GoogleARCore
{
using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using GoogleARCoreInternal;
using UnityEngine;
/// <summary>
/// Attaches a GameObject to an ARCore <see cref="Trackable"/>. The transform of the GameObject will
/// be updated to maintain the semantics of the attachment relationship, which varies between
/// sub-types of Trackable.
/// </summary>
[HelpURL("https://developers.google.com/ar/reference/unity/class/GoogleARCore/Anchor")]
public class Anchor : MonoBehaviour
{
private static Dictionary<IntPtr, Anchor> s_AnchorDict =
new Dictionary<IntPtr, Anchor>(new IntPtrEqualityComparer());
private TrackingState m_LastFrameTrackingState = TrackingState.Stopped;
private bool m_IsSessionDestroyed = false;
/// <summary>
/// Gets the tracking state of the anchor.
/// </summary>
public TrackingState TrackingState
{
get
{
if (_IsSessionDestroyed())
{
// Anchors from another session are considered stopped.
return TrackingState.Stopped;
}
return m_NativeSession.AnchorApi.GetTrackingState(m_NativeHandle);
}
}
internal NativeSession m_NativeSession { get; private set; }
internal IntPtr m_NativeHandle { get; private set; }
internal static Anchor Factory(NativeSession nativeApi, IntPtr anchorNativeHandle,
bool isCreate = true)
{
if (anchorNativeHandle == IntPtr.Zero)
{
return null;
}
Anchor result;
if (s_AnchorDict.TryGetValue(anchorNativeHandle, out result))
{
// Release acquired handle and return cached result
result.m_NativeSession.AnchorApi.Release(anchorNativeHandle);
return result;
}
if (isCreate)
{
Anchor anchor = (new GameObject()).AddComponent<Anchor>();
anchor.gameObject.name = "Anchor";
anchor.m_NativeHandle = anchorNativeHandle;
anchor.m_NativeSession = nativeApi;
anchor.Update();
s_AnchorDict.Add(anchorNativeHandle, anchor);
return anchor;
}
return null;
}
/// <summary>
/// The Unity Update method.
/// </summary>
private void Update()
{
if (m_NativeHandle == IntPtr.Zero)
{
Debug.LogError(
"Anchor components instantiated outside of ARCore are not supported. " +
"Please use a 'Create' method within ARCore to instantiate anchors.");
return;
}
if (_IsSessionDestroyed())
{
return;
}
var pose = m_NativeSession.AnchorApi.GetPose(m_NativeHandle);
transform.position = pose.position;
transform.rotation = pose.rotation;
TrackingState currentFrameTrackingState = TrackingState;
if (m_LastFrameTrackingState != currentFrameTrackingState)
{
bool isAnchorTracking = currentFrameTrackingState == TrackingState.Tracking;
foreach (Transform child in transform)
{
child.gameObject.SetActive(isAnchorTracking);
}
m_LastFrameTrackingState = currentFrameTrackingState;
}
}
private void OnDestroy()
{
if (m_NativeHandle == IntPtr.Zero)
{
return;
}
s_AnchorDict.Remove(m_NativeHandle);
m_NativeSession.AnchorApi.Detach(m_NativeHandle);
m_NativeSession.AnchorApi.Release(m_NativeHandle);
}
private bool _IsSessionDestroyed()
{
if (!m_IsSessionDestroyed)
{
var nativeSession = LifecycleManager.Instance.NativeSession;
if (nativeSession != m_NativeSession)
{
Debug.LogErrorFormat(
"The session which created this anchor has been destroyed. " +
"The anchor on GameObject {0} can no longer update.",
this.gameObject != null ? this.gameObject.name : "Unknown");
m_IsSessionDestroyed = true;
}
}
return m_IsSessionDestroyed;
}
}
}
fileFormatVersion: 2
guid: bd5c45a099b834b8d847a3ba64b2c8ec
timeCreated: 1502157890
licenseType: Free
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: -16000
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
//-----------------------------------------------------------------------
// <copyright file="AndroidPermissionsManager.cs" company="Google">
//
// Copyright 2017 Google Inc. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// </copyright>
//-----------------------------------------------------------------------
namespace GoogleARCore
{
using System;
using GoogleARCoreInternal;
using UnityEngine;
/// <summary>
/// Manages Android permissions for the Unity application.
/// </summary>
public class AndroidPermissionsManager : AndroidJavaProxy
{
private static AndroidPermissionsManager s_Instance;
private static AndroidJavaObject s_Activity;
private static AndroidJavaObject s_PermissionService;
private static AsyncTask<AndroidPermissionsRequestResult> s_CurrentRequest = null;
private static Action<AndroidPermissionsRequestResult> s_OnPermissionsRequestFinished;
/// @cond EXCLUDE_FROM_DOXYGEN
/// <summary>
/// Constructs a new AndroidPermissionsManager.
/// </summary>
public AndroidPermissionsManager() : base(
"com.unity3d.plugin.UnityAndroidPermissions$IPermissionRequestResult")
{
}
/// @endcond
/// <summary>
/// Checks if an Android permission is granted to the application.
/// </summary>
/// <param name="permissionName">The full name of the Android permission to check (e.g.
/// android.permission.CAMERA).</param>
/// <returns><c>true</c> if <c>permissionName</c> is granted to the application, otherwise
/// <c>false</c>.</returns>
[SuppressMemoryAllocationError(
IsWarning = true, Reason = "Allocates new objects the first time is called")]
public static bool IsPermissionGranted(string permissionName)
{
if (Application.isEditor)
{
return true;
}
return GetPermissionsService().Call<bool>(
"IsPermissionGranted", GetUnityActivity(), permissionName);
}
/// <summary>
/// Requests an Android permission from the user.
/// </summary>
/// <param name="permissionName">The permission to be requested (e.g.
/// android.permission.CAMERA).</param>
/// <returns>An asynchronous task that completes when the user has accepted or rejected the
/// requested permission and yields a <see cref="AndroidPermissionsRequestResult"/> that
/// summarizes the result. If this method is called when another permissions request is
/// pending, <c>null</c> will be returned instead.</returns>
[SuppressMemoryAllocationError(
IsWarning = true, Reason = "Allocates new objects the first time is called")]
public static AsyncTask<AndroidPermissionsRequestResult> RequestPermission(
string permissionName)
{
if (AndroidPermissionsManager.IsPermissionGranted(permissionName))
{
return new AsyncTask<AndroidPermissionsRequestResult>(
new AndroidPermissionsRequestResult(
new string[] { permissionName }, new bool[] { true }));
}
if (s_CurrentRequest != null)
{
ARDebug.LogError("Attempted to make simultaneous Android permissions requests.");
return null;
}
GetPermissionsService().Call("RequestPermissionAsync", GetUnityActivity(),
new[] { permissionName }, GetInstance());
s_CurrentRequest =
new AsyncTask<AndroidPermissionsRequestResult>(out s_OnPermissionsRequestFinished);
return s_CurrentRequest;
}
/// @cond EXCLUDE_FROM_DOXYGEN
/// <summary>
/// Callback fired when a permission is granted.
/// </summary>
/// <param name="permissionName">The name of the permission that was granted.</param>
[SuppressMemoryAllocationError(
IsWarning = true, Reason = "Implements java object interface.")]
public virtual void OnPermissionGranted(string permissionName)
{
_OnPermissionResult(permissionName, true);
}
/// @endcond
/// @cond EXCLUDE_FROM_DOXYGEN
/// <summary>
/// Callback fired when a permission is denied.
/// </summary>
/// <param name="permissionName">The name of the permission that was denied.</param>
[SuppressMemoryAllocationError(
IsWarning = true, Reason = "Implements java object interface.")]
public virtual void OnPermissionDenied(string permissionName)
{
_OnPermissionResult(permissionName, false);
}
/// @endcond
/// @cond EXCLUDE_FROM_DOXYGEN
/// <summary>
/// Callback fired on an Android activity result (unused part of UnityAndroidPermissions
/// interface).
/// </summary>
[SuppressMemoryAllocationError(
IsWarning = true, Reason = "Implements java object interface.")]
public virtual void OnActivityResult()
{
}
private static AndroidPermissionsManager GetInstance()
{
if (s_Instance == null)
{
s_Instance = new AndroidPermissionsManager();
}
return s_Instance;
}
private static AndroidJavaObject GetUnityActivity()
{
if (s_Activity == null)
{
AndroidJavaClass unityPlayer =
new AndroidJavaClass("com.unity3d.player.UnityPlayer");
s_Activity = unityPlayer.GetStatic<AndroidJavaObject>("currentActivity");
}
return s_Activity;
}
private static AndroidJavaObject GetPermissionsService()
{
if (s_PermissionService == null)
{
s_PermissionService =
new AndroidJavaObject("com.unity3d.plugin.UnityAndroidPermissions");
}
return s_PermissionService;
}
/// @endcond
/// <summary>
/// Callback fired on an Android permission result.
/// </summary>
/// <param name="permissionName">The name of the permission.</param>
/// <param name="granted">If permission is granted or not.</param>
private void _OnPermissionResult(string permissionName, bool granted)
{
if (s_OnPermissionsRequestFinished == null)
{
Debug.LogErrorFormat(
"AndroidPermissionsManager received an unexpected permissions result {0}",
permissionName);
return;
}
// Cache completion method and reset request state.
var onRequestFinished = s_OnPermissionsRequestFinished;
s_CurrentRequest = null;
s_OnPermissionsRequestFinished = null;
onRequestFinished(new AndroidPermissionsRequestResult(new string[] { permissionName },
new bool[] { granted }));
}
}
}
fileFormatVersion: 2
guid: c0726c8b601b041069fad86754497703
timeCreated: 1502330118
licenseType: Free
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
//-----------------------------------------------------------------------
// <copyright file="AndroidPermissionsRequestResult.cs" company="Google">
//
// Copyright 2017 Google Inc. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// </copyright>
//-----------------------------------------------------------------------
namespace GoogleARCore
{
using GoogleARCoreInternal;
using UnityEngine;
/// <summary>
/// Structure holding data summarizing the result of an Android permissions request.
/// </summary>
public struct AndroidPermissionsRequestResult
{
/// <summary>
/// Constructs a new AndroidPermissionsRequestResult.
/// </summary>
/// <param name="permissionNames">The value for PermissionNames.</param>
/// <param name="grantResults">The value for GrantResults.</param>
public AndroidPermissionsRequestResult(
string[] permissionNames, bool[] grantResults) : this()
{
PermissionNames = permissionNames;
GrantResults = grantResults;
}
/// <summary>
/// Gets a collection of permissions requested.
/// </summary>
public string[] PermissionNames { get; private set; }
/// <summary>
/// Gets a collection of results corresponding to <see cref="PermissionNames"/>.
/// </summary>
public bool[] GrantResults { get; private set; }
/// <summary>
/// Gets a value indicating whether all permissions are granted.
/// </summary>
public bool IsAllGranted
{
[SuppressMemoryAllocationError(
IsWarning = true, Reason = "Requires further investigation.")]
get
{
if (PermissionNames == null || GrantResults == null)
{
return false;
}
for (int i = 0; i < GrantResults.Length; i++)
{
if (!GrantResults[i])
{
return false;
}
}
return true;
}
}
}
}
fileFormatVersion: 2
guid: d7676570d2869469a8e061cbd3d90c9f
timeCreated: 1502330118
licenseType: Free
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 11813694e8abb437eb9ef46ed1cc67c5
folderAsset: yes
timeCreated: 1502400396
licenseType: Free
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
//-----------------------------------------------------------------------
// <copyright file="NativeSession.cs" company="Google">
//
// Copyright 2017 Google Inc. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// </copyright>
//-----------------------------------------------------------------------
namespace GoogleARCoreInternal
{
using System;
using System.Collections.Generic;
using System.Runtime.InteropServices;
using GoogleARCore;
using UnityEngine;
internal class NativeSession
{
#pragma warning disable 414
private static bool s_ReportedEngineType = false;
#pragma warning restore 414
private PointCloudManager m_PointCloudManager = null;
private TrackableManager m_TrackableManager = null;
public NativeSession(IntPtr sessionHandle, IntPtr frameHandle)
{
IsDestroyed = false;
SessionHandle = sessionHandle;
FrameHandle = frameHandle;
m_PointCloudManager = new PointCloudManager(this);
m_TrackableManager = new TrackableManager(this);
AnchorApi = new AnchorApi(this);
AugmentedFaceApi = new AugmentedFaceApi(this);
AugmentedImageApi = new AugmentedImageApi(this);
AugmentedImageDatabaseApi = new AugmentedImageDatabaseApi(this);
CameraApi = new CameraApi(this);
CameraConfigApi = new CameraConfigApi(this);
CameraConfigFilterApi = new CameraConfigFilterApi(this);
CameraConfigListApi = new CameraConfigListApi(this);
CameraMetadataApi = new CameraMetadataApi(this);
FrameApi = new FrameApi(this);
HitTestApi = new HitTestApi(this);
ImageApi = new ImageApi();
LightEstimateApi = new LightEstimateApi(this);
PlaneApi = new PlaneApi(this);
PointApi = new PointApi(this);
PointCloudApi = new PointCloudApi(this);
PoseApi = new PoseApi(this);
SessionApi = new SessionApi(this);
SessionConfigApi = new SessionConfigApi(this);
TrackableApi = new TrackableApi(this);
TrackableListApi = new TrackableListApi(this);
#if !UNITY_EDITOR
if (!s_ReportedEngineType)
{
SessionApi.ReportEngineType();
s_ReportedEngineType = true;
}
#endif
}
public bool IsDestroyed { get; private set; }
public IntPtr SessionHandle { get; private set; }
public IntPtr FrameHandle { get; private set; }
public IntPtr PointCloudHandle
{
get
{
return m_PointCloudManager.PointCloudHandle;
}
}
public bool IsPointCloudNew
{
get
{
return m_PointCloudManager.IsPointCloudNew;
}
}
public AnchorApi AnchorApi { get; private set; }
public AugmentedFaceApi AugmentedFaceApi { get; private set; }
public AugmentedImageApi AugmentedImageApi { get; private set; }
public AugmentedImageDatabaseApi AugmentedImageDatabaseApi { get; private set; }
public CameraApi CameraApi { get; private set; }
public CameraConfigApi CameraConfigApi { get; private set; }
public CameraConfigFilterApi CameraConfigFilterApi { get; private set; }
public CameraConfigListApi CameraConfigListApi { get; private set; }
public CameraMetadataApi CameraMetadataApi { get; private set; }
public FrameApi FrameApi { get; private set; }
public HitTestApi HitTestApi { get; private set; }
public ImageApi ImageApi { get; private set; }
public LightEstimateApi LightEstimateApi { get; private set; }
public PlaneApi PlaneApi { get; private set; }
public PointApi PointApi { get; private set; }
public PointCloudApi PointCloudApi { get; private set; }
public PoseApi PoseApi { get; private set; }
public SessionApi SessionApi { get; private set; }
public SessionConfigApi SessionConfigApi { get; private set; }
public TrackableApi TrackableApi { get; private set; }
public TrackableListApi TrackableListApi { get; private set; }
public Trackable TrackableFactory(IntPtr nativeHandle)
{
return m_TrackableManager.TrackableFactory(nativeHandle);
}
public void GetTrackables<T>(List<T> trackables, TrackableQueryFilter filter)
where T : Trackable
{
m_TrackableManager.GetTrackables<T>(trackables, filter);
}
public void OnUpdate(IntPtr frameHandle)
{
FrameHandle = frameHandle;
m_PointCloudManager.OnUpdate();
}
public void MarkDestroyed()
{
IsDestroyed = true;
}
}
}
fileFormatVersion: 2
guid: d592900cfcf4d46c69256dbe400dec56
timeCreated: 1516388608
licenseType: Pro
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: cef4efd6b93e74f2fa2f541212fa6195
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
//-----------------------------------------------------------------------
// <copyright file="ApiApkInstallStatusExtensions.cs" company="Google">
//
// Copyright 2017 Google Inc. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// </copyright>
//-----------------------------------------------------------------------
namespace GoogleARCoreInternal
{
using System.Collections.Generic;
using GoogleARCore;
internal static class ApiApkInstallStatusExtensions
{
public static ApkInstallationStatus ToApkInstallationStatus(
this ApiApkInstallationStatus apiStatus)
{
switch (apiStatus)
{
case ApiApkInstallationStatus.Uninitialized:
return ApkInstallationStatus.Uninitialized;
case ApiApkInstallationStatus.Requested:
return ApkInstallationStatus.Requested;
case ApiApkInstallationStatus.Success:
return ApkInstallationStatus.Success;
case ApiApkInstallationStatus.Error:
return ApkInstallationStatus.Error;
case ApiApkInstallationStatus.ErrorDeviceNotCompatible:
return ApkInstallationStatus.ErrorDeviceNotCompatible;
case ApiApkInstallationStatus.ErrorUserDeclined:
return ApkInstallationStatus.ErrorUserDeclined;
default:
UnityEngine.Debug.LogErrorFormat(
"Unexpected ApiApkInstallStatus status {0}", apiStatus);
return ApkInstallationStatus.Error;
}
}
}
}
fileFormatVersion: 2
guid: 3345208dea93f4ca6a361f8852a87704
timeCreated: 1517873495
licenseType: Pro
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
//-----------------------------------------------------------------------
// <copyright file="ApiApkInstallationStatus.cs" company="Google">
//
// Copyright 2017 Google Inc. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// </copyright>
//-----------------------------------------------------------------------
namespace GoogleARCoreInternal
{
internal enum ApiApkInstallationStatus
{
Uninitialized = 0,
Requested = 1,
Success = 100,
Error = 200,
ErrorDeviceNotCompatible = 201,
ErrorUserDeclined = 203,
}
}
fileFormatVersion: 2
guid: 7aa753c5e597b4841b03ea5f7f21326f
timeCreated: 1517874709
licenseType: Pro
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
//-----------------------------------------------------------------------
// <copyright file="ApiArStatus.cs" company="Google">
//
// Copyright 2016 Google Inc. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// </copyright>
//-----------------------------------------------------------------------
namespace GoogleARCoreInternal
{
using System.Collections;
using UnityEngine;
internal enum ApiArStatus
{
// The operation was successful.
Success = 0,
// One of the arguments was invalid, either null or not appropriate for the operation
// requested.
ErrorInvalidArgument = -1,
// An internal error occurred that the application should not attempt to recover from.
ErrorFatal = -2,
// An operation was attempted that requires the session be running, but the session was
// paused.
ErrorSessionPaused = -3,
// An operation was attempted that requires the session be paused, but the session was
// running.
ErrorSessionNotPaused = -4,
// An operation was attempted that the session should be in the TRACKING state, but the
// session was not.
ErrorNotTracking = -5,
// A texture name was not set by calling ArSession_setCameraTextureName() before the first
// call to ArSession_update().
ErrorTextureNotSet = -6,
// An operation required GL context but one was not available.
ErrorMissingGlContext = -7,
// The configuration supplied to ArSession_configure() was unsupported. To avoid this error,
// ensure that Session_checkSupported() returns true.
ErrorUnsupportedConfiguration = -8,
// The android camera permission has not been granted prior to calling ArSession_resume().
ErrorCameraPermissionNotGranted = -9,
// Acquire failed because the object being acquired is already released. This happens e.g.
// if the developer holds an old frame for too long, and then tries to acquire a point cloud
// from it.
ErrorDeadlineExceeded = -10,
// There are no available resources to complete the operation.
ErrorResourceExhausted = -11,
// Acquire failed because the data isn't available yet for the current frame. For example,
// acquire the image metadata may fail with this error because the camera hasn't fully
// started.
ErrorNotYetAvailable = -12,
// The android camera has been reallocated to a higher priority app or is otherwise
// unavailable.
ErrorCameraNotAvailable = -13,
// The host/resolve function call failed because the Session is not configured for cloud
// anchors.
ErrorCloudAnchorsNotConfigured = -14,
// ArSession_configure() failed because the specified configuration required the Android
// INTERNET permission, which the application did not have.
ErrorInternetPermissionNotGranted = -15,
// HostCloudAnchor() failed because the anchor is not a type of anchor that is currently
// supported for hosting.
ErrorAnchorNotSupportedForHosting = -16,
// An image with insufficient quality (e.g. too few features) was attempted to be added to
// the image database.
ErrorImageInsufficientQuality = -17,
// The data passed in for this operation was not in a valid format.
ErrorDataInvalidFormat = -18,
// The data passed in for this operation is not supported by this version of the SDK.
ErrorDatatUnsupportedVersion = -19,
// The ARCore APK is not installed on this device.
UnavailableArCoreNotInstalled = -100,
// The device is not currently compatible with ARCore.
UnavailableDeviceNotCompatible = -101,
// The ARCore APK currently installed on device is too old and needs to be updated.
UnavailableApkTooOld = -103,
// The ARCore APK currently installed no longer supports the ARCore SDK that the application
// was built with.
UnavailableSdkTooOld = -104,
// The user declined installation of the ARCore APK during this run of the application and
// the current request was not marked as user-initiated.
UnavailableUserDeclinedInstall = -105,
}
}
fileFormatVersion: 2
guid: 2632806855cc1405ca80cf82ad68f50a
timeCreated: 1511201582
licenseType: Free
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
//-----------------------------------------------------------------------
// <copyright file="ApiArStatusExtensions.cs" company="Google">
//
// Copyright 2018 Google Inc. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// </copyright>
//-----------------------------------------------------------------------
namespace GoogleARCoreInternal.CrossPlatform
{
using GoogleARCore.CrossPlatform;
internal static class ApiArStatusExtensions
{
public static CloudServiceResponse ToCloudServiceResponse(this ApiArStatus status)
{
switch (status)
{
case ApiArStatus.Success:
return CloudServiceResponse.Success;
case ApiArStatus.ErrorCloudAnchorsNotConfigured:
return CloudServiceResponse.ErrorNotSupportedByConfiguration;
case ApiArStatus.ErrorNotTracking:
case ApiArStatus.ErrorSessionPaused:
return CloudServiceResponse.ErrorNotTracking;
case ApiArStatus.ErrorResourceExhausted:
default:
return CloudServiceResponse.ErrorInternal;
}
}
}
}
fileFormatVersion: 2
guid: ea2a292110d0345f1acb6aea2f69228c
timeCreated: 1523839399
licenseType: Pro
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
//-----------------------------------------------------------------------
// <copyright file="ApiAugmentedFaceMode.cs" company="Google">
//
// Copyright 2018 Google Inc. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// </copyright>
//-----------------------------------------------------------------------
namespace GoogleARCoreInternal
{
internal enum ApiAugmentedFaceMode
{
Disabled = 0,
Mesh3D = 2,
}
}
fileFormatVersion: 2
guid: 8bcf2768d214d4b648f4f6f19dfb11e8
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
//-----------------------------------------------------------------------
// <copyright file="ApiAugmentedFaceRegionType.cs" company="Google">
//
// Copyright 2018 Google Inc. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// </copyright>
//-----------------------------------------------------------------------
namespace GoogleARCoreInternal
{
internal enum ApiAugmentedFaceRegionType
{
Nose = 0,
ForeheadLeft = 1,
ForeheadRight = 2,
}
}
fileFormatVersion: 2
guid: 204b01c787d04436499b33a3eb9838e0
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
//-----------------------------------------------------------------------
// <copyright file="ApiAvailability.cs" company="Google">
//
// Copyright 2017 Google Inc. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// </copyright>
//-----------------------------------------------------------------------
namespace GoogleARCoreInternal
{
internal enum ApiAvailability
{
UnknownError = 0,
UnknownChecking = 1,
UnknownTimedOut = 2,
UnsupportedDeviceNotCapable = 100,
SupportedNotInstalled = 201,
SupportedApkTooOld = 202,
SupportedInstalled = 203
}
}
fileFormatVersion: 2
guid: a2ff5d80474fa4dcf979bc5ec9b89ca4
timeCreated: 1517858100
licenseType: Pro
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
//-----------------------------------------------------------------------
// <copyright file="ApiAvailabilityExtensions.cs" company="Google">
//
// Copyright 2017 Google Inc. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// </copyright>
//-----------------------------------------------------------------------
namespace GoogleARCoreInternal
{
using System.Collections.Generic;
using GoogleARCore;
internal static class ApiAvailabilityExtensions
{
public static ApkAvailabilityStatus ToApkAvailabilityStatus(this ApiAvailability apiStatus)
{
switch (apiStatus)
{
case ApiAvailability.UnknownError:
return ApkAvailabilityStatus.UnknownError;
case ApiAvailability.UnknownChecking:
return ApkAvailabilityStatus.UnknownChecking;
case ApiAvailability.UnknownTimedOut:
return ApkAvailabilityStatus.UnknownTimedOut;
case ApiAvailability.UnsupportedDeviceNotCapable:
return ApkAvailabilityStatus.UnsupportedDeviceNotCapable;
case ApiAvailability.SupportedNotInstalled:
return ApkAvailabilityStatus.SupportedNotInstalled;
case ApiAvailability.SupportedApkTooOld:
return ApkAvailabilityStatus.SupportedApkTooOld;
case ApiAvailability.SupportedInstalled:
return ApkAvailabilityStatus.SupportedInstalled;
default:
UnityEngine.Debug.LogErrorFormat(
"Unexpected ApiAvailability status {0}", apiStatus);
return ApkAvailabilityStatus.UnknownError;
}
}
}
}
fileFormatVersion: 2
guid: da78fe0b9a17c46dea099872f469ccd7
timeCreated: 1517871435
licenseType: Pro
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
//-----------------------------------------------------------------------
// <copyright file="ApiCameraConfigFacingDirection.cs" company="Google">
//
// Copyright 2019 Google Inc. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// </copyright>
//-----------------------------------------------------------------------
namespace GoogleARCoreInternal
{
internal enum ApiCameraConfigFacingDirection
{
Back = 0,
Front = 1,
}
}
fileFormatVersion: 2
guid: c8faf20d7e9c74fbd8da23f348c621e7
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
//-----------------------------------------------------------------------
// <copyright file="ApiCameraConfigFacingDirectionExtensions.cs" company="Google">
//
// Copyright 2018 Google Inc. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// </copyright>
//-----------------------------------------------------------------------
namespace GoogleARCoreInternal
{
using System.Diagnostics.CodeAnalysis;
using GoogleARCore;
using UnityEngine;
internal static class ApiCameraConfigFacingDirectionExtensions
{
public static DeviceCameraDirection ToDeviceCameraDirection(
this ApiCameraConfigFacingDirection direction)
{
switch (direction)
{
case ApiCameraConfigFacingDirection.Front:
return DeviceCameraDirection.FrontFacing;
case ApiCameraConfigFacingDirection.Back:
default:
return DeviceCameraDirection.BackFacing;
}
}
}
}
fileFormatVersion: 2
guid: d765a2cb133004842b62a1d8bb49e5f3
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
//-----------------------------------------------------------------------
// <copyright file="ApiCameraConfigTargetFps.cs" company="Google">
//
// Copyright 2019 Google Inc. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// </copyright>
//-----------------------------------------------------------------------
namespace GoogleARCoreInternal
{
using System;
[Flags]
internal enum ApiCameraConfigTargetFps
{
TargetFps30 = 0x0001,
TargetFps60 = 0x0002,
}
}
fileFormatVersion: 2
guid: fa1b5f6196eea451e8c55d5b905cb29c
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
//-----------------------------------------------------------------------
// <copyright file="ApiCameraFocusMode.cs" company="Google">
//
// Copyright 2017 Google Inc. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// </copyright>
//-----------------------------------------------------------------------
namespace GoogleARCoreInternal
{
internal enum ApiCameraFocusMode
{
Fixed = 0,
Auto = 1,
}
}
fileFormatVersion: 2
guid: 9f65b9d078b2845138ef70cdd04e3c73
timeCreated: 1529969528
licenseType: Pro
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
//-----------------------------------------------------------------------
// <copyright file="ApiCameraMetadata.cs" company="Google">
//
// Copyright 2017 Google Inc. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// </copyright>
//-----------------------------------------------------------------------
[module: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.DocumentationRules",
"SA1649:FileHeaderFileNameDocumentationMustMatchTypeName", Justification = "Internal.")]
namespace GoogleARCoreInternal
{
using System;
using System.Diagnostics.CodeAnalysis;
using System.Runtime.InteropServices;
using UnityEngine;
internal enum NdkCameraMetadataType
{
Byte = 0,
Int32 = 1,
Float = 2,
Int64 = 3,
Double = 4,
Rational = 5,
NumTypes,
}
internal enum NdkCameraStatus
{
Ok = 0,
ErrorBase = -10000,
ErrorUnknown = ErrorBase,
ErrorInvalidParameter = ErrorBase - 1,
ErrorMetadataNotFound = ErrorBase - 4,
}
[StructLayout(LayoutKind.Explicit)]
internal struct NdkCameraMetadata
{
[FieldOffset(0)]
[MarshalAs(UnmanagedType.I4)]
public int Tag;
[FieldOffset(4)]
[MarshalAs(UnmanagedType.I1)]
public NdkCameraMetadataType Type;
[FieldOffset(8)]
[MarshalAs(UnmanagedType.I4)]
public int Count;
[FieldOffset(12)]
public IntPtr Value;
}
}
fileFormatVersion: 2
guid: bfdd6a8d3f3624cc68c5c22390d84305
timeCreated: 1511898550
licenseType: Pro
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
//-----------------------------------------------------------------------
// <copyright file="ApiCloudAnchorMode.cs" company="Google">
//
// Copyright 2018 Google Inc. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// </copyright>
//-----------------------------------------------------------------------
namespace GoogleARCoreInternal.CrossPlatform
{
internal enum ApiCloudAnchorMode
{
Disabled = 0,
Enabled = 1,
}
}
fileFormatVersion: 2
guid: 0d4558a37894940f89ca1e8aec3bffd0
timeCreated: 1523839648
licenseType: Pro
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
//-----------------------------------------------------------------------
// <copyright file="ApiCloudAnchorState.cs" company="Google">
//
// Copyright 2018 Google Inc. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// </copyright>
//-----------------------------------------------------------------------
namespace GoogleARCoreInternal.CrossPlatform
{
internal enum ApiCloudAnchorState
{
None = 0,
TaskInProgress = 1,
Success = 2,
ErrorInternal = -1,
ErrorNotAuthorized = -2,
ErrorServiceUnavailable = -3,
ErrorResourceExhausted = -4,
ErrorHostingDatasetProcessingFailed = -5,
ErrorResolveingCloudIdNotFound = -6,
ErrorResolvingLocalizationNoMatch = -7,
ErrorResolvingSDKTooOld = -8,
ErrorResolvingSDKTooNew = -9,
}
}
fileFormatVersion: 2
guid: 50ba1888bff2542ae98827586e95f255
timeCreated: 1523839648
licenseType: Pro
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
//-----------------------------------------------------------------------
// <copyright file="ApiCloudAnchorStateExtensions.cs" company="Google">
//
// Copyright 2018 Google Inc. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// </copyright>
//-----------------------------------------------------------------------
namespace GoogleARCoreInternal.CrossPlatform
{
using GoogleARCore.CrossPlatform;
internal static class ApiCloudAnchorStateExtensions
{
public static CloudServiceResponse ToCloudServiceResponse(
this ApiCloudAnchorState anchorState)
{
switch (anchorState)
{
case ApiCloudAnchorState.Success:
return CloudServiceResponse.Success;
case ApiCloudAnchorState.ErrorServiceUnavailable:
return CloudServiceResponse.ErrorServiceUnreachable;
case ApiCloudAnchorState.ErrorNotAuthorized:
return CloudServiceResponse.ErrorNotAuthorized;
case ApiCloudAnchorState.ErrorResourceExhausted:
return CloudServiceResponse.ErrorApiQuotaExceeded;
case ApiCloudAnchorState.ErrorHostingDatasetProcessingFailed:
return CloudServiceResponse.ErrorDatasetInadequate;
case ApiCloudAnchorState.ErrorResolveingCloudIdNotFound:
return CloudServiceResponse.ErrorCloudIdNotFound;
case ApiCloudAnchorState.ErrorResolvingLocalizationNoMatch:
return CloudServiceResponse.ErrorLocalizationFailed;
case ApiCloudAnchorState.ErrorResolvingSDKTooOld:
return CloudServiceResponse.ErrorSDKTooOld;
case ApiCloudAnchorState.ErrorResolvingSDKTooNew:
return CloudServiceResponse.ErrorSDKTooNew;
case ApiCloudAnchorState.None:
case ApiCloudAnchorState.TaskInProgress:
case ApiCloudAnchorState.ErrorInternal:
default:
return CloudServiceResponse.ErrorInternal;
}
}
}
}
fileFormatVersion: 2
guid: 3d34b5c2dd26b4d69940a1a3b98afa17
timeCreated: 1523839648
licenseType: Pro
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
//-----------------------------------------------------------------------
// <copyright file="ApiConstants.cs" company="Google">
//
// Copyright 2017 Google Inc. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// </copyright>
//-----------------------------------------------------------------------
namespace GoogleARCoreInternal
{
using System;
using System.Collections.Generic;
using System.Runtime.InteropServices;
using GoogleARCore;
using UnityEngine;
internal static class ApiConstants
{
#if UNITY_EDITOR
public const string ARCoreNativeApi = InstantPreviewManager.InstantPreviewNativeApi;
public const string ARCoreARKitIntegrationApi = "NOT_AVAILABLE";
public const string ARCoreShimApi = InstantPreviewManager.InstantPreviewNativeApi;
public const string ARPrestoApi = InstantPreviewManager.InstantPreviewNativeApi;
public const string MediaNdk = InstantPreviewManager.InstantPreviewNativeApi;
public const string NdkCameraApi = "NOT_AVAILABLE";
#elif UNITY_ANDROID
public const string ARCoreNativeApi = "arcore_sdk_c";
public const string ARCoreARKitIntegrationApi = "NOT_AVAILABLE";
public const string ARCoreShimApi = "arcore_unity_api";
public const string ARPrestoApi = "arpresto_api";
public const string MediaNdk = "mediandk";
public const string NdkCameraApi = "camera2ndk";
#elif UNITY_IOS
#if ARCORE_IOS_SUPPORT
public const string ARCoreNativeApi = "__Internal";
public const string ARCoreARKitIntegrationApi = "__Internal";
#else
public const string ARCoreNativeApi = "NOT_AVAILABLE";
public const string ARCoreARKitIntegrationApi = "NOT_AVAILABLE";
#endif
public const string ARCoreShimApi = "NOT_AVAILABLE";
public const string ARPrestoApi = "NOT_AVAILABLE";
public const string MediaNdk = "NOT_AVAILABLE";
public const string NdkCameraApi = "NOT_AVAILABLE";
#else
public const string ARCoreNativeApi = "NOT_AVAILABLE";
public const string ARCoreARKitIntegrationApi = "NOT_AVAILABLE";
public const string ARCoreShimApi = "NOT_AVAILABLE";
public const string ARPrestoApi = "NOT_AVAILABLE";
public const string MediaNdk = "NOT_AVAILABLE";
public const string NdkCameraApi = "NOT_AVAILABLE";
#endif
#if UNITY_EDITOR_OSX
public const string AugmentedImageCliBinaryName = "augmented_image_cli_osx";
#elif UNITY_EDITOR_WIN
public const string AugmentedImageCliBinaryName = "augmented_image_cli_win";
#elif UNITY_EDITOR_LINUX
public const string AugmentedImageCliBinaryName = "augmented_image_cli_linux";
#endif
}
}
fileFormatVersion: 2
guid: 020d4ce00b42e47d2b46e7aa6244bedb
timeCreated: 1509553365
licenseType: Free
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
//-----------------------------------------------------------------------
// <copyright file="ApiCoordinates2dType.cs" company="Google">
//
// Copyright 2019 Google Inc. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// </copyright>
//-----------------------------------------------------------------------
namespace GoogleARCoreInternal
{
internal enum ApiCoordinates2dType
{
TexturePixels = 0,
TextureNormalized = 1,
ImagePixels = 2,
ImageNormalized = 3,
FeatureTrackingImage = 4,
FeatureTrackingImageNormalized = 5,
OpenGLDeviceNormalized = 6,
View = 7,
ViewNormalized = 8,
}
}
fileFormatVersion: 2
guid: 49a64a36a4ebb456193015fb613e4303
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
//-----------------------------------------------------------------------
// <copyright file="ApiDisplayUvCoords.cs" company="Google">
//
// Copyright 2017 Google Inc. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// </copyright>
//-----------------------------------------------------------------------
namespace GoogleARCoreInternal
{
using System.Diagnostics.CodeAnalysis;
using System.Runtime.InteropServices;
using UnityEngine;
/// <summary>
/// UV coordinates for the four corners of the display.
/// </summary>
[StructLayout(LayoutKind.Sequential)]
[SuppressMessage("StyleCop.CSharp.DocumentationRules", "SA1600:ElementsMustBeDocumented",
Justification = "Internal")]
public struct ApiDisplayUvCoords
{
/// <summary>
/// Number of floats contained in this struct.
/// </summary>
public const int NumFloats = 8;
public Vector2 TopLeft;
public Vector2 TopRight;
public Vector2 BottomLeft;
public Vector2 BottomRight;
public ApiDisplayUvCoords(Vector2 topLeft, Vector2 topRight,
Vector2 bottomLeft, Vector2 bottomRight)
{
TopLeft = topLeft;
TopRight = topRight;
BottomLeft = bottomLeft;
BottomRight = bottomRight;
}
}
}
fileFormatVersion: 2
guid: ed17abe8b8d17dc44ae53ea9840cd4dc
timeCreated: 1510289770
licenseType: Pro
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
//-----------------------------------------------------------------------
// <copyright file="ApiDisplayUvCoordsExtensions.cs" company="Google">
//
// Copyright 2018 Google Inc. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// </copyright>
//-----------------------------------------------------------------------
namespace GoogleARCoreInternal
{
using System.Diagnostics.CodeAnalysis;
using GoogleARCore;
using UnityEngine;
internal static class ApiDisplayUvCoordsExtensions
{
public static DisplayUvCoords ToDisplayUvCoords(this ApiDisplayUvCoords apiCoords)
{
return new DisplayUvCoords(apiCoords.TopLeft, apiCoords.TopRight,
apiCoords.BottomLeft, apiCoords.BottomRight);
}
}
}
fileFormatVersion: 2
guid: 7bb05187099e74075868cb33b22f51b8
timeCreated: 1520038125
licenseType: Pro
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
//-----------------------------------------------------------------------
// <copyright file="ApiFeaturePointOrientationMode.cs" company="Google">
//
// Copyright 2017 Google Inc. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// </copyright>
//-----------------------------------------------------------------------
namespace GoogleARCoreInternal
{
using System.Diagnostics.CodeAnalysis;
[SuppressMessage("StyleCop.CSharp.DocumentationRules", "SA1600:ElementsMustBeDocumented",
Justification = "Internal")]
public enum ApiFeaturePointOrientationMode
{
Identity = 0,
SurfaceNormal = 1,
}
}
fileFormatVersion: 2
guid: 1e55289de34ec44b191ed1bdc5b17c9d
timeCreated: 1517185900
licenseType: Pro
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
//-----------------------------------------------------------------------
// <copyright file="ApiFeaturePointOrientationModeExtensions.cs"
// company="Google">
//
// Copyright 2017 Google Inc. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// </copyright>
//-----------------------------------------------------------------------
namespace GoogleARCoreInternal
{
using System;
using System.Diagnostics.CodeAnalysis;
using GoogleARCore;
[SuppressMessage("StyleCop.CSharp.DocumentationRules", "SA1600:ElementsMustBeDocumented",
Justification = "Internal")]
public static class ApiFeaturePointOrientationModeExtensions
{
public static FeaturePointOrientationMode ToFeaturePointOrientationMode(
this ApiFeaturePointOrientationMode apiMode)
{
switch (apiMode)
{
case ApiFeaturePointOrientationMode.Identity:
return FeaturePointOrientationMode.Identity;
case ApiFeaturePointOrientationMode.SurfaceNormal:
return FeaturePointOrientationMode.SurfaceNormal;
default:
ARDebug.LogError("Invalid value for ApiFeaturePointOrientationMode.");
return FeaturePointOrientationMode.Identity;
}
}
}
}
fileFormatVersion: 2
guid: f7f21e3757d39475aae8f4a13d02253a
timeCreated: 1517185900
licenseType: Pro
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
//-----------------------------------------------------------------------
// <copyright file="ApiLightEstimateState.cs" company="Google">
//
// Copyright 2017 Google Inc. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// </copyright>
//-----------------------------------------------------------------------
namespace GoogleARCoreInternal
{
internal enum ApiLightEstimateState
{
NotValid = 0,
Valid = 1,
}
}
fileFormatVersion: 2
guid: edc967aa80d4104418f83a5d540219ca
timeCreated: 1510799673
licenseType: Pro
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
//-----------------------------------------------------------------------
// <copyright file="ApiLightEstimateStateExtensions.cs" company="Google">
//
// Copyright 2017 Google Inc. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// </copyright>
//-----------------------------------------------------------------------
namespace GoogleARCoreInternal
{
using GoogleARCore;
internal static class ApiLightEstimateStateExtensions
{
public static LightEstimateState ToLightEstimateState(this ApiLightEstimateState apiState)
{
switch (apiState)
{
case ApiLightEstimateState.NotValid:
return LightEstimateState.NotValid;
case ApiLightEstimateState.Valid:
return LightEstimateState.Valid;
default:
return LightEstimateState.NotValid;
}
}
}
}
fileFormatVersion: 2
guid: 7b62de06fc1d1854d8e46bfb414db000
timeCreated: 1510799673
licenseType: Pro
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
//-----------------------------------------------------------------------
// <copyright file="ApiLightEstimationMode.cs" company="Google">
//
// Copyright 2017 Google Inc. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// </copyright>
//-----------------------------------------------------------------------
namespace GoogleARCoreInternal
{
using System.Diagnostics.CodeAnalysis;
[SuppressMessage("StyleCop.CSharp.DocumentationRules", "SA1600:ElementsMustBeDocumented",
Justification = "Internal")]
public enum ApiLightEstimationMode
{
Disabled = 0,
AmbientIntensity = 1,
EnvironmentalHDR = 2,
}
}
fileFormatVersion: 2
guid: 31136b31f422e49a5b4307c1b3bff384
timeCreated: 1512782847
licenseType: Pro
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment