@esotericsoftware/spine-core 4.2.26 → 4.2.28

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.
@@ -33,6 +33,8 @@ import { StringSet, NumberArrayLike } from "./Utils.js";
33
33
  import { Event } from "./Event.js";
34
34
  import { HasTextureRegion } from "./attachments/HasTextureRegion.js";
35
35
  import { SequenceMode } from "./attachments/Sequence.js";
36
+ import { PhysicsConstraint } from "./PhysicsConstraint.js";
37
+ import { PhysicsConstraintData } from "./PhysicsConstraintData.js";
36
38
  /** A simple container for a list of timelines and a name. */
37
39
  export declare class Animation {
38
40
  /** The animation's name, which is unique across all animations in the skeleton. */
@@ -148,6 +150,10 @@ export declare abstract class CurveTimeline1 extends CurveTimeline {
148
150
  setFrame(frame: number, time: number, value: number): void;
149
151
  /** Returns the interpolated value for the specified time. */
150
152
  getCurveValue(time: number): number;
153
+ getRelativeValue(time: number, alpha: number, blend: MixBlend, current: number, setup: number): number;
154
+ getAbsoluteValue(time: number, alpha: number, blend: MixBlend, current: number, setup: number): number;
155
+ getAbsoluteValue2(time: number, alpha: number, blend: MixBlend, current: number, setup: number, value: number): number;
156
+ getScaleValue(time: number, alpha: number, blend: MixBlend, direction: MixDirection, current: number, setup: number): number;
151
157
  }
152
158
  /** The base class for a {@link CurveTimeline} which sets two properties. */
153
159
  export declare abstract class CurveTimeline2 extends CurveTimeline {
@@ -320,8 +326,8 @@ export declare class DrawOrderTimeline extends Timeline {
320
326
  /** Changes an IK constraint's {@link IkConstraint#mix}, {@link IkConstraint#softness},
321
327
  * {@link IkConstraint#bendDirection}, {@link IkConstraint#stretch}, and {@link IkConstraint#compress}. */
322
328
  export declare class IkConstraintTimeline extends CurveTimeline {
323
- /** The index of the IK constraint slot in {@link Skeleton#ikConstraints} that will be changed. */
324
- ikConstraintIndex: number;
329
+ /** The index of the IK constraint in {@link Skeleton#getIkConstraints()} that will be changed when this timeline is */
330
+ constraintIndex: number;
325
331
  constructor(frameCount: number, bezierCount: number, ikConstraintIndex: number);
326
332
  getFrameEntries(): number;
327
333
  /** Sets the time in seconds, mix, softness, bend direction, compress, and stretch for the specified key frame. */
@@ -332,7 +338,7 @@ export declare class IkConstraintTimeline extends CurveTimeline {
332
338
  * {@link TransformConstraint#scaleMix}, and {@link TransformConstraint#shearMix}. */
333
339
  export declare class TransformConstraintTimeline extends CurveTimeline {
334
340
  /** The index of the transform constraint slot in {@link Skeleton#transformConstraints} that will be changed. */
335
- transformConstraintIndex: number;
341
+ constraintIndex: number;
336
342
  constructor(frameCount: number, bezierCount: number, transformConstraintIndex: number);
337
343
  getFrameEntries(): number;
338
344
  /** The time in seconds, rotate mix, translate mix, scale mix, and shear mix for the specified key frame. */
@@ -341,28 +347,115 @@ export declare class TransformConstraintTimeline extends CurveTimeline {
341
347
  }
342
348
  /** Changes a path constraint's {@link PathConstraint#position}. */
343
349
  export declare class PathConstraintPositionTimeline extends CurveTimeline1 {
344
- /** The index of the path constraint slot in {@link Skeleton#pathConstraints} that will be changed. */
345
- pathConstraintIndex: number;
350
+ /** The index of the path constraint in {@link Skeleton#getPathConstraints()} that will be changed when this timeline is
351
+ * applied. */
352
+ constraintIndex: number;
346
353
  constructor(frameCount: number, bezierCount: number, pathConstraintIndex: number);
347
354
  apply(skeleton: Skeleton, lastTime: number, time: number, firedEvents: Array<Event>, alpha: number, blend: MixBlend, direction: MixDirection): void;
348
355
  }
349
356
  /** Changes a path constraint's {@link PathConstraint#spacing}. */
350
357
  export declare class PathConstraintSpacingTimeline extends CurveTimeline1 {
351
- /** The index of the path constraint slot in {@link Skeleton#getPathConstraints()} that will be changed. */
352
- pathConstraintIndex: number;
358
+ /** The index of the path constraint in {@link Skeleton#getPathConstraints()} that will be changed when this timeline is
359
+ * applied. */
360
+ constraintIndex: number;
353
361
  constructor(frameCount: number, bezierCount: number, pathConstraintIndex: number);
354
362
  apply(skeleton: Skeleton, lastTime: number, time: number, firedEvents: Array<Event>, alpha: number, blend: MixBlend, direction: MixDirection): void;
355
363
  }
356
364
  /** Changes a transform constraint's {@link PathConstraint#getMixRotate()}, {@link PathConstraint#getMixX()}, and
357
365
  * {@link PathConstraint#getMixY()}. */
358
366
  export declare class PathConstraintMixTimeline extends CurveTimeline {
359
- /** The index of the path constraint slot in {@link Skeleton#getPathConstraints()} that will be changed. */
360
- pathConstraintIndex: number;
367
+ /** The index of the path constraint in {@link Skeleton#getPathConstraints()} that will be changed when this timeline is
368
+ * applied. */
369
+ constraintIndex: number;
361
370
  constructor(frameCount: number, bezierCount: number, pathConstraintIndex: number);
362
371
  getFrameEntries(): number;
363
372
  setFrame(frame: number, time: number, mixRotate: number, mixX: number, mixY: number): void;
364
373
  apply(skeleton: Skeleton, lastTime: number, time: number, firedEvents: Array<Event>, alpha: number, blend: MixBlend, direction: MixDirection): void;
365
374
  }
375
+ /** The base class for most {@link PhysicsConstraint} timelines. */
376
+ export declare abstract class PhysicsConstraintTimeline extends CurveTimeline1 {
377
+ /** The index of the physics constraint in {@link Skeleton#getPhysicsConstraints()} that will be changed when this timeline
378
+ * is applied, or -1 if all physics constraints in the skeleton will be changed. */
379
+ constraintIndex: number;
380
+ /** @param physicsConstraintIndex -1 for all physics constraints in the skeleton. */
381
+ constructor(frameCount: number, bezierCount: number, physicsConstraintIndex: number, property: number);
382
+ apply(skeleton: Skeleton, lastTime: number, time: number, firedEvents: Array<Event>, alpha: number, blend: MixBlend, direction: MixDirection): void;
383
+ abstract setup(constraint: PhysicsConstraint): number;
384
+ abstract get(constraint: PhysicsConstraint): number;
385
+ abstract set(constraint: PhysicsConstraint, value: number): void;
386
+ abstract global(constraint: PhysicsConstraintData): boolean;
387
+ }
388
+ /** Changes a physics constraint's {@link PhysicsConstraint#getInertia()}. */
389
+ export declare class PhysicsConstraintInertiaTimeline extends PhysicsConstraintTimeline {
390
+ constructor(frameCount: number, bezierCount: number, physicsConstraintIndex: number, property: number);
391
+ setup(constraint: PhysicsConstraint): number;
392
+ get(constraint: PhysicsConstraint): number;
393
+ set(constraint: PhysicsConstraint, value: number): void;
394
+ global(constraint: PhysicsConstraintData): boolean;
395
+ }
396
+ /** Changes a physics constraint's {@link PhysicsConstraint#getStrength()}. */
397
+ export declare class PhysicsConstraintStrengthTimeline extends PhysicsConstraintTimeline {
398
+ constructor(frameCount: number, bezierCount: number, physicsConstraintIndex: number, property: number);
399
+ setup(constraint: PhysicsConstraint): number;
400
+ get(constraint: PhysicsConstraint): number;
401
+ set(constraint: PhysicsConstraint, value: number): void;
402
+ global(constraint: PhysicsConstraintData): boolean;
403
+ }
404
+ /** Changes a physics constraint's {@link PhysicsConstraint#getDamping()}. */
405
+ export declare class PhysicsConstraintDampingTimeline extends PhysicsConstraintTimeline {
406
+ constructor(frameCount: number, bezierCount: number, physicsConstraintIndex: number, property: number);
407
+ setup(constraint: PhysicsConstraint): number;
408
+ get(constraint: PhysicsConstraint): number;
409
+ set(constraint: PhysicsConstraint, value: number): void;
410
+ global(constraint: PhysicsConstraintData): boolean;
411
+ }
412
+ /** Changes a physics constraint's {@link PhysicsConstraint#getMassInverse()}. The timeline values are not inverted. */
413
+ export declare class PhysicsConstraintMassTimeline extends PhysicsConstraintTimeline {
414
+ constructor(frameCount: number, bezierCount: number, physicsConstraintIndex: number, property: number);
415
+ setup(constraint: PhysicsConstraint): number;
416
+ get(constraint: PhysicsConstraint): number;
417
+ set(constraint: PhysicsConstraint, value: number): void;
418
+ global(constraint: PhysicsConstraintData): boolean;
419
+ }
420
+ /** Changes a physics constraint's {@link PhysicsConstraint#getWind()}. */
421
+ export declare class PhysicsConstraintWindTimeline extends PhysicsConstraintTimeline {
422
+ constructor(frameCount: number, bezierCount: number, physicsConstraintIndex: number, property: number);
423
+ setup(constraint: PhysicsConstraint): number;
424
+ get(constraint: PhysicsConstraint): number;
425
+ set(constraint: PhysicsConstraint, value: number): void;
426
+ global(constraint: PhysicsConstraintData): boolean;
427
+ }
428
+ /** Changes a physics constraint's {@link PhysicsConstraint#getGravity()}. */
429
+ export declare class PhysicsConstraintGravityTimeline extends PhysicsConstraintTimeline {
430
+ constructor(frameCount: number, bezierCount: number, physicsConstraintIndex: number, property: number);
431
+ setup(constraint: PhysicsConstraint): number;
432
+ get(constraint: PhysicsConstraint): number;
433
+ set(constraint: PhysicsConstraint, value: number): void;
434
+ global(constraint: PhysicsConstraintData): boolean;
435
+ }
436
+ /** Changes a physics constraint's {@link PhysicsConstraint#getMix()}. */
437
+ export declare class PhysicsConstraintMixTimeline extends PhysicsConstraintTimeline {
438
+ constructor(frameCount: number, bezierCount: number, physicsConstraintIndex: number, property: number);
439
+ setup(constraint: PhysicsConstraint): number;
440
+ get(constraint: PhysicsConstraint): number;
441
+ set(constraint: PhysicsConstraint, value: number): void;
442
+ global(constraint: PhysicsConstraintData): boolean;
443
+ }
444
+ /** Resets a physics constraint when specific animation times are reached. */
445
+ export declare class PhysicsConstraintResetTimeline extends Timeline {
446
+ private static propertyIds;
447
+ /** The index of the physics constraint in {@link Skeleton#getPhysicsConstraints()} that will be reset when this timeline is
448
+ * applied, or -1 if all physics constraints in the skeleton will be reset. */
449
+ constraintIndex: number;
450
+ /** @param physicsConstraintIndex -1 for all physics constraints in the skeleton. */
451
+ constructor(frameCount: number, physicsConstraintIndex: number);
452
+ getFrameCount(): number;
453
+ /** Sets the time for the specified frame.
454
+ * @param frame Between 0 and <code>frameCount</code>, inclusive. */
455
+ setFrame(frame: number, time: number): void;
456
+ /** Resets the physics constraint when frames > <code>lastTime</code> and <= <code>time</code>. */
457
+ apply(skeleton: Skeleton, lastTime: number, time: number, firedEvents: Array<Event>, alpha: number, blend: MixBlend, direction: MixDirection): void;
458
+ }
366
459
  /** Changes a slot's {@link Slot#getSequenceIndex()} for an attachment's {@link Sequence}. */
367
460
  export declare class SequenceTimeline extends Timeline implements SlotTimeline {
368
461
  static ENTRIES: number;