Package org.polyfrost.polyui.unit
Class Vec2
-
- All Implemented Interfaces:
-
kotlin.Cloneable,kotlin.Comparable
public class Vec2 implements Cloneable, Comparable<Vec2>
Class that represents a 2D vector.
- Since:
1.1.0
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classVec2.ImmutableImmutable version of Vec2.
-
Method Summary
Modifier and Type Method Description FloatgetX()UnitsetX(Float x)FloatgetY()UnitsetY(Float y)final Floatget(Integer index)final Vec2plus(Vec2 other)final Vec2minus(Vec2 other)final Vec2times(Vec2 other)final Vec2div(Vec2 other)IntegercompareTo(Vec2 other)final IntegercompareTo(Float other)final Unitset(Integer index, Float value)final Unitset(Vec2 other)final Unitmin(Float x, Float y, Boolean respectRatio)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(Vec2 other)final UnitdivAssign(Float other)final UnitunaryMinus()final UnitplusAssign(Vec2 other)final UnitminusAssign(Vec2 other)final Unitsmin(Vec2 other)simple min function. final Unitsmax(Vec2 other)simple max function. Booleanequals(Object other)IntegerhashCode()Vec2clone()StringtoString()final static Vec2valueOf(Float x, Float y)-
-
Method Detail
-
timesAssign
final Unit timesAssign(Vec2 other)
-
timesAssign
final Unit timesAssign(Float other)
-
unaryMinus
final Unit unaryMinus()
-
plusAssign
final Unit plusAssign(Vec2 other)
-
minusAssign
final Unit minusAssign(Vec2 other)
-
-
-
-