UNPKG

node-insim

Version:

An InSim library for NodeJS with TypeScript support

97 lines (96 loc) 2.59 kB
import { __decorate } from "tslib"; import { byte, float, int, word } from '../decorators'; import { SendablePacket } from './base'; import { PacketType } from './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. */ export class IS_CPP extends SendablePacket { constructor(data) { super(); this.Size = 32; this.Type = 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); } } __decorate([ byte() ], IS_CPP.prototype, "Size", void 0); __decorate([ byte() ], IS_CPP.prototype, "Type", void 0); __decorate([ byte() ], IS_CPP.prototype, "ReqI", void 0); __decorate([ byte() ], IS_CPP.prototype, "Zero", void 0); __decorate([ int() ], IS_CPP.prototype, "X", void 0); __decorate([ int() ], IS_CPP.prototype, "Y", void 0); __decorate([ int() ], IS_CPP.prototype, "Z", void 0); __decorate([ word() ], IS_CPP.prototype, "H", void 0); __decorate([ word() ], IS_CPP.prototype, "P", void 0); __decorate([ word() ], IS_CPP.prototype, "R", void 0); __decorate([ byte() ], IS_CPP.prototype, "ViewPLID", void 0); __decorate([ byte() ], IS_CPP.prototype, "InGameCam", void 0); __decorate([ float() ], IS_CPP.prototype, "FOV", void 0); __decorate([ word() ], IS_CPP.prototype, "Time", void 0); __decorate([ word() ], IS_CPP.prototype, "Flags", void 0);