IntVector2

data class IntVector2(x: Int, y: Int)

Integer 2D vector, exclusively for integer calculations.

Constructors

IntVector2
Link copied to clipboard
fun IntVector2(x: Int, y: Int)

Types

Companion
Link copied to clipboard
object Companion

Functions

div
Link copied to clipboard
operator fun div(d: Int): IntVector2
dot
Link copied to clipboard
infix fun dot(right: IntVector2): Int

Calculates a dot product between this Vector2 and right.

minus
Link copied to clipboard
operator fun minus(v: IntVector2): IntVector2
plus
Link copied to clipboard
operator fun plus(v: IntVector2): IntVector2
times
Link copied to clipboard
operator fun times(d: Int): IntVector2

Properties

length
Link copied to clipboard
val length: Double

The Euclidean length of the vector.

squaredLength
Link copied to clipboard
val squaredLength: Int

The squared Euclidean length of the vector.

vector2
Link copied to clipboard
val vector2: Vector2

Casts to Vector2.

x
Link copied to clipboard
val x: Int
xx
Link copied to clipboard
val xx: IntVector2
y
Link copied to clipboard
val y: Int
yx
Link copied to clipboard
val yx: IntVector2
yy
Link copied to clipboard
val yy: IntVector2

Extensions

clamp
Link copied to clipboard
fun IntVector2.clamp(min: IntVector2, max: IntVector2): IntVector2

Returns IntVector2 whose value is limited between min and max per vector component.

mod
Link copied to clipboard
fun IntVector2.mod(b: IntVector2): IntVector2