Position3D

data class Position3D : Comparable<Position3D>

Represents a coordinate in 3D space. Extends Position with a z dimension. Use Position3D.from2DPosition and Position3D.to2DPosition to convert between the two. The z dimension represents the up and down axis.

Explanation:

<pre> ^ (z axis, positive direction) \ \ \ \ O---------> (x axis, positive direction) / / / L (y axis, positive direction)</pre>

Types

Companion
Link copied to clipboard
common
object Companion

Functions

compareTo
Link copied to clipboard
common
open operator override fun compareTo(other: Position3D): Int
component1
Link copied to clipboard
common
operator fun component1(): Int
component2
Link copied to clipboard
common
operator fun component2(): Int
component3
Link copied to clipboard
common
operator fun component3(): Int
copy
Link copied to clipboard
common
fun copy(x: Int, y: Int, z: Int): Position3D
equals
Link copied to clipboard
common
open operator override fun equals(other: Any?): Boolean
hashCode
Link copied to clipboard
common
open override fun hashCode(): Int
minus
Link copied to clipboard
common
operator fun minus(other: Position3D): Position3D
Returns a new Position3D which is the difference of x, y and z in both Position3Ds.
plus
Link copied to clipboard
common
operator fun plus(other: Position3D): Position3D
Returns a new Position3D which is the sum of x, y and z in both Position3Ds.
to2DPosition
Link copied to clipboard
common
fun to2DPosition(): Position
Transforms this Position3D to a Position.
toSize
Link copied to clipboard
common
fun toSize(): Size3D
Transforms this Position3D to a Size3D so if this position is Position(x=2, y=3, z=1) it will become Size3D(x=2, y=3, z=1).
toString
Link copied to clipboard
common
open override fun toString(): String
withRelative
Link copied to clipboard
common
fun withRelative(translate: Position3D): Position3D
Creates a new Position3D object that is translated by an amount of x, y and z specified by another Position3D.
withRelativeX
Link copied to clipboard
common
fun withRelativeX(deltaX: Int): Position3D
Creates a new Position3D object representing a position on the same y and y, but with an x offset by the supplied deltaX.
withRelativeY
Link copied to clipboard
common
fun withRelativeY(deltaY: Int): Position3D
Creates a new Position3D object representing a position on the same x and y, but with an y offset by the supplied deltaY.
withRelativeZ
Link copied to clipboard
common
fun withRelativeZ(deltaZ: Int): Position3D
Creates a new Position3D object representing a position on the same x and y, but with a y offset by the supplied deltaZ.
withX
Link copied to clipboard
common
fun withX(x: Int): Position3D
Creates a new Position3D object representing a 3D position with the same y and y as this but with the supplied x.
withY
Link copied to clipboard
common
fun withY(y: Int): Position3D
Creates a new Position3D object representing a 3D position with the same x and y as this but with the supplied y.
withZ
Link copied to clipboard
common
fun withZ(z: Int): Position3D
Creates a new Position3D object representing a 3D position with the same x and y as this but with the supplied y.

Properties

hasNegativeComponent
Link copied to clipboard
common
val hasNegativeComponent: Boolean
Tells whether this Position3D has a negative component (x, y or z) or not.
isUnknown
Link copied to clipboard
common
val isUnknown: Boolean
x
Link copied to clipboard
common
val x: Int
y
Link copied to clipboard
common
val y: Int
z
Link copied to clipboard
common
val z: Int

Sources

(source)
Link copied to clipboard