VectorBase class abstract
Base class of an immutable 2D vector or direction
Constructors
- VectorBase(int x, int y)
-
const
Properties
- absArea → int
-
The area of a rectangle formed by (0, 0) and this vector
Will always be a positive value
no setter
- area → int
-
The area of a rectangle formed by (0, 0) and this vector
Will be a negative value if one of the vector's components are negative
no setter
- aspectRatio → double
-
Aspect ratio of the rectangle formed between (0, 0) and this vector
(always >= 1.0)
no setter
- hashCode → int
-
The hash code for this object.
no setteroverride
- length → num
-
Cartesian length of the vector
no setter
- lengthSquared → int
-
Length of the vector squared; useful for length comparisons
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- x → int
-
final
- y → int
-
final
Methods
-
clamp(
VectorBase other) → Vec2 - Clamps the given vector so that it falls within the boundaries formed by a rectangle between the origin (0, 0) and this vector.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator *(
Object other) → Vec2 -
operator +(
Object other) → Vec2 -
operator -(
Object other) → Vec2 -
operator ==(
Object other) → bool -
The equality operator.
override
-
operator ~/(
Object other) → Vec2