The OBject Hit packet is now implemented. Please have a look and see if you think it is OK. This does not report wall contacts - only contacts with actual objects - like autocross objects or other polygon objects that are not available in layouts.
Wall hits will be reported with a simpler packet that will also be used to report illegal ground surfaces. Those reports will be triggered using the HLVC code.
Wall hits will be reported with a simpler packet that will also be used to report illegal ground surfaces. Those reports will be triggered using the HLVC code.
struct CarContOBJ // 8 bytes : car in a contact with an object
{
byte Direction; // car's motion if Speed > 0 : 0 = world y direction, 128 = 180 deg
byte Heading; // direction of forward axis : 0 = world y direction, 128 = 180 deg
byte Speed; // m/s
byte Sp3;
short X; // position (1 metre = 16)
short Y; // position (1 metre = 16)
};
struct IS_OBH // OBject Hit - car hit an autocross object or an unknown object
{
byte Size; // 24
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 Time; // looping time stamp (hundredths - time since reset - like TINY_GTH)
CarContOBJ C;
short X; // as in ObjectInfo
short Y; // as in ObjectInfo
byte Sp0;
byte Sp1;
byte Index; // AXO_x as in ObjectInfo or zero if it is an unknown object
byte OBHFlags; // see below
};
// OBHFlags byte
#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