Skip to main content

Class VectorDataLog

Represents a log entry that stores a 3D vector with X, Y, and Z components. This class allows for conversion to Unity's Vector3 and Vector2 types.

[Serializable]
public class VectorDataLog : DataLog

Inheritance​

Constructors​

VectorDataLog(Vector3, int)​

Initializes a new instance of the VectorDataLog class with a Vector3 position. The vector components are optionally rounded to a specified number of decimal places.

public VectorDataLog(Vector3 pos, int digits = -1)

Parameters​

NameTypeDescription
posVector3The Vector3 position data.
digitsintThe number of decimal places to round each component to. If negative, no rounding is performed.

Fields​

x​

The X component of the vector.

public double x

Field Value​

double

y​

The Y component of the vector.

public double y

Field Value​

double

z​

The Z component of the vector.

public double z

Field Value​

double

Methods​

GetVector2()​

Converts the stored vector into a Vector2 representation. Only the X and Y components are used in the conversion.

public Vector2 GetVector2()

Returns​

Vector2 — The vector as a Vector2.

GetVector3()​

Converts the stored vector into a Vector3 representation.

public Vector3 GetVector3()

Returns​

Vector3 — The vector as a Vector3.