Search in sources :

Example 11 with NumericalValue

use of com.talosvfx.talos.runtime.values.NumericalValue in project talos by rockbite.

the class AbstractModule method createInputSlot.

public NumericalValue createInputSlot(int slotId) {
    inputSlots.put(slotId, new Slot(this, slotId, true));
    NumericalValue value = new NumericalValue();
    inputSlots.get(slotId).setValue(value);
    return value;
}
Also used : NumericalValue(com.talosvfx.talos.runtime.values.NumericalValue) Slot(com.talosvfx.talos.runtime.Slot)

Example 12 with NumericalValue

use of com.talosvfx.talos.runtime.values.NumericalValue in project talos by rockbite.

the class AttractorModule method processValues.

@Override
public void processValues() {
    NumericalValue posNumVal = getScope().get(ScopePayload.PARTICLE_POSITION);
    pos.set(posNumVal.get(0), posNumVal.get(1));
    float alphaVal = getScope().getFloat(ScopePayload.PARTICLE_ALPHA);
    ;
    if (!alpha.isEmpty()) {
        alphaVal = alpha.getFloat();
    }
    initialVector.set(initialVelocity.getFloat(), 0);
    initialVector.rotate(initialAngle.getFloat());
    attractionVector.set(attractorPosition.get(0), attractorPosition.get(1)).sub(pos);
    attractionVector.nor().scl(initialVelocity.getFloat());
    Interpolation interpolation = Interpolation.linear;
    // now let's mix them
    result.set(interpolation.apply(initialVector.x, attractionVector.x, alphaVal), interpolation.apply(initialVector.y, attractionVector.y, alphaVal));
    angle.set(result.angle());
    velocity.set(result.len());
}
Also used : Interpolation(com.badlogic.gdx.math.Interpolation) NumericalValue(com.talosvfx.talos.runtime.values.NumericalValue)

Aggregations

NumericalValue (com.talosvfx.talos.runtime.values.NumericalValue)12 Slot (com.talosvfx.talos.runtime.Slot)3 ParticleEffectInstance (com.talosvfx.talos.runtime.ParticleEffectInstance)2 FileHandle (com.badlogic.gdx.files.FileHandle)1 Interpolation (com.badlogic.gdx.math.Interpolation)1 Vector2 (com.badlogic.gdx.math.Vector2)1 JsonValue (com.badlogic.gdx.utils.JsonValue)1 ObjectMap (com.badlogic.gdx.utils.ObjectMap)1 DragPoint (com.talosvfx.talos.editor.widgets.ui.DragPoint)1