glok
Toggle table of contents
common
Platform filter
common
Switch theme
Search in API
glok
glok-core
/
uk.co.nickthecoder.glok.backend
/
Vector2
Vector2
class
Vector2
(
val
x
:
Float
,
val
y
:
Float
)
Holds an
x
,
y
coordinate.
Used to pass
point
data from the core of Glok to the
Backend
.
Members
Constructors
Vector2
Link copied to clipboard
constructor
(
)
constructor
(
x
:
Double
,
y
:
Double
)
constructor
(
x
:
Float
,
y
:
Float
)
Properties
x
Link copied to clipboard
val
x
:
Float
y
Link copied to clipboard
val
y
:
Float
Functions
angle
Radians
Link copied to clipboard
fun
angleRadians
(
other
:
Vector2
)
:
Double
cross
Link copied to clipboard
fun
cross
(
other
:
Vector2
)
:
Float
distance
Squared
To
Link copied to clipboard
fun
distanceSquaredTo
(
to
:
Vector2
)
:
Float
distance
To
Link copied to clipboard
fun
distanceTo
(
to
:
Vector2
)
:
Float
div
Link copied to clipboard
operator
fun
div
(
scale
:
Float
)
:
Vector2
operator
fun
div
(
other
:
Vector2
)
:
Vector2
dot
Link copied to clipboard
fun
dot
(
other
:
Vector2
)
:
Float
equals
Link copied to clipboard
open
operator override
fun
equals
(
other
:
Any
?
)
:
Boolean
hamiltonian
Link copied to clipboard
fun
hamiltonian
(
)
:
Float
magnitude
Link copied to clipboard
fun
magnitude
(
)
:
Float
magnitude
Squared
Link copied to clipboard
fun
magnitudeSquared
(
)
:
Float
minus
Link copied to clipboard
operator
fun
minus
(
other
:
Vector2
)
:
Vector2
fun
minus
(
dx
:
Float
,
dy
:
Float
)
:
Vector2
perpendicular
Link copied to clipboard
fun
perpendicular
(
)
:
Vector2
plus
Link copied to clipboard
operator
fun
plus
(
other
:
Vector2
)
:
Vector2
fun
plus
(
dx
:
Float
,
dy
:
Float
)
:
Vector2
rem
Link copied to clipboard
operator
fun
rem
(
other
:
Float
)
:
Vector2
operator
fun
rem
(
other
:
Vector2
)
:
Vector2
rotate
Radians
Link copied to clipboard
fun
rotateRadians
(
radians
:
Double
)
:
Vector2
times
Link copied to clipboard
operator
fun
times
(
scale
:
Float
)
:
Vector2
operator
fun
times
(
other
:
Vector2
)
:
Vector2
to
String
Link copied to clipboard
open
override
fun
toString
(
)
:
String
translate
Link copied to clipboard
fun
translate
(
dx
:
Float
,
dy
:
Float
)
:
Vector2
unary
Minus
Link copied to clipboard
operator
fun
unaryMinus
(
)
:
Vector2
unit
Link copied to clipboard
fun
unit
(
)
:
Vector2