UNPKG

node-insim

Version:

An InSim library for NodeJS with TypeScript support

43 lines (42 loc) 1.46 kB
import { Struct } from '../base'; import type { StructData } from '../types'; export declare class CompCar extends Struct { /** Current path node */ Node: number; /** Current lap */ Lap: number; /** Player's unique id */ PLID: number; /** Current race position: 0 = unknown, 1 = leader, etc... */ Position: number; /** Flags and other info */ Info: CompCarFlags | 0; private readonly Sp3; /** X map (65536 = 1 metre) */ X: number; /** Y map (65536 = 1 metre) */ Y: number; /** Z alt (65536 = 1 metre) */ Z: number; /** Speed (32768 = 100 m/s) */ Speed: number; /** car's motion if Speed > 0: 0 = world y direction, 32768 = 180 deg */ Direction: number; /** direction of forward axis: 0 = world y direction, 32768 = 180 deg anticlockwise from above */ Heading: number; /** Signed, rate of change of heading: (8192 = 180 deg/s anticlockwise) */ AngVel: number; constructor(data?: StructData<CompCar>); } export declare enum CompCarFlags { /** This car is in the way of a driver who is a lap ahead */ CCI_BLUE = 1, /** This car is slow or stopped and in a dangerous place */ CCI_YELLOW = 2, /** This car is lagging (missing or delayed position packets) */ CCI_LAG = 32, /** This is the first compcar in this set of MCI packets */ CCI_FIRST = 64, /** This is the last compcar in this set of MCI packets */ CCI_LAST = 128 }