Skip to content

Commit

Permalink
Merged cM__Deg2Short into cM_deg2s (the game's original name)
Browse files Browse the repository at this point in the history
Changed one use case to use the new name
  • Loading branch information
themikelester committed Nov 18, 2024
1 parent 2d9d5f3 commit 0ef39a0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/ZeldaTwilightPrincess/d_a.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { JPABaseEmitter } from "../Common/JSYSTEM/JPA.js";
import { BTIData } from "../Common/JSYSTEM/JUTTexture.js";
import { MathConstants, Vec3UnitY, invlerp, saturate, scaleMatrix } from "../MathHelpers.js";
import { TSDraw } from "../SuperMarioGalaxy/DDraw.js";
import { cLib_addCalc, cLib_addCalc2, cLib_addCalcAngleS2, cLib_addCalcAngleS_, cLib_chaseF, cLib_targetAngleX, cLib_targetAngleY, cM__Short2Rad, cM__Deg2Short, cM_atan2s } from "../ZeldaWindWaker/SComponent.js";
import { cLib_addCalc, cLib_addCalc2, cLib_addCalcAngleS2, cLib_addCalcAngleS_, cLib_chaseF, cLib_targetAngleX, cLib_targetAngleY, cM__Short2Rad, cM_deg2s, cM_atan2s } from "../ZeldaWindWaker/SComponent.js";
import { dBgW } from "../ZeldaWindWaker/d_bg.js";
import { MtxPosition, MtxTrans, calc_mtx, mDoMtx_XrotM, mDoMtx_YrotM, mDoMtx_YrotS, mDoMtx_ZXYrotM, mDoMtx_ZrotM } from "../ZeldaWindWaker/m_do_mtx.js";
import { GfxDevice } from "../gfx/platform/GfxPlatform.js";
Expand Down Expand Up @@ -3100,7 +3100,7 @@ class d_a_obj_magLiftRot extends fopAc_ac_c {
private modeMove(deltaTimeFrames: number): void {
this.speedF = cLib_chaseF(this.speedF, 8.0, 0.05 * deltaTimeFrames);

const speed = cM__Deg2Short(this.speedF);
const speed = cM_deg2s(this.speedF);
this.rot[2] = cLib_addCalcAngleS_(this.rot[2], this.rotTarget, 1, speed * deltaTimeFrames, 1);

if ((this.rotTarget - this.rot[2]) === 0) {
Expand Down
8 changes: 2 additions & 6 deletions src/ZeldaWindWaker/SComponent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,8 @@ export function cM_rndFX(max: number): number {
return 2.0 * (max * (Math.random() - 0.5));
}

export function cM_deg2s(deg: number): number {
return deg * 182.04445;
export function cM_deg2s(v: number): number {
return cM__Rad2Short(v * MathConstants.DEG_TO_RAD);
}

export function cM_sht2d(rad: number) {
Expand All @@ -133,10 +133,6 @@ export function cM__Rad2Short(v: number): number {
return v * (0x8000 / Math.PI);
}

export function cM__Deg2Short(v: number): number {
return cM__Rad2Short(v * MathConstants.DEG_TO_RAD);
}

export function cLib_targetAngleX(p0: ReadonlyVec3, p1: ReadonlyVec3): number {
const dy = p1[1] - p0[1];
const dist = cLib_distanceXZ(p0, p1);
Expand Down

0 comments on commit 0ef39a0

Please sign in to comment.