Vector2 class
Constructors
- Vector2([double? x, double? y])
- Vector2.copy(Vector v)
-
Vector2.fromJson(List<
double> ? json) - Vector2.zero([double x = 0, double y = 0])
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- height ↔ double
-
getter/setter pair
- length → double
-
no setteroverride
- length2 → double
-
no setteroverride
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- storage ↔ Float32List
-
getter/setter pairinherited
- width ↔ double
-
getter/setter pair
- x ↔ double
-
getter/setter pairinherited
- y ↔ double
-
getter/setter pairinherited
Methods
-
add(
Vector a) → Vector2 -
override
-
add2(
Vector a, Vector b) → Vector2 -
addScalar(
num s) → Vector2 -
override
-
addScaled(
Vector v, double s) → Vector2 -
override
-
angle(
) → double -
applyMatrix3(
Matrix3 m) → Vector2 -
override
-
ceil(
) → Vector2 -
override
-
clamp(
Vector2 min, Vector2 max) → Vector2 -
clampLength<
T extends num> (T min, T max) → Vector2 -
override
-
clampScalar(
double minVal, double maxVal) → Vector2 -
override
-
clone(
) → Vector2 -
override
-
copyFromArray(
List< double> array, [int offset = 0]) → Vector2 -
override
-
copyFromUnknown(
dynamic array, [int offset = 0]) → Vector2 -
override
-
copyIntoArray(
[List< double> ? array, int offset = 0]) → List<double> -
override
-
cross(
Vector2 v) → double -
distanceTo(
Vector v) → double -
override
-
distanceToSquared(
Vector v) → double -
override
-
divide(
Vector2 v) → Vector2 -
divideScalar(
double scalar) → Vector2 -
override
-
dot(
Vector v) → double -
override
-
equals(
Vector v) → bool -
override
-
floor(
) → Vector2 -
override
-
fromBuffer(
BufferAttribute< NativeArray< attribute, int index) → Vector2num> > -
override
-
fromNativeArray(
NativeArray< num> array, [int offset = 0]) → Vector2 -
override
-
getComponent(
int index) → num -
override
-
lerp(
Vector2 v, double alpha) → Vector2 -
lerpVectors(
Vector2 v1, Vector2 v2, double alpha) → Vector2 -
manhattanDistanceTo(
Vector2 v) → num -
manhattanLength(
) → double -
override
-
max(
Vector2 v) → Vector2 -
min(
Vector2 v) → Vector2 -
multiply(
Vector2 v) → Vector2 -
negate(
) → Vector2 -
override
-
normalize(
) → Vector2 -
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
random(
) → Vector2 -
override
-
rotateAround(
Vector2 center, double angle) → Vector2 -
round(
) → Vector2 -
override
-
roundToZero(
) → Vector2 -
override
-
scale(
num scalar) → Vector2 -
override
-
setComponent(
int index, double value) → Vector2 -
setFrom(
Vector v) → Vector2 -
override
-
setLength(
double length) → Vector2 -
override
-
setScalar(
double scalar) → Vector2 -
override
-
setValues(
double x, double y) → Vector2 -
override
-
setX(
double x) → Vector2 -
setY(
double y) → Vector2 -
sub(
Vector a) → Vector2 -
override
-
sub2(
Vector a, Vector b) → Vector2 -
subScalar(
num s) → Vector2 -
override
-
toJson(
) → Map< String, dynamic> -
override
-
toList(
) → List< double> -
override
-
toNumArray(
List< num> array, [int offset = 0]) → List<num> -
override
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
-
operator [](
int i) → double -
operator []=(
int i, double v) → void