// Update is called once per frame void Update() { // Now there is MapToRender MUST use physics and not transform position Vector3 centerPos = GravityEngine.Instance().GetPhysicsPosition(aroundNBody); // Is the resulting orbit and ellipse or hyperbola? bool mapToScene = true; Vector3d pos = ge.GetPositionDoubleV3(nbody); Vector3d vel; if (velocityFromScript) { vel = new Vector3d(velocity); } else { vel = ge.GetVelocityDoubleV3(nbody); } if (destination != null) { // since the segment code just uses this for the angle, the scale does not matter destPoint = destination.transform.position; } orbitU.InitFromRVT(pos, vel, ge.GetPhysicalTimeDouble(), aroundNBody, false); // TODO: Decide on best segment approach. Common for hyperbola vs ellipse ?? Vector3[] positions; if (orbitU.eccentricity < 1.0) { positions = orbitU.EllipseSegment(numPoints, centerPos, pos.ToVector3(), destPoint, shortPath); } else { float radius = (pos.ToVector3() - centerPos).magnitude; positions = orbitU.HyperSegmentSymmetric(numPoints, centerPos, radius, mapToScene); } lineR.SetPositions(positions); }