Skip to content

API reference Obsidian.API

VectorF struct

Represents a three-dimensional vector. Uses Single.

public struct VectorF : IEquatable<VectorF>

In Obsidian.API.

Constructors

VectorF(float)

public VectorF(float value);

Creates new instance of VectorF with VectorF.X, VectorF.Y and VectorF.Z set to value.

Parameters

value
Value of VectorF.X, VectorF.Y and VectorF.Z.

VectorF(float, float, float)

public VectorF(float x, float y, float z);

Creates a new instance of VectorF with specific values.

Parameters

x
Value of X coordinate.
y
Value of Y coordinate.
z
Value of Z coordinate.

VectorF(int, int, int)

public VectorF(int x, int y, int z);

Creates a new instance of VectorF with specific values.

Parameters

x
Value of X coordinate.
y
Value of Y coordinate.
z
Value of Z coordinate.

Properties

Magnitude

public float Magnitude { get; }

Calculates magnitude of this VectorF.

X

public float X { get; set; }

The X component of the VectorF.

Y

public float Y { get; set; }

The Y component of the VectorF.

Z

public float Z { get; set; }

The Z component of the VectorF.

Methods

ChunkClamped(float, float, float)

public static VectorF ChunkClamped(float x, float y, float z);

Creates new Vector clamped to fit inside a single minecraft chunk.

Clamp(VectorF, VectorF)

public VectorF Clamp(VectorF min, VectorF max);

Returns VectorF clamped to the inclusive range of min and max.

public static VectorF Clamp(VectorF value, VectorF min, VectorF max);public static VectorF Cross(VectorF value1, VectorF value2);public void Deconstruct(out float x, out float y, out float z);

Distance(VectorF, VectorF)

public static float Distance(VectorF from, VectorF to);

Calculates the distance between two VectorFs.

public static float Dot(VectorF value1, VectorF value2);public override bool Equals(object obj);

Equals(VectorF)

public bool Equals(VectorF other);

Indicates whether this VectorF is near equal to other.

Floor()

public VectorF Floor();

Truncates the decimal component of each part of this VectorF.

public override int GetHashCode();public static VectorF Lerp(VectorF value1, VectorF value2, float amount);

MagnitudeSquared()

public float MagnitudeSquared();

Calculates magnitude of this VectorF squared.

Normalize()

public VectorF Normalize();

Performs vector normalization on this VectorF's coordinates.

Returns

Normalized VectorF.

ToString()

public override string ToString();

Returns VectorF formatted as a String.

Returns

String representaion of this VectorF.

Operators

public static explicit operator Vector(VectorF positionF);public static bool operator !=(VectorF a, VectorF b);public static VectorF operator %(float a, VectorF b);public static VectorF operator %(VectorF a, float b);public static VectorF operator %(VectorF a, VectorF b);public static VectorF operator *(float a, VectorF b);public static VectorF operator *(VectorF a, float b);public static VectorF operator *(VectorF a, VectorF b);public static VectorF operator +(float a, VectorF b);public static VectorF operator +(VectorF a, (int, int, int) b);public static VectorF operator +(VectorF a, float b);public static VectorF operator +(VectorF a, VectorF b);public static VectorF operator -(float a, VectorF b);public static VectorF operator -(VectorF a);public static VectorF operator -(VectorF a, float b);public static VectorF operator -(VectorF a, VectorF b);public static VectorF operator /(float a, VectorF b);public static VectorF operator /(VectorF a, float b);public static VectorF operator /(VectorF a, VectorF b);public static bool operator ==(VectorF a, VectorF b);

Fields

Backwards

public static readonly VectorF Backwards;

A read-only field that represents VectorF with coordinates (0, 0, -1).

Down

public static readonly VectorF Down;

A read-only field that represents VectorF with coordinates (0, -1, 0).

East

public static readonly VectorF East;

A read-only field that represents VectorF with coordinates (1, 0, 0).

Forwards

public static readonly VectorF Forwards;

A read-only field that represents VectorF with coordinates (0, 0, 1).

Left

public static readonly VectorF Left;

A read-only field that represents VectorF with coordinates (-1, 0, 0).

North

public static readonly VectorF North;

A read-only field that represents VectorF with coordinates (0, 0, -1).

One

public static readonly VectorF One;

A read-only field that represents VectorF with coordinates (1, 1, 1).

public static readonly VectorF Right;

A read-only field that represents VectorF with coordinates (1, 0, 0).

South

public static readonly VectorF South;

A read-only field that represents VectorF with coordinates (0, 0, 1).

Up

public static readonly VectorF Up;

A read-only field that represents VectorF with coordinates (0, 1, 0).

West

public static readonly VectorF West;

A read-only field that represents VectorF with coordinates (-1, 0, 0).

Zero

public static readonly VectorF Zero;

A read-only field that represents VectorF with coordinates (0, 0, 0).

On this page