node-insim
Version:
An InSim library for NodeJS with TypeScript support
44 lines (43 loc) • 1.32 kB
TypeScript
import { Packet } from './base';
import type { ObjectIndex } from './enums';
import { PacketType } from './enums';
import { CarContOBJ } from './structs';
/**
* OBject Hit - car hit an autocross object or an unknown object
*
* Set the {@link ISF_OBH} flag in the {@link IS_ISI} to receive object contact reports.
*/
export declare class IS_OBH extends Packet {
readonly Size = 28;
readonly Type = PacketType.ISP_OBH;
readonly ReqI = 0;
/** Player's unique id */
PLID: number;
/** High 4 bits: reserved / low 12 bits: closing speed (10 = 1 m/s) */
SpClose: number;
private readonly SpW;
/** Time stamp (ms) */
Time: number;
/** Contact object */
C: CarContOBJ;
/** Position (1 metre = 16) */
X: number;
/** Position (1 metre = 16) */
Y: number;
/** If {@link OBH_LAYOUT} is set: Zbyte as in {@link ObjectInfo} */
Zbyte: number;
private readonly Sp1;
/** AXO_x as in {@link ObjectInfo} or zero if it is an unknown object */
Index: ObjectIndex;
OBHFlags: ObjectHitFlags | 0;
}
export declare enum ObjectHitFlags {
/** An added object */
OBH_LAYOUT = 1,
/** A movable object */
OBH_CAN_MOVE = 2,
/** Was moving before this hit */
OBH_WAS_MOVING = 4,
/** Object in original position */
OBH_ON_SPOT = 8
}