endstone.util
Multi and single purpose classes.
Multi and single purpose classes.
Classes
| Name | Description |
|---|---|
SocketAddress | Represents an IP Socket Address (hostname + port number). |
Vector | Represents a 3-dimensional vector. |
classSocketAddress
SocketAddress()Represents an IP Socket Address (hostname + port number).
classVector
Vector()Represents a 3-dimensional vector.
Methods
| Name | Description |
|---|---|
angle | Gets the angle between this vector and another in radians. |
cross_product | Calculates the cross-product of this vector with another. |
distance | The distance between this Vector and another |
distance_squared | The squared distance between this Vector and another |
dot | Calculates the dot product of this vector with another. |
is_in_aabb | Returns whether this vector is in an axis-aligned bounding box. |
is_in_sphere | Returns whether this vector is within a sphere. |
midpoint | Gets a new midpoint vector between this vector and another. |
normalize | Converts this vector to a unit vector (a vector with length of 1). |
normalize_zero | Converts each component of value |
rotate_around_axis | Rotates the vector around a given arbitrary axis in 3-dimensional space. |
rotate_around_x | Rotates the vector around the x-axis. |
rotate_around_y | Rotates the vector around the y-axis. |
rotate_around_z | Rotates the vector around the z-axis. |
zero | Zero this vector's components. |
Attributes
| Name | Type | Description |
|---|---|---|
block_x | int | Gets the floored value of the X component, indicating the block that this vector is contained with. |
block_y | int | Gets the floored value of the Y component, indicating the block that this vector is contained with. |
block_z | int | Gets the floored value of the Z component, indicating the block that this vector is contained with. |
is_normalized | bool | Returns if a vector is normalized. |
is_zero | bool | Check whether or not each component of this vector is equal to 0. |
length | float | The magnitude of the Vector |
length_squared | float | The squared magnitude of the Vector |
x | float | The X component of the vector |
y | float | The Y component of the vector |
z | float | The Z component of the vector |
attrblock_xproperty
block_x: intGets the floored value of the X component, indicating the block that this vector is contained with.
attrblock_yproperty
block_y: intGets the floored value of the Y component, indicating the block that this vector is contained with.
attrblock_zproperty
block_z: intGets the floored value of the Z component, indicating the block that this vector is contained with.
attris_normalizedproperty
is_normalized: boolReturns if a vector is normalized.
attris_zeroproperty
is_zero: boolCheck whether or not each component of this vector is equal to 0.
attrlengthproperty
length: floatThe magnitude of the Vector
attrlength_squaredproperty
length_squared: floatThe squared magnitude of the Vector
attrxproperty
x: floatThe X component of the vector
attryproperty
y: floatThe Y component of the vector
attrzproperty
z: floatThe Z component of the vector
methangle
Gets the angle between this vector and another in radians.
methcross_product
Calculates the cross-product of this vector with another.
methdistance
The distance between this Vector and another
methdistance_squared
The squared distance between this Vector and another
methdot
Calculates the dot product of this vector with another.
methis_in_aabb
Returns whether this vector is in an axis-aligned bounding box.
methis_in_sphere
Returns whether this vector is within a sphere.
methmidpoint
Gets a new midpoint vector between this vector and another.
methnormalize
normalize() -> VectorConverts this vector to a unit vector (a vector with length of 1).
methnormalize_zero
normalize_zero() -> VectorConverts each component of value -0.0 to 0.0
methrotate_around_axis
Rotates the vector around a given arbitrary axis in 3-dimensional space.
methrotate_around_x
Rotates the vector around the x-axis.
methrotate_around_y
Rotates the vector around the y-axis.
methrotate_around_z
Rotates the vector around the z-axis.
methzero
zero() -> VectorZero this vector's components.