Difference between revisions of "IS OBH"
Bokujishin (talk | contribs) (Created page with "== Introduction == The '''OB'''ject '''H'''it packet is sent by LFS when a car collides with an object (not only layout objects). This packet is only sent if ISF_OBH is set i...") |
|||
| Line 1: | Line 1: | ||
| − | == | + | {{Infobox InSim packet |
| + | | description = Collision report for contact between a car and an object | ||
| + | | size = 4 | ||
| + | | type_key = ISP_OBH | ||
| + | | type_value = 22 | ||
| + | | direction = in | ||
| + | | prev = [[IS_CON]] | ||
| + | | next = [[IS_HLV]] | ||
| + | }} | ||
| − | The '''OB'''ject '''H'''it packet is sent by LFS when a car collides with an object (not only layout objects). This packet is only sent if ISF_OBH is set in [[IS_ISI]]. | + | The '''OB'''ject '''H'''it packet is sent by LFS when a [[:Category:Cars|car]] collides with an object (not only [[List of autocross layout objects|layout objects]]). This packet is only sent if ISF_OBH is set in [[IS_ISI]]. |
{| class="wikitable" | {| class="wikitable" | ||
| Line 90: | Line 98: | ||
The [[#OBHFlags|OBHFlags]] can help determine if a car hit an object that has already been hit by another car: if OBH_CAN_MOVE and OBH_WAS_MOVING are both set, the car hit a moving object (caused by a previous hit). | The [[#OBHFlags|OBHFlags]] can help determine if a car hit an object that has already been hit by another car: if OBH_CAN_MOVE and OBH_WAS_MOVING are both set, the car hit a moving object (caused by a previous hit). | ||
| + | |||
| + | {{InSim packets}} | ||
[[Category:InSim packets]] | [[Category:InSim packets]] | ||
Revision as of 11:18, 14 February 2026
| IS_OBH | |
|---|---|
| Collision report for contact between a car and an object | |
| Overview | |
| Size | 4 |
| Type | ISP_OBH (22) |
| Usage | info |
| Previous packet IS_CON |
Next packet IS_HLV |
The OBject Hit packet is sent by LFS when a car collides with an object (not only layout objects). This packet is only sent if ISF_OBH is set in IS_ISI.
| Type | Name | Description |
|---|---|---|
| byte | Size | 28 |
| byte | Type | ISP_OBH |
| byte | ReqI | 0 |
| byte | PLID | player's unique id |
| word | SpClose | high 4 bits: reserved / low 12 bits: closing speed (10 = 1 m/s) |
| word | SpW | |
| unsigned | Time | time stamp (ms) |
| CarContOBJ | C | |
| short | X | as in ObjectInfo |
| short | Y | as in ObjectInfo |
| byte | Zbyte | if OBH_LAYOUT is set: Zbyte as in ObjectInfo |
| byte | Sp1 | |
| byte | Index | AXO_x as in ObjectInfo or zero if it is an unknown object |
| byte | OBHFlags | see below |
Packet Details
Size
The size of the packet is always 28 bytes.
Type
The packet type from the ISP_ enumeration, always ISP_OBH.
ReqI
ReqI is always equal to zero.
SpClose
Only the 12 lower bits are used to encode the closing speed, where a value of 10 corresponds to 1 m/s.
Time
The timestamp of the contact.
C
A CarContOBJ giving details about the involved car.
X
The X coordinate of the object, as in ObjectInfo.
Y
The Y coordinate of the object, as in ObjectInfo.
Zbyte
The Z coordinate of the object, as in ObjectInfo.
Index
The AXO_ index of the object, as in ObjectInfo, or 0 if the object is unknown.
OBHFlags
Flags for the hit event:
#define OBH_LAYOUT 1 // an added object #define OBH_CAN_MOVE 2 // a movable object #define OBH_WAS_MOVING 4 // was moving before this hit #define OBH_ON_SPOT 8 // object in original position
Notes
The OBHFlags can help determine if a car hit an object that has already been hit by another car: if OBH_CAN_MOVE and OBH_WAS_MOVING are both set, the car hit a moving object (caused by a previous hit).
| Initialisation | IS_ISI | ||
|---|---|---|---|
| Version Information | IS_VER | ||
| General Purpose | IS_TINY · IS_SMALL · IS_TTC | ||
| State Reporting and Requests | IS_STA · IS_SFP · IS_ISM | ||
| Text Messages and Key Presses | IS_SCH · IS_MSO · IS_III · IS_MST · IS_MTC · IS_MSX · IS_MSL | ||
| Voting | IS_VTN | ||
| Race Tracking | IS_RST · IS_REO | ||
| Autocross | IS_AXI · IS_AXO · IS_UCO · IS_OCO · IS_AXM | ||
| Connection Tracking | IS_NCN · IS_CNL · IS_CPR · IS_ACR · IS_NCI · IS_SLC · IS_CIM | ||
| Car Tracking | IS_NPL · IS_PLP · IS_PLL · IS_LAP · IS_SPX · IS_PIT · IS_PSF · IS_PLA · IS_PEN · IS_TOC · IS_FLG · IS_PFL · IS_FIN · IS_RES · IS_NLP · IS_MCI · IS_CRS · IS_CON · IS_OBH · IS_HLV · IS_CSC | ||
| Camera Control | IS_SCC · IS_CPP | ||
| Replay Control | IS_RIP | ||
| Screenshots | IS_SSH | ||
| InSim Buttons | IS_BFN · IS_BTN · IS_BTC · IS_BTT | ||
| AI Control | IS_AIC · IS_AII | ||
| Other packets | IS_MOD · IS_CCH · IS_PLC · IS_HCP · IS_JRR · IS_MAL · IS_PLH · IS_IPB | ||