From cc60317e4d6bf5cef93167bf255454598b1f352a Mon Sep 17 00:00:00 2001 From: Mario Zechner Date: Wed, 22 Nov 2023 17:33:47 +0100 Subject: [PATCH] [ts] Unsafed changes... --- spine-ts/spine-core/src/attachments/PointAttachment.ts | 8 ++++---- spine-ts/spine-core/src/attachments/RegionAttachment.ts | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/spine-ts/spine-core/src/attachments/PointAttachment.ts b/spine-ts/spine-core/src/attachments/PointAttachment.ts index c2ee11826..4af53d8d4 100644 --- a/spine-ts/spine-core/src/attachments/PointAttachment.ts +++ b/spine-ts/spine-core/src/attachments/PointAttachment.ts @@ -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 { diff --git a/spine-ts/spine-core/src/attachments/RegionAttachment.ts b/spine-ts/spine-core/src/attachments/RegionAttachment.ts index 69309d95e..a94ceacef 100644 --- a/spine-ts/spine-core/src/attachments/RegionAttachment.ts +++ b/spine-ts/spine-core/src/attachments/RegionAttachment.ts @@ -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;