public void Logger(Vector3 lookAtPoint) { if (recorderState == RecorderState.recording) { if (previousState == StateEnum.InAir && state == StateEnum.OnGround) { //filled log section inserted into session, and skip if just started recording if (logSection != null) { sessionLog.logSections.Add(logSection); } //clear old data for new ones logSection = new LogSection(); logSection.sector = GetSector(); } LogLine logLine = new LogLine(); logLine.time = Time.time; logLine.state = state; logLine.action = action; logLine.playerPosition = Point3.ToPoint(player.position); logLine.cameraRotation = Rotation4.ToRotation(playerCamera.rotation); logLine.lookAtPoint = Point3.ToPoint(lookAtPoint); logSection.logLines.Add(logLine); previousState = state; } }
public static Quaternion ToQuaternion(Rotation4 r) { return(new Quaternion(r.x, r.y, r.z, r.w)); }