Package org.polyfrost.polyui.unit
Class Vec2
-
- All Implemented Interfaces:
@JvmInline() public final class Vec2
Class that represents a 2D vector.
(revised 1.5) Vec2's are now purely syntactical sugar which are inlined and have no runtime overhead. Their representation in internal data structures has been replaced with floats instead.
- Since:
1.1.0
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classVec2.Constants
-
Field Summary
Fields Modifier and Type Field Description private final Floatxprivate final Floatyprivate final BooleanisNegativeprivate final BooleanisZeroprivate final BooleanisPositiveprivate final Stringhexprivate final Stringbinaryprivate final Longvaluepublic final static Vec2.ConstantsConstants
-
Method Summary
Modifier and Type Method Description final FloatgetX()final FloatgetY()final BooleanisNegative()final BooleanisZero()final BooleanisPositive()final StringgetHex()final StringgetBinary()final LonggetValue()final Floatget(Integer index)final Floatcomponent1()final Floatcomponent2()StringtoString()final IntegercompareTo(Vec2 size)final Vec2times(Vec2 other)final Vec2div(Vec2 other)final Vec2plus(Vec2 other)final Vec2minus(Vec2 other)final Vec2rem(Vec2 other)final Vec2coerceAtLeast(Vec2 other)final Vec2coerceAtMost(Vec2 other)final Vec2coerceIn(Vec2 min, Vec2 max)final static Vec2of(Float x, Float y)-
-
Method Detail
-
isNegative
final Boolean isNegative()
-
isPositive
final Boolean isPositive()
-
component1
final Float component1()
-
component2
final Float component2()
-
coerceAtLeast
final Vec2 coerceAtLeast(Vec2 other)
-
coerceAtMost
final Vec2 coerceAtMost(Vec2 other)
-
-
-
-