cleaned Matrix4x4

This commit is contained in:
Dank074 2021-06-06 23:18:29 -05:00
parent 69b550c982
commit 2719fad043
5 changed files with 28 additions and 28 deletions

View File

@ -238,13 +238,13 @@ export class AvatarModelGeometry
const sets: [ number, GeometryBodyPart ][] = []; const sets: [ number, GeometryBodyPart ][] = [];
const ids: string[] = []; const ids: string[] = [];
this._transformation = Matrix4x4._Str_1560(_arg_2); this._transformation = Matrix4x4.getYRotationMatrix(_arg_2);
for(const part of parts.values()) for(const part of parts.values())
{ {
if(!part) continue; if(!part) continue;
part._Str_1101(this._transformation); part.applyTransform(this._transformation);
sets.push([ part._Str_1522(this._camera), part ]); sets.push([ part._Str_1522(this._camera), part ]);
} }
@ -277,7 +277,7 @@ export class AvatarModelGeometry
{ {
const part = this._Str_1280(k).get(_arg_2); const part = this._Str_1280(k).get(_arg_2);
this._transformation = Matrix4x4._Str_1560(_arg_3); this._transformation = Matrix4x4.getYRotationMatrix(_arg_3);
return part.getParts(this._transformation, this._camera, _arg_4, _arg_5); return part.getParts(this._transformation, this._camera, _arg_4, _arg_5);
} }

View File

@ -129,7 +129,7 @@ export class GeometryBodyPart extends Node3D
{ {
if(!part) continue; if(!part) continue;
part._Str_1101(k); part.applyTransform(k);
parts.push([ part._Str_1522(_arg_2), part ]); parts.push([ part._Str_1522(_arg_2), part ]);
} }
@ -144,7 +144,7 @@ export class GeometryBodyPart extends Node3D
if(!part) continue; if(!part) continue;
part._Str_1101(k); part.applyTransform(k);
parts.push([ part._Str_1522(_arg_2), part ]); parts.push([ part._Str_1522(_arg_2), part ]);
} }
@ -176,8 +176,8 @@ export class GeometryBodyPart extends Node3D
public _Str_1522(k: Vector3D): number public _Str_1522(k: Vector3D): number
{ {
const _local_2 = Math.abs(((k.z - this._Str_1604.z) - this._radius)); const _local_2 = Math.abs(((k.z - this.transformedLocation.z) - this._radius));
const _local_3 = Math.abs(((k.z - this._Str_1604.z) + this._radius)); const _local_3 = Math.abs(((k.z - this.transformedLocation.z) + this._radius));
return Math.min(_local_2, _local_3); return Math.min(_local_2, _local_3);
} }

View File

@ -22,8 +22,8 @@ export class GeometryItem extends Node3D
public _Str_1522(k: Vector3D): number public _Str_1522(k: Vector3D): number
{ {
const _local_2 = Math.abs(((k.z - this._Str_1604.z) - this._radius)); const _local_2 = Math.abs(((k.z - this.transformedLocation.z) - this._radius));
const _local_3 = Math.abs(((k.z - this._Str_1604.z) + this._radius)); const _local_3 = Math.abs(((k.z - this.transformedLocation.z) + this._radius));
return Math.min(_local_2, _local_3); return Math.min(_local_2, _local_3);
} }
@ -45,7 +45,7 @@ export class GeometryItem extends Node3D
public toString(): string public toString(): string
{ {
return ((((this._id + ': ') + this.location) + ' - ') + this._Str_1604); return ((((this._id + ': ') + this.location) + ' - ') + this.transformedLocation);
} }
public get _Str_1457(): boolean public get _Str_1457(): boolean

View File

