rock-mod
Version:
Rock-Mod is a powerful framework designed for creating and managing mods for Grand Theft Auto (GTA) games.
30 lines (29 loc) • 947 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.RageWorldObject = void 0;
const RageBaseObject_1 = require("../baseObject/RageBaseObject");
const Vectors_1 = require("../../../../shared/common/utils/math/Vectors");
class RageWorldObject extends RageBaseObject_1.RageBaseObject {
_position;
get position() {
const { x, y, z } = this.mpEntity.position ?? this._position;
return new Vectors_1.Vector3D(x, y, z);
}
get dimension() {
return this.mpEntity.dimension;
}
constructor(options) {
super(options);
if (options.position)
this._position = options.position;
}
setPosition(value) {
if (this._position)
this._position = value;
this.mpEntity.position = new mp.Vector3(value);
}
setDimension(value) {
this.mpEntity.dimension = value;
}
}
exports.RageWorldObject = RageWorldObject;