@babylonjs/viewer
Version:
The Babylon Viewer aims to simplify a specific but common Babylon.js use case: loading, viewing, and interacting with a 3D model.
65 lines (61 loc) • 2.29 kB
JavaScript
import { F as FlowGraphBlock } from './KHR_interactivity-CEwUaqxQ.esm.js';
import { R as RichTypeAny, j as RichTypeFlowGraphInteger, F as FlowGraphInteger } from './declarationMapper-CqO08-WM.esm.js';
import { u as RegisterClass } from './index-MZPybX0H.esm.js';
import './objectModelMapping-De5EKNEZ.esm.js';
import './spotLight.pure-CRdZC6Ci.esm.js';
/** This file must only contain pure code and pure imports */
/**
* This block takes an object as input and an array and returns the index of the object in the array.
*/
class FlowGraphIndexOfBlock extends FlowGraphBlock {
/**
* Construct a FlowGraphIndexOfBlock.
* @param config construction parameters
*/
constructor(config) {
super(config);
this.config = config;
this.object = this.registerDataInput("object", RichTypeAny);
this.array = this.registerDataInput("array", RichTypeAny);
this.index = this.registerDataOutput("index", RichTypeFlowGraphInteger, new FlowGraphInteger(-1));
}
/**
* @internal
*/
_updateOutputs(context) {
const object = this.object.getValue(context);
const array = this.array.getValue(context);
if (array) {
this.index.setValue(new FlowGraphInteger(array.indexOf(object)), context);
}
}
/**
* Serializes this block
* @param serializationObject the object to serialize to
*/
serialize(serializationObject) {
super.serialize(serializationObject);
}
getClassName() {
return "FlowGraphIndexOfBlock" /* FlowGraphBlockNames.IndexOf */;
}
}
let _Registered = false;
/**
* Register side effects for flowGraphIndexOfBlock.
* Safe to call multiple times; only the first call has an effect.
*/
function RegisterFlowGraphIndexOfBlock() {
if (_Registered) {
return;
}
_Registered = true;
RegisterClass("FlowGraphIndexOfBlock" /* FlowGraphBlockNames.IndexOf */, FlowGraphIndexOfBlock);
}
/**
* Re-exports pure implementation and applies runtime side effects.
* Import flowGraphIndexOfBlock.pure for tree-shakeable, side-effect-free usage.
*/
RegisterFlowGraphIndexOfBlock();
export { FlowGraphIndexOfBlock, RegisterFlowGraphIndexOfBlock };
//# sourceMappingURL=flowGraphIndexOfBlock-DhEbrsKf.esm.js.map