public class Vec
2d vector. Seems wasteful to create millions of these, but they should be removed by JVM's escape analysis.
In some places we have used other equivalents like Pair
Modifier and Type | Class and Description |
---|---|
static class |
Vec.Companion |
Modifier and Type | Field and Description |
---|---|
static Vec.Companion |
Companion |
Constructor and Description |
---|
Vec(float x,
float y)
2d vector. Seems wasteful to create millions of these, but they should be removed by JVM's escape analysis.
In some places we have used other equivalents like Pair
|
Vec() |
Modifier and Type | Method and Description |
---|---|
Vec |
clampMagnitude(float max) |
float |
component1() |
float |
component2() |
Vec |
convertToDpad() |
boolean |
equals(java.lang.Object other) |
float |
getX() |
float |
getY() |
Vec |
ignoreDeadzone(float deadzone) |
boolean |
isMoreOrLessZero() |
boolean |
isNotZero() |
float |
magnitude() |
Vec |
minus(Vec p) |
Vec |
normVector(float magnitude) |
Vec |
normVectorOrZero(float magnitude) |
Vec |
rescaleWithDeadzone(float deadzone) |
Vec |
rescaleWithDeadzone(float deadzone,
float upperBound) |
Vec |
times(float other) |
float |
toAngle() |
java.lang.String |
toString() |
kotlin.Pair<java.lang.Float,java.lang.Float> |
xy() |
public static Vec.Companion Companion
public Vec(float x, float y)
2d vector. Seems wasteful to create millions of these, but they should be removed by JVM's escape analysis.
In some places we have used other equivalents like Pair
public Vec()
public kotlin.Pair<java.lang.Float,java.lang.Float> xy()
public float component1()
public float component2()
public Vec normVector(float magnitude)
public Vec normVectorOrZero(float magnitude)
public float magnitude()
public boolean isMoreOrLessZero()
public boolean isNotZero()
public boolean equals(java.lang.Object other)
public Vec times(float other)
public Vec rescaleWithDeadzone(float deadzone)
public Vec ignoreDeadzone(float deadzone)
public Vec clampMagnitude(float max)
public Vec rescaleWithDeadzone(float deadzone, float upperBound)
public float toAngle()
public Vec convertToDpad()
public java.lang.String toString()
public float getX()
public float getY()