Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions Assets/UXF/Scripts/Etc/Tracker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ namespace UXF
/// </summary>
public abstract class Tracker : MonoBehaviour
{
private static string[] baseHeaders = new string[] { "time" };
private static string[] baseHeaders = new string[] { };
private TrackerState currentState = TrackerState.Stopped;

/// <summary>
Expand Down Expand Up @@ -87,7 +87,6 @@ public void RecordRow()
"Tracker measurements cannot be taken when not recording!");

UXFDataRow newRow = GetCurrentValues();
newRow.Add(("time", Time.time));
Data.AddCompleteRow(newRow);
}

Expand Down
5 changes: 4 additions & 1 deletion Assets/UXF/Scripts/Trackers/MouseScreenTracker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,24 @@ namespace UXF
public class MouseScreenTracker : Tracker
{
public override string MeasurementDescriptor => "mouse_screen";
public override IEnumerable<string> CustomHeader => new string[] { "pix_x", "pix_y" };
public override IEnumerable<string> CustomHeader => new string[] { "time", "pix_x", "pix_y" };

/// <summary>
/// Returns current mouse position in screen coordinates
/// </summary>
/// <returns></returns>
protected override UXFDataRow GetCurrentValues()
{
float time = Time.time;

// get position and rotation
Vector2 p = new Vector2(Input.mousePosition.x, Input.mousePosition.y);


// return position, rotation (x, y, z) as an array
var values = new UXFDataRow()
{
("time", time),
("pix_x", p.x),
("pix_y", p.y)
};
Expand Down
5 changes: 4 additions & 1 deletion Assets/UXF/Scripts/Trackers/MouseWorldTracker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,23 @@ public class MouseWorldTracker : Tracker

public override string MeasurementDescriptor => "mouse_world";

public override IEnumerable<string> CustomHeader => new string[] { "pos_x", "pos_y", "pos_z", };
public override IEnumerable<string> CustomHeader => new string[] { "time", "pos_x", "pos_y", "pos_z", };

/// <summary>
/// Returns current mouse position in world coordinates
/// </summary>
/// <returns></returns>
protected override UXFDataRow GetCurrentValues()
{
float time = Time.time;

// get position and rotation
Vector3 p = mainCamera.ScreenToWorldPoint(new Vector3(Input.mousePosition.x, Input.mousePosition.y, distanceFromCamera));

// return position, rotation (x, y, z) as an array
var values = new UXFDataRow()
{
("time", time),
("pos_x", p.x),
("pos_y", p.y),
("pos_z", p.z)
Expand Down
5 changes: 4 additions & 1 deletion Assets/UXF/Scripts/Trackers/PositionRotationTracker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,24 @@ namespace UXF
public class PositionRotationTracker : Tracker
{
public override string MeasurementDescriptor => "movement";
public override IEnumerable<string> CustomHeader => new string[] { "pos_x", "pos_y", "pos_z", "rot_x", "rot_y", "rot_z" };
public override IEnumerable<string> CustomHeader => new string[] { "time", "pos_x", "pos_y", "pos_z", "rot_x", "rot_y", "rot_z" };

/// <summary>
/// Returns current position and rotation values
/// </summary>
/// <returns></returns>
protected override UXFDataRow GetCurrentValues()
{
float time = Time.time;

// get position and rotation
Vector3 p = gameObject.transform.position;
Vector3 r = gameObject.transform.eulerAngles;

// return position, rotation (x, y, z) as an array
var values = new UXFDataRow()
{
("time", time),
("pos_x", p.x),
("pos_y", p.y),
("pos_z", p.z),
Expand Down