Files
old-profesor-atom/Profesor Atom/Library/metadata/b2/b2d1785fa0c551e408b6c94398847b76

158 lines
9.3 KiB
Plaintext
Raw Normal View History

2017-05-17 12:25:25 +03:00
a%e5.6.1f1<00><><EFBFBD><EFBFBD><00><><EFBFBD>0<05><><EFBFBD><EFBFBD>L.`?^<5E>0D7<00><><EFBFBD><EFBFBD><EFBFBD><00><00><00><><00><00><00><00><00><00><00><00><00>#<00><00>+H<00>3<00><><EFBFBD><EFBFBD><00>1<00>1<00><><EFBFBD><EFBFBD><EFBFBD>@<00><00><00> Q<00>j<00>
<00><00>< <00><00>H H<00>Z<00><><EFBFBD><EFBFBD> <00>1<00>1<00><><EFBFBD><EFBFBD><EFBFBD>@<00><00><00>Q<00>j<00><00><00>g<00><00><00><00><00><00>#<00><00>+v~<00><00><><00><00><><00><00><><00><00><><00><00><><00><00><><00><00><><00><00><><00><00><><00><00><> <00><00><>!<00><00><>"<00><00><>#<00><00>$<00><00>%<00><00>&<00><00>#<00><><EFBFBD><EFBFBD>'<00>1<00>1<00><><EFBFBD><EFBFBD><EFBFBD>(<00><00><00><00>)H<00>j<00><><EFBFBD><EFBFBD><EFBFBD>*<00>1<00>1<00><><EFBFBD><EFBFBD><EFBFBD>+@<00><00><00>,Q<00>j<00>-<00><00>*.<00><00>8/AssetMetaDataguiddata[0]data[1]data[2]data[3]pathNametimeCreatedoriginalChangesetoriginalNameoriginalParentHash128originalDigestbytes[0]bytes[1]bytes[2]bytes[3]bytes[4]bytes[5]bytes[6]bytes[7]bytes[8]bytes[9]bytes[10]bytes[11]bytes[12]bytes[13]bytes[14]bytes[15]labelsassetStoreReflicenseType <00><>z{<0E>@<40><05><>5^(<28>H'<00>7<00><><EFBFBD><EFBFBD><EFBFBD><00><00><00><><00> <00><00> <00><00>#.<00>,<00><00><><00> <00><00>#.<00>,H<00><><00><><EFBFBD><EFBFBD><EFBFBD><01>1<00>1<00><><EFBFBD><EFBFBD><EFBFBD> @<00><00><00>
Q<00>j<00> <00><00>5<00><><EFBFBD><EFBFBD> <00>1<00>1<00><><EFBFBD><EFBFBD><EFBFBD> <00><00><00><00><00>j<00><><EFBFBD><EFBFBD><EFBFBD><00>H<00><><00><><EFBFBD><EFBFBD><EFBFBD><00>1<00>1<00><><EFBFBD><EFBFBD><EFBFBD>@<00><00><00>Q<00>j<00>y<00>
<00> <00><00>#.<00>, <00>I@<00><00>X @<00><00>#.<00>,H<00>]<00><><EFBFBD><EFBFBD><00>1<00>1<00><><EFBFBD><EFBFBD><EFBFBD>@<00><00><00>Q<00>j<00>H<00>h<00><><EFBFBD><EFBFBD><00>1<00>1<00><><EFBFBD><EFBFBD><EFBFBD> @<00><00><00>!Q<00>j<00>"H<00>z<00><><EFBFBD><EFBFBD>#<00>1<00>1<00><><EFBFBD><EFBFBD><EFBFBD>$@<00><00><00>%Q<00>j<00>&MonoImporterPPtr<EditorExtension>m_FileIDm_PathIDm_DefaultReferencesexecutionOrdericonm_UserDatam_AssetBundleNamem_AssetBundleVariants<00><><EFBFBD>8-l'<27><>愁h<E68481>ΐA,<00><00>7<00><><EFBFBD><EFBFBD><EFBFBD><00><00><00><><00><00><00> <00><00>.<00><00><00><><00> <00><00>.<00>H<00><><00><><EFBFBD><EFBFBD><EFBFBD><01>1<00>1<00><><EFBFBD><EFBFBD><EFBFBD> @<00><00><00>
Q<00>j<00> H<00><><00><><EFBFBD><EFBFBD><EFBFBD> <01>1<00>1<00><><EFBFBD><EFBFBD><EFBFBD> @<00><00><00>Q<00>j<00><00><00>(<00><><EFBFBD><EFBFBD><01>1<00>1<00><><EFBFBD><EFBFBD><EFBFBD><01><00><00><00><00>j<00><><EFBFBD><EFBFBD><EFBFBD><01>H<00><><00><><EFBFBD><EFBFBD><EFBFBD><01>1<00>1<00><><EFBFBD><EFBFBD><EFBFBD>@<00><00><00>Q<00>j<00>y<00>
<00> <00><00>.<00>y<00>< <00><00>.<00><00><00>CH<00>T<00><><EFBFBD><EFBFBD><10>1<00>1<00><><EFBFBD><EFBFBD><EFBFBD> @<00><00><00>!Q<00>j<00>"H<00>`<00><><EFBFBD><EFBFBD>#<10>1<00>1<00><><EFBFBD><EFBFBD><EFBFBD>$@<00><00><00>%Q<00>j<00>&H<00>l<00><><EFBFBD><EFBFBD>'<10>1<00>1<00><><EFBFBD><EFBFBD><EFBFBD>(@<00><00><00>)Q<00>j<00>*L<00>{+PPtr<EditorExtension>m_FileIDm_PathIDm_DefaultReferencesm_Iconm_ExecutionOrderm_ClassNamem_Namespacem_AssemblyNamem_IsEditorScript<00><00>@<00>y<EFBFBD><00><00>+<1D><>
\N<>k<EFBFBD>4<EFBFBD>H<EFBFBD>g)Assets/SteamVR/Scripts/SteamVR_Frustum.cs$gUSteamVR_Frustum#//======= Copyright (c) Valve Corporation, All rights reserved. ===============
//
// Purpose: Generates a mesh based on field of view.
//
//=============================================================================
using UnityEngine;
using Valve.VR;
[ExecuteInEditMode, RequireComponent(typeof(MeshRenderer), typeof(MeshFilter))]
public class SteamVR_Frustum : MonoBehaviour
{
public SteamVR_TrackedObject.EIndex index;
public float fovLeft = 45, fovRight = 45, fovTop = 45, fovBottom = 45, nearZ = 0.5f, farZ = 2.5f;
public void UpdateModel()
{
fovLeft = Mathf.Clamp(fovLeft, 1, 89);
fovRight = Mathf.Clamp(fovRight, 1, 89);
fovTop = Mathf.Clamp(fovTop, 1, 89);
fovBottom = Mathf.Clamp(fovBottom, 1, 89);
farZ = Mathf.Max(farZ, nearZ + 0.01f);
nearZ = Mathf.Clamp(nearZ, 0.01f, farZ - 0.01f);
var lsin = Mathf.Sin(-fovLeft * Mathf.Deg2Rad);
var rsin = Mathf.Sin(fovRight * Mathf.Deg2Rad);
var tsin = Mathf.Sin(fovTop * Mathf.Deg2Rad);
var bsin = Mathf.Sin(-fovBottom * Mathf.Deg2Rad);
var lcos = Mathf.Cos(-fovLeft * Mathf.Deg2Rad);
var rcos = Mathf.Cos(fovRight * Mathf.Deg2Rad);
var tcos = Mathf.Cos(fovTop * Mathf.Deg2Rad);
var bcos = Mathf.Cos(-fovBottom * Mathf.Deg2Rad);
var corners = new Vector3[] {
new Vector3(lsin * nearZ / lcos, tsin * nearZ / tcos, nearZ), //tln
new Vector3(rsin * nearZ / rcos, tsin * nearZ / tcos, nearZ), //trn
new Vector3(rsin * nearZ / rcos, bsin * nearZ / bcos, nearZ), //brn
new Vector3(lsin * nearZ / lcos, bsin * nearZ / bcos, nearZ), //bln
new Vector3(lsin * farZ / lcos, tsin * farZ / tcos, farZ ), //tlf
new Vector3(rsin * farZ / rcos, tsin * farZ / tcos, farZ ), //trf
new Vector3(rsin * farZ / rcos, bsin * farZ / bcos, farZ ), //brf
new Vector3(lsin * farZ / lcos, bsin * farZ / bcos, farZ ), //blf
};
var triangles = new int[] {
// 0, 1, 2, 0, 2, 3, // near
// 0, 2, 1, 0, 3, 2, // near
// 4, 5, 6, 4, 6, 7, // far
// 4, 6, 5, 4, 7, 6, // far
0, 4, 7, 0, 7, 3, // left
0, 7, 4, 0, 3, 7, // left
1, 5, 6, 1, 6, 2, // right
1, 6, 5, 1, 2, 6, // right
0, 4, 5, 0, 5, 1, // top
0, 5, 4, 0, 1, 5, // top
2, 3, 7, 2, 7, 6, // bottom
2, 7, 3, 2, 6, 7, // bottom
};
int j = 0;
var vertices = new Vector3[triangles.Length];
var normals = new Vector3[triangles.Length];
for (int i = 0; i < triangles.Length / 3; i++)
{
var a = corners[triangles[i * 3 + 0]];
var b = corners[triangles[i * 3 + 1]];
var c = corners[triangles[i * 3 + 2]];
var n = Vector3.Cross(b - a, c - a).normalized;
normals[i * 3 + 0] = n;
normals[i * 3 + 1] = n;
normals[i * 3 + 2] = n;
vertices[i * 3 + 0] = a;
vertices[i * 3 + 1] = b;
vertices[i * 3 + 2] = c;
triangles[i * 3 + 0] = j++;
triangles[i * 3 + 1] = j++;
triangles[i * 3 + 2] = j++;
}
var mesh = new Mesh();
mesh.vertices = vertices;
mesh.normals = normals;
mesh.triangles = triangles;
GetComponent<MeshFilter>().mesh = mesh;
}
private void OnDeviceConnected(int i, bool connected)
{
if (i != (int)index)
return;
GetComponent<MeshFilter>().mesh = null;
if (connected)
{
var system = OpenVR.System;
if (system != null && system.GetTrackedDeviceClass((uint)i) == ETrackedDeviceClass.TrackingReference)
{
var error = ETrackedPropertyError.TrackedProp_Success;
var result = system.GetFloatTrackedDeviceProperty((uint)i, ETrackedDeviceProperty.Prop_FieldOfViewLeftDegrees_Float, ref error);
if (error == ETrackedPropertyError.TrackedProp_Success)
fovLeft = result;
result = system.GetFloatTrackedDeviceProperty((uint)i, ETrackedDeviceProperty.Prop_FieldOfViewRightDegrees_Float, ref error);
if (error == ETrackedPropertyError.TrackedProp_Success)
fovRight = result;
result = system.GetFloatTrackedDeviceProperty((uint)i, ETrackedDeviceProperty.Prop_FieldOfViewTopDegrees_Float, ref error);
if (error == ETrackedPropertyError.TrackedProp_Success)
fovTop = result;
result = system.GetFloatTrackedDeviceProperty((uint)i, ETrackedDeviceProperty.Prop_FieldOfViewBottomDegrees_Float, ref error);
if (error == ETrackedPropertyError.TrackedProp_Success)
fovBottom = result;
result = system.GetFloatTrackedDeviceProperty((uint)i, ETrackedDeviceProperty.Prop_TrackingRangeMinimumMeters_Float, ref error);
if (error == ETrackedPropertyError.TrackedProp_Success)
nearZ = result;
result = system.GetFloatTrackedDeviceProperty((uint)i, ETrackedDeviceProperty.Prop_TrackingRangeMaximumMeters_Float, ref error);
if (error == ETrackedPropertyError.TrackedProp_Success)
farZ = result;
UpdateModel();
}
}
}
void OnEnable()
{
GetComponent<MeshFilter>().mesh = null;
SteamVR_Events.DeviceConnected.Listen(OnDeviceConnected);
}
void OnDisable()
{
SteamVR_Events.DeviceConnected.Remove(OnDeviceConnected);
GetComponent<MeshFilter>().mesh = null;
}
#if UNITY_EDITOR
void Update()
{
if (!Application.isPlaying)
UpdateModel();
}
#endif
}
SteamVR_FrustumAssembly-CSharp.dll