Velocity struct
Represents velocity of an entity in the world.
public struct Velocity : IEquatable<Velocity>
In Obsidian.API.
Remarks
Creates a new instance of Velocity with specific values.
Constructors
Velocity(double, double, double)
public Velocity(double x, double y, double z);Represents velocity of an entity in the world.
Parameters
x- Velocity on the X axis.
y- Velocity on the Y axis.
z- Velocity on the Z axis.
Remarks
Creates a new instance of Velocity with specific values.
Properties
X
public double X { get; set; }Velocity on the X axis.
Y
public double Y { get; set; }Velocity on the Y axis.
Z
public double Z { get; set; }Velocity on the Z axis.
Methods
public override bool Equals(object obj);public bool Equals(Velocity other);FromBlockPerSecond(float, float, float)
public static Velocity FromBlockPerSecond(float x, float y, float z);Returns Velocity expressed as how many blocks on each axis can be travelled in a second.
Parameters
x- How many blocks can be travelled on the X axis in a second.
y- How many blocks can be travelled on the Y axis in a second.
z- How many blocks can be travelled on the Z axis in a second.
FromBlockPerTick(float, float, float)
public static Velocity FromBlockPerTick(float x, float y, float z);Returns Velocity expressed as how many blocks on each axis can be travelled in a tick (50ms).
Parameters
x- How many blocks can be travelled on the X axis in a tick (50ms).
y- How many blocks can be travelled on the Y axis in a tick (50ms).
z- How many blocks can be travelled on the Z axis in a tick (50ms).
FromDirection(Vector, Vector)
public static Velocity FromDirection(Vector from, Vector to);Returns such velocity, that can travel from from to to in a second.
Parameters
from- Starting position.
to- Target position.
FromDirection(VectorD, VectorD)
public static Velocity FromDirection(VectorD from, VectorD to);Returns such velocity, that can travel from from to to in a second.
Parameters
from- Starting position.
to- Target position.
FromVector(Vector)
public static Velocity FromVector(Vector vector);Turns Vector into Velocity, using it's coordinates as to how many blocks can be travelled per second.
Parameters
vectorVectorto be used for conversion.
FromVector(VectorD)
public static Velocity FromVector(VectorD vector);Turns VectorD into Velocity, using it's coordinates as to how many blocks can be travelled per second.
Parameters
vectorVectorDto be used for conversion.
public override int GetHashCode();Operators
public static bool operator !=(Velocity left, Velocity right);public static bool operator ==(Velocity left, Velocity right);Fields
public static readonly Velocity Zero;