mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2025-12-21 17:56:04 +08:00
Formatting
This commit is contained in:
parent
f540dd4985
commit
fd0c20a2c7
@ -383,7 +383,7 @@ export abstract class CurveTimeline1 extends CurveTimeline {
|
|||||||
return current + (value - current) * alpha;
|
return current + (value - current) * alpha;
|
||||||
}
|
}
|
||||||
|
|
||||||
getAbsoluteValue2 (time: number, alpha: number, blend: MixBlend , current: number, setup: number, value: number) {
|
getAbsoluteValue2 (time: number, alpha: number, blend: MixBlend, current: number, setup: number, value: number) {
|
||||||
if (time < this.frames[0]) {
|
if (time < this.frames[0]) {
|
||||||
switch (blend) {
|
switch (blend) {
|
||||||
case MixBlend.setup:
|
case MixBlend.setup:
|
||||||
@ -2024,8 +2024,8 @@ export abstract class PhysicsConstraintTimeline extends CurveTimeline1 {
|
|||||||
abstract global (constraint: PhysicsConstraintData): boolean;
|
abstract global (constraint: PhysicsConstraintData): boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Changes a physics constraint's {@link PhysicsConstraint#getInertia()}. */
|
/** Changes a physics constraint's {@link PhysicsConstraint#getInertia()}. */
|
||||||
export class PhysicsConstraintInertiaTimeline extends PhysicsConstraintTimeline {
|
export class PhysicsConstraintInertiaTimeline extends PhysicsConstraintTimeline {
|
||||||
constructor (frameCount: number, bezierCount: number, physicsConstraintIndex: number, property: number) {
|
constructor (frameCount: number, bezierCount: number, physicsConstraintIndex: number, property: number) {
|
||||||
super(frameCount, bezierCount, physicsConstraintIndex, Property.physicsConstraintInertia);
|
super(frameCount, bezierCount, physicsConstraintIndex, Property.physicsConstraintInertia);
|
||||||
}
|
}
|
||||||
@ -2045,10 +2045,10 @@ export abstract class PhysicsConstraintTimeline extends CurveTimeline1 {
|
|||||||
global (constraint: PhysicsConstraintData): boolean {
|
global (constraint: PhysicsConstraintData): boolean {
|
||||||
return constraint.inertiaGlobal;
|
return constraint.inertiaGlobal;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Changes a physics constraint's {@link PhysicsConstraint#getStrength()}. */
|
/** Changes a physics constraint's {@link PhysicsConstraint#getStrength()}. */
|
||||||
export class PhysicsConstraintStrengthTimeline extends PhysicsConstraintTimeline {
|
export class PhysicsConstraintStrengthTimeline extends PhysicsConstraintTimeline {
|
||||||
constructor (frameCount: number, bezierCount: number, physicsConstraintIndex: number, property: number) {
|
constructor (frameCount: number, bezierCount: number, physicsConstraintIndex: number, property: number) {
|
||||||
super(frameCount, bezierCount, physicsConstraintIndex, Property.physicsConstraintStrength);
|
super(frameCount, bezierCount, physicsConstraintIndex, Property.physicsConstraintStrength);
|
||||||
}
|
}
|
||||||
@ -2068,10 +2068,10 @@ export abstract class PhysicsConstraintTimeline extends CurveTimeline1 {
|
|||||||
global (constraint: PhysicsConstraintData): boolean {
|
global (constraint: PhysicsConstraintData): boolean {
|
||||||
return constraint.strengthGlobal;
|
return constraint.strengthGlobal;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Changes a physics constraint's {@link PhysicsConstraint#getDamping()}. */
|
/** Changes a physics constraint's {@link PhysicsConstraint#getDamping()}. */
|
||||||
export class PhysicsConstraintDampingTimeline extends PhysicsConstraintTimeline {
|
export class PhysicsConstraintDampingTimeline extends PhysicsConstraintTimeline {
|
||||||
constructor (frameCount: number, bezierCount: number, physicsConstraintIndex: number, property: number) {
|
constructor (frameCount: number, bezierCount: number, physicsConstraintIndex: number, property: number) {
|
||||||
super(frameCount, bezierCount, physicsConstraintIndex, Property.physicsConstraintDamping);
|
super(frameCount, bezierCount, physicsConstraintIndex, Property.physicsConstraintDamping);
|
||||||
}
|
}
|
||||||
@ -2091,10 +2091,10 @@ export abstract class PhysicsConstraintTimeline extends CurveTimeline1 {
|
|||||||
global (constraint: PhysicsConstraintData): boolean {
|
global (constraint: PhysicsConstraintData): boolean {
|
||||||
return constraint.dampingGlobal;
|
return constraint.dampingGlobal;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Changes a physics constraint's {@link PhysicsConstraint#getMassInverse()}. The timeline values are not inverted. */
|
/** Changes a physics constraint's {@link PhysicsConstraint#getMassInverse()}. The timeline values are not inverted. */
|
||||||
export class PhysicsConstraintMassTimeline extends PhysicsConstraintTimeline {
|
export class PhysicsConstraintMassTimeline extends PhysicsConstraintTimeline {
|
||||||
constructor (frameCount: number, bezierCount: number, physicsConstraintIndex: number, property: number) {
|
constructor (frameCount: number, bezierCount: number, physicsConstraintIndex: number, property: number) {
|
||||||
super(frameCount, bezierCount, physicsConstraintIndex, Property.physicsConstraintMass);
|
super(frameCount, bezierCount, physicsConstraintIndex, Property.physicsConstraintMass);
|
||||||
}
|
}
|
||||||
@ -2114,10 +2114,10 @@ export abstract class PhysicsConstraintTimeline extends CurveTimeline1 {
|
|||||||
global (constraint: PhysicsConstraintData): boolean {
|
global (constraint: PhysicsConstraintData): boolean {
|
||||||
return constraint.massGlobal;
|
return constraint.massGlobal;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Changes a physics constraint's {@link PhysicsConstraint#getWind()}. */
|
/** Changes a physics constraint's {@link PhysicsConstraint#getWind()}. */
|
||||||
export class PhysicsConstraintWindTimeline extends PhysicsConstraintTimeline {
|
export class PhysicsConstraintWindTimeline extends PhysicsConstraintTimeline {
|
||||||
constructor (frameCount: number, bezierCount: number, physicsConstraintIndex: number, property: number) {
|
constructor (frameCount: number, bezierCount: number, physicsConstraintIndex: number, property: number) {
|
||||||
super(frameCount, bezierCount, physicsConstraintIndex, Property.physicsConstraintWind);
|
super(frameCount, bezierCount, physicsConstraintIndex, Property.physicsConstraintWind);
|
||||||
}
|
}
|
||||||
@ -2137,10 +2137,10 @@ export abstract class PhysicsConstraintTimeline extends CurveTimeline1 {
|
|||||||
global (constraint: PhysicsConstraintData): boolean {
|
global (constraint: PhysicsConstraintData): boolean {
|
||||||
return constraint.windGlobal;
|
return constraint.windGlobal;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Changes a physics constraint's {@link PhysicsConstraint#getGravity()}. */
|
/** Changes a physics constraint's {@link PhysicsConstraint#getGravity()}. */
|
||||||
export class PhysicsConstraintGravityTimeline extends PhysicsConstraintTimeline {
|
export class PhysicsConstraintGravityTimeline extends PhysicsConstraintTimeline {
|
||||||
constructor (frameCount: number, bezierCount: number, physicsConstraintIndex: number, property: number) {
|
constructor (frameCount: number, bezierCount: number, physicsConstraintIndex: number, property: number) {
|
||||||
super(frameCount, bezierCount, physicsConstraintIndex, Property.physicsConstraintGravity);
|
super(frameCount, bezierCount, physicsConstraintIndex, Property.physicsConstraintGravity);
|
||||||
}
|
}
|
||||||
@ -2160,10 +2160,10 @@ export abstract class PhysicsConstraintTimeline extends CurveTimeline1 {
|
|||||||
global (constraint: PhysicsConstraintData): boolean {
|
global (constraint: PhysicsConstraintData): boolean {
|
||||||
return constraint.gravityGlobal;
|
return constraint.gravityGlobal;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Changes a physics constraint's {@link PhysicsConstraint#getMix()}. */
|
/** Changes a physics constraint's {@link PhysicsConstraint#getMix()}. */
|
||||||
export class PhysicsConstraintMixTimeline extends PhysicsConstraintTimeline {
|
export class PhysicsConstraintMixTimeline extends PhysicsConstraintTimeline {
|
||||||
constructor (frameCount: number, bezierCount: number, physicsConstraintIndex: number, property: number) {
|
constructor (frameCount: number, bezierCount: number, physicsConstraintIndex: number, property: number) {
|
||||||
super(frameCount, bezierCount, physicsConstraintIndex, Property.physicsConstraintMix);
|
super(frameCount, bezierCount, physicsConstraintIndex, Property.physicsConstraintMix);
|
||||||
}
|
}
|
||||||
@ -2183,10 +2183,10 @@ export abstract class PhysicsConstraintTimeline extends CurveTimeline1 {
|
|||||||
global (constraint: PhysicsConstraintData): boolean {
|
global (constraint: PhysicsConstraintData): boolean {
|
||||||
return constraint.mixGlobal;
|
return constraint.mixGlobal;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Resets a physics constraint when specific animation times are reached. */
|
/** Resets a physics constraint when specific animation times are reached. */
|
||||||
export class PhysicsConstraintResetTimeline extends Timeline {
|
export class PhysicsConstraintResetTimeline extends Timeline {
|
||||||
private static propertyIds: string[] = [Property.physicsConstraintReset.toString()];
|
private static propertyIds: string[] = [Property.physicsConstraintReset.toString()];
|
||||||
|
|
||||||
/** The index of the physics constraint in {@link Skeleton#getPhysicsConstraints()} that will be reset when this timeline is
|
/** The index of the physics constraint in {@link Skeleton#getPhysicsConstraints()} that will be reset when this timeline is
|
||||||
@ -2237,7 +2237,7 @@ export abstract class PhysicsConstraintTimeline extends CurveTimeline1 {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Changes a slot's {@link Slot#getSequenceIndex()} for an attachment's {@link Sequence}. */
|
/** Changes a slot's {@link Slot#getSequenceIndex()} for an attachment's {@link Sequence}. */
|
||||||
export class SequenceTimeline extends Timeline implements SlotTimeline {
|
export class SequenceTimeline extends Timeline implements SlotTimeline {
|
||||||
|
|||||||
@ -76,7 +76,7 @@ export class PhysicsConstraint implements Updatable {
|
|||||||
remaining = 0;
|
remaining = 0;
|
||||||
lastTime = 0;
|
lastTime = 0;
|
||||||
|
|
||||||
constructor(data: PhysicsConstraintData, skeleton: Skeleton) {
|
constructor (data: PhysicsConstraintData, skeleton: Skeleton) {
|
||||||
this.data = data;
|
this.data = data;
|
||||||
this.skeleton = skeleton;
|
this.skeleton = skeleton;
|
||||||
this.bone = skeleton.bones[data.bone.index];
|
this.bone = skeleton.bones[data.bone.index];
|
||||||
|
|||||||
@ -34,7 +34,7 @@ import { ConstraintData } from "./ConstraintData.js";
|
|||||||
/** Stores the setup pose for a {@link PhysicsConstraint}.
|
/** Stores the setup pose for a {@link PhysicsConstraint}.
|
||||||
* <p>
|
* <p>
|
||||||
* See <a href="http://esotericsoftware.com/spine-physics-constraints">Physics constraints</a> in the Spine User Guide. */
|
* See <a href="http://esotericsoftware.com/spine-physics-constraints">Physics constraints</a> in the Spine User Guide. */
|
||||||
export class PhysicsConstraintData extends ConstraintData {
|
export class PhysicsConstraintData extends ConstraintData {
|
||||||
private _bone: BoneData | null = null;
|
private _bone: BoneData | null = null;
|
||||||
/** The bone constrained by this physics constraint. */
|
/** The bone constrained by this physics constraint. */
|
||||||
public set bone (boneData: BoneData) { this._bone = boneData; }
|
public set bone (boneData: BoneData) { this._bone = boneData; }
|
||||||
|
|||||||
@ -199,7 +199,7 @@ export class MathUtils {
|
|||||||
return Math.sin(degrees * MathUtils.degRad);
|
return Math.sin(degrees * MathUtils.degRad);
|
||||||
}
|
}
|
||||||
|
|
||||||
static atan2Deg(y: number, x: number) {
|
static atan2Deg (y: number, x: number) {
|
||||||
return Math.atan2(y, x) * MathUtils.degRad;
|
return Math.atan2(y, x) * MathUtils.degRad;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user