com.talosvfx.talos.runtime.modules.CartToRadModule Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of talos-libgdx Show documentation
Show all versions of talos-libgdx Show documentation
Talos runtime for use in LibGDX projects
The newest version!
package com.talosvfx.talos.runtime.modules;
import com.badlogic.gdx.math.Vector2;
import com.talosvfx.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());
}
}