Struct Velocity
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
Properties
Magnitude
Returns the length of this Velocity.
public float Magnitude { get; }
Property Value
X
Velocity on the X axis.
public short X { readonly get; set; }
Property Value
Y
Velocity on the Y axis.
public short Y { readonly get; set; }
Property Value
Z
Velocity on the Z axis.
public short Z { readonly get; set; }
Property Value
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
floatHow many blocks can be travelled on the X axis in a second.
y
floatHow many blocks can be travelled on the Y axis in a second.
z
floatHow many blocks can be travelled on the Z axis in a second.
Returns
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
floatHow many blocks can be travelled on the X axis in a tick (50ms).
y
floatHow many blocks can be travelled on the Y axis in a tick (50ms).
z
floatHow many blocks can be travelled on the Z axis in a tick (50ms).
Returns
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
Returns
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
Returns
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
Returns
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)