games.rednblack.talos.runtime.modules.CartToRadModule Maven / Gradle / Ivy
package games.rednblack.talos.runtime.modules;
import com.badlogic.gdx.math.Vector2;
import games.rednblack.talos.runtime.values.NumericalValue;
public class CartToRadModule extends AbstractModule {
public static final int POSITION = 0;
public static final int ANGLE = 0;
public static final int LENGTH = 1;
NumericalValue position;
NumericalValue angle;
NumericalValue length;
Vector2 tmp = new Vector2();
@Override
protected void defineSlots() {
position = createInputSlot(POSITION);
angle = createOutputSlot(ANGLE);
length = createOutputSlot(LENGTH);
}
@Override
public void processValues() {
tmp.set(position.get(0), position.get(1));
angle.set(tmp.angle());
length.set(tmp.len());
}
}