Vec2 class

Standard 2D vector

Inheritance

Constructors

Vec2(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 setterinherited
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 setterinherited
aspectRatio double
Aspect ratio of the rectangle formed between (0, 0) and this vector (always >= 1.0)
no setterinherited
hashCode int
The hash code for this object.
no setterinherited
length num
Cartesian length of the vector
no setterinherited
lengthSquared int
Length of the vector squared; useful for length comparisons
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
x int
finalinherited
y int
finalinherited

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.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator *(Object other) Vec2
inherited
operator +(Object other) Vec2
inherited
operator -(Object other) Vec2
inherited
operator ==(Object other) bool
The equality operator.
inherited
operator ~/(Object other) Vec2
inherited

Constants

identity → const Vec2
zero → const Vec2