Vector2 class

class Vector2

Annotations
  • @JS()

Constructors

Vector2([num x, num y])

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
x num
getter/setter pair
y num
getter/setter pair

Methods

add(Vector2 otherVector) Vector2
addInPlace(Vector2 otherVector) Vector2
addToRef(Vector2 otherVector, Vector2 result) Vector2
addVector3(Vector3 otherVector) Vector2
asArray() List<num>
clone() Vector2
copyFrom(Vector2 source) Vector2
copyFromFloats(num x, num y) Vector2
divide(Vector2 otherVector) Vector2
divideInPlace(Vector2 otherVector) Vector2
divideToRef(Vector2 otherVector, Vector2 result) Vector2
equals(Vector2 otherVector) bool
equalsWithEpsilon(Vector2 otherVector, [num epsilon]) bool
floor() Vector2
fract() Vector2
fromArray(Float32List array, [num index]) Vector2
getClassName() String
getHashCode() num
length() num
lengthSquared() num
multiply(Vector2 otherVector) Vector2
multiplyByFloats(num x, num y) Vector2
multiplyInPlace(Vector2 otherVector) Vector2
multiplyToRef(Vector2 otherVector, Vector2 result) Vector2
negate() Vector2
negateInPlace() Vector2
negateToRef(Vector2 result) Vector2
normalize() Vector2
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
scale(num scale) Vector2
scaleAndAddToRef(num scale, Vector2 result) Vector2
scaleInPlace(num scale) Vector2
scaleToRef(num scale, Vector2 result) Vector2
set(num x, num y) Vector2
subtract(Vector2 otherVector) Vector2
subtractInPlace(Vector2 otherVector) Vector2
subtractToRef(Vector2 otherVector, Vector2 result) Vector2
toArray(Float32List array, [num index]) Vector2
toString() String
A string representation of this object.
override

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

CatmullRom(Vector2 value1, Vector2 value2, Vector2 value3, Vector2 value4, num amount) Vector2
Center(Vector2 value1, Vector2 value2) Vector2
Clamp(Vector2 value, Vector2 min, Vector2 max) Vector2
Distance(Vector2 value1, Vector2 value2) num
DistanceOfPointFromSegment(Vector2 p, Vector2 segA, Vector2 segB) num
DistanceSquared(Vector2 value1, Vector2 value2) num
Dot(Vector2 left, Vector2 right) num
FromArray(List<num> array, [num offset]) Vector2
FromArrayToRef(List<num> array, num offset, Vector2 result) → void
Hermite(Vector2 value1, Vector2 tangent1, Vector2 value2, Vector2 tangent2, num amount) Vector2
Lerp(Vector2 start, Vector2 end, num amount) Vector2
Maximize(Vector2 left, Vector2 right) Vector2
Minimize(Vector2 left, Vector2 right) Vector2
Normalize(Vector2 vector) Vector2
One() Vector2
PointInTriangle(Vector2 p, Vector2 p0, Vector2 p1, Vector2 p2) bool
Transform(Vector2 vector, Matrix transformation) Vector2
TransformToRef(Vector2 vector, Matrix transformation, Vector2 result) → void
Zero() Vector2