mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-06 07:14:55 +08:00
[ts] Unsafed changes...
This commit is contained in:
parent
549f19383d
commit
cc60317e4d
@ -56,10 +56,10 @@ export class PointAttachment extends VertexAttachment {
|
||||
}
|
||||
|
||||
computeWorldRotation (bone: Bone) {
|
||||
let cos = MathUtils.cosDeg(this.rotation), sin = MathUtils.sinDeg(this.rotation);
|
||||
let x = cos * bone.a + sin * bone.b;
|
||||
let y = cos * bone.c + sin * bone.d;
|
||||
return Math.atan2(y, x) * MathUtils.radDeg;
|
||||
const r = this.rotation * MathUtils.degRad, cos = Math.cos(r), sin = Math.sin(r);
|
||||
const x = cos * bone.a + sin * bone.b;
|
||||
const y = cos * bone.c + sin * bone.d;
|
||||
return MathUtils.atan2Deg(y, x);
|
||||
}
|
||||
|
||||
copy (): Attachment {
|
||||
|
||||
@ -29,7 +29,7 @@
|
||||
|
||||
import { Bone } from "../Bone.js";
|
||||
import { TextureRegion } from "../Texture.js";
|
||||
import { Color, NumberArrayLike, Utils } from "../Utils.js";
|
||||
import { Color, MathUtils, NumberArrayLike, Utils } from "../Utils.js";
|
||||
import { Attachment } from "./Attachment.js";
|
||||
import { HasTextureRegion } from "./HasTextureRegion.js";
|
||||
import { Sequence } from "./Sequence.js";
|
||||
@ -107,7 +107,7 @@ export class RegionAttachment extends Attachment implements HasTextureRegion {
|
||||
let localY = -this.height / 2 * this.scaleY + this.region.offsetY * regionScaleY;
|
||||
let localX2 = localX + this.region.width * regionScaleX;
|
||||
let localY2 = localY + this.region.height * regionScaleY;
|
||||
let radians = this.rotation * Math.PI / 180;
|
||||
let radians = this.rotation * MathUtils.degRad;
|
||||
let cos = Math.cos(radians);
|
||||
let sin = Math.sin(radians);
|
||||
let x = this.x, y = this.y;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user