Class endstone::Location¶
ClassList > endstone > Location
Represents a 3-dimensional location in a dimension within a level.
#include <endstone/level/location.h>
Inherits the following classes: endstone::Position
Public Functions¶
Type | Name |
---|---|
Location (Dimension * dimension, int x, int y, int z, float pitch=0.0, float yaw=0.0) |
|
Location (Dimension * dimension, float x, float y, float z, float pitch=0.0, float yaw=0.0) |
|
float | getPitch () const |
float | getYaw () const |
void | setPitch (float pitch) |
void | setYaw (float yaw) |
Public Functions inherited from endstone::Position¶
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 Location [½]¶
inline endstone::Location::Location (
Dimension * dimension,
int x,
int y,
int z,
float pitch=0.0,
float yaw=0.0
)
function Location [2/2]¶
inline endstone::Location::Location (
Dimension * dimension,
float x,
float y,
float z,
float pitch=0.0,
float yaw=0.0
)
function getPitch¶
Gets the pitch of this location, measured in degrees.
Returns:
the incline's pitch
function getYaw¶
Gets the yaw of this location, measured in degrees.
Returns:
the rotation's yaw
function setPitch¶
Sets the pitch of this location, measured in degrees. * A pitch of 0 represents level forward facing. * A pitch of 90 represents downward facing, or negative y direction. * A pitch of -90 represents upward facing, or positive y direction.
Increasing pitch values the equivalent of looking down.
Parameters:
pitch
new incline's pitch
function setYaw¶
Sets the yaw of this location, measured in degrees. * A yaw of 0 or 360 represents the positive z direction. * A yaw of 180 represents the negative z direction. * A yaw of 90 represents the negative x direction. * A yaw of 270 represents the positive x direction.
Increasing yaw values are the equivalent of turning to your right-facing, increasing the scale of the next respective axis, and decreasing the scale of the previous axis.
Parameters:
yaw
new rotation's yaw
The documentation for this class was generated from the following file include/endstone/level/location.h