Skip to content
Snippets Groups Projects
Commit 498f99a0 authored by Clément's avatar Clément
Browse files

BLA BLA

parent 386229f6
No related branches found
No related tags found
No related merge requests found
...@@ -178,7 +178,7 @@ Terrain: ...@@ -178,7 +178,7 @@ Terrain:
m_DrawTreesAndFoliage: 1 m_DrawTreesAndFoliage: 1
m_StaticShadowCaster: 0 m_StaticShadowCaster: 0
m_ReflectionProbeUsage: 1 m_ReflectionProbeUsage: 1
m_MaterialTemplate: {fileID: 10652, guid: 0000000000000000f000000000000000, type: 0} m_MaterialTemplate: {fileID: 2100000, guid: 594ea882c5a793440b60ff72d896021e, type: 2}
m_BakeLightProbesForTrees: 1 m_BakeLightProbesForTrees: 1
m_PreserveTreePrototypeLayers: 0 m_PreserveTreePrototypeLayers: 0
m_DeringLightProbesForTrees: 1 m_DeringLightProbesForTrees: 1
...@@ -211,14 +211,14 @@ MonoBehaviour: ...@@ -211,14 +211,14 @@ MonoBehaviour:
m_GameObject: {fileID: 460623921} m_GameObject: {fileID: 460623921}
m_Enabled: 1 m_Enabled: 1
m_EditorHideFlags: 0 m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: fd4883b8303617d4992553ff7503d039, type: 3} m_Script: {fileID: 11500000, guid: 86c7bfd105ba6e14180f833234cbc0b8, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
depth: 20 depth: 20
width: 256 width: 256
height: 256 height: 256
scale: 2 scale: 2
values: ptProches:
--- !u!1 &705507993 --- !u!1 &705507993
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
...@@ -229,6 +229,7 @@ GameObject: ...@@ -229,6 +229,7 @@ GameObject:
m_Component: m_Component:
- component: {fileID: 705507995} - component: {fileID: 705507995}
- component: {fileID: 705507994} - component: {fileID: 705507994}
- component: {fileID: 705507996}
m_Layer: 0 m_Layer: 0
m_Name: Directional Light m_Name: Directional Light
m_TagString: Untagged m_TagString: Untagged
...@@ -313,6 +314,26 @@ Transform: ...@@ -313,6 +314,26 @@ Transform:
m_Father: {fileID: 0} m_Father: {fileID: 0}
m_RootOrder: 1 m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0} m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0}
--- !u!114 &705507996
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 705507993}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 474bcb49853aa07438625e644c072ee6, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Version: 1
m_UsePipelineSettings: 1
m_AdditionalLightsShadowResolutionTier: 2
m_LightLayerMask: 1
m_CustomShadowLayers: 0
m_ShadowLayerMask: 1
m_LightCookieSize: {x: 1, y: 1}
m_LightCookieOffset: {x: 0, y: 0}
--- !u!1 &963194225 --- !u!1 &963194225
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
......
...@@ -9,6 +9,7 @@ public class V7 : MonoBehaviour ...@@ -9,6 +9,7 @@ public class V7 : MonoBehaviour
public float scale = 2f; public float scale = 2f;
public int[,] values; public int[,] values;
public int[] ptProches;
int dim1; int dim1;
int dim2; int dim2;
...@@ -51,10 +52,16 @@ public class V7 : MonoBehaviour ...@@ -51,10 +52,16 @@ public class V7 : MonoBehaviour
bool PisteTest(int x, int y) bool PisteTest(int x, int y)
{ {
int ptLePlusProche;
for (int i = 0; i < dim2; i++) for (int i = 0; i < dim2; i++)
{ {
if (x == values[0, i] && y == values[1, i]) if (x == values[0, i] && y == values[1, i])
{ {
int x1 = values[0, i];
int y1 = values[1, i];
int x2 = values[0, ptProches[i]];
int y2 = values[1, ptProches[i]];
return true; return true;
} }
} }
...@@ -62,24 +69,57 @@ public class V7 : MonoBehaviour ...@@ -62,24 +69,57 @@ public class V7 : MonoBehaviour
return false; return false;
} }
void ptLePlusProche()
{
int ptProche = -1;
double resultPtProche = 256;
double resultPtActuel = 256;
for (int i = 0; i < dim2; i++)
{
for (int j = 0; j < dim2; j++)
{
if (values[0, j] != values[0, i] || values[1, j] != values[1, i])
{
int x1 = values[0, i];
int y1 = values[1, i];
int x2 = values[0, j];
int y2 = values[1, j];
resultPtActuel = Mathf.Sqrt((x2 - x1) ^ 2 + (y2 - y1) ^ 2);
if (resultPtActuel < resultPtProche)
{
resultPtProche = resultPtActuel;
ptProche = j;
}
}
}
ptProches[i] = ptProche;
}
}
bool tracerChemin(int x1, int y1, int x2, int y2, int x, int y)
{
double m = (y2 - y1) / (x2 - x1);
double p = y - m * x;
bool equation = m == (p - y) / x;
return equation;
}
float[,] GenerateHeights() float[,] GenerateHeights()
{ {
float[,] heights = new float[width, height]; float[,] heights = new float[width, height];
for (int x = 0; x < width; x++) for (int x = 0; x < width; x++)
{ {
for (int y = 0; y < height; y++) for (int y = 0; y < height; y++)
{
if (PisteTest(x, y))
{
heights[x, y] = 0;
}
else
{ {
heights[x, y] = CalculateHeight(x, y); heights[x, y] = CalculateHeight(x, y);
} }
} }
}
for (int i = 0; i < dim2; i++)
{
heights[values[0, i], values[1, i]] = 0;
}
return heights; return heights;
} }
......
No preview for this file type
...@@ -178,7 +178,7 @@ Terrain: ...@@ -178,7 +178,7 @@ Terrain:
m_DrawTreesAndFoliage: 1 m_DrawTreesAndFoliage: 1
m_StaticShadowCaster: 0 m_StaticShadowCaster: 0
m_ReflectionProbeUsage: 1 m_ReflectionProbeUsage: 1
m_MaterialTemplate: {fileID: 10652, guid: 0000000000000000f000000000000000, type: 0} m_MaterialTemplate: {fileID: 2100000, guid: 594ea882c5a793440b60ff72d896021e, type: 2}
m_BakeLightProbesForTrees: 1 m_BakeLightProbesForTrees: 1
m_PreserveTreePrototypeLayers: 0 m_PreserveTreePrototypeLayers: 0
m_DeringLightProbesForTrees: 1 m_DeringLightProbesForTrees: 1
...@@ -211,14 +211,14 @@ MonoBehaviour: ...@@ -211,14 +211,14 @@ MonoBehaviour:
m_GameObject: {fileID: 460623921} m_GameObject: {fileID: 460623921}
m_Enabled: 1 m_Enabled: 1
m_EditorHideFlags: 0 m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: fd4883b8303617d4992553ff7503d039, type: 3} m_Script: {fileID: 11500000, guid: 86c7bfd105ba6e14180f833234cbc0b8, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
depth: 20 depth: 20
width: 256 width: 256
height: 256 height: 256
scale: 2 scale: 2
values: ptProches:
--- !u!1 &705507993 --- !u!1 &705507993
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
...@@ -229,6 +229,7 @@ GameObject: ...@@ -229,6 +229,7 @@ GameObject:
m_Component: m_Component:
- component: {fileID: 705507995} - component: {fileID: 705507995}
- component: {fileID: 705507994} - component: {fileID: 705507994}
- component: {fileID: 705507996}
m_Layer: 0 m_Layer: 0
m_Name: Directional Light m_Name: Directional Light
m_TagString: Untagged m_TagString: Untagged
...@@ -313,6 +314,26 @@ Transform: ...@@ -313,6 +314,26 @@ Transform:
m_Father: {fileID: 0} m_Father: {fileID: 0}
m_RootOrder: 1 m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0} m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0}
--- !u!114 &705507996
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 705507993}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 474bcb49853aa07438625e644c072ee6, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Version: 1
m_UsePipelineSettings: 1
m_AdditionalLightsShadowResolutionTier: 2
m_LightLayerMask: 1
m_CustomShadowLayers: 0
m_ShadowLayerMask: 1
m_LightCookieSize: {x: 1, y: 1}
m_LightCookieOffset: {x: 0, y: 0}
--- !u!1 &963194225 --- !u!1 &963194225
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment