Vector2 class

Properties

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

Methods

add(Vector2 v, {Vector2? w}) Vector2
addScalar(num s) Vector2
addScaledVector(Vector2 v, double s) Vector2
addVectors(Vector2 a, Vector2 b) Vector2
angle() double
applyMatrix3(Matrix3 m) Vector2
ceil() Vector2
clamp(Vector2 min, Vector2 max) Vector2
clampLength(double min, double max) Vector2
clampScalar(double minVal, double maxVal) Vector2
clone() Vector2
copy(Vector2 v) Vector2
cross(Vector2 v) num
distanceTo(Vector2 v) double
distanceToSquared(Vector2 v) num
divide(Vector2 v) Vector2
divideScalar(double scalar) Vector2
dot(Vector2 v) num
equals(Vector2 v) bool
floor() Vector2
fromArray(dynamic array, [int offset = 0]) Vector2
fromBufferAttribute(dynamic attribute, dynamic index) Vector2
getComponent(int index) num
length() double
lengthSq() num
lerp(Vector2 v, double alpha) Vector2
lerpVectors(Vector2 v1, Vector2 v2, double alpha) Vector2
manhattanDistanceTo(Vector2 v) num
manhattanLength() num
max(Vector2 v) Vector2
min(Vector2 v) Vector2
multiply(Vector2 v) Vector2
multiplyScalar(num scalar) Vector2
negate() Vector2
normalize() Vector2
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
random() Vector2
rotateAround(Vector2 center, double angle) Vector2
round() Vector2
roundToZero() Vector2
set(double x, double y) Vector2
setComponent(int index, double value) Vector2
setLength(double length) Vector2
setScalar(double scalar) Vector2
setX(double x) Vector2
setY(double y) Vector2
sub(Vector2 v, {Vector2? w}) Vector2
subScalar(num s) Vector2
subVectors(Vector2 a, Vector2 b) Vector2
toArray([List<double>? array, int offset = 0]) List<num>
toJSON() List<num>
toJson() Map<String, double>
toString() String
A string representation of this object.
inherited

Operators

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