@intelligentgraphics/3d.ig.gfx.standard 1.8.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.
@@ -0,0 +1,1045 @@
1
+ /*
2
+ * Version: 1.8.2.100
3
+ * Commit: 6f0359b
4
+ * Date: 2023-01-26T10:52:15.606Z
5
+ *
6
+ * @preserve
7
+ */
8
+ /// <reference types="@intelligentgraphics/3d.ig.math" />
9
+ /// <reference types="@intelligentgraphics/3d.ig.gfx.core" />
10
+ declare module IGX.Std {
11
+ class KinematicChain {
12
+ /** how are these joints inserted? (unit vector for all joints) */
13
+ GeometryBase: string;
14
+ /**
15
+ * List of components acting as joints in the kinematic chain.
16
+ * The first joint is the origin. Head of origin is fixed.
17
+ * All joints are connected with its next joint (0.tail -> 1.head).
18
+ * So the right order inside joints array is important!
19
+ */
20
+ Joints: [
21
+ {
22
+ /** (optional) name of this joint */
23
+ Name?: string;
24
+ /** component id for head (relative path from interaktor node) */
25
+ HeadX: string;
26
+ /** component id for head (relative path from interaktor node) */
27
+ HeadY: string;
28
+ /** component id for head (relative path from interaktor node) */
29
+ HeadZ: string;
30
+ /** component id for tail (relative path from interaktor node) */
31
+ Tail: string;
32
+ /** (optional)(experimental) how is this joint inserted? (will override defined GeometryDirection) */
33
+ GeometryBase?: string;
34
+ /**
35
+ * (optional) this joint strictly follows a node from another joint.
36
+ * Needs path to node in other joint. Used as Head for this joint.
37
+ */
38
+ FollowJointNode?: string;
39
+ /** (optional) max angle (DEG) for rotation to the left (affects position of Head) */
40
+ LimitLeft?: number;
41
+ /** (optional) max angle (DEG) for rotation to the right (affects position of Head) */
42
+ LimitRight?: number;
43
+ /** (optional) max angle (DEG) for rotation to the up (affects position of Head) */
44
+ LimitUp?: number;
45
+ /** (optional) max angle (DEG) for rotation to the bottom (affects position of Head) */
46
+ LimitDown?: number;
47
+ /** internal */
48
+ _Length?: number;
49
+ /** internal */
50
+ _HeadPos?: IG.Math.Vector3;
51
+ /** internal */
52
+ _TailPos?: IG.Math.Vector3;
53
+ /** internal */
54
+ _Rotation?: IG.Math.Quaternion;
55
+ /** internal */
56
+ _Blocked?: boolean;
57
+ }
58
+ ];
59
+ /** Absolute path (+ component id) to target node. When using multi target kinematics this can be set to "subbase". */
60
+ Target: string;
61
+ /**
62
+ * (optional) When using multi target kinematics this references path to subbase kinematic chain (relative to interactor)
63
+ * or is set to "root" for the first chain
64
+ */
65
+ Parent?: string;
66
+ /** Tolerance as break condition for the IK solver */
67
+ Tolerance: number;
68
+ /** (optional) Max number of iterations */
69
+ MaxIterations?: number;
70
+ /** internal */
71
+ _RootId?: string;
72
+ /** internal */
73
+ _ChainPath?: string;
74
+ /** internal */
75
+ _ParentChain?: KinematicChain;
76
+ /** internal */
77
+ _Level?: number;
78
+ /** internal */
79
+ _Origin?: string;
80
+ /** internal */
81
+ _TotalLength?: number;
82
+ /** internal */
83
+ _OriginPos?: IG.Math.Vector3;
84
+ /** internal */
85
+ _TargetPos?: IG.Math.Vector3;
86
+ }
87
+ }
88
+ /** Data-controlled IG.GFX Animations.
89
+ *
90
+ * Version 1.4 (1.4.0.100)
91
+ *
92
+ * Copyright (C) 2013 - 2023 intelligentgraphics AG. All Rights Reserved.
93
+ */
94
+ declare module IGX.Std {
95
+ /**
96
+ * Describes an animation state. An animation state may provide values for
97
+ * Rotation and/or Position and/or Scaling and/or Deformation.
98
+ */
99
+ class AnimationState {
100
+ /**
101
+ * If available, the position of the component is described.
102
+ * If not available, but another state involved in the interpolation,
103
+ * provides a position, the position is implicitly considered to be 0, 0, 0.
104
+ * Only non-undefined values are considered. If undefined but needed, e.g.
105
+ * in interpolation, 0 is assumed.
106
+ * Positions are defined the same way as in the IG.GFX data.
107
+ */
108
+ Position?: {
109
+ X?: number | string;
110
+ Y?: number | string;
111
+ Z?: number | string;
112
+ };
113
+ /**
114
+ * If available, the rotation of the component is described.
115
+ * If not available, but another state involved in the interpolation,
116
+ * provides a rotation, the rotation is implicitly considered to be 0, 0, 0.
117
+ * Only non-undefined values are considered. If undefined but needed, e.g.
118
+ * in interpolation, 0 is assumed.
119
+ * Rotations are defined the same way as in the IG.GFX data.
120
+ */
121
+ Rotation?: {
122
+ X?: number | string;
123
+ Y?: number | string;
124
+ Z?: number | string;
125
+ };
126
+ /**
127
+ * If available, the scaling of the component is described.
128
+ * If not available, but another state involved in the interpolation,
129
+ * provides a scaling, the scaling is implicitly considered to be 1, 1, 1.
130
+ * Only non-undefined values are considered. If undefined but needed, e.g.
131
+ * in interpolation, 1 is assumed.
132
+ * Scaling is defined the same way as in the IG.GFX data.
133
+ */
134
+ Scaling?: {
135
+ X?: number | string;
136
+ Y?: number | string;
137
+ Z?: number | string;
138
+ };
139
+ /**
140
+ * If not undefined, it describes the deformation to be applied.
141
+ * If undefined but needed, e.g. in interpolation, 0 is assumed.
142
+ * Deformation is defined the same way as in the IG.GFX data.
143
+ */
144
+ Deformation?: number | string;
145
+ /** If defined, sets the visibility. */
146
+ Visibility?: boolean | string;
147
+ }
148
+ /**
149
+ * Data structure for animation descriptions.
150
+ * An animation is processed by IGX.Std.AnimationInteractor and
151
+ * may contain different micro animations.
152
+ */
153
+ class Animation {
154
+ /**
155
+ * The id of the animation. Must be a usual identifier, e.g. start with uppercase letter,
156
+ * no spaces, etc., and unique in the package. The file should be named then <Id>.animation.json
157
+ */
158
+ Id: string;
159
+ /**
160
+ * One or more micro animations. Each micro animation is assigned to a component.
161
+ * You may assign multiple micro animations to one and the same component.
162
+ */
163
+ Animations: {
164
+ /**
165
+ * The path that identifies the component to be animated.
166
+ * If path is undefined or ".", the component to which the Interactor is assigned, is considered.
167
+ */
168
+ Path?: string;
169
+ /**
170
+ * The interpolation mode to be applied for this micro animation.<br>
171
+ * Mode Linear (or undefined) requests a linear interpolation of two animation states.
172
+ */
173
+ Mode?: "Linear";
174
+ /**
175
+ * Two or more animation states. The time values must be in the range 0.0 to 1.0.<br>
176
+ * If there is no state for time 0.0, the smallest time value is used for 0.0.<br>
177
+ * If there is no state for time 1.0, the highest time value is used for 1.0.<br>
178
+ * If the requested time value is outside an epsilon range of an explicitly provided time
179
+ * value, a proportional interpolation of the closest two explicit animation states will
180
+ * be applied under consideration of the mode.<br>
181
+ * The time value must be a number string in scientific notation.
182
+ */
183
+ States: {
184
+ [time: string]: AnimationState;
185
+ };
186
+ }[];
187
+ /**
188
+ * Move Snappoints following a given (usually geometryless) node
189
+ */
190
+ LinkedPoints?: {
191
+ [path: string]: string[];
192
+ };
193
+ /**
194
+ * (optional) Build kinematic chains with this param.
195
+ * For a documentation see Gfx/userdoc/kinematics/index.html
196
+ */
197
+ Kinematics?: KinematicChain | KinematicChain[];
198
+ /** For internal optimization. Sorted by increasing time. */
199
+ _loops?: {
200
+ path: string;
201
+ mode: string;
202
+ states: {
203
+ time: number;
204
+ period?: number;
205
+ state1: AnimationState;
206
+ state2?: AnimationState;
207
+ }[];
208
+ }[];
209
+ }
210
+ }
211
+ declare module IGX.Std {
212
+ const Minimum = "Minimum";
213
+ const Maximum = "Maximum";
214
+ const Snap = "Snap";
215
+ const Raster = "Raster";
216
+ const Values = "Values";
217
+ const StartValue = "StartValue";
218
+ const EndValue = "EndValue";
219
+ const StartTime = "StartTime";
220
+ const EndTime = "EndTime";
221
+ const Steps = "Steps";
222
+ const Mode = "Mode";
223
+ const XPosition = "XPosition";
224
+ const YPosition = "YPosition";
225
+ const ZPosition = "ZPosition";
226
+ const XRotation = "XRotation";
227
+ const YRotation = "YRotation";
228
+ const ZRotation = "ZRotation";
229
+ const Start = "Start";
230
+ const End = "End";
231
+ const Stage = "Stage";
232
+ const Period = "Period";
233
+ const BackwardPeriod = "BackwardPeriod";
234
+ const StageStart = "StageStart";
235
+ const StageEnd = "StageEnd";
236
+ const Manual = "Manual";
237
+ const cString = "string";
238
+ const cNumber = "number";
239
+ interface AnimationParameters {
240
+ Start?: string | number;
241
+ End?: string | number;
242
+ StageStart?: string | number;
243
+ StageEnd?: string | number;
244
+ Stage?: string | number;
245
+ Period?: string | number;
246
+ BackwardPeriod?: string | number;
247
+ Values?: number[] | string;
248
+ IntermediateCalculation?: string | number;
249
+ DebugLevel?: number;
250
+ Record?: string | boolean;
251
+ }
252
+ function SetupValue<K extends keyof AnimationParameters>(parameters: AnimationParameters & {
253
+ [key: string]: any;
254
+ }, key: K, fallbackValue: number): void;
255
+ function SetupValue(parameters: {
256
+ [key: string]: any;
257
+ }, key: string, fallbackValue: number): void;
258
+ var SetupValues: (parameters: AnimationParameters & {
259
+ [key: string]: any;
260
+ }, fallbackValues: number[]) => void;
261
+ function GetValue<K extends keyof AnimationParameters>(parameters: AnimationParameters & {
262
+ [key: string]: any;
263
+ }, parameter: K): number;
264
+ function GetValue(parameters: AnimationParameters & {
265
+ [key: string]: any;
266
+ }, parameter: string): number;
267
+ var SetupAnimation: (parameters: AnimationParameters) => void;
268
+ /**
269
+ * Resturns the absolute path of a node inside a component
270
+ * @param componentId absolute path of component
271
+ * @param relPath relative path inside component
272
+ */
273
+ function getAbsPath(componentId: string, relPath: string): string;
274
+ }
275
+ declare module IGX.Std {
276
+ type Array3 = [number, number, number];
277
+ export type ShadowScene = Record<string, {
278
+ position: Float3;
279
+ rotation: Array3;
280
+ scaling: Float3;
281
+ visibility: boolean;
282
+ deformation?: number;
283
+ activedeformation?: boolean;
284
+ }>;
285
+ /**
286
+ * Collection of API calls implementing IGX.API.*
287
+ *
288
+ * works on ThreeJS scenegraph OR internal virtual scenegraph("shadow scene") that is actually a subset of the real scenegraph
289
+ *
290
+ * @export
291
+ * @class ApiConnection
292
+ */
293
+ export class ApiConnection {
294
+ private shadow?;
295
+ private useShadowApi;
296
+ private debug;
297
+ callLog: string[];
298
+ printCallAsError: boolean;
299
+ constructor(debug?: boolean);
300
+ /**
301
+ * accesses real scenegraph
302
+ *
303
+ * @private
304
+ * @param {string} id
305
+ * @returns
306
+ * @memberof ApiConnection
307
+ */
308
+ private getNodeInfo;
309
+ makeShadow(componentId: string, subNodes?: string[]): ShadowScene;
310
+ setShadowWithParameters(componentId: string, subNodes: string[], absoluteNodesToBeCached: string[], parameters: Animation, interactorParams: {
311
+ [t: string]: any;
312
+ }, backwards?: boolean): ShadowScene;
313
+ private cloneShadow;
314
+ setShadow(id: string, joints?: string[]): any;
315
+ getShadow(): any;
316
+ setUseShadow(value: boolean): void;
317
+ getUseShadow(): boolean;
318
+ /**
319
+ * write shadow scene into real scenegraph
320
+ *
321
+ * @param {ShadowScene} [shadow]
322
+ * @memberof ApiConnection
323
+ */
324
+ setOriginalSceneFromShadow(shadow?: ShadowScene, componentId?: string, this_animation_LinkedPoints?: {
325
+ [path: string]: string[];
326
+ }): void;
327
+ private appendNode;
328
+ SetPoint(componentId: string, key: string, position: Float3, rotation: Float3, visibility?: boolean | null): void;
329
+ GetParent(componentId: string): string;
330
+ IsValid(componentId: string): boolean;
331
+ GetPosition(componentId: string): Float3;
332
+ GetVisibility(componentId: string): boolean;
333
+ GetScaling(componentId: string): Float3;
334
+ GetXRotation(componentId: string): number;
335
+ GetYRotation(componentId: string): number;
336
+ GetZRotation(componentId: string): number;
337
+ /**
338
+ *
339
+ * @param {string} componentId
340
+ * @returns {number}
341
+ * @memberof ApiConnection
342
+ */
343
+ GetDeformation(componentId: string): number;
344
+ SetDeformation(componentId: string, value: number): void;
345
+ SetPosition(componentId: string, pos: IGX.Float3): void;
346
+ SetXRotation(componentId: string, rotation: number): void;
347
+ SetYRotation(componentId: string, rotation: number): void;
348
+ SetZRotation(componentId: string, rotation: number): void;
349
+ SetVisibility(componentId: string, visible: boolean): void;
350
+ SetScaling(componentId: string, scaling: IGX.Float3): void;
351
+ }
352
+ export {};
353
+ }
354
+ declare namespace IGX.Std {
355
+ /**
356
+ * Helper class for FourBar linkage
357
+ *
358
+ * Describing a nonlinear folding mechanism often used to access a bed box
359
+ * Idea1: calculations are done for scene graph points
360
+ * Idea2: the linear rotation of Vector Alo-Aup around Alo is the thing set for a given position and the rest of the positions are calculated from that
361
+ *
362
+ * Steps:
363
+ * 1) Model Bed so
364
+ * 1a) Matress and hinges and upper screws (Aup, Bup) form a proper subtree of a scenegraph
365
+ * 1b) Box and lower screws (Alo, Blo) form a proper subtree of a scenegraph
366
+ * 1c) Alo, Blo, Aup, Bup HAVE TO BE IN ONE PLANE (looking at their world coordinates)
367
+ * 1d) Bars are attached to lower screws respectively and modeled flat,
368
+ * i.e. the Alo-Aup bar is attached to Alo and has an initial z rotation of e.g. 20 degrees
369
+ * 2) Add an interactor as the one here
370
+ * 3) Get the point ids of Alo, Aup, Bup and Blo respectively
371
+ *
372
+ * 4) call the helper like so
373
+ *
374
+ * const tMove = FourBarHelper.calculatePosition(child,startangle,endangle,Alo, Aup,Bup, Blo,position, []);
375
+ *
376
+ * where
377
+ * child is the id of the mattress subtree
378
+ * startangle is something like 20
379
+ * endangle is something like 70
380
+ * Alo, Aup, Bup, Blo are the ids of these points respectively
381
+ * position is the interactor state 0..1
382
+ * additionalpoints can be empty (i.e. []) for the first test
383
+ *
384
+ * 5) call the interactor with position 0
385
+ * --> look at the console to find out the original (position:0 angles)
386
+ * --> the A angle is the one to be used for startangle
387
+ *
388
+ * 6) adjust startangle accordingly
389
+ *
390
+ * 7) use the tMove result to correctly change the matress position
391
+ *
392
+ * // save initial matress position
393
+ * let tPosition = IGX.API.GetPosition(child);
394
+ * IGX.API.SetZRotation(child, -tMove.rotation);
395
+ * IGX.API.SetPosition(child, {
396
+ * x: tPosition.x + tMove.positionDifference.x,
397
+ * y: tPosition.y + tMove.positionDifference.y,
398
+ * z: tPosition.z + tMove.positionDifference.z
399
+ * });
400
+ *
401
+ * NB: which set*Rotation is necessary depends one the spatial direction of the matress
402
+ * also the sign might need flipping
403
+ *
404
+ *
405
+ * Graphical example
406
+ *
407
+ * simplest example:
408
+ * Matress
409
+ * Box
410
+ * 2 Screws Aup, Bup attached to matress
411
+ * Aup is nearer to the origin (similar to rotation axis) of matress
412
+ * 2 Screws Alo, Blo attached to Box and unmoved
413
+ *
414
+ * #############################################################
415
+ * ##############################################################
416
+ * ##############################################################
417
+ * ########### Aup-------Bup ####################################
418
+ * org ######## \ ### \ ################################
419
+ * ============= \ ========= \ ==============================
420
+ * | \ \ |
421
+ * | Alo Blo |
422
+ * | |
423
+ * | |
424
+ * | BOX |
425
+ * ===========================================================
426
+ *
427
+ * 8) Make sure the matress is correctly moving
428
+ * 9) Add rotation to bars (example for Alo-Aup)
429
+ *
430
+ * let angdeg = FourBarHelper.berechneWinkelGegenHinten(tMove, Alo, Aup);
431
+ * IGX.API.SetZRotation(okid, angdeg ); //stange A
432
+ *
433
+ * 10) Fix the angle, possibly you need another sign, or some offset like +180
434
+ * The first important step is to make setPosition(0) look like nothing changed
435
+ *
436
+ * 11) Do steps 9 + 10 for the other bar Blo-Bup
437
+ *
438
+ * +++++ Additional work for dampers ++++++++++++++++++++++++++++
439
+ * 12a) model a damper consisting of 2 parts, where the upper one is attached to Cup
440
+ * and the lower one is attached to Clo
441
+ *
442
+ * 12b) Add top screws to the last paramter of calculatePosition() and replace the original call with that
443
+ *
444
+ * let pts = [Cup]
445
+ * const tMove = FourBarHelper.calculatePosition(child,startangle,endangle,Alo, Aup,Bup, Blo,position, pts);
446
+ *
447
+ * 13) intentionally left blank
448
+ * 14) now tMove also contains the new position of the additional point Cup
449
+ *
450
+ * #############################################################
451
+ * ##############################################################
452
+ * ##############################################################
453
+ * ########### Aup-------Bup ################## Cup #############
454
+ * org ######## \ ### \ ############### | | #############
455
+ * ============= \ ========= \ =============== ||| ==========
456
+ * | \ \ | |
457
+ * | Alo Blo Clo |
458
+ * | |
459
+ * | |
460
+ * | BOX |
461
+ * ===========================================================
462
+ *
463
+ * 15) calculate the angle of Clo-Cup
464
+ * let angdeg = FourBarHelper.berechneWinkelGegenHinten(tMove, Clo, Cup);
465
+ * 16) rotate the lower part attached to Clo accordingly
466
+ * 17) rotate the upper part attached to Cup by angdeg and tMove.rotation
467
+ * as the base, i.e. matress is now also rotating itself
468
+ *
469
+ * For a rotated bed, the points have to like that:
470
+ * ############################################################
471
+ * ##############################################################
472
+ * ##############################################################
473
+ * ############ Cup ################## Bup-------Aup ############
474
+ * ########### | | ################ / ### / ######## org
475
+ * ========== ||| =============== / ========= / ==============
476
+ * | | / / |
477
+ * | Clo Blo Alo |
478
+ * | |
479
+ * | |
480
+ * | BOX |
481
+ * ============================================================
482
+ *
483
+ *
484
+ *
485
+ */
486
+ class FourBar {
487
+ static debug: boolean;
488
+ static dlog(...x: any[]): void;
489
+ /**
490
+ * Deprecated because it always works on non overwritten API
491
+ *
492
+ * Specialised fourbar algorithm
493
+ * @param mattressId id of the main object to be rotated
494
+ * @param startAngleDeg minimum angle between AloAup and BloAlo
495
+ * @param endAngleDeg maximum angle between AloAup and BloAlo
496
+ * @param Alo id of lower screw of vertical bar next to origin
497
+ * @param Aup id of upper screw of vertical bar next to origin
498
+ * @param Bup id of upper screw of vertical bar away from origin
499
+ * @param Blo id of lower screw of vertical bar away from origin
500
+ * @param position 0...1 as usual in interactor
501
+ * @param topAttacheds ids of screws attached to matress
502
+ * @param tLocalRoot id of local root element for fourbar animation
503
+ */
504
+ static calculatePosition(mattressId: string, startAngleDeg: number, endAngleDeg: number, Alo: string, Aup: string, Bup: string, Blo: string, position: number, topAttacheds: string[], tLocalRoot?: string | undefined): IMove;
505
+ static calculateAngleAgainstBaseBack(tMove: IMove, slantbegin: string, slantend: string, tRoot: string, _api: any): number;
506
+ }
507
+ interface IMove {
508
+ rotation: number;
509
+ positionDifference: Float3;
510
+ topAttached: {
511
+ [key: string]: {
512
+ originalpos: Float3;
513
+ newpos: Float3;
514
+ };
515
+ };
516
+ baseLineDir: Float3;
517
+ }
518
+ interface IPlane {
519
+ point: Float3;
520
+ normal: Float3;
521
+ }
522
+ interface IRay {
523
+ origin: Float3;
524
+ direction: Float3;
525
+ }
526
+ /**
527
+ * Custom vector / matrix functions
528
+ */
529
+ class Util {
530
+ static factorOfDirectionFromRayToPlane(ray: IRay, plane: IPlane): number | null;
531
+ static intersectionPoint(ray: IRay, plane: IPlane): Float3 | null;
532
+ static rotatedVectorAaroundPointBbyNormalCangleRadR(a: Float3, b: Float3, n: Float3, ang: number): Float3;
533
+ /**
534
+ * returns the relative position of local object
535
+ * @param root the root node of local object
536
+ * @param node the node inside this object
537
+ */
538
+ static GetLocalPosition(root: string, node: string, _api: IGX._API): IGX.Float3;
539
+ /**
540
+ * returns the relative rotation of local object
541
+ * @param root the root node of local object
542
+ * @param node the node inside this object
543
+ */
544
+ static GetLocalRotation(root: string, node: string, _api: IGX._API): IG.Math.Euler;
545
+ /**
546
+ * returns the relative transformation of local object
547
+ * Returning Object[] consists of [0: Position as Vector3, 1: Rotation as Quaternion, 2: Scale as Vector3]
548
+ * @param root the root node of local object
549
+ * @param node the node inside this object
550
+ */
551
+ static GetLocalTransform(root: string, node: string, _api: IGX._API): Object[];
552
+ /**
553
+ *
554
+ * @param root the root node of local object
555
+ * @param baseNode the node you work with
556
+ * @param targetNode the node outside your workspace node
557
+ */
558
+ static GetRelativePosition(root: string, baseNode: string, targetNode: string, _api: any): IG.Math.Vector3;
559
+ /** @deprecated use IG.Math.Deg2Rad */
560
+ static DEG2RAD: number;
561
+ /** @deprecated use IG.Math.Rad2Deg */
562
+ static RAD2DEG: number;
563
+ /** @deprecated use IG.Math.Vector3.add */
564
+ static add(a: Float3, b: Float3): Float3;
565
+ /** @deprecated use IG.Math.Vector3.sub */
566
+ static sub(a: Float3, b: Float3): Float3;
567
+ /** @deprecated use IG.Math.Vector3.innerProduct */
568
+ static dot(a: Float3, b: Float3): number;
569
+ /** @deprecated use IG.Math.Vector3.magnitude */
570
+ static mag(a: Float3): number;
571
+ /** @deprecated use IG.Math.Vector3.crossProduct */
572
+ static cross(a: Float3, b: Float3): Float3;
573
+ /** @deprecated use IG.Math.Vector3.scalarMultiply */
574
+ static scale(num: number, a: Float3): Float3;
575
+ /** @deprecated use IG.Math.Vector3.normalize */
576
+ static normalize(a: Float3): Float3 | null;
577
+ /** @deprecated use IG.Math.Matrix3.multiplyWithVector3 */
578
+ static multMat(m: number[][], a: Float3): Float3;
579
+ /** @deprecated use IG.Math.Vector3.angleBetween */
580
+ static angleBetweenRad(u: Float3, v: Float3): number;
581
+ /** @deprecated use IG.Math.Matrix3.makeRotationMatrixFromNormalVector */
582
+ static rotationMatrix(rotationNormal: Float3, angRad: number): number[][];
583
+ }
584
+ }
585
+ declare module IGX.Std {
586
+ class XRangeRotator extends IGX.Core.Interactor {
587
+ absRotation: number;
588
+ nullAxis: IGX.Float3;
589
+ bAutoReset: boolean;
590
+ constructor(parameters: any);
591
+ SetPosition(position: any): void;
592
+ SetStagePosition(stage: number, position: number): void;
593
+ SingleTouchStart(touch: IGX.Core.Touch): void;
594
+ SingleTouchMotion(touch: IGX.Core.Touch): void;
595
+ SingleTouchEnd(touch: IGX.Core.Touch): void;
596
+ ApplyMotion(touch: IGX.Core.Touch, isFinal: boolean): void;
597
+ }
598
+ }
599
+ declare module IGX.Std {
600
+ class XRangeTranslator extends IGX.Core.Interactor {
601
+ osCoords: any;
602
+ startPosition: number;
603
+ bAutoReset: boolean;
604
+ constructor(parameters: any);
605
+ SetPosition(position: any): void;
606
+ SetStagePosition(stage: number, position: number): void;
607
+ SingleTouchStart(touch: IGX.Core.Touch): void;
608
+ SingleTouchMotion(touch: IGX.Core.Touch): void;
609
+ SingleTouchEnd(touch: IGX.Core.Touch): void;
610
+ ApplyMotion(touch: IGX.Core.Touch, isFinal: boolean): void;
611
+ }
612
+ }
613
+ declare module IGX.Std {
614
+ class XRasterRotator extends IGX.Core.Interactor {
615
+ absRotation: number;
616
+ nullAxis: Float3;
617
+ bAutoReset: boolean;
618
+ constructor(parameters: any);
619
+ SetPosition(position: any): void;
620
+ SetStagePosition(stage: number, position: number): void;
621
+ SingleTouchStart(touch: IGX.Core.Touch): void;
622
+ SingleTouchMotion(touch: IGX.Core.Touch): void;
623
+ SingleTouchEnd(touch: IGX.Core.Touch): void;
624
+ ApplyMotion(touch: IGX.Core.Touch, isFinal: boolean): void;
625
+ }
626
+ }
627
+ declare module IGX.Std {
628
+ class XRasterTranslator extends IGX.Core.Interactor {
629
+ osCoords: Float3;
630
+ startPosition: number;
631
+ bAutoReset: boolean;
632
+ constructor(parameters: any);
633
+ SetPosition(position: any): void;
634
+ SetStagePosition(stage: number, position: number): void;
635
+ SingleTouchStart(touch: IGX.Core.Touch): void;
636
+ SingleTouchMotion(touch: IGX.Core.Touch): void;
637
+ SingleTouchEnd(touch: IGX.Core.Touch): void;
638
+ ApplyMotion(touch: IGX.Core.Touch, isFinal: boolean): void;
639
+ }
640
+ }
641
+ declare module IGX.Std {
642
+ class XValueRotator extends IGX.Core.Interactor {
643
+ absRotation: number;
644
+ nullAxis: Float3;
645
+ constructor(parameters: any);
646
+ SetPosition(position: any): void;
647
+ SingleTouchStart(touch: IGX.Core.Touch): void;
648
+ SingleTouchMotion(touch: IGX.Core.Touch): void;
649
+ SingleTouchEnd(touch: IGX.Core.Touch): void;
650
+ ApplyMotion(touch: IGX.Core.Touch, isFinal: boolean): void;
651
+ }
652
+ }
653
+ declare module IGX.Std {
654
+ class XValueTranslator extends IGX.Core.Interactor {
655
+ osCoords: Float3;
656
+ startPosition: number;
657
+ constructor(parameters: any);
658
+ SetPosition(position: any): void;
659
+ SingleTouchStart(touch: IGX.Core.Touch): void;
660
+ SingleTouchMotion(touch: IGX.Core.Touch): void;
661
+ SingleTouchEnd(touch: IGX.Core.Touch): void;
662
+ ApplyMotion(touch: IGX.Core.Touch, isFinal: boolean): void;
663
+ }
664
+ }
665
+ declare module IGX.Std {
666
+ class YRangeRotator extends IGX.Core.Interactor {
667
+ absRotation: number;
668
+ nullAxis: Float3;
669
+ bAutoReset: boolean;
670
+ constructor(parameters: any);
671
+ SetPosition(position: any): void;
672
+ SetStagePosition(stage: number, position: number): void;
673
+ SingleTouchStart(touch: IGX.Core.Touch): void;
674
+ SingleTouchMotion(touch: IGX.Core.Touch): void;
675
+ SingleTouchEnd(touch: IGX.Core.Touch): void;
676
+ ApplyMotion(touch: IGX.Core.Touch, isFinal: boolean): void;
677
+ }
678
+ }
679
+ declare module IGX.Std {
680
+ class YRangeTranslator extends IGX.Core.Interactor {
681
+ osCoords: Float3;
682
+ startPosition: number;
683
+ bAutoReset: boolean;
684
+ constructor(parameters: any);
685
+ SetPosition(position: any): void;
686
+ SetStagePosition(stage: number, position: number): void;
687
+ SingleTouchStart(touch: IGX.Core.Touch): void;
688
+ SingleTouchMotion(touch: IGX.Core.Touch): void;
689
+ SingleTouchEnd(touch: IGX.Core.Touch): void;
690
+ ApplyMotion(touch: IGX.Core.Touch, isFinal: boolean): void;
691
+ }
692
+ }
693
+ declare module IGX.Std {
694
+ class YRasterRotator extends IGX.Core.Interactor {
695
+ absRotation: number;
696
+ nullAxis: Float3;
697
+ bAutoReset: boolean;
698
+ constructor(parameters: any);
699
+ SetPosition(position: any): void;
700
+ SetStagePosition(stage: number, position: number): void;
701
+ SingleTouchStart(touch: IGX.Core.Touch): void;
702
+ SingleTouchMotion(touch: IGX.Core.Touch): void;
703
+ SingleTouchEnd(touch: IGX.Core.Touch): void;
704
+ ApplyMotion(touch: IGX.Core.Touch, isFinal: boolean): void;
705
+ }
706
+ }
707
+ declare module IGX.Std {
708
+ class YRasterTranslator extends IGX.Core.Interactor {
709
+ osCoords: Float3;
710
+ startPosition: number;
711
+ bAutoReset: boolean;
712
+ constructor(parameters: any);
713
+ SetPosition(position: any): void;
714
+ SetStagePosition(stage: number, position: number): void;
715
+ SingleTouchStart(touch: IGX.Core.Touch): void;
716
+ SingleTouchMotion(touch: IGX.Core.Touch): void;
717
+ SingleTouchEnd(touch: IGX.Core.Touch): void;
718
+ ApplyMotion(touch: IGX.Core.Touch, isFinal: boolean): void;
719
+ }
720
+ }
721
+ declare module IGX.Std {
722
+ class YValueRotator extends IGX.Core.Interactor {
723
+ absRotation: number;
724
+ nullAxis: Float3;
725
+ constructor(parameters: any);
726
+ SetPosition(position: any): void;
727
+ SingleTouchStart(touch: IGX.Core.Touch): void;
728
+ SingleTouchMotion(touch: IGX.Core.Touch): void;
729
+ SingleTouchEnd(touch: IGX.Core.Touch): void;
730
+ ApplyMotion(touch: IGX.Core.Touch, isFinal: boolean): void;
731
+ }
732
+ }
733
+ declare module IGX.Std {
734
+ class YValueTranslator extends IGX.Core.Interactor {
735
+ osCoords: Float3;
736
+ startPosition: number;
737
+ constructor(parameters: any);
738
+ SetPosition(position: any): void;
739
+ SingleTouchStart(touch: IGX.Core.Touch): void;
740
+ SingleTouchMotion(touch: IGX.Core.Touch): void;
741
+ SingleTouchEnd(touch: IGX.Core.Touch): void;
742
+ ApplyMotion(touch: IGX.Core.Touch, isFinal: boolean): void;
743
+ }
744
+ }
745
+ declare module IGX.Std {
746
+ class ZRangeRotator extends IGX.Core.Interactor {
747
+ absRotation: number;
748
+ nullAxis: Float3;
749
+ bAutoReset: boolean;
750
+ constructor(parameters: any);
751
+ SetPosition(position: any): void;
752
+ SetStagePosition(stage: number, position: number): void;
753
+ SingleTouchStart(touch: IGX.Core.Touch): void;
754
+ SingleTouchMotion(touch: IGX.Core.Touch): void;
755
+ SingleTouchEnd(touch: IGX.Core.Touch): void;
756
+ ApplyMotion(touch: IGX.Core.Touch, isFinal: boolean): void;
757
+ }
758
+ }
759
+ declare module IGX.Std {
760
+ class ZRangeTranslator extends IGX.Core.Interactor {
761
+ osCoords: Float3;
762
+ startPosition: number;
763
+ bAutoReset: boolean;
764
+ constructor(parameters: any);
765
+ SetPosition(position: any): void;
766
+ SetStagePosition(stage: number, position: number): void;
767
+ SingleTouchStart(touch: IGX.Core.Touch): void;
768
+ SingleTouchMotion(touch: IGX.Core.Touch): void;
769
+ SingleTouchEnd(touch: IGX.Core.Touch): void;
770
+ ApplyMotion(touch: IGX.Core.Touch, isFinal: boolean): void;
771
+ }
772
+ }
773
+ declare module IGX.Std {
774
+ class ZRasterRotator extends IGX.Core.Interactor {
775
+ absRotation: number;
776
+ nullAxis: Float3;
777
+ bAutoReset: boolean;
778
+ constructor(parameters: any);
779
+ SetPosition(position: any): void;
780
+ SetStagePosition(stage: number, position: number): void;
781
+ SingleTouchStart(touch: IGX.Core.Touch): void;
782
+ SingleTouchMotion(touch: IGX.Core.Touch): void;
783
+ SingleTouchEnd(touch: IGX.Core.Touch): void;
784
+ ApplyMotion(touch: IGX.Core.Touch, isFinal: boolean): void;
785
+ }
786
+ }
787
+ declare module IGX.Std {
788
+ class ZRasterTranslator extends IGX.Core.Interactor {
789
+ osCoords: Float3;
790
+ startPosition: number;
791
+ bAutoReset: boolean;
792
+ constructor(parameters: any);
793
+ SetPosition(position: any): void;
794
+ SetStagePosition(stage: number, position: number): void;
795
+ SingleTouchStart(touch: IGX.Core.Touch): void;
796
+ SingleTouchMotion(touch: IGX.Core.Touch): void;
797
+ SingleTouchEnd(touch: IGX.Core.Touch): void;
798
+ ApplyMotion(touch: IGX.Core.Touch, isFinal: boolean): void;
799
+ }
800
+ }
801
+ declare module IGX.Std {
802
+ class ZValueRotator extends IGX.Core.Interactor {
803
+ absRotation: number;
804
+ nullAxis: Float3;
805
+ constructor(parameters: any);
806
+ SetPosition(position: any): void;
807
+ SingleTouchStart(touch: IGX.Core.Touch): void;
808
+ SingleTouchMotion(touch: IGX.Core.Touch): void;
809
+ SingleTouchEnd(touch: IGX.Core.Touch): void;
810
+ ApplyMotion(touch: IGX.Core.Touch, isFinal: boolean): void;
811
+ }
812
+ }
813
+ declare module IGX.Std {
814
+ class ZValueTranslator extends IGX.Core.Interactor {
815
+ osCoords: Float3;
816
+ startPosition: number;
817
+ constructor(parameters: any);
818
+ SetPosition(position: any): void;
819
+ SingleTouchStart(touch: IGX.Core.Touch): void;
820
+ SingleTouchMotion(touch: IGX.Core.Touch): void;
821
+ SingleTouchEnd(touch: IGX.Core.Touch): void;
822
+ ApplyMotion(touch: IGX.Core.Touch, isFinal: boolean): void;
823
+ }
824
+ }
825
+ declare module IGX.Std {
826
+ class BasicLinearInteractor extends IGX.Core.Interactor {
827
+ constructor(parameters: {
828
+ [key: string]: any;
829
+ });
830
+ SetPosition(position: string): void;
831
+ private ApplyValue;
832
+ SetStagePosition(stage: number, position: number): void;
833
+ }
834
+ }
835
+ declare module IGX.Std {
836
+ class DeformationInteractor extends IGX.Core.Interactor {
837
+ bAutoReset: boolean;
838
+ constructor(parameters: any);
839
+ SetPosition(position: string): void;
840
+ SetStagePosition(stage: number, position: number): void;
841
+ }
842
+ }
843
+ declare module IGX.Std {
844
+ class OffsetRotator extends IGX.Core.Interactor {
845
+ position: Float3;
846
+ bAutoReset: boolean;
847
+ constructor(parameters: any);
848
+ SetPosition(position: string): void;
849
+ setPosition(position: number): void;
850
+ SetStagePosition(stage: number, position: number): void;
851
+ }
852
+ }
853
+ declare module IGX.Std {
854
+ class VisibilityInteractor extends IGX.Core.Interactor {
855
+ constructor(parameters: any);
856
+ SetPosition(position: string): void;
857
+ SetStagePosition(stage: number, position: number): void;
858
+ }
859
+ }
860
+ declare module IGX.Std {
861
+ /**
862
+ * An Interactor for JSON animations with inverse kinematics.
863
+ * Needs AnimationInteractor!
864
+ */
865
+ class KinematicsInteractor {
866
+ private _MultiTargetChain;
867
+ private _MultiTargetChainStructure;
868
+ private _Chain;
869
+ private _ChainList;
870
+ private _ComponentId;
871
+ private _MaxIteration;
872
+ private IGX_API;
873
+ constructor(param: any, api: any);
874
+ /**
875
+ * Solves the kinematic problem
876
+ * Also writes the resultsvia draw()
877
+ * @param kinematicComponentId path to interactor
878
+ * @param params animation interactor params
879
+ * @param movedJoints already animated components that shouldnt be affected by the kinematic solver
880
+ */
881
+ KinematicSolver(kinematicComponentId: string, params: string[], movedJoints: string[], _api: any): void;
882
+ /**
883
+ * assign data structure and check consistency for each chain
884
+ * @param _C chain
885
+ * @param params animation interactor params
886
+ * @param movedJoints already animated components that shouldnt be affected by the kinematic solver
887
+ * @param tR "t1__oX." = path to interactor component
888
+ * @param tRoot "t1__"
889
+ */
890
+ private buildDataStructure;
891
+ /**
892
+ * Checks given nodes if they have a relation
893
+ * @param parentNode ancestor
894
+ * @param childNode descendant
895
+ */
896
+ private isParent;
897
+ /**
898
+ * returns the base vector
899
+ * @param idx joint index
900
+ */
901
+ private getGeometryBase;
902
+ /**
903
+ * returns the euler angles for given joint
904
+ * @param base geometry base
905
+ * @param eye starting vector
906
+ * @param target where to look at
907
+ */
908
+ private getBoneEuler;
909
+ /**
910
+ * checks if all constraints are defined for given joint
911
+ * @param idx joint index
912
+ */
913
+ private isConstraintActive;
914
+ private getChainLevel;
915
+ /**
916
+ * Returns all end effectors sorted by parent path of this level
917
+ * @param level the level where to look for end effectors
918
+ */
919
+ private getEndEffectors;
920
+ private getJoint;
921
+ private isFollowingJoint;
922
+ /**
923
+ * Algorithm for one chain and one target
924
+ * @param tR path to root component
925
+ */
926
+ private singleTargetKinematics;
927
+ /**
928
+ * Algorithm for multiple targets and one chain divided into multiple subchains
929
+ * @param tR path to root component
930
+ */
931
+ private multiTargetKinematics;
932
+ private multiTargetSolve;
933
+ /**
934
+ * set relative positions and apply rotations on the chain
935
+ * @param tR path to root component
936
+ */
937
+ private draw;
938
+ /**
939
+ * Solves the centroid problem
940
+ * @param chainList end effector list
941
+ */
942
+ private solveCentroid;
943
+ /**
944
+ * simple inverse kinematics solver based on the FABRIK method
945
+ * see: http://www.andreasaristidou.com/FABRIK.html
946
+ */
947
+ private solve;
948
+ /**
949
+ * FABRIK method - backwards
950
+ */
951
+ private backward;
952
+ /**
953
+ * FABRIK method - forwards
954
+ */
955
+ private forward;
956
+ /**
957
+ * check constrains and correct new pos if necessary
958
+ * @param calc Vector3 - (new position tail - new position head)
959
+ * @param line Vector3 - convex cone (unit vector of (new Tail - new Head))
960
+ * @param idx - current joint of chain
961
+ */
962
+ private constrain;
963
+ }
964
+ }
965
+ declare module IGX.Std {
966
+ class Cache {
967
+ private rootId;
968
+ private stepSize;
969
+ private subNodes;
970
+ private animation;
971
+ private interactorParams;
972
+ private cachedScenes;
973
+ private steps;
974
+ private date;
975
+ constructor(rootId: string, stepSize: number, subNodes: string[], animation: Animation, interactorParams: {
976
+ [t: string]: any;
977
+ });
978
+ /**
979
+ * set shadow scene at position 0
980
+ *
981
+ * @param {ShadowScene} s
982
+ * @memberof Cache
983
+ */
984
+ initialize(s: ShadowScene): void;
985
+ debugInfo(): void;
986
+ getStepSize(): number;
987
+ getCache(): ShadowScene[];
988
+ setCache(position: number, scene: ShadowScene): void;
989
+ clearCache(): void;
990
+ interpolate(position: number): ShadowScene;
991
+ }
992
+ }
993
+ declare module IGX.Std {
994
+ /** An Interactor for JSON animations */
995
+ class AnimationInteractor extends IGX.Core.Interactor {
996
+ static PARAM_COUNT: number;
997
+ params: string[];
998
+ animation: Animation;
999
+ backwardAnimation?: Animation;
1000
+ kinematics: KinematicsInteractor;
1001
+ backwardKinematics: KinematicsInteractor;
1002
+ private lastPositionForIntermediateCalculationOnly;
1003
+ private useCache;
1004
+ private stepSize;
1005
+ private forwardCache;
1006
+ private forwardCache_debug;
1007
+ private backwardsCache;
1008
+ private nodesToBeCached;
1009
+ private absoluteNodesToBeCached;
1010
+ private useDebugCache;
1011
+ private debugapi;
1012
+ private d;
1013
+ private IGX_API;
1014
+ Debug: boolean;
1015
+ constructor(parameters: any);
1016
+ setUseCache(value: boolean): void;
1017
+ private PrepAnimation;
1018
+ SetPosition(position: "Start" | "End"): void;
1019
+ SetStagePosition(stage: number, position: number, backwards?: boolean): void;
1020
+ debug_compareShadows(a: ShadowScene, b: ShadowScene): void;
1021
+ /**
1022
+ * Calculates auxilaries left and right of position
1023
+ * via setStagePositionInternal and writes them into cache
1024
+ *
1025
+ * @param position number between 0 and 1 including the boundaries
1026
+ */
1027
+ private calculateMissing;
1028
+ private calculate___SetStagePositionInternal;
1029
+ }
1030
+ const Test1: Animation;
1031
+ }
1032
+ declare module IGX.Std {
1033
+ /**
1034
+ * Empty interactor to be used as placeholder
1035
+ *
1036
+ * @export
1037
+ * @class EmptyInteractor
1038
+ * @extends {IGX.Core.Interactor}
1039
+ */
1040
+ class EmptyInteractor extends IGX.Core.Interactor {
1041
+ constructor(parameters: any);
1042
+ SetPosition(position: string): void;
1043
+ SetStagePosition(stage: number, position: number): void;
1044
+ }
1045
+ }