Vec2

value class Vec2

Class that represents a 2D vector.

(revised 1.5) Vec2's are now purely syntactical sugar which are inlined and have no runtime overhead. Their representation in internal data structures has been replaced with floats instead.

Since

1.1.0

Constructors

Link copied to clipboard
constructor(x: Float, y: Float)

Types

Link copied to clipboard
object Constants

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val x: Float
Link copied to clipboard
val y: Float

Functions

Link copied to clipboard
operator fun component1(): Float
Link copied to clipboard
operator fun component2(): Float
Link copied to clipboard
operator fun get(index: Int): Float
Link copied to clipboard
open override fun toString(): String
Link copied to clipboard

Create a Vec4 from a Vec2, copying the Vec2.x and Vec2.y values to Vec4.w and Vec4.h respectively.