From 05731a8e09adbd3582cba6f276465c43a732632d Mon Sep 17 00:00:00 2001 From: Nico de Poel Date: Sun, 25 Apr 2021 19:44:33 +0200 Subject: [PATCH] Removed redundant division in QTriVertex conversion, and scaled up the rest of the test scene to match. Fixes scale of imported alias models when compared to the world brush model. --- Assets/Scenes/Default.unity | 39 ++++++++++++++++++++++++-- Assets/Scripts/Data/QExtensions.cs | 2 +- Assets/Scripts/Modules/RenderModule.cs | 6 ++-- 3 files changed, 40 insertions(+), 7 deletions(-) diff --git a/Assets/Scenes/Default.unity b/Assets/Scenes/Default.unity index 09841e7..1986eca 100644 --- a/Assets/Scenes/Default.unity +++ b/Assets/Scenes/Default.unity @@ -271,6 +271,7 @@ GameObject: - component: {fileID: 963194228} - component: {fileID: 963194227} - component: {fileID: 963194226} + - component: {fileID: 963194229} m_Layer: 0 m_Name: Main Camera m_TagString: MainCamera @@ -309,8 +310,8 @@ Camera: y: 0 width: 1 height: 1 - near clip plane: 0.3 - far clip plane: 1000 + near clip plane: 4 + far clip plane: 16384 field of view: 60 orthographic: 0 orthographic size: 5 @@ -337,9 +338,41 @@ Transform: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 963194225} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 1, z: -10} + m_LocalPosition: {x: 0, y: 250, z: -2500} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 0} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &963194229 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 963194225} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: a79441f348de89743a2939f4d699eac1, type: 3} + m_Name: + m_EditorClassIdentifier: + m_RenderShadows: 1 + m_RequiresDepthTextureOption: 2 + m_RequiresOpaqueTextureOption: 2 + m_CameraType: 0 + m_Cameras: [] + m_RendererIndex: -1 + m_VolumeLayerMask: + serializedVersion: 2 + m_Bits: 1 + m_VolumeTrigger: {fileID: 0} + m_RenderPostProcessing: 0 + m_Antialiasing: 0 + m_AntialiasingQuality: 2 + m_StopNaN: 0 + m_Dithering: 0 + m_ClearDepth: 1 + m_AllowXRRendering: 1 + m_RequiresDepthTexture: 0 + m_RequiresColorTexture: 0 + m_Version: 2 diff --git a/Assets/Scripts/Data/QExtensions.cs b/Assets/Scripts/Data/QExtensions.cs index a48546a..abb4c51 100644 --- a/Assets/Scripts/Data/QExtensions.cs +++ b/Assets/Scripts/Data/QExtensions.cs @@ -43,6 +43,6 @@ public static class QExtensions public static Vector3 ToVector3(this QTriVertex triVertex) { byte[] v = triVertex.v; - return new Vector3(v[0] / 255f, v[1] / 255f, v[2] / 255f); + return new Vector3(v[0], v[1], v[2]); } } diff --git a/Assets/Scripts/Modules/RenderModule.cs b/Assets/Scripts/Modules/RenderModule.cs index d11e031..ce2a056 100644 --- a/Assets/Scripts/Modules/RenderModule.cs +++ b/Assets/Scripts/Modules/RenderModule.cs @@ -14,7 +14,7 @@ public partial class RenderModule BuildCallbacks(); zPos = globalZPos; - globalZPos -= 1.0f; + globalZPos -= 256f; } public override void Destroy() @@ -36,7 +36,7 @@ public partial class RenderModule textures.Clear(); } - private float xPos = -8f; + private float xPos = -2048f; private float zPos = 0f; private static float globalZPos = 0f; @@ -115,7 +115,7 @@ public partial class RenderModule mr.reflectionProbeUsage = ReflectionProbeUsage.Off; } - xPos += 0.5f; + xPos += 128f; return 1; }