Table of Contents

Struct Velocity

Namespace
Obsidian.API
Assembly
Obsidian.API.dll

Represents velocity of an entity in the world.

public struct Velocity
Inherited Members

Constructors

Velocity(short, short, short)

Creates a new instance of Velocity with specific values.

public Velocity(short x, short y, short z)

Parameters

x short

Velocity on the X axis.

y short

Velocity on the Y axis.

z short

Velocity on the Z axis.

Properties

Magnitude

Returns the length of this Velocity.

public float Magnitude { get; }

Property Value

float

X

Velocity on the X axis.

public short X { readonly get; set; }

Property Value

short

Y

Velocity on the Y axis.

public short Y { readonly get; set; }

Property Value

short

Z

Velocity on the Z axis.

public short Z { readonly get; set; }

Property Value

short

Methods

FromBlockPerSecond(float, float, float)

Returns Velocity expressed as how many blocks on each axis can be travelled in a second.

public static Velocity FromBlockPerSecond(float x, float y, float z)

Parameters

x float

How many blocks can be travelled on the X axis in a second.

y float

How many blocks can be travelled on the Y axis in a second.

z float

How many blocks can be travelled on the Z axis in a second.

Returns

Velocity

FromBlockPerTick(float, float, float)

Returns Velocity expressed as how many blocks on each axis can be travelled in a tick (50ms).

public static Velocity FromBlockPerTick(float x, float y, float z)

Parameters

x float

How many blocks can be travelled on the X axis in a tick (50ms).

y float

How many blocks can be travelled on the Y axis in a tick (50ms).

z float

How many blocks can be travelled on the Z axis in a tick (50ms).

Returns

Velocity

FromDirection(Vector, Vector)

Returns such velocity, that can travel from from to to in a second.

public static Velocity FromDirection(Vector from, Vector to)

Parameters

from Vector

Starting position.

to Vector

Target position.

Returns

Velocity

FromDirection(VectorF, VectorF)

Returns such velocity, that can travel from from to to in a second.

public static Velocity FromDirection(VectorF from, VectorF to)

Parameters

from VectorF

Starting position.

to VectorF

Target position.

Returns

Velocity

FromVector(Vector)

Turns Vector into Velocity, using it's coordinates as to how many blocks can be travelled per second.

public static Velocity FromVector(Vector vector)

Parameters

vector Vector

Vector to be used for conversion.

Returns

Velocity

FromVector(VectorF)

Turns VectorF into Velocity, using it's coordinates as to how many blocks can be travelled per second.

public static Velocity FromVector(VectorF vector)

Parameters

vector VectorF

VectorF to be used for conversion.

Returns

Velocity