Skip to content

Class endstone::Position

ClassList > endstone > Position

Represents a 3-dimensional position in a dimension within a level.

  • #include <endstone/level/position.h>

Inherits the following classes: endstone::Vector

Inherited by the following classes: endstone::Location

Public Functions

Type Name
Position (Dimension * dimension, float x, float y, float z)
int getBlockX () const
Gets the floored value of the X component, indicating the block that this location is contained with.
int getBlockY () const
Gets the floored value of the Y component, indicating the block that this location is contained with.
int getBlockZ () const
Gets the floored value of the Z component, indicating the block that this location is contained with.
Dimension * getDimension () const
void setDimension (Dimension & dimension)

Public Functions inherited from endstone::Vector

See endstone::Vector

Type Name
constexpr Vector ()
constexpr Vector (T x, T y, T z)
constexpr T distance (const Vector< T > & other) const
constexpr T distanceSquared (const Vector< T > & other) const
constexpr T getX () const
Gets the X component.
constexpr T getY () const
Gets the Y component.
constexpr T getZ () const
Gets the Z component.
constexpr T length () const
Gets the magnitude of the vector, defined as sqrt(x2+y2+z^2).
constexpr T lengthSquared () const
Gets the magnitude of the vector squared.
constexpr Vector< T > operator* (const Vector< T > & other) const
Vector< T > operator* (T scalar) const
Vector< T > & operator*= (const Vector< T > & other)
constexpr Vector< T > operator+ (const Vector< T > & other) const
Vector< T > operator+ (T scalar) const
Vector< T > & operator+= (const Vector< T > & other)
constexpr Vector< T > operator- (const Vector< T > & other) const
Vector< T > operator- (T scalar) const
Vector< T > & operator-= (const Vector< T > & other)
constexpr Vector< T > operator/ (const Vector< T > & other) const
Vector< T > operator/ (T scalar) const
Vector< T > & operator/= (const Vector< T > & other)
constexpr bool operator== (const Vector< T > & other) const
constexpr void setX (T x)
Set the X component.
constexpr void setY (T y)
Set the Y component.
constexpr void setZ (T z)
Set the Z component.

Protected Attributes inherited from endstone::Vector

See endstone::Vector

Type Name
T x_
T y_
T z_

Public Functions Documentation

function Position

inline endstone::Position::Position (
    Dimension * dimension,
    float x,
    float y,
    float z
) 

function getBlockX

Gets the floored value of the X component, indicating the block that this location is contained with.

inline int endstone::Position::getBlockX () const

Returns:

block X


function getBlockY

Gets the floored value of the Y component, indicating the block that this location is contained with.

inline int endstone::Position::getBlockY () const

Returns:

block Y


function getBlockZ

Gets the floored value of the Z component, indicating the block that this location is contained with.

inline int endstone::Position::getBlockZ () const

Returns:

block Z


function getDimension

inline Dimension * endstone::Position::getDimension () const

Gets the dimension that this position resides in

Returns:

Dimension that contains this position, or nullptr if the dimension is not set.


function setDimension

inline void endstone::Position::setDimension (
    Dimension & dimension
) 

Sets the dimension that this position resides in

Parameters:

  • dimension New dimension that this position resides in


The documentation for this class was generated from the following file include/endstone/level/position.h