rock-mod
Version:
Rock-Mod is a powerful framework designed for creating and managing mods for Grand Theft Auto (GTA) games.
44 lines (43 loc) • 1.26 kB
JavaScript
import { Vector3D } from "../../../../shared/index";
import { RageBaseObject } from "../../../entities/ragemp/baseObject/RageBaseObject";
export class RageCamera extends RageBaseObject {
constructor(options) {
super(options);
}
get _cameraEntity() {
return this.mpEntity;
}
get isActive() {
return this._cameraEntity.isActive();
}
setIsActive(value) {
this._cameraEntity.setActive(value);
}
get direction() {
const { x, y, z } = this._cameraEntity.getDirection();
return new Vector3D(x, y, z);
}
get fov() {
return this._cameraEntity.getFov();
}
setFov(value) {
this._cameraEntity.setFov(value);
}
pointAtCoord(value) {
this._cameraEntity.pointAtCoord(value.x, value.y, value.z);
}
setPosition(value) {
this._cameraEntity.setCoord(value.x, value.y, value.z);
}
get position() {
const { x, y, z } = this._cameraEntity.getCoord();
return new Vector3D(x, y, z);
}
get rotation() {
const { x, y, z } = this._cameraEntity.getRot(2);
return new Vector3D(x, y, z);
}
setRotation(value) {
this._cameraEntity.setRot(value.x, value.y, value.z, 2);
}
}