Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
curvedflats
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
6
Issues
6
List
Boards
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
Flatland
curvedflats
Commits
27c0b9cc
Commit
27c0b9cc
authored
Aug 14, 2019
by
Chae Ho Shin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
trajectory movement WIP
parent
833ef0ae
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
40 additions
and
36 deletions
+40
-36
Test.unity
Assets/Scenes/Test.unity
+3
-3
BackgroundMovement.cs
Assets/Scripts/BackgroundMovement.cs
+1
-1
Constants.cs
Assets/Scripts/Constants.cs
+1
-1
PathRenderer.cs
Assets/Scripts/PathRenderer.cs
+25
-1
Planemovement.cs
Assets/Scripts/Planemovement.cs
+4
-4
UIManager.cs
Assets/Scripts/UIManager.cs
+4
-24
TimeManager.asset
ProjectSettings/TimeManager.asset
+2
-2
No files found.
Assets/Scenes/Test.unity
View file @
27c0b9cc
...
@@ -303,7 +303,7 @@ Transform:
...
@@ -303,7 +303,7 @@ Transform:
m_LocalScale
:
{
x
:
1
,
y
:
1
,
z
:
1
}
m_LocalScale
:
{
x
:
1
,
y
:
1
,
z
:
1
}
m_Children
:
[]
m_Children
:
[]
m_Father
:
{
fileID
:
0
}
m_Father
:
{
fileID
:
0
}
m_RootOrder
:
4
m_RootOrder
:
5
m_LocalEulerAnglesHint
:
{
x
:
0
,
y
:
0
,
z
:
0
}
m_LocalEulerAnglesHint
:
{
x
:
0
,
y
:
0
,
z
:
0
}
---
!u!114
&279236944
---
!u!114
&279236944
MonoBehaviour
:
MonoBehaviour
:
...
@@ -1064,7 +1064,7 @@ Transform:
...
@@ -1064,7 +1064,7 @@ Transform:
m_Children
:
m_Children
:
-
{
fileID
:
439858922
}
-
{
fileID
:
439858922
}
m_Father
:
{
fileID
:
0
}
m_Father
:
{
fileID
:
0
}
m_RootOrder
:
6
m_RootOrder
:
4
m_LocalEulerAnglesHint
:
{
x
:
0
,
y
:
0
,
z
:
0
}
m_LocalEulerAnglesHint
:
{
x
:
0
,
y
:
0
,
z
:
0
}
---
!u!1
&674390267
---
!u!1
&674390267
GameObject
:
GameObject
:
...
@@ -3472,7 +3472,7 @@ Transform:
...
@@ -3472,7 +3472,7 @@ Transform:
m_LocalScale
:
{
x
:
1
,
y
:
0.1000003
,
z
:
1
}
m_LocalScale
:
{
x
:
1
,
y
:
0.1000003
,
z
:
1
}
m_Children
:
[]
m_Children
:
[]
m_Father
:
{
fileID
:
0
}
m_Father
:
{
fileID
:
0
}
m_RootOrder
:
5
m_RootOrder
:
6
m_LocalEulerAnglesHint
:
{
x
:
90
,
y
:
0
,
z
:
0
}
m_LocalEulerAnglesHint
:
{
x
:
90
,
y
:
0
,
z
:
0
}
---
!u!114
&1661408491
---
!u!114
&1661408491
MonoBehaviour
:
MonoBehaviour
:
...
...
Assets/Scripts/BackgroundMovement.cs
View file @
27c0b9cc
...
@@ -46,7 +46,7 @@ public class BackgroundMovement : MonoBehaviour
...
@@ -46,7 +46,7 @@ public class BackgroundMovement : MonoBehaviour
void
FixedUpdate
()
void
FixedUpdate
()
{
{
if
(
!
toggle
)
if
(
toggle
)
{
{
transform
.
localPosition
=
new
Vector3
(
0
,
0
,
0
);
transform
.
localPosition
=
new
Vector3
(
0
,
0
,
0
);
}
}
...
...
Assets/Scripts/Constants.cs
View file @
27c0b9cc
...
@@ -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
=>
10
;
// speed of light.
public
static
double
c
=>
4
;
// 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
))));
...
...
Assets/Scripts/PathRenderer.cs
View file @
27c0b9cc
...
@@ -22,6 +22,19 @@ public class PathRenderer : MonoBehaviour
...
@@ -22,6 +22,19 @@ public class PathRenderer : MonoBehaviour
LineRenderer
_pathRenderer
;
LineRenderer
_pathRenderer
;
float
_originalPathColliderY
;
float
_originalPathColliderY
;
public
BackgroundMovement
Background
{
get
{
return
background
;
}
set
{
background
=
value
;
}
}
// Start is called before the first frame update
// Start is called before the first frame update
void
Start
()
void
Start
()
{
{
...
@@ -154,7 +167,7 @@ public class PathRenderer : MonoBehaviour
...
@@ -154,7 +167,7 @@ public class PathRenderer : MonoBehaviour
/// 현재 설정된 경로의 속력을 반환.
/// 현재 설정된 경로의 속력을 반환.
/// 0번은 0.0f
/// 0번은 0.0f
/// </summary>
/// </summary>
public
List
<
float
>
PathVelocit
y
s
public
List
<
float
>
PathVelocit
ie
s
{
{
get
get
{
{
...
@@ -178,4 +191,15 @@ public class PathRenderer : MonoBehaviour
...
@@ -178,4 +191,15 @@ public class PathRenderer : MonoBehaviour
_pathCollider
.
transform
.
localPosition
=
(
square
.
pathList
[
n
]
+
square
.
pathList
[
n
+
1
])
/
2
;
_pathCollider
.
transform
.
localPosition
=
(
square
.
pathList
[
n
]
+
square
.
pathList
[
n
+
1
])
/
2
;
}
}
public
IEnumerator
_StartMovingPath
(
int
finalPathNum
)
{
int
i
=
0
;
while
(
i
<
finalPathNum
)
{
yield
return
new
WaitForFixedUpdate
();
}
}
}
}
Assets/Scripts/Planemovement.cs
View file @
27c0b9cc
...
@@ -42,6 +42,9 @@ public class Planemovement : FlatlandMovement
...
@@ -42,6 +42,9 @@ public class Planemovement : FlatlandMovement
{
{
cnt
=
0
;
cnt
=
0
;
}
}
alpha
=
4
*
Vector3
.
forward
*
Mathf
.
Cos
(
2
*
Mathf
.
PI
*
cnt
/
480
)
+
4
*
Vector3
.
left
*
Mathf
.
Sin
(
2
*
Mathf
.
PI
*
cnt
/
480
);
if
(
alpha
.
magnitude
>
0.0f
)
if
(
alpha
.
magnitude
>
0.0f
)
{
{
...
@@ -91,10 +94,7 @@ public class Planemovement : FlatlandMovement
...
@@ -91,10 +94,7 @@ public class Planemovement : FlatlandMovement
v
=
levelManager
.
player
.
v
;
v
=
levelManager
.
player
.
v
;
Debug
.
Log
(
"being grabbed"
);
Debug
.
Log
(
"being grabbed"
);
}
}
else
{
v
=
new
Vector3
(
0
,
0
,
0
);
}
beta
=
v
.
magnitude
/
(
float
)
Constants
.
c
;
beta
=
v
.
magnitude
/
(
float
)
Constants
.
c
;
...
...
Assets/Scripts/UIManager.cs
View file @
27c0b9cc
...
@@ -112,12 +112,6 @@ public class UIManager : MonoBehaviour
...
@@ -112,12 +112,6 @@ public class UIManager : MonoBehaviour
prevSelectPathNum
=
pathNum
;
prevSelectPathNum
=
pathNum
;
}
}
else
{
_pathUI
.
SetActive
(
false
);
prevSelectPathNum
=
-
1
;
sliderflag
=
0
;
}
}
}
else
else
{
{
...
@@ -213,26 +207,12 @@ public class UIManager : MonoBehaviour
...
@@ -213,26 +207,12 @@ public class UIManager : MonoBehaviour
/// </summary>
/// </summary>
public
void
PathStart
()
public
void
PathStart
()
{
{
bool
result
;
pathRenderer
.
Background
.
Toggle
=
false
;
var
positions
=
pathRenderer
.
PathPositionsXZ
;
StartCoroutine
(
pathRenderer
.
_StartMovingPath
(
prevSelectPathNum
));
var
velocitys
=
pathRenderer
.
PathVelocitys
;
if
(
positions
.
Count
<=
1
||
velocitys
.
Count
<=
1
)
{
return
;
}
// remove dummy
positions
.
RemoveAt
(
0
);
velocitys
.
RemoveAt
(
0
);
result
=
levelManager
.
player
.
MoveToRetivePosition
(
positions
,
velocitys
);
if
(
result
)
{
pathRenderer
.
PathClear
();
}
}
}
public
void
OnDoubleClicked
()
public
void
OnDoubleClicked
()
{
{
try
try
...
...
ProjectSettings/TimeManager.asset
View file @
27c0b9cc
...
@@ -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.0
1
Fixed Timestep
:
0.0
05
Maximum Allowed Timestep
:
0.1
Maximum Allowed Timestep
:
0.1
m_TimeScale
:
1
m_TimeScale
:
1
Maximum Particle Timestep
:
0.0
1
Maximum Particle Timestep
:
0.0
05
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