node-insim
Version:
An InSim library for NodeJS with TypeScript support
124 lines (123 loc) • 4.6 kB
JavaScript
;
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
if (typeof b !== "function" && b !== null)
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.IS_CPP = void 0;
var decorators_1 = require("../decorators");
var base_1 = require("./base");
var enums_1 = require("./enums");
/**
* Cam Pos Pack - Full camera packet (in car OR SHIFT+U mode)
*
* A Camera Position Packet can be used for LFS to report a camera position and state.
* An InSim program can also send one to set LFS camera position in game or SHIFT+U mode.
*/
var IS_CPP = /** @class */ (function (_super) {
__extends(IS_CPP, _super);
function IS_CPP(data) {
var _this = _super.call(this) || this;
_this.Size = 32;
_this.Type = enums_1.PacketType.ISP_CPP;
/** Instruction: 0 / or reply: ReqI as received in the {@link TINY_SCP} */
_this.ReqI = 0;
_this.Zero = 0;
/** Position vector X coordinate - 65536 means 1 metre */
_this.X = 0;
/** Position vector Y coordinate - 65536 means 1 metre */
_this.Y = 0;
/** Position vector Z coordinate - 65536 means 1 metre */
_this.Z = 0;
/** Heading - 0 points along Y axis */
_this.H = 0;
/** Pitch */
_this.P = 0;
/** Roll */
_this.R = 0;
/**
* Unique ID of viewed player (0 = none).
*
* Set this to 255 to leave that option unchanged.
*/
_this.ViewPLID = 0;
/**
* InGameCam (as reported in StatePack).
*
* Set this to 255 to leave that option unchanged.
*/
_this.InGameCam = 0;
/** FOV in degrees */
_this.FOV = 0;
/** Time in ms to get there (0 means instant) */
_this.Time = 0;
/** ISS state flags */
_this.Flags = 0;
_this.initialize(data);
return _this;
}
__decorate([
(0, decorators_1.byte)()
], IS_CPP.prototype, "Size", void 0);
__decorate([
(0, decorators_1.byte)()
], IS_CPP.prototype, "Type", void 0);
__decorate([
(0, decorators_1.byte)()
], IS_CPP.prototype, "ReqI", void 0);
__decorate([
(0, decorators_1.byte)()
], IS_CPP.prototype, "Zero", void 0);
__decorate([
(0, decorators_1.int)()
], IS_CPP.prototype, "X", void 0);
__decorate([
(0, decorators_1.int)()
], IS_CPP.prototype, "Y", void 0);
__decorate([
(0, decorators_1.int)()
], IS_CPP.prototype, "Z", void 0);
__decorate([
(0, decorators_1.word)()
], IS_CPP.prototype, "H", void 0);
__decorate([
(0, decorators_1.word)()
], IS_CPP.prototype, "P", void 0);
__decorate([
(0, decorators_1.word)()
], IS_CPP.prototype, "R", void 0);
__decorate([
(0, decorators_1.byte)()
], IS_CPP.prototype, "ViewPLID", void 0);
__decorate([
(0, decorators_1.byte)()
], IS_CPP.prototype, "InGameCam", void 0);
__decorate([
(0, decorators_1.float)()
], IS_CPP.prototype, "FOV", void 0);
__decorate([
(0, decorators_1.word)()
], IS_CPP.prototype, "Time", void 0);
__decorate([
(0, decorators_1.word)()
], IS_CPP.prototype, "Flags", void 0);
return IS_CPP;
}(base_1.SendablePacket));
exports.IS_CPP = IS_CPP;