@ -12,7 +12,7 @@ export class Matrix4x4
this._data = [k, _arg_2, _arg_3, _arg_4, _arg_5, _arg_6, _arg_7, _arg_8, _arg_9]; this._data = [k, _arg_2, _arg_3, _arg_4, _arg_5, _arg_6, _arg_7, _arg_8, _arg_9];
} }
public static _Str_1869(k: number): Matrix4x4 public static getXRotationMatrix(k: number): Matrix4x4
{ {
const _local_2 = ((k * Math.PI) / 180); const _local_2 = ((k * Math.PI) / 180);
const _local_3 = Math.cos(_local_2); const _local_3 = Math.cos(_local_2);
@ -21,7 +21,7 @@ export class Matrix4x4
return new Matrix4x4(1, 0, 0, 0, _local_3, -(_local_4), 0, _local_4, _local_3); return new Matrix4x4(1, 0, 0, 0, _local_3, -(_local_4), 0, _local_4, _local_3);
} }
public static _Str_1560(k: number): Matrix4x4 public static getYRotationMatrix(k: number): Matrix4x4
{ {
const _local_2 = ((k * Math.PI) / 180); const _local_2 = ((k * Math.PI) / 180);
const _local_3 = Math.cos(_local_2); const _local_3 = Math.cos(_local_2);
@ -30,7 +30,7 @@ export class Matrix4x4
return new Matrix4x4(_local_3, 0, _local_4, 0, 1, 0, -(_local_4), 0, _local_3); return new Matrix4x4(_local_3, 0, _local_4, 0, 1, 0, -(_local_4), 0, _local_3);
} }
public static _Str_1368(k: number): Matrix4x4 public static getZRotationMatrix(k: number): Matrix4x4
{ {
const _local_2 = ((k * Math.PI) / 180); const _local_2 = ((k * Math.PI) / 180);
const _local_3 = Math.cos(_local_2); const _local_3 = Math.cos(_local_2);
@ -46,7 +46,7 @@ export class Matrix4x4
return this; return this;
} }
public _Str_2186(k: Vector3D): Vector3D public vectorMultiplication(k: Vector3D): Vector3D
{ {
const _local_2 = (((k.x * this._data[0]) + (k.y * this._data[3])) + (k.z * this._data[6])); const _local_2 = (((k.x * this._data[0]) + (k.y * this._data[3])) + (k.z * this._data[6]));
const _local_3 = (((k.x * this._data[1]) + (k.y * this._data[4])) + (k.z * this._data[7])); const _local_3 = (((k.x * this._data[1]) + (k.y * this._data[4])) + (k.z * this._data[7]));
@ -55,7 +55,7 @@ export class Matrix4x4
return new Vector3D(_local_2, _local_3, _local_4); return new Vector3D(_local_2, _local_3, _local_4);
} }
public _Str_1186(k:Matrix4x4): Matrix4x4 public multiply(k:Matrix4x4): Matrix4x4
{ {
const _local_2 = (((this._data[0] * k.data[0]) + (this._data[1] * k.data[3])) + (this._data[2] * k.data[6])); const _local_2 = (((this._data[0] * k.data[0]) + (this._data[1] * k.data[3])) + (this._data[2] * k.data[6]));
const _local_3 = (((this._data[0] * k.data[1]) + (this._data[1] * k.data[4])) + (this._data[2] * k.data[7])); const _local_3 = (((this._data[0] * k.data[1]) + (this._data[1] * k.data[4])) + (this._data[2] * k.data[7]));
@ -70,7 +70,7 @@ export class Matrix4x4
return new Matrix4x4(_local_2, _local_3, _local_4, _local_5, _local_6, _local_7, _local_8, _local_9, _local_10); return new Matrix4x4(_local_2, _local_3, _local_4, _local_5, _local_6, _local_7, _local_8, _local_9, _local_10);
} }
public _Str_1157(k: number): void public scalarMultiply(k: number): void
{ {
let index = 0; let index = 0;
@ -82,41 +82,41 @@ export class Matrix4x4
} }
} }
public _Str_1089(k: number): Matrix4x4 public rotateX(k: number): Matrix4x4
{ {
const _local_2 = ((k * Math.PI) / 180); const _local_2 = ((k * Math.PI) / 180);
const _local_3 = Math.cos(_local_2); const _local_3 = Math.cos(_local_2);
const _local_4 = Math.sin(_local_2); const _local_4 = Math.sin(_local_2);
const _local_5 = new Matrix4x4(1, 0, 0, 0, _local_3, -(_local_4), 0, _local_4, _local_3); const _local_5 = new Matrix4x4(1, 0, 0, 0, _local_3, -(_local_4), 0, _local_4, _local_3);
return _local_5._Str_1186(this); return _local_5.multiply(this);
} }
public _Str_2123(k: number): Matrix4x4 public rotateY(k: number): Matrix4x4
{ {
const _local_2 = ((k * Math.PI) / 180); const _local_2 = ((k * Math.PI) / 180);
const _local_3 = Math.cos(_local_2); const _local_3 = Math.cos(_local_2);
const _local_4 = Math.sin(_local_2); const _local_4 = Math.sin(_local_2);
const _local_5 = new Matrix4x4(_local_3, 0, _local_4, 0, 1, 0, -(_local_4), 0, _local_3); const _local_5 = new Matrix4x4(_local_3, 0, _local_4, 0, 1, 0, -(_local_4), 0, _local_3);
return _local_5._Str_1186(this); return _local_5.multiply(this);
} }
public _Str_2232(k: number): Matrix4x4 public rotateZ(k: number): Matrix4x4
{ {
const _local_2 = ((k * Math.PI) / 180); const _local_2 = ((k * Math.PI) / 180);
const _local_3 = Math.cos(_local_2); const _local_3 = Math.cos(_local_2);
const _local_4 = Math.sin(_local_2); const _local_4 = Math.sin(_local_2);
const _local_5 = new Matrix4x4(_local_3, -(_local_4), 0, _local_4, _local_3, 0, 0, 0, 1); const _local_5 = new Matrix4x4(_local_3, -(_local_4), 0, _local_4, _local_3, 0, 0, 0, 1);
return _local_5._Str_1186(this); return _local_5.multiply(this);
} }
public skew(): void public skew(): void
{ {
} }
public _Str_1779(): Matrix4x4 public transpose(): Matrix4x4
{ {
return new Matrix4x4(this._data[0], this._data[3], this._data[6], this._data[1], this._data[4], this._data[7], this._data[2], this._data[5], this._data[8]); return new Matrix4x4(this._data[0], this._data[3], this._data[6], this._data[1], this._data[4], this._data[7], this._data[2], this._data[5], this._data[8]);
} }

View File

@ -21,13 +21,13 @@ export class Node3D
return this._location; return this._location;
} }
public get _Str_1604(): Vector3D public get transformedLocation(): Vector3D
{ {
return this._transformedLocation; return this._transformedLocation;
} }
public _Str_1101(k: Matrix4x4): void public applyTransform(k: Matrix4x4): void
{ {
if(this._needsTransformation) this._transformedLocation = k._Str_2186(this._location); if(this._needsTransformation) this._transformedLocation = k.vectorMultiplication(this._location);
} }
} }