Commit 6d9196b3 authored by Chae Ho Shin's avatar Chae Ho Shin

some help for bug fix

parent 2b23d67e
......@@ -205,10 +205,12 @@ public class PathRenderer : MonoBehaviour
int tinterval = Constants.alphatinterval;
VectorBuilder<double> V = Vector<double>.Build;
//square.PathList에서 0에서 시작해 finalPathNum까지 이동
while (i <= finalPathNum)
{
Vector3 startpos = new Vector3(levelManager.player.transform.position.x, 0, levelManager.player.transform.position.z);
Vector3 dest = new Vector3(square.GetNthPath(i).x, 0f, square.GetNthPath(i).y);
Vector3 startpos = new Vector3(levelManager.player.transform.position.x, 0, levelManager.player.transform.position.z); // 경로 이동 시작할때 위치
Vector3 dest = new Vector3(square.GetNthPath(i).x, 0f, square.GetNthPath(i).y); // 시작 관성계 기준 startpos에서 목표지점까지 공간 좌표
Vector3 acceleration = dest.normalized;
var v = square.GetPathVelocity(i);
......@@ -230,8 +232,8 @@ public class PathRenderer : MonoBehaviour
if (u.magnitude > 0.0f)
{
deltav = Constants.BoostMatrix(-u) * deltav;
deltax = Constants.BoostMatrix(-u) * deltaxnaive;
deltav = Constants.BoostMatrix(-u) * deltav; // 로렌츠 행렬을 곱해서 경로 이동시 속도가 월드 관성계에서 무슨 속도인지 구함(deltav)
deltax = Constants.BoostMatrix(-u) * deltaxnaive; // 로렌츠 행렬을 곱해서 경로 이동시 위치 변화가 월드 관성계에서 얼마나 되는지 구함(deltax)
}
var tt = deltav[0] / Constants.c;
......@@ -239,7 +241,7 @@ public class PathRenderer : MonoBehaviour
Vector3 finaldeltav = new Vector3((float)(deltav[1] / tt), 0.0f, (float)(deltav[2] / tt));
Vector3 finaldeltax = new Vector3((float)deltax[1], 0.0f, (float)deltax[2]);
levelManager.player.v = finaldeltav;
levelManager.player.v = finaldeltav; // 플레이어 월드 관성계 기준 속도를 deltav로 세팅
while (true)
{
......@@ -253,18 +255,25 @@ public class PathRenderer : MonoBehaviour
}
levelManager.player.v = u;
levelManager.player.v = u; // 원래 관성계로 돌아옴
levelManager.player.transform.position = new Vector3(startpos.x + finaldeltax.x
, levelManager.player.transform.position.y
, startpos.z + finaldeltax.z);
, startpos.z + finaldeltax.z); // 위치 보정해줌(fixed update오차)
// INSERT CODE TO REMOVE PATH FROM PATH RENDERER HERE
// 여기에 방금 이동한 경로를 안보이게 해야 함
i++;
}
Background.Toggle = true;
//아마 여기에 이동을 다 마친 경로들을 square.pathList랑 square.pathVelocity에서 없애주고, finalPathNum 다음 경로가 square.pathList[1]이 되게 해야할듯
// PathRenderer에 child로 되 있는 Path-n들 이름도 다 바꿔줘야 할꺼임(니가 최종 경로 가 몇번째인지 판정으로 GameObject 이름을 string으로 받아와서 하니까)
// 귀찮으면 아예 UIManager.cs에서 int pathNum = int.Parse(obj.name.Substring(13)); 이부분을 바꿔도 됨.
}
public void DeletePathsAfterNthPath(int n)
......
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