Commit e7013954 authored by Chae Ho Shin's avatar Chae Ho Shin

Fix camera work

parent 02456aa4
...@@ -4,135 +4,74 @@ ...@@ -4,135 +4,74 @@
Material: Material:
serializedVersion: 6 serializedVersion: 6
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0} m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0} m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: B m_Name: B
m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0}
m_ShaderKeywords: m_ShaderKeywords: _EMISSION
m_LightmapFlags: 5 m_LightmapFlags: 1
m_CustomRenderQueue: 2400 m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {} stringTagMap: {}
disabledShaderPasses: []
m_SavedProperties: m_SavedProperties:
serializedVersion: 2 serializedVersion: 3
m_TexEnvs: m_TexEnvs:
data: - _BumpMap:
first: m_Texture: {fileID: 0}
name: _MainTex m_Scale: {x: 1, y: 1}
second: m_Offset: {x: 0, y: 0}
m_Texture: {fileID: 0} - _DetailAlbedoMap:
m_Scale: {x: 1, y: 1} m_Texture: {fileID: 0}
m_Offset: {x: 0, y: 0} m_Scale: {x: 1, y: 1}
data: m_Offset: {x: 0, y: 0}
first: - _DetailMask:
name: _BumpMap m_Texture: {fileID: 0}
second: m_Scale: {x: 1, y: 1}
m_Texture: {fileID: 0} m_Offset: {x: 0, y: 0}
m_Scale: {x: 1, y: 1} - _DetailNormalMap:
m_Offset: {x: 0, y: 0} m_Texture: {fileID: 0}
data: m_Scale: {x: 1, y: 1}
first: m_Offset: {x: 0, y: 0}
name: _DetailNormalMap - _EmissionMap:
second: m_Texture: {fileID: 0}
m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1}
m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0}
m_Offset: {x: 0, y: 0} - _MainTex:
data: m_Texture: {fileID: 0}
first: m_Scale: {x: 1, y: 1}
name: _ParallaxMap m_Offset: {x: 0, y: 0}
second: - _MetallicGlossMap:
m_Texture: {fileID: 0} m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1} m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0} m_Offset: {x: 0, y: 0}
data: - _OcclusionMap:
first: m_Texture: {fileID: 0}
name: _OcclusionMap m_Scale: {x: 1, y: 1}
second: m_Offset: {x: 0, y: 0}
m_Texture: {fileID: 0} - _ParallaxMap:
m_Scale: {x: 1, y: 1} m_Texture: {fileID: 0}
m_Offset: {x: 0, y: 0} m_Scale: {x: 1, y: 1}
data: m_Offset: {x: 0, y: 0}
first:
name: _EmissionMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
data:
first:
name: _DetailMask
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
data:
first:
name: _DetailAlbedoMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
data:
first:
name: _MetallicGlossMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats: m_Floats:
data: - _BumpScale: 1
first: - _Cutoff: 0.5
name: _SrcBlend - _DetailNormalMapScale: 1
second: 1 - _DstBlend: 0
data: - _GlossMapScale: 1
first: - _Glossiness: 0.5
name: _DstBlend - _GlossyReflections: 1
second: 0 - _Metallic: 0
data: - _Mode: 0
first: - _OcclusionStrength: 1
name: _Cutoff - _Parallax: 0.02
second: 0.5 - _SmoothnessTextureChannel: 0
data: - _SpecularHighlights: 1
first: - _SrcBlend: 1
name: _Parallax - _UVSec: 0
second: 0.02 - _ZWrite: 1
data:
first:
name: _ZWrite
second: 1
data:
first:
name: _Glossiness
second: 0.5
data:
first:
name: _BumpScale
second: 1
data:
first:
name: _OcclusionStrength
second: 1
data:
first:
name: _DetailNormalMapScale
second: 1
data:
first:
name: _UVSec
second: 0
data:
first:
name: _Mode
second: 0
data:
first:
name: _Metallic
second: 0
m_Colors: m_Colors:
data: - _Color: {r: 0, g: 0, b: 0.78431374, a: 1}
first: - _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
name: _EmissionColor
second: {r: 0, g: 0, b: 0, a: 1}
data:
first:
name: _Color
second: {r: 0, g: 0, b: 0.78431374, a: 1}
...@@ -4,151 +4,74 @@ ...@@ -4,151 +4,74 @@
Material: Material:
serializedVersion: 6 serializedVersion: 6
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0} m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0} m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: ThreeAAPlanesCrossSection m_Name: ThreeAAPlanesCrossSection
m_Shader: {fileID: 4800000, guid: b42f1ab5d8353214ab7616620a82e483, type: 3} m_Shader: {fileID: 4800000, guid: b42f1ab5d8353214ab7616620a82e483, type: 3}
m_ShaderKeywords: m_ShaderKeywords:
m_LightmapFlags: 5 m_LightmapFlags: 5
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: 2000 m_CustomRenderQueue: 2000
stringTagMap: {} stringTagMap: {}
disabledShaderPasses: []
m_SavedProperties: m_SavedProperties:
serializedVersion: 2 serializedVersion: 3
m_TexEnvs: m_TexEnvs:
data: - _BumpMap:
first: m_Texture: {fileID: 0}
name: _MainTex m_Scale: {x: 1, y: 1}
second: m_Offset: {x: 0, y: 0}
m_Texture: {fileID: 0} - _DetailAlbedoMap:
m_Scale: {x: 1, y: 1} m_Texture: {fileID: 0}
m_Offset: {x: 0, y: 0} m_Scale: {x: 1, y: 1}
data: m_Offset: {x: 0, y: 0}
first: - _DetailMask:
name: _BumpMap m_Texture: {fileID: 0}
second: m_Scale: {x: 1, y: 1}
m_Texture: {fileID: 0} m_Offset: {x: 0, y: 0}
m_Scale: {x: 1, y: 1} - _DetailNormalMap:
m_Offset: {x: 0, y: 0} m_Texture: {fileID: 0}
data: m_Scale: {x: 1, y: 1}
first: m_Offset: {x: 0, y: 0}
name: _DetailNormalMap - _EmissionMap:
second: m_Texture: {fileID: 0}
m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1}
m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0}
m_Offset: {x: 0, y: 0} - _MainTex:
data: m_Texture: {fileID: 0}
first: m_Scale: {x: 1, y: 1}
name: _ParallaxMap m_Offset: {x: 0, y: 0}
second: - _MetallicGlossMap:
m_Texture: {fileID: 0} m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1} m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0} m_Offset: {x: 0, y: 0}
data: - _OcclusionMap:
first: m_Texture: {fileID: 0}
name: _OcclusionMap m_Scale: {x: 1, y: 1}
second: m_Offset: {x: 0, y: 0}
m_Texture: {fileID: 0} - _ParallaxMap:
m_Scale: {x: 1, y: 1} m_Texture: {fileID: 0}
m_Offset: {x: 0, y: 0} m_Scale: {x: 1, y: 1}
data: m_Offset: {x: 0, y: 0}
first:
name: _EmissionMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
data:
first:
name: _DetailMask
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
data:
first:
name: _DetailAlbedoMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
data:
first:
name: _MetallicGlossMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats: m_Floats:
data: - _BumpScale: 1
first: - _Cutoff: 0.5
name: _SrcBlend - _DetailNormalMapScale: 1
second: 1 - _DstBlend: 0
data: - _Glossiness: 0.5
first: - _Metallic: 0
name: _DstBlend - _Mode: 0
second: 0 - _OcclusionStrength: 1
data: - _Parallax: 0.02
first: - _SrcBlend: 1
name: _Cutoff - _UVSec: 0
second: 0.5 - _ZWrite: 1
data:
first:
name: _Parallax
second: 0.02
data:
first:
name: _ZWrite
second: 1
data:
first:
name: _Glossiness
second: 0.5
data:
first:
name: _BumpScale
second: 1
data:
first:
name: _OcclusionStrength
second: 1
data:
first:
name: _DetailNormalMapScale
second: 1
data:
first:
name: _UVSec
second: 0
data:
first:
name: _Mode
second: 0
data:
first:
name: _Metallic
second: 0
m_Colors: m_Colors:
data: - _Color: {r: 0.6838235, g: 0.030168673, b: 0.0675203, a: 1}
first: - _CrossColor: {r: 0.875, g: 0.59945494, b: 0.0064338297, a: 1}
name: _EmissionColor - _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
second: {r: 0, g: 0, b: 0, a: 1} - _Plane1Position: {r: -0.04, g: 0, b: 0, a: 1}
data: - _Plane2Position: {r: 0, g: 0.37, b: 0, a: 1}
first: - _Plane3Position: {r: 0, g: 0, b: 0.24, a: 1}
name: _Color
second: {r: 0.6838235, g: 0.030168673, b: 0.0675203, a: 1}
data:
first:
name: _CrossColor
second: {r: 0.875, g: 0.59945494, b: 0.0064338297, a: 1}
data:
first:
name: _Plane1Position
second: {r: 0, g: 0, b: 0, a: 1}
data:
first:
name: _Plane2Position
second: {r: 0, g: 0, b: 0, a: 1}
data:
first:
name: _Plane3Position
second: {r: 0, g: 0, b: 0, a: 1}
...@@ -4,135 +4,74 @@ ...@@ -4,135 +4,74 @@
Material: Material:
serializedVersion: 6 serializedVersion: 6
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0} m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0} m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: defaultMat m_Name: defaultMat
m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0}
m_ShaderKeywords: m_ShaderKeywords: _EMISSION
m_LightmapFlags: 5 m_LightmapFlags: 1
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1 m_CustomRenderQueue: -1
stringTagMap: {} stringTagMap: {}
disabledShaderPasses: []
m_SavedProperties: m_SavedProperties:
serializedVersion: 2 serializedVersion: 3
m_TexEnvs: m_TexEnvs:
data: - _BumpMap:
first: m_Texture: {fileID: 0}
name: _MainTex m_Scale: {x: 1, y: 1}
second: m_Offset: {x: 0, y: 0}
m_Texture: {fileID: 0} - _DetailAlbedoMap:
m_Scale: {x: 1, y: 1} m_Texture: {fileID: 0}
m_Offset: {x: 0, y: 0} m_Scale: {x: 1, y: 1}
data: m_Offset: {x: 0, y: 0}
first: - _DetailMask:
name: _BumpMap m_Texture: {fileID: 0}
second: m_Scale: {x: 1, y: 1}
m_Texture: {fileID: 0} m_Offset: {x: 0, y: 0}
m_Scale: {x: 1, y: 1} - _DetailNormalMap:
m_Offset: {x: 0, y: 0} m_Texture: {fileID: 0}
data: m_Scale: {x: 1, y: 1}
first: m_Offset: {x: 0, y: 0}
name: _DetailNormalMap - _EmissionMap:
second: m_Texture: {fileID: 0}
m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1}
m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0}
m_Offset: {x: 0, y: 0} - _MainTex:
data: m_Texture: {fileID: 0}
first: m_Scale: {x: 1, y: 1}
name: _ParallaxMap m_Offset: {x: 0, y: 0}
second: - _MetallicGlossMap:
m_Texture: {fileID: 0} m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1} m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0} m_Offset: {x: 0, y: 0}
data: - _OcclusionMap:
first: m_Texture: {fileID: 0}
name: _OcclusionMap m_Scale: {x: 1, y: 1}
second: m_Offset: {x: 0, y: 0}
m_Texture: {fileID: 0} - _ParallaxMap:
m_Scale: {x: 1, y: 1} m_Texture: {fileID: 0}
m_Offset: {x: 0, y: 0} m_Scale: {x: 1, y: 1}
data: m_Offset: {x: 0, y: 0}
first:
name: _EmissionMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
data:
first:
name: _DetailMask
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
data:
first:
name: _DetailAlbedoMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
data:
first:
name: _MetallicGlossMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats: m_Floats:
data: - _BumpScale: 1
first: - _Cutoff: 0.5
name: _SrcBlend - _DetailNormalMapScale: 1
second: 1 - _DstBlend: 0
data: - _GlossMapScale: 1
first: - _Glossiness: 0.5
name: _DstBlend - _GlossyReflections: 1
second: 0 - _Metallic: 0
data: - _Mode: 0
first: - _OcclusionStrength: 1
name: _Cutoff - _Parallax: 0.02
second: 0.5 - _SmoothnessTextureChannel: 0
data: - _SpecularHighlights: 1
first: - _SrcBlend: 1
name: _Parallax - _UVSec: 0
second: 0.02 - _ZWrite: 1
data:
first:
name: _ZWrite
second: 1
data:
first:
name: _Glossiness
second: 0.5
data:
first:
name: _BumpScale
second: 1
data:
first:
name: _OcclusionStrength
second: 1
data:
first:
name: _DetailNormalMapScale
second: 1
data:
first:
name: _UVSec
second: 0
data:
first:
name: _Mode
second: 0
data:
first:
name: _Metallic
second: 0
m_Colors: m_Colors:
data: - _Color: {r: 0.8, g: 0.8, b: 0.8, a: 1}
first: - _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
name: _EmissionColor
second: {r: 0, g: 0, b: 0, a: 1}
data:
first:
name: _Color
second: {r: 0.8, g: 0.8, b: 0.8, a: 1}
...@@ -9,6 +9,7 @@ public class CameraMovement : MonoBehaviour ...@@ -9,6 +9,7 @@ public class CameraMovement : MonoBehaviour
Camera thecamera; Camera thecamera;
double aspect; double aspect;
double size;
//public double playergamma; //public double playergamma;
// Start is called before the first frame update // Start is called before the first frame update
void Start() void Start()
...@@ -16,6 +17,7 @@ public class CameraMovement : MonoBehaviour ...@@ -16,6 +17,7 @@ public class CameraMovement : MonoBehaviour
//playergamma = 1.0f; //playergamma = 1.0f;
thecamera = GetComponent<Camera>(); thecamera = GetComponent<Camera>();
aspect = 16.0f / 9.0f; aspect = 16.0f / 9.0f;
size = 10.0f;
} }
// Update is called once per frame // Update is called once per frame
...@@ -25,7 +27,7 @@ public class CameraMovement : MonoBehaviour ...@@ -25,7 +27,7 @@ public class CameraMovement : MonoBehaviour
var v = Levelmanager.player.v; var v = Levelmanager.player.v;
var vt = v + Vector3.up; var vt = v + (float)Constants.c * Vector3.up;
vt.x = -vt.x; vt.x = -vt.x;
...@@ -37,7 +39,7 @@ public class CameraMovement : MonoBehaviour ...@@ -37,7 +39,7 @@ public class CameraMovement : MonoBehaviour
transform.rotation = Quaternion.LookRotation(-vt, newforward); transform.rotation = Quaternion.LookRotation(-vt, newforward);
thecamera.orthographicSize = 10.0f * ((float)Levelmanager.player.gamma); // number is size of camera thecamera.orthographicSize = (float)(size * (Levelmanager.player.gamma)); // number is size of camera
aspect = 16.0f / (9.0f * (Levelmanager.player.gamma)); aspect = 16.0f / (9.0f * (Levelmanager.player.gamma));
......
...@@ -6,7 +6,7 @@ using MathNet.Numerics.LinearAlgebra.Double; ...@@ -6,7 +6,7 @@ using MathNet.Numerics.LinearAlgebra.Double;
public static class Constants public static class Constants
{ {
public static double c => 5; // speed of light. public static double c => 10; // speed of light.
public static double Gamma(double v) public static double Gamma(double v)
{ {
return 1.0f / Mathf.Sqrt((float)(1 - ((v / c) * (v / c)))); return 1.0f / Mathf.Sqrt((float)(1 - ((v / c) * (v / c))));
......
...@@ -179,6 +179,7 @@ public class UIManager : MonoBehaviour ...@@ -179,6 +179,7 @@ public class UIManager : MonoBehaviour
{ {
Levelmanager.player.alpha -= new Vector3(Levelmanager.player.alpha.x, 0, 0); Levelmanager.player.alpha -= new Vector3(Levelmanager.player.alpha.x, 0, 0);
} }
} }
private Vector3 getMouseClickPosition(RaycastHit hit) private Vector3 getMouseClickPosition(RaycastHit hit)
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
--- !u!5 &1 --- !u!5 &1
TimeManager: TimeManager:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
Fixed Timestep: 0.02 Fixed Timestep: 0.01
Maximum Allowed Timestep: 0.1 Maximum Allowed Timestep: 0.1
m_TimeScale: 1 m_TimeScale: 1
Maximum Particle Timestep: 0.03 Maximum Particle Timestep: 0.01
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