mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-26 22:49:01 +08:00
[ts] Port to 4.3 (WIP) - Format.
This commit is contained in:
parent
d7212370f6
commit
59d138124d
@ -283,7 +283,7 @@ export interface SlotTimeline {
|
||||
slotIndex: number;
|
||||
}
|
||||
|
||||
export function isSlotTimeline(obj: any): obj is SlotTimeline {
|
||||
export function isSlotTimeline (obj: any): obj is SlotTimeline {
|
||||
return typeof obj === 'object' && obj !== null && typeof obj.slotIndex === 'number';
|
||||
}
|
||||
|
||||
@ -436,7 +436,7 @@ export abstract class CurveTimeline1 extends CurveTimeline {
|
||||
}
|
||||
}
|
||||
|
||||
getAbsoluteValue(time: number, alpha: number, blend: MixBlend, current: number, setup: number, value?: number) {
|
||||
getAbsoluteValue (time: number, alpha: number, blend: MixBlend, current: number, setup: number, value?: number) {
|
||||
if (value === undefined)
|
||||
return this.getAbsoluteValue1(time, alpha, blend, current, setup);
|
||||
else
|
||||
@ -543,7 +543,7 @@ export abstract class BoneTimeline2 extends CurveTimeline implements BoneTimelin
|
||||
if (bone.active) this.apply1(appliedPose ? bone.applied : bone.pose, bone.data.setup, time, alpha, blend, direction);
|
||||
}
|
||||
|
||||
protected abstract apply1 (pose: BoneLocal, setup: BoneLocal, time: number, alpha:number, blend: MixBlend,
|
||||
protected abstract apply1 (pose: BoneLocal, setup: BoneLocal, time: number, alpha: number, blend: MixBlend,
|
||||
direction: MixDirection): void;
|
||||
}
|
||||
|
||||
@ -552,7 +552,7 @@ export interface BoneTimeline {
|
||||
boneIndex: number;
|
||||
}
|
||||
|
||||
export function isBoneTimeline(obj: any): obj is BoneTimeline {
|
||||
export function isBoneTimeline (obj: any): obj is BoneTimeline {
|
||||
return typeof obj === 'object' && obj !== null && typeof obj.boneIndex === 'number';
|
||||
}
|
||||
|
||||
@ -571,7 +571,7 @@ export abstract class BoneTimeline1 extends CurveTimeline1 implements BoneTimeli
|
||||
if (bone.active) this.apply1(appliedPose ? bone.applied : bone.pose, bone.data.setup, time, alpha, blend, direction);
|
||||
}
|
||||
|
||||
protected abstract apply1 (pose: BoneLocal, setup: BoneLocal, time: number, alpha:number, blend: MixBlend,
|
||||
protected abstract apply1 (pose: BoneLocal, setup: BoneLocal, time: number, alpha: number, blend: MixBlend,
|
||||
direction: MixDirection): void;
|
||||
}
|
||||
|
||||
@ -581,7 +581,7 @@ export class RotateTimeline extends BoneTimeline1 {
|
||||
super(frameCount, bezierCount, boneIndex, Property.rotate);
|
||||
}
|
||||
|
||||
apply1 (pose: BoneLocal, setup: BoneLocal, time: number, alpha:number, blend: MixBlend, direction: MixDirection) {
|
||||
apply1 (pose: BoneLocal, setup: BoneLocal, time: number, alpha: number, blend: MixBlend, direction: MixDirection) {
|
||||
pose.rotation = this.getRelativeValue(time, alpha, blend, pose.rotation, setup.rotation);
|
||||
}
|
||||
}
|
||||
@ -592,7 +592,7 @@ export class TranslateTimeline extends BoneTimeline2 {
|
||||
super(frameCount, bezierCount, boneIndex, Property.x, Property.y);
|
||||
}
|
||||
|
||||
apply1 (pose: BoneLocal, setup: BoneLocal, time: number, alpha:number, blend: MixBlend,direction: MixDirection) {
|
||||
apply1 (pose: BoneLocal, setup: BoneLocal, time: number, alpha: number, blend: MixBlend, direction: MixDirection) {
|
||||
let frames = this.frames;
|
||||
if (time < frames[0]) {
|
||||
switch (blend) {
|
||||
@ -651,7 +651,7 @@ export class TranslateXTimeline extends BoneTimeline1 {
|
||||
super(frameCount, bezierCount, boneIndex, Property.x);
|
||||
}
|
||||
|
||||
protected apply1 (pose: BoneLocal, setup: BoneLocal, time: number, alpha:number, blend: MixBlend,direction: MixDirection) {
|
||||
protected apply1 (pose: BoneLocal, setup: BoneLocal, time: number, alpha: number, blend: MixBlend, direction: MixDirection) {
|
||||
pose.x = this.getRelativeValue(time, alpha, blend, pose.x, setup.x);
|
||||
}
|
||||
}
|
||||
@ -662,7 +662,7 @@ export class TranslateYTimeline extends BoneTimeline1 {
|
||||
super(frameCount, bezierCount, boneIndex, Property.y);
|
||||
}
|
||||
|
||||
protected apply1 (pose: BoneLocal, setup: BoneLocal, time: number, alpha:number, blend: MixBlend,direction: MixDirection) {
|
||||
protected apply1 (pose: BoneLocal, setup: BoneLocal, time: number, alpha: number, blend: MixBlend, direction: MixDirection) {
|
||||
pose.y = this.getRelativeValue(time, alpha, blend, pose.y, setup.y);
|
||||
}
|
||||
}
|
||||
@ -673,7 +673,7 @@ export class ScaleTimeline extends BoneTimeline2 {
|
||||
super(frameCount, bezierCount, boneIndex, Property.scaleX, Property.scaleY);
|
||||
}
|
||||
|
||||
protected apply1 (pose: BoneLocal, setup: BoneLocal, time: number, alpha:number, blend: MixBlend, direction: MixDirection) {
|
||||
protected apply1 (pose: BoneLocal, setup: BoneLocal, time: number, alpha: number, blend: MixBlend, direction: MixDirection) {
|
||||
let frames = this.frames;
|
||||
if (time < frames[0]) {
|
||||
switch (blend) {
|
||||
@ -770,7 +770,7 @@ export class ScaleXTimeline extends BoneTimeline1 {
|
||||
super(frameCount, bezierCount, boneIndex, Property.scaleX);
|
||||
}
|
||||
|
||||
protected apply1 (pose: BoneLocal, setup: BoneLocal, time: number, alpha:number, blend: MixBlend,direction: MixDirection) {
|
||||
protected apply1 (pose: BoneLocal, setup: BoneLocal, time: number, alpha: number, blend: MixBlend, direction: MixDirection) {
|
||||
pose.scaleX = this.getScaleValue(time, alpha, blend, direction, pose.scaleX, setup.scaleX);
|
||||
}
|
||||
}
|
||||
@ -781,7 +781,7 @@ export class ScaleYTimeline extends BoneTimeline1 {
|
||||
super(frameCount, bezierCount, boneIndex, Property.scaleY);
|
||||
}
|
||||
|
||||
protected apply1 (pose: BoneLocal, setup: BoneLocal, time: number, alpha:number, blend: MixBlend,direction: MixDirection) {
|
||||
protected apply1 (pose: BoneLocal, setup: BoneLocal, time: number, alpha: number, blend: MixBlend, direction: MixDirection) {
|
||||
pose.scaleY = this.getScaleValue(time, alpha, blend, direction, pose.scaleY, setup.scaleY);
|
||||
}
|
||||
}
|
||||
@ -792,7 +792,7 @@ export class ShearTimeline extends BoneTimeline2 {
|
||||
super(frameCount, bezierCount, boneIndex, Property.shearX, Property.shearY);
|
||||
}
|
||||
|
||||
protected apply1 (pose: BoneLocal, setup: BoneLocal, time: number, alpha:number, blend: MixBlend,direction: MixDirection) {
|
||||
protected apply1 (pose: BoneLocal, setup: BoneLocal, time: number, alpha: number, blend: MixBlend, direction: MixDirection) {
|
||||
let frames = this.frames;
|
||||
if (time < frames[0]) {
|
||||
switch (blend) {
|
||||
@ -851,7 +851,7 @@ export class ShearXTimeline extends BoneTimeline1 {
|
||||
super(frameCount, bezierCount, boneIndex, Property.shearX);
|
||||
}
|
||||
|
||||
protected apply1 (pose: BoneLocal, setup: BoneLocal, time: number, alpha:number, blend: MixBlend,direction: MixDirection) {
|
||||
protected apply1 (pose: BoneLocal, setup: BoneLocal, time: number, alpha: number, blend: MixBlend, direction: MixDirection) {
|
||||
pose.shearX = this.getRelativeValue(time, alpha, blend, pose.shearX, setup.shearX);
|
||||
}
|
||||
}
|
||||
@ -862,7 +862,7 @@ export class ShearYTimeline extends BoneTimeline1 {
|
||||
super(frameCount, bezierCount, boneIndex, Property.shearY);
|
||||
}
|
||||
|
||||
protected apply1 (pose: BoneLocal, setup: BoneLocal, time: number, alpha:number, blend: MixBlend,direction: MixDirection) {
|
||||
protected apply1 (pose: BoneLocal, setup: BoneLocal, time: number, alpha: number, blend: MixBlend, direction: MixDirection) {
|
||||
pose.shearY = this.getRelativeValue(time, alpha, blend, pose.shearY, setup.shearY);
|
||||
}
|
||||
}
|
||||
@ -1826,7 +1826,7 @@ export interface ConstraintTimeline {
|
||||
readonly constraintIndex: number;
|
||||
}
|
||||
|
||||
export function isConstraintTimeline(obj: any): obj is ConstraintTimeline {
|
||||
export function isConstraintTimeline (obj: any): obj is ConstraintTimeline {
|
||||
return typeof obj === 'object' && obj !== null && typeof obj.constraintIndex === 'number';
|
||||
}
|
||||
|
||||
|
||||
@ -73,9 +73,9 @@ export class BoneLocal implements Pose<BoneLocal> {
|
||||
this.y = y;
|
||||
}
|
||||
|
||||
setScale(scaleX: number, scaleY: number): void;
|
||||
setScale(scale: number): void;
|
||||
setScale(scaleOrX: number, scaleY?: number): void {
|
||||
setScale (scaleX: number, scaleY: number): void;
|
||||
setScale (scale: number): void;
|
||||
setScale (scaleOrX: number, scaleY?: number): void {
|
||||
this.scaleX = scaleOrX;
|
||||
this.scaleY = scaleY === undefined ? scaleOrX : scaleY;
|
||||
}
|
||||
|
||||
@ -243,7 +243,7 @@ export class Skeleton {
|
||||
* <p>
|
||||
* See <a href="https://esotericsoftware.com/spine-runtime-skeletons#World-transforms">World transforms</a> in the Spine
|
||||
* Runtimes Guide. */
|
||||
updateWorldTransform(physics: Physics): void {
|
||||
updateWorldTransform (physics: Physics): void {
|
||||
this._update++;
|
||||
|
||||
const resetCache = this.resetCache;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user