Vec2f

open class Vec2f

Author

Colton Daily

Constructors

Link copied to clipboard
fun Vec2f(x: Float, y: Float)
Link copied to clipboard
fun Vec2f(f: Float)
Link copied to clipboard
fun Vec2f(v: Vec2f)

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
fun add(other: Vec2f, result: MutableVec2f): MutableVec2f
Link copied to clipboard
fun angleTo(other: Vec2f): Angle
Link copied to clipboard
fun distance(other: Vec2f): Float
Link copied to clipboard
fun dot(other: Vec2f): Float
Link copied to clipboard
open operator override fun equals(other: Any?): Boolean

Checks vector components for equality (using '==' operator). For better numeric stability consider using isFuzzyEqual.

Link copied to clipboard
open operator fun get(i: Int): Float
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
fun isFuzzyEqual(other: Vec2f, eps: Float = FUZZY_EQ_F): Boolean

Checks vector components for equality using com.lehaine.littlekt.math.isFuzzyEqual, that is all components must have a difference less or equal eps.

Link copied to clipboard
fun length(): Float
Link copied to clipboard
fun mix(other: Vec2f, weight: Float, result: MutableVec2f): MutableVec2f
Link copied to clipboard
fun mul(other: Vec2f, result: MutableVec2f): MutableVec2f
Link copied to clipboard
Link copied to clipboard
fun rotate(angle: Angle, result: MutableVec2f): MutableVec2f
Link copied to clipboard
fun scale(factor: Float, result: MutableVec2f): MutableVec2f
Link copied to clipboard
fun setLength(length: Float, result: MutableVec2f): MutableVec2f
Link copied to clipboard
fun setSqrLength(sqrLength: Float, result: MutableVec2f): MutableVec2f
Link copied to clipboard
fun sqrDistance(other: Vec2f): Float
Link copied to clipboard
open fun sqrLength(): Float
Link copied to clipboard
fun subtract(other: Vec2f, result: MutableVec2f): MutableVec2f
Link copied to clipboard
operator fun times(other: Vec2f): Float
Link copied to clipboard
Link copied to clipboard
open override fun toString(): String
Link copied to clipboard
fun toVec2(): Vec2f

Properties

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

Inheritors

Link copied to clipboard
Link copied to clipboard

Extensions

Link copied to clipboard
fun Vec2f.distanceToEdge(edgeA: Vec2f, edgeB: Vec2f): Float
Link copied to clipboard
Link copied to clipboard
fun Vec2f.sqrDistanceToEdge(edgeA: Vec2f, edgeB: Vec2f): Float