Vector2

gdext.builtin.Vector2
See theVector2 companion object
final case class Vector2(x: Float, y: Float)

Godot's Vector2: two single-precision components (8 bytes). The whole engine API is implemented in Scala (ported from core/math), so no method calls into the engine. Zero-argument methods take no parentheses.

Attributes

Companion
object
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

def *(o: Vector2): Vector2
def *(s: Float): Vector2
def *(t: Transform2D): Vector2

Vector2 * Transform2D: the inverse transform of this point.

Vector2 * Transform2D: the inverse transform of this point.

Attributes

def +(o: Vector2): Vector2
def -(o: Vector2): Vector2
def /(o: Vector2): Vector2
def /(s: Float): Vector2
def <(o: Vector2): Boolean
def <=(o: Vector2): Boolean
def >(o: Vector2): Boolean
def >=(o: Vector2): Boolean
def abs: Vector2
def angle: Float
def angleTo(to: Vector2): Float
def angleToPoint(to: Vector2): Float
def apply(axis: Int): Float
def aspect: Float
def bezierDerivative(control1: Vector2, control2: Vector2, end: Vector2, t: Float): Vector2
def bezierInterpolate(control1: Vector2, control2: Vector2, end: Vector2, t: Float): Vector2

Requires a normalized n.

Requires a normalized n.

Attributes

def ceil: Vector2
def clamp(min: Vector2, max: Vector2): Vector2
def clampf(min: Float, max: Float): Vector2
def cross(o: Vector2): Float
def cubicInterpolate(b: Vector2, preA: Vector2, postB: Vector2, weight: Float): Vector2
def cubicInterpolateInTime(b: Vector2, preA: Vector2, postB: Vector2, weight: Float, bT: Float, preAT: Float, postBT: Float): Vector2
def distanceSquaredTo(to: Vector2): Float
def distanceTo(to: Vector2): Float
def dot(o: Vector2): Float
def floor: Vector2
def isEqualApprox(to: Vector2): Boolean
def isFinite: Boolean
def isNormalized: Boolean
def isZeroApprox: Boolean
def length: Float
def lengthSquared: Float
def lerp(to: Vector2, weight: Float): Vector2
def limitLength(length: Float = ...): Vector2
def max(o: Vector2): Vector2
def maxAxisIndex: Long
def maxf(o: Float): Vector2
def min(o: Vector2): Vector2
def minAxisIndex: Long
def minf(o: Float): Vector2
def moveToward(to: Vector2, delta: Float): Vector2
def posmod(mod: Float): Vector2
def posmodv(modv: Vector2): Vector2
def reflect(line: Vector2): Vector2

Requires a normalized line.

Requires a normalized line.

Attributes

def rotated(angle: Float): Vector2
def round: Vector2
def sign: Vector2
def slerp(to: Vector2, weight: Float): Vector2
def slide(n: Vector2): Vector2

Requires a normalized n.

Requires a normalized n.

Attributes

def snapped(step: Vector2): Vector2
def snappedf(step: Float): Vector2

Inherited methods

def productElementNames: Iterator[String]

An iterator over the names of all the elements of this product.

An iterator over the names of all the elements of this product.

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

An iterator over all the elements of this product.

An iterator over all the elements of this product.

Attributes

Returns

in the default implementation, an Iterator[Any]

Inherited from:
Product