On the right track
parent
1e4d6c1ec1
commit
bc96207204
|
@ -1,40 +0,0 @@
|
|||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!84 &8400000
|
||||
RenderTexture:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name: New Render Texture
|
||||
m_ImageContentsHash:
|
||||
serializedVersion: 2
|
||||
Hash: 00000000000000000000000000000000
|
||||
m_ForcedFallbackFormat: 4
|
||||
m_DownscaleFallback: 0
|
||||
m_IsAlphaChannelOptional: 0
|
||||
serializedVersion: 5
|
||||
m_Width: 256
|
||||
m_Height: 256
|
||||
m_AntiAliasing: 1
|
||||
m_MipCount: -1
|
||||
m_DepthStencilFormat: 92
|
||||
m_ColorFormat: 8
|
||||
m_MipMap: 0
|
||||
m_GenerateMips: 1
|
||||
m_SRGB: 0
|
||||
m_UseDynamicScale: 0
|
||||
m_BindMS: 0
|
||||
m_EnableCompatibleFormat: 1
|
||||
m_EnableRandomWrite: 0
|
||||
m_TextureSettings:
|
||||
serializedVersion: 2
|
||||
m_FilterMode: 1
|
||||
m_Aniso: 0
|
||||
m_MipBias: 0
|
||||
m_WrapU: 1
|
||||
m_WrapV: 1
|
||||
m_WrapW: 1
|
||||
m_Dimension: 2
|
||||
m_VolumeDepth: 1
|
||||
m_ShadowSamplingMode: 2
|
|
@ -1,8 +0,0 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 408bdb50ea5c1fb9a9ba0b304a23937f
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 8400000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -110,7 +110,13 @@ MonoBehaviour:
|
|||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
outsideCameraPrefab: {fileID: 8232122274264839316, guid: ac9fbe69dff6d1c7a93e664c3f5ae6c5, type: 3}
|
||||
window: {fileID: 6981166311419570614}
|
||||
meshRenderer: {fileID: 7611775921384905385}
|
||||
--- !u!4 &6981166311419570614 stripped
|
||||
Transform:
|
||||
m_CorrespondingSourceObject: {fileID: 1132682185376712905, guid: 891349029806e4144812ff2d304d9cf9, type: 3}
|
||||
m_PrefabInstance: {fileID: 8023740769919345023}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
--- !u!23 &7611775921384905385 stripped
|
||||
MeshRenderer:
|
||||
m_CorrespondingSourceObject: {fileID: 502283750161808342, guid: 891349029806e4144812ff2d304d9cf9, type: 3}
|
||||
|
|
|
@ -5,6 +5,8 @@ using UnityEngine.Networking;
|
|||
public class WallArt : MonoBehaviour
|
||||
{
|
||||
public GameObject outsideCameraPrefab;
|
||||
|
||||
public Transform window;
|
||||
private Camera outsideCameraInstance;
|
||||
public MeshRenderer meshRenderer;
|
||||
private OVRCameraRig ovrCameraRig;
|
||||
|
@ -69,6 +71,9 @@ public class WallArt : MonoBehaviour
|
|||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
|
||||
// https://www.youtube.com/watch?v=txF4t1qynyk
|
||||
|
||||
// Check if the cameraRig is assigned
|
||||
if (ovrCameraRig == null) return;
|
||||
|
||||
|
@ -77,12 +82,18 @@ public class WallArt : MonoBehaviour
|
|||
//Vector3 centerEyePosition = new Vector3();
|
||||
|
||||
// Update the position of the object based on the CenterEyeAnchor position with an added offset to the y-axis
|
||||
outsideCameraInstance.transform.position = new Vector3(centerEyePosition.x, centerEyePosition.y + 0f, centerEyePosition.z);
|
||||
///outsideCameraInstance.transform.position = new Vector3(centerEyePosition.x, centerEyePosition.y + 0f, centerEyePosition.z);
|
||||
|
||||
// Remove rotation around the z-axis
|
||||
Vector3 eulerRotation = ovrCameraRig.centerEyeAnchor.rotation.eulerAngles;
|
||||
///Vector3 eulerRotation = ovrCameraRig.centerEyeAnchor.rotation.eulerAngles;
|
||||
//Vector3 eulerRotation = Vector3.right;
|
||||
outsideCameraInstance.transform.rotation = Quaternion.Euler(eulerRotation.x, eulerRotation.y, 0f);
|
||||
///outsideCameraInstance.transform.rotation = Quaternion.Euler(eulerRotation.x, eulerRotation.y, 0f);
|
||||
|
||||
Vector3 localPlayer = window.InverseTransformPoint(centerEyePosition);
|
||||
outsideCameraInstance.transform.position = window.TransformPoint(new Vector3(localPlayer.x, localPlayer.y, localPlayer.z));
|
||||
Vector3 lookAtWindow = window.TransformPoint(new Vector3(-localPlayer.x, localPlayer.y, localPlayer.z));
|
||||
outsideCameraInstance.transform.LookAt(lookAtWindow);
|
||||
|
||||
}
|
||||
|
||||
private void Log(string message)
|
||||
|
|
|
@ -6486,7 +6486,7 @@ PrefabInstance:
|
|||
- target: {fileID: 747806495401477012, guid: c813208e672e3074bbe118e1a9ee94fd, type: 3}
|
||||
propertyPath: PrefabOverrides.Array.data[4].Prefab
|
||||
value:
|
||||
objectReference: {fileID: 3685766024578757413, guid: 00f12700905120bd8a9ac57cf4832751, type: 3}
|
||||
objectReference: {fileID: 3685766024578757413, guid: 5af880326f63b099fa3411bbb738df9f, type: 3}
|
||||
- target: {fileID: 747806495401477012, guid: c813208e672e3074bbe118e1a9ee94fd, type: 3}
|
||||
propertyPath: PrefabOverrides.Array.data[5].Prefab
|
||||
value:
|
||||
|
|
|
@ -139,8 +139,6 @@ PlayerSettings:
|
|||
bundleVersion: 0.1
|
||||
preloadedAssets:
|
||||
- {fileID: 11400000, guid: 29d72bf9f28086693968cedbdc8f08cd, type: 2}
|
||||
- {fileID: 11400000, guid: 541751c4fa90967d68ef779a22ee43f3, type: 2}
|
||||
- {fileID: -3127938587913570544, guid: 8eb28e39ec717d0799039f01965f0533, type: 2}
|
||||
metroInputSource: 0
|
||||
wsaTransparentSwapchain: 0
|
||||
m_HolographicPauseOnTrackingLoss: 1
|
||||
|
|
Loading…
Reference in New Issue