use of com.talosvfx.talos.runtime.values.Value in project talos by rockbite.
the class AbstractModule method fetchInputSlotValue.
/**
* Fetch value from the input of this module
* @param slotId
*/
public void fetchInputSlotValue(int slotId) {
// find what it is connected to
Slot inputSlot = inputSlots.get(slotId);
if (inputSlot == null) {
return;
}
if (inputSlot.getTargetSlot() == null) {
if (inputSlot.getValue() == null)
return;
inputSlot.getValue().setEmpty(true);
} else {
// ask it's module give it's output value
Value result = inputSlot.getTargetModule().fetchOutputSlotValue(inputSlot.getTargetSlot().getIndex());
if (result != null) {
inputSlot.getValue().set(result);
inputSlot.getValue().setEmpty(false);
}
}
}
use of com.talosvfx.talos.runtime.values.Value in project talos by rockbite.
the class RandomInputModule method processValues.
@Override
public void processValues() {
Value output = outputSlots.get(0).getValue();
if (output != null) {
random.setSeed((long) ((getScope().getFloat(ScopePayload.EMITTER_ALPHA_AT_P_INIT) * 10000 * (index + 1) * 1000)));
int index = MathUtils.round(random.nextFloat() * (inputSlots.size - 1));
Value input = inputSlots.get(index).getValue();
if (input != null && !input.isEmpty()) {
output.set(input);
}
}
}
Aggregations