@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.
96 lines (92 loc) • 4.23 kB
JavaScript
import { F as FlowGraphUnaryOperationBlock } from './flowGraphUnaryOperationBlock-Bewxi-_r.esm.js';
import { d as RichTypeNumber, j as RichTypeFlowGraphInteger, F as FlowGraphInteger, a as RichTypeBoolean } from './declarationMapper-CqO08-WM.esm.js';
import { u as RegisterClass } from './index-MZPybX0H.esm.js';
import './flowGraphCachedOperationBlock-oE7khWes.esm.js';
import './KHR_interactivity-CEwUaqxQ.esm.js';
import './objectModelMapping-De5EKNEZ.esm.js';
import './spotLight.pure-CRdZC6Ci.esm.js';
/** This file must only contain pure code and pure imports */
/**
* A block that converts a boolean to a float.
*/
class FlowGraphBooleanToFloat extends FlowGraphUnaryOperationBlock {
constructor(config) {
super(RichTypeBoolean, RichTypeNumber, (a) => +a, "FlowGraphBooleanToFloat" /* FlowGraphBlockNames.BooleanToFloat */, config);
}
}
/**
* A block that converts a boolean to an integer
*/
class FlowGraphBooleanToInt extends FlowGraphUnaryOperationBlock {
constructor(config) {
super(RichTypeBoolean, RichTypeFlowGraphInteger, (a) => FlowGraphInteger.FromValue(+a), "FlowGraphBooleanToInt" /* FlowGraphBlockNames.BooleanToInt */, config);
}
}
/**
* A block that converts a float to a boolean.
*/
class FlowGraphFloatToBoolean extends FlowGraphUnaryOperationBlock {
constructor(config) {
super(RichTypeNumber, RichTypeBoolean, (a) => !!a, "FlowGraphFloatToBoolean" /* FlowGraphBlockNames.FloatToBoolean */, config);
}
}
/**
* A block that converts an integer to a boolean.
*/
class FlowGraphIntToBoolean extends FlowGraphUnaryOperationBlock {
constructor(config) {
super(RichTypeFlowGraphInteger, RichTypeBoolean, (a) => !!a.value, "FlowGraphIntToBoolean" /* FlowGraphBlockNames.IntToBoolean */, config);
}
}
/**
* A block that converts an integer to a float.
*/
class FlowGraphIntToFloat extends FlowGraphUnaryOperationBlock {
constructor(config) {
super(RichTypeFlowGraphInteger, RichTypeNumber, (a) => a.value, "FlowGraphIntToFloat" /* FlowGraphBlockNames.IntToFloat */, config);
}
}
/**
* A block that converts a float to an integer.
*/
class FlowGraphFloatToInt extends FlowGraphUnaryOperationBlock {
constructor(config) {
super(RichTypeNumber, RichTypeFlowGraphInteger, (a) => {
const roundingMode = config?.roundingMode;
switch (roundingMode) {
case "floor":
return FlowGraphInteger.FromValue(Math.floor(a));
case "ceil":
return FlowGraphInteger.FromValue(Math.ceil(a));
case "round":
return FlowGraphInteger.FromValue(Math.round(a));
default:
return FlowGraphInteger.FromValue(a);
}
}, "FlowGraphFloatToInt" /* FlowGraphBlockNames.FloatToInt */, config);
}
}
let _Registered = false;
/**
* Register side effects for flowGraphTypeToTypeBlocks.
* Safe to call multiple times; only the first call has an effect.
*/
function RegisterFlowGraphTypeToTypeBlocks() {
if (_Registered) {
return;
}
_Registered = true;
RegisterClass("FlowGraphBooleanToFloat" /* FlowGraphBlockNames.BooleanToFloat */, FlowGraphBooleanToFloat);
RegisterClass("FlowGraphBooleanToInt" /* FlowGraphBlockNames.BooleanToInt */, FlowGraphBooleanToInt);
RegisterClass("FlowGraphFloatToBoolean" /* FlowGraphBlockNames.FloatToBoolean */, FlowGraphFloatToBoolean);
RegisterClass("FlowGraphIntToBoolean" /* FlowGraphBlockNames.IntToBoolean */, FlowGraphIntToBoolean);
RegisterClass("FlowGraphIntToFloat" /* FlowGraphBlockNames.IntToFloat */, FlowGraphIntToFloat);
RegisterClass("FlowGraphFloatToInt" /* FlowGraphBlockNames.FloatToInt */, FlowGraphFloatToInt);
}
/**
* Re-exports pure implementation and applies runtime side effects.
* Import flowGraphTypeToTypeBlocks.pure for tree-shakeable, side-effect-free usage.
*/
RegisterFlowGraphTypeToTypeBlocks();
export { FlowGraphBooleanToFloat, FlowGraphBooleanToInt, FlowGraphFloatToBoolean, FlowGraphFloatToInt, FlowGraphIntToBoolean, FlowGraphIntToFloat, RegisterFlowGraphTypeToTypeBlocks };
//# sourceMappingURL=flowGraphTypeToTypeBlocks-BiWGvAqL.esm.js.map