Class Vec2
-
- All Implemented Interfaces:
-
kotlin.Cloneable,kotlin.Comparable
public class Vec2 implements Comparable<Vec2>, Cloneable
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public abstract classVec2.Sourcedpublic final classVec2.Relativepublic final classVec2.Based⣿⣿⣿⣿⣿⣿⣿⣿⡿⠿⠛⠛⠛⠋⠉⠈⠉⠉⠉⠉⠛⠻⢿⣿⣿⣿⣿⣿⣿⣿ ⣿⣿⣿⣿⣿⡿⠋⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠉⠛⢿⣿⣿⣿⣿ ⣿⣿⣿⣿⡏⣀⠀⠀⠀⠀⠀⠀⠀⣀⣤⣤⣤⣄⡀⠀⠀⠀⠀⠀⠀⠀⠙⢿⣿⣿ ⣿⣿⣿⢏⣴⣿⣷⠀⠀⠀⠀⠀⢾⣿⣿⣿⣿⣿⣿⡆⠀⠀⠀⠀⠀⠀⠀⠈⣿⣿ ⣿⣿⣟⣾⣿⡟⠁⠀⠀⠀⠀⠀⢀⣾⣿⣿⣿⣿⣿⣷⢢⠀⠀⠀⠀⠀⠀⠀⢸⣿ ⣿⣿⣿⣿⣟⠀⡴⠄⠀⠀⠀⠀⠀⠀⠙⠻⣿⣿⣿⣿⣷⣄⠀⠀⠀⠀⠀⠀⠀⣿ ⣿⣿⣿⠟⠻⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠶⢴⣿⣿⣿⣿⣿⣧⠀⠀⠀⠀⠀⠀⣿ ⣿⣁⡀⠀⠀⢰⢠⣦⠀⠀⠀⠀⠀⠀⠀⠀⢀⣼⣿⣿⣿⣿⣿⡄⠀⣴⣶⣿⡄⣿ ⣿⡋⠀⠀⠀⠎⢸⣿⡆⠀⠀⠀⠀⠀⠀⣴⣿⣿⣿⣿⣿⣿⣿⠗⢘⣿⣟⠛⠿⣼ ⣿⣿⠋⢀⡌⢰⣿⡿⢿⡀⠀⠀⠀⠀⠀⠙⠿⣿⣿⣿⣿⣿⡇⠀⢸⣿⣿⣧⢀⣼ ⣿⣿⣷⢻⠄⠘⠛⠋⠛⠃⠀⠀⠀⠀⠀⢿⣧⠈⠉⠙⠛⠋⠀⠀⠀⣿⣿⣿⣿⣿ ⣿⣿⣧⠀⠈⢸⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠟⠀⠀⠀⠀⢀⢃⠀⠀⢸⣿⣿⣿⣿ ⣿⣿⡿⠀⠴⢗⣠⣤⣴⡶⠶⠖⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣀⡸⠀⣿⣿⣿⣿ ⣿⣿⣿⡀⢠⣾⣿⠏⠀⠠⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠛⠉⠀⣿⣿⣿⣿ ⣿⣿⣿⣧⠈⢹⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣰⣿⣿⣿⣿ ⣿⣿⣿⣿⡄⠈⠃⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣠⣴⣾⣿⣿⣿⣿⣿ ⣿⣿⣿⣿⣧⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣠⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿ ⣿⣿⣿⣿⣷⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣴⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿ ⣿⣿⣿⣿⣿⣦⣄⣀⣀⣀⣀⠀⠀⠀⠀⠘⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿ ⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⡄⠀⠀⠀⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿ ⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣧⠀⠀⠀⠙⣿⣿⡟⢻⣿⣿⣿⣿⣿⣿⣿⣿⣿ ⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠇⠀⠁⠀⠀⠹⣿⠃⠀⣿⣿⣿⣿⣿⣿⣿⣿⣿ ⣿⣿⣿⣿⣿⣿⣿⣿⡿⠛⣿⣿⠀⠀⠀⠀⠀⠀⠀⠀⢐⣿⣿⣿⣿⣿⣿⣿⣿⣿ ⣿⣿⣿⣿⠿⠛⠉⠉⠁⠀⢻⣿⡇⠀⠀⠀⠀⠀⠀⢀⠈⣿⣿⡿⠉⠛⠛⠛⠉⠉ ⣿⡿⠋⠁⠀⠀⢀⣀⣠⡴⣸⣿⣇⡄⠀⠀⠀⠀⢀⡿⠄⠙⠛⠀⣀⣠⣤⣤⠄⠀
public final classVec2.Percentpublic final classVec2.ImmutableImmutable Vec2 wrapper. Attempts to set will result in a compilation error in Kotlin, and an UnsupportedOperationException.
-
Field Summary
Fields Modifier and Type Field Description public final static Vec2.ImmutableONEpublic final static Vec2.ImmutableZEROpublic final static Vec2.ImmutableRES_1080Ppublic final static Vec2.ImmutableRES_1440Ppublic final static Vec2.ImmutableRES_4Kprivate Floatwidthprivate Floatheightprivate final BooleanisZeroprivate final BooleanhasZeroprivate final BooleanisNegativeprivate final Floatmagnitude2private final Floatmagnitudeprivate Floatxprivate Floaty
-
Method Summary
Modifier and Type Method Description final FloatgetWidth()final UnitsetWidth(Float width)final FloatgetHeight()final UnitsetHeight(Float height)final BooleanisZero()final BooleangetHasZero()final BooleanisNegative()FloatgetMagnitude2()FloatgetMagnitude()FloatgetX()UnitsetX(Float x)FloatgetY()UnitsetY(Float y)final Unitnormalize()Normalize this vector. final Unitmin(Float x, Float y, Boolean respectRatio)final UnitensureSmallerThan(Vec2 other)final UnitensureLargerThan(Vec2 other)final Unitmax(Float x, Float y, Boolean respectRatio)final Unitresize(Float x, Float y, Boolean respectRatio)Unitscale(Float xScale, Float yScale)final UnittimesAssign(Vec2 other)final UnittimesAssign(Float other)final UnitdivAssign(Float other)final UnitplusAssign(Vec2 other)final UnitminusAssign(Vec2 other)final Unitset(Integer index, Float value)final Unitset(Vec2 other)final Floatget(Integer index)IntegercompareTo(Vec2 other)Compares the two Vec2 instances according to the magnitude of the vectors. final IntegercompareTo(Float fl)Compares the magnitude of this to the given float, which should be a magnitude of a vector itself. Booleanequals(Object other)IntegerhashCode()StringtoString()Vec2clone()-
-
Method Detail
-
getHasZero
final Boolean getHasZero()
-
isNegative
final Boolean isNegative()
-
getMagnitude2
Float getMagnitude2()
-
getMagnitude
Float getMagnitude()
-
ensureSmallerThan
final Unit ensureSmallerThan(Vec2 other)
-
ensureLargerThan
final Unit ensureLargerThan(Vec2 other)
-
timesAssign
final Unit timesAssign(Vec2 other)
-
timesAssign
final Unit timesAssign(Float other)
-
plusAssign
final Unit plusAssign(Vec2 other)
-
minusAssign
final Unit minusAssign(Vec2 other)
-
compareTo
Integer compareTo(Vec2 other)
Compares the two Vec2 instances according to the magnitude of the vectors. A positive number is returned if this magnitude is larger than other, negative if it is smaller than other, and 0 if it is equal to other.
Note that two different vectors can have the same magnitude.
-
compareTo
final Integer compareTo(Float fl)
Compares the magnitude of this to the given float, which should be a magnitude of a vector itself.
-
-
-
-