"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.Math = void 0;
const Vector3_1 = __importDefault(require("modloader64_api/math/Vector3"));
class Math {
    emulator;
    constructor(emulator) {
        this.emulator = emulator;
    }
    rdramReadPtrV3(addr, offset) {
        return new Vector3_1.default(this.emulator.rdramReadPtrF32(addr, offset), this.emulator.rdramReadPtrF32(addr, offset + 4), this.emulator.rdramReadPtrF32(addr, offset + 8));
    }
    rdramWritePtrV3(addr, offset, rhs) {
        this.emulator.rdramWritePtrF32(addr, offset, rhs.x);
        this.emulator.rdramWritePtrF32(addr, offset + 4, rhs.y);
        this.emulator.rdramWritePtrF32(addr, offset + 8, rhs.y);
    }
    rdramReadV3(addr) {
        return new Vector3_1.default(this.emulator.rdramReadF32(addr), this.emulator.rdramReadF32(addr + 4), this.emulator.rdramReadF32(addr + 8));
    }
    rdramWriteV3(addr, rhs) {
        this.emulator.rdramWriteF32(addr, rhs.x);
        this.emulator.rdramWriteF32(addr + 4, rhs.y);
        this.emulator.rdramWriteF32(addr + 8, rhs.z);
    }
    rdramReadV3i(addr) {
        return new Vector3_1.default(this.emulator.rdramRead32(addr), this.emulator.rdramRead32(addr + 4), this.emulator.rdramRead32(addr + 8));
    }
    rdramWriteV3i(addr, rhs) {
        this.emulator.rdramWrite32(addr, rhs.x);
        this.emulator.rdramWrite32(addr + 4, rhs.y);
        this.emulator.rdramWrite32(addr + 8, rhs.z);
    }
    rdramReadV3i16(addr) {
        return new Vector3_1.default(this.emulator.rdramRead16(addr), this.emulator.rdramRead16(addr + 2), this.emulator.rdramRead16(addr + 4));
    }
    rdramWriteV3i16(addr, rhs) {
        this.emulator.rdramWrite16(addr, rhs.x);
        this.emulator.rdramWrite16(addr + 2, rhs.y);
        this.emulator.rdramWrite16(addr + 4, rhs.z);
    }
    rdramReadV3i8(addr) {
        return new Vector3_1.default(this.emulator.rdramRead8(addr), this.emulator.rdramRead8(addr + 1), this.emulator.rdramRead8(addr + 2));
    }
    rdramWriteV3i8(addr, rhs) {
        this.emulator.rdramWrite8(addr, rhs.x);
        this.emulator.rdramWrite8(addr + 1, rhs.y);
        this.emulator.rdramWrite8(addr + 2, rhs.z);
    }
}
exports.Math = Math;
//# sourceMappingURL=Math.js.map