babylonjs-gltf2interface 7.51.0 → 7.51.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1361,58 +1361,161 @@ declare module BABYLON.GLTF2 {
1361
1361
  * Interfaces for the KHR_interactivity extension
1362
1362
  */
1363
1363
  interface IKHRInteractivity {
1364
- nodes: IKHRInteractivity_Node[];
1365
- customEvents?: IKHRInteractivity_CustomEvent[];
1366
- types?: IKHRInteractivity_Type[];
1364
+ /**
1365
+ * Holding all of the graphs in the glTF
1366
+ */
1367
+ graphs: IKHRInteractivity_Graph[];
1368
+ /**
1369
+ * The graph to run. Defaults to index 0
1370
+ */
1371
+ graph?: number;
1372
+ }
1373
+
1374
+ interface IKHRInteractivity_Graph {
1375
+ types?: IKHRInteractivity_Type /* | IKHRInteractivity_CustomType */[]; // should technically behave as a set - no two signatures should match
1367
1376
  variables?: IKHRInteractivity_Variable[];
1377
+ events?: IKHRInteractivity_Event[];
1378
+ declarations?: IKHRInteractivity_Declaration[];
1379
+ nodes?: IKHRInteractivity_Node[];
1368
1380
  }
1369
1381
 
1370
- interface IKHRInteractivity_Node {
1371
- type: string;
1372
- flows?: IKHRInteractivity_Flow[];
1373
- configuration?: IKHRInteractivity_Configuration[];
1374
- values?: IKHRInteractivity_Value[];
1375
- metadata?: any;
1382
+ /**
1383
+ * An index of the types array
1384
+ */
1385
+ type TypeIndex = number;
1386
+ /**
1387
+ * An index of the declaration array
1388
+ */
1389
+ type DeclarationIndex = number;
1390
+
1391
+ /**
1392
+ * An index of the nodes array
1393
+ */
1394
+ type NodeIndex = number;
1395
+ /**
1396
+ * Value types supported (in js it is either boolean or number)
1397
+ */
1398
+ type ValueType = (boolean | number)[];
1399
+
1400
+ type ValueSignature = "bool" | "float" | "float2" | "float3" | "float4" | "float2x2" | "float3x3" | "float4x4" | "int" | "custom";
1401
+
1402
+ type ConfigurationValueSignature = "bool" | "int" | "int[]" | "string";
1403
+
1404
+ type ConfigurationValueType = (boolean | number | string)[];
1405
+
1406
+ interface IKHRInteractivity_Event {
1407
+ /**
1408
+ * The event id is an application-specific event identifier recognized by the execution environment. If the id property is undefined, the event is considered internal to the graph.
1409
+ */
1410
+ id?: string;
1411
+ /**
1412
+ * The properties of the values object define ids and the values of those properties define types and optional initial values of the value sockets associated with the event.
1413
+ */
1414
+ values?:
1415
+ | {
1416
+ [id: string]: IKHRInteractivity_Variable;
1417
+ }
1418
+ | undefined;
1376
1419
  }
1377
1420
 
1378
- interface IKHRInteractivity_Flow {
1379
- id: string;
1380
- node: number;
1381
- socket: string;
1421
+ interface IKHRInteractivity_Type {
1422
+ /**
1423
+ * A signature of this type or custom if defined by an external extension
1424
+ */
1425
+ signature: ValueSignature;
1382
1426
  }
1383
1427
 
1384
- interface IKHRInteractivity_Configuration {
1385
- id: string;
1386
- value: any;
1387
- type?: number;
1428
+ // interface IKHRInteractivity_CustomType {
1429
+ // signature: string;
1430
+ // }
1431
+
1432
+ interface IKHRInteractivity_Variable {
1433
+ /**
1434
+ * Array size depends on the type. primitives have array size 1, rest depending on the object type (2,3,4,16)
1435
+ * if value is not provided it should be initialized to the default value of the type according to the specs - NaN for floats, 0 for integers, false for booleans.
1436
+ */
1437
+ value?: ValueType;
1438
+ /**
1439
+ * An index in the types array
1440
+ */
1441
+ type: TypeIndex;
1388
1442
  }
1389
1443
 
1390
- interface IKHRInteractivity_Value {
1391
- id: string;
1392
- value?: any;
1393
- node?: number;
1394
- socket?: string;
1395
- type?: number;
1444
+ /**
1445
+ * a KHR_Interactivity operation declaration.
1446
+ * Declarations are considered equal when their op, extension and input values are equal.
1447
+ * If stating an external extension it is possible the declaration is not supported by the engine. In this case the operation will be a no-op
1448
+ */
1449
+ interface IKHRInteractivity_Declaration {
1450
+ /**
1451
+ * the operation identifier.
1452
+ * Either defined by the interactivity extension or a custom operation by an external extension
1453
+ */
1454
+ op: string;
1455
+ /**
1456
+ * If the op is not defined by the interactivity specs, this states the extension that defines the operation
1457
+ */
1458
+ extension?: string;
1459
+ /**
1460
+ * If custom operation, this is the output values signatures of the event
1461
+ * if undefined the custom operation has no outputs
1462
+ */
1463
+ outputValueSockets?: { [id: string]: { type: TypeIndex } };
1464
+ /**
1465
+ * if custom operation, this is the input values signatures of the event
1466
+ * If undefined the custom operation has no inputs
1467
+ */
1468
+ inputValueSockets?: { [id: string]: { type: TypeIndex } };
1396
1469
  }
1397
1470
 
1398
- interface IKHRInteractivity_CustomEvent {
1399
- id: string;
1400
- values: IKHRInteractivity_CustomEventValue[];
1471
+ interface IKHRInteractivity_Node {
1472
+ /**
1473
+ * An index in the declarations array
1474
+ */
1475
+ declaration: DeclarationIndex;
1476
+ /**
1477
+ * Input value sockets
1478
+ */
1479
+ values?: { [id: string]: IKHRInteractivity_Variable | IKHRInteractivity_OutputSocketReference };
1480
+
1481
+ /**
1482
+ * Output Flow Socket Pointers
1483
+ */
1484
+ flows?: { [id: string]: IKHRInteractivity_OutputFlow };
1485
+ configuration?: { [id: string]: IKHRInteractivity_Configuration };
1401
1486
  }
1402
1487
 
1403
- interface IKHRInteractivity_CustomEventValue {
1404
- id: string;
1405
- type: number;
1406
- description: string;
1488
+ interface IKHRInteractivity_OutputSocketReference {
1489
+ /**
1490
+ * An index in the nodes array
1491
+ */
1492
+ node: NodeIndex;
1493
+ /**
1494
+ * Must be defined if the node doesn't have a "value" output socket
1495
+ */
1496
+ socket?: string;
1497
+ /**
1498
+ * An optional type that must match the type of the output socket of the target node
1499
+ */
1500
+ type?: TypeIndex;
1407
1501
  }
1408
1502
 
1409
- interface IKHRInteractivity_Type {
1410
- signature: string;
1503
+ interface IKHRInteractivity_OutputFlow {
1504
+ /**
1505
+ * An index in the nodes array
1506
+ */
1507
+ node: NodeIndex;
1508
+ /**
1509
+ * The socket to connect to in the target node
1510
+ * defaults to "in" when undefined.
1511
+ */
1512
+ socket?: string;
1411
1513
  }
1412
1514
 
1413
- interface IKHRInteractivity_Variable {
1414
- id: string;
1415
- value: any;
1416
- type: number;
1515
+ interface IKHRInteractivity_Configuration {
1516
+ /**
1517
+ * Array size depends on the type. primitives have array size 1, rest depending on the object type (2,3,4,16)
1518
+ */
1519
+ value: ConfigurationValueType;
1417
1520
  }
1418
1521
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "babylonjs-gltf2interface",
3
3
  "description": "A typescript declaration of babylon's gltf2 interface.",
4
- "version": "7.51.0",
4
+ "version": "7.51.2",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "https://github.com/BabylonJS/Babylon.js.git"