[ts] Unsafed changes...

This commit is contained in:
Mario Zechner 2023-11-22 17:33:47 +01:00
parent 549f19383d
commit cc60317e4d
2 changed files with 6 additions and 6 deletions

View File

@ -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 {

View File

@ -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;