Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
C
car-sim-remaster
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
9631059
car-sim-remaster
Commits
936a9011
Commit
936a9011
authored
Jun 26, 2020
by
Danial KordModanlou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
distance system updated
parent
098c4aaa
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
197 additions
and
284 deletions
+197
-284
indexLayout.xml
.idea/.idea.car-sim-remaster/.idea/indexLayout.xml
+1
-0
workspace.xml
.idea/.idea.car-sim-remaster/.idea/workspace.xml
+43
-42
SampleScene.unity
Assets/Scenes/SampleScene.unity
+142
-235
Wall.cs
Assets/scripts/Wall.cs
+11
-7
No files found.
.idea/.idea.car-sim-remaster/.idea/indexLayout.xml
View file @
936a9011
...
...
@@ -19,6 +19,7 @@
<Path>
.vs
</Path>
<Path>
Library
</Path>
<Path>
Logs
</Path>
<Path>
Temp
</Path>
<Path>
obj
</Path>
</explicitExcludes>
</component>
...
...
.idea/.idea.car-sim-remaster/.idea/workspace.xml
View file @
936a9011
...
...
@@ -3,8 +3,9 @@
<component
name=
"ChangeListManager"
>
<list
default=
"true"
id=
"63a78b22-9aa4-4157-97bc-72b63425d4fc"
name=
"Default Changelist"
comment=
""
>
<change
beforePath=
"$PROJECT_DIR$/.idea/.idea.car-sim-remaster/.idea/indexLayout.xml"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/.idea/.idea.car-sim-remaster/.idea/indexLayout.xml"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/.idea/.idea.car-sim-remaster/.idea/workspace.xml"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/.idea/.idea.car-sim-remaster/.idea/workspace.xml"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/Assets/CSV/p1.csv"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/Assets/CSV/p1.csv"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/Assets/
scripts/DataSaver.cs"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/Assets/scripts/DataSaver.cs
"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/Assets/
Scenes/SampleScene.unity"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/Assets/Scenes/SampleScene.unity
"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/Assets/scripts/Wall.cs"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/Assets/scripts/Wall.cs"
afterDir=
"false"
/>
</list>
<option
name=
"EXCLUDED_CONVERTED_TO_IGNORED"
value=
"true"
/>
...
...
@@ -29,11 +30,11 @@
</component>
<component
name=
"FileEditorManager"
>
<leaf
SIDE_TABS_SIZE_LIMIT_KEY=
"300"
>
<file
pinned=
"false"
current-in-tab=
"
tru
e"
>
<file
pinned=
"false"
current-in-tab=
"
fals
e"
>
<entry
file=
"file://$PROJECT_DIR$/Assets/scripts/DataSaver.cs"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"
332
"
>
<caret
line=
"1
16"
column=
"44"
selection-start-line=
"116"
selection-start-column=
"44"
selection-end-line=
"116"
selection-end-column=
"44
"
/>
<state
relative-caret-position=
"
177
"
>
<caret
line=
"1
02"
column=
"7"
selection-start-line=
"102"
selection-start-column=
"7"
selection-end-line=
"102"
selection-end-column=
"7
"
/>
<folding>
<marker
date=
"1593164590767"
expanded=
"true"
signature=
"7:181"
ph=
"..."
/>
<marker
date=
"1593164590767"
expanded=
"true"
signature=
"221:6851"
ph=
"{...}"
/>
...
...
@@ -83,22 +84,22 @@
</provider>
</entry>
</file>
<file
pinned=
"false"
current-in-tab=
"
fals
e"
>
<file
pinned=
"false"
current-in-tab=
"
tru
e"
>
<entry
file=
"file://$PROJECT_DIR$/Assets/scripts/Wall.cs"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"3
12
"
>
<caret
line=
"
82"
column=
"27"
selection-start-line=
"82"
selection-start-column=
"27"
selection-end-line=
"82"
selection-end-column=
"2
7"
/>
<state
relative-caret-position=
"3
71
"
>
<caret
line=
"
79"
column=
"17"
selection-start-line=
"79"
selection-start-column=
"8"
selection-end-line=
"79"
selection-end-column=
"1
7"
/>
<folding>
<marker
date=
"15931
64435901
"
expanded=
"true"
signature=
"6:111"
ph=
"..."
/>
<marker
date=
"15931
64435901"
expanded=
"true"
signature=
"205:2573
"
ph=
"{...}"
/>
<marker
date=
"15931
64435901
"
expanded=
"true"
signature=
"404:560"
ph=
"{...}"
/>
<marker
date=
"15931
64435901"
expanded=
"true"
signature=
"607:941
"
ph=
"{...}"
/>
<marker
date=
"15931
64435901"
expanded=
"true"
signature=
"1037:1104
"
ph=
"{...}"
/>
<marker
date=
"15931
64435901"
expanded=
"true"
signature=
"1188:2390
"
ph=
"{...}"
/>
<marker
date=
"15931
64435901"
expanded=
"true"
signature=
"1558:1960
"
ph=
"{...}"
/>
<marker
date=
"15931
64435901"
expanded=
"true"
signature=
"1698:1808
"
ph=
"{...}"
/>
<marker
date=
"15931
64435901"
expanded=
"true"
signature=
"1860:1950
"
ph=
"{...}"
/>
<marker
date=
"15931
64435901"
expanded=
"true"
signature=
"2426:2566
"
ph=
"{...}"
/>
<marker
date=
"15931
82337612
"
expanded=
"true"
signature=
"6:111"
ph=
"..."
/>
<marker
date=
"15931
82337612"
expanded=
"true"
signature=
"205:2815
"
ph=
"{...}"
/>
<marker
date=
"15931
82337612
"
expanded=
"true"
signature=
"404:560"
ph=
"{...}"
/>
<marker
date=
"15931
82337612"
expanded=
"true"
signature=
"607:1103
"
ph=
"{...}"
/>
<marker
date=
"15931
82337612"
expanded=
"true"
signature=
"1199:1298
"
ph=
"{...}"
/>
<marker
date=
"15931
82337612"
expanded=
"true"
signature=
"1382:2632
"
ph=
"{...}"
/>
<marker
date=
"15931
82337612"
expanded=
"true"
signature=
"1752:2154
"
ph=
"{...}"
/>
<marker
date=
"15931
82337612"
expanded=
"true"
signature=
"1892:2002
"
ph=
"{...}"
/>
<marker
date=
"15931
82337612"
expanded=
"true"
signature=
"2054:2144
"
ph=
"{...}"
/>
<marker
date=
"15931
82337612"
expanded=
"true"
signature=
"2668:2808
"
ph=
"{...}"
/>
</folding>
</state>
</provider>
...
...
@@ -440,8 +441,8 @@
<option
value=
"$PROJECT_DIR$/Assets/scripts/CarCustom.cs"
/>
<option
value=
"$PROJECT_DIR$/Assets/TurnTheGameOn/IK Driver/Scripts/Utility/IKD_DemoController.cs"
/>
<option
value=
"$PROJECT_DIR$/Assets/scripts/menuSystem.cs"
/>
<option
value=
"$PROJECT_DIR$/Assets/scripts/Wall.cs"
/>
<option
value=
"$PROJECT_DIR$/Assets/scripts/DataSaver.cs"
/>
<option
value=
"$PROJECT_DIR$/Assets/scripts/Wall.cs"
/>
</list>
</option>
</component>
...
...
@@ -540,12 +541,12 @@
<workItem
from=
"1593094252552"
duration=
"2199000"
/>
<workItem
from=
"1593109187851"
duration=
"1718000"
/>
<workItem
from=
"1593113545384"
duration=
"1808000"
/>
<workItem
from=
"1593157840945"
duration=
"
5288
000"
/>
<workItem
from=
"1593157840945"
duration=
"
9231
000"
/>
</task>
<servers
/>
</component>
<component
name=
"TimeTrackingManager"
>
<option
name=
"totallyTimeSpent"
value=
"6
4259
000"
/>
<option
name=
"totallyTimeSpent"
value=
"6
8202
000"
/>
</component>
<component
name=
"TodoView"
>
<todo-panel
id=
"selected-file"
>
...
...
@@ -557,7 +558,7 @@
</todo-panel>
</component>
<component
name=
"ToolWindowManager"
>
<frame
x=
"-7"
y=
"-7"
width=
"1550"
height=
"838"
extended-state=
"
7
"
/>
<frame
x=
"-7"
y=
"-7"
width=
"1550"
height=
"838"
extended-state=
"
6
"
/>
<layout>
<window_info
active=
"true"
content_ui=
"combo"
id=
"Project"
order=
"0"
visible=
"true"
weight=
"0.3286385"
/>
<window_info
id=
"Structure"
order=
"1"
side_tool=
"true"
weight=
"0.25"
/>
...
...
@@ -1178,29 +1179,10 @@
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/Assets/scripts/Wall.cs"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"312"
>
<caret
line=
"82"
column=
"27"
selection-start-line=
"82"
selection-start-column=
"27"
selection-end-line=
"82"
selection-end-column=
"27"
/>
<folding>
<marker
date=
"1593164435901"
expanded=
"true"
signature=
"6:111"
ph=
"..."
/>
<marker
date=
"1593164435901"
expanded=
"true"
signature=
"205:2573"
ph=
"{...}"
/>
<marker
date=
"1593164435901"
expanded=
"true"
signature=
"404:560"
ph=
"{...}"
/>
<marker
date=
"1593164435901"
expanded=
"true"
signature=
"607:941"
ph=
"{...}"
/>
<marker
date=
"1593164435901"
expanded=
"true"
signature=
"1037:1104"
ph=
"{...}"
/>
<marker
date=
"1593164435901"
expanded=
"true"
signature=
"1188:2390"
ph=
"{...}"
/>
<marker
date=
"1593164435901"
expanded=
"true"
signature=
"1558:1960"
ph=
"{...}"
/>
<marker
date=
"1593164435901"
expanded=
"true"
signature=
"1698:1808"
ph=
"{...}"
/>
<marker
date=
"1593164435901"
expanded=
"true"
signature=
"1860:1950"
ph=
"{...}"
/>
<marker
date=
"1593164435901"
expanded=
"true"
signature=
"2426:2566"
ph=
"{...}"
/>
</folding>
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/Assets/scripts/DataSaver.cs"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"
332
"
>
<caret
line=
"1
16"
column=
"44"
selection-start-line=
"116"
selection-start-column=
"44"
selection-end-line=
"116"
selection-end-column=
"44
"
/>
<state
relative-caret-position=
"
177
"
>
<caret
line=
"1
02"
column=
"7"
selection-start-line=
"102"
selection-start-column=
"7"
selection-end-line=
"102"
selection-end-column=
"7
"
/>
<folding>
<marker
date=
"1593164590767"
expanded=
"true"
signature=
"7:181"
ph=
"..."
/>
<marker
date=
"1593164590767"
expanded=
"true"
signature=
"221:6851"
ph=
"{...}"
/>
...
...
@@ -1231,5 +1213,24 @@
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/Assets/scripts/Wall.cs"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"371"
>
<caret
line=
"79"
column=
"17"
selection-start-line=
"79"
selection-start-column=
"8"
selection-end-line=
"79"
selection-end-column=
"17"
/>
<folding>
<marker
date=
"1593182337612"
expanded=
"true"
signature=
"6:111"
ph=
"..."
/>
<marker
date=
"1593182337612"
expanded=
"true"
signature=
"205:2815"
ph=
"{...}"
/>
<marker
date=
"1593182337612"
expanded=
"true"
signature=
"404:560"
ph=
"{...}"
/>
<marker
date=
"1593182337612"
expanded=
"true"
signature=
"607:1103"
ph=
"{...}"
/>
<marker
date=
"1593182337612"
expanded=
"true"
signature=
"1199:1298"
ph=
"{...}"
/>
<marker
date=
"1593182337612"
expanded=
"true"
signature=
"1382:2632"
ph=
"{...}"
/>
<marker
date=
"1593182337612"
expanded=
"true"
signature=
"1752:2154"
ph=
"{...}"
/>
<marker
date=
"1593182337612"
expanded=
"true"
signature=
"1892:2002"
ph=
"{...}"
/>
<marker
date=
"1593182337612"
expanded=
"true"
signature=
"2054:2144"
ph=
"{...}"
/>
<marker
date=
"1593182337612"
expanded=
"true"
signature=
"2668:2808"
ph=
"{...}"
/>
</folding>
</state>
</provider>
</entry>
</component>
</project>
\ No newline at end of file
Assets/Scenes/SampleScene.unity
View file @
936a9011
This diff is collapsed.
Click to expand it.
Assets/scripts/Wall.cs
View file @
936a9011
...
...
@@ -26,11 +26,13 @@ public class Wall : MonoBehaviour
public
Vector3
distanceToCar
(
Vector3
car
)
{
car
=
transform
.
InverseTransformPoint
(
car
);
//
car = transform.InverseTransformPoint(car);
Debug
.
Log
(
GetComponent
<
MeshCollider
>().
name
);
Vector3
closestPoint
=
GetComponent
<
MeshCollider
>().
ClosestPointOnBounds
(
car
);
Vector3
closestPoint
=
this
.
transform
.
GetComponent
<
MeshCollider
>().
ClosestPointOnBounds
(
car
);
Debug
.
Log
(
"--> "
+
car
+
" "
+
transform
.
TransformPoint
(
closestPoint
));
lastPos
=
closestPoint
;
//transform.TransformPoint(closestPoint);//closestPoint;
lastPoint
=
car
;
//transform.TransformPoint(car);
return
closestPoint
;
}
...
...
@@ -41,6 +43,7 @@ public class Wall : MonoBehaviour
public
void
newMethod
(
Vector3
point
,
Action
<
Vector3
,
float
>
onComplete
)
{
// distanceToCar(point);
StartCoroutine
(
findVertex
(
point
,
onComplete
));
}
...
...
@@ -73,14 +76,15 @@ public class Wall : MonoBehaviour
}
}
// convert nearest vertex back to world space
lastPos
=
transform
.
TransformPoint
(
nearestVertex
);
lastPoint
=
transform
.
TransformPoint
(
point
);
Debug
.
Log
(
"--> "
+
point
+
" "
+
minDistanceSqr
+
" "
+
transform
.
TransformPoint
(
nearestVertex
));
minDistanceSqr
=
Vector3
.
Distance
(
transform
.
TransformPoint
(
nearestVertex
),
lastPoint
);
Debug
.
Log
(
"--> "
+
point
+
" "
+
minDistanceSqr
+
" "
);
onComplete
(
transform
.
TransformPoint
(
nearestVertex
),
minDistanceSqr
);
lastPos
=
transform
.
TransformPoint
(
nearestVertex
);
lastPoint
=
transform
.
TransformPoint
(
point
);
Debug
.
Log
(
lastPoint
);
// Debug.Log(lastPoint);
yield
break
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment