As far as I know, there are currently 2 ways to retrieve information about a vehicle's dimensions:
Since the origin of a vehicle varies from vehicle to vehicle, it would be really useful if a new packet could be added to retrieve this data, which could be cached after being computed (if needed) when a player/AI leaves the pits, so it can be retrieved easily.
Assuming the vehicle origin is what the IS_MCI packet gives us, I propose the following format:
Total length/width/height represents the dimensions of the vehicle's bounding box, which could be based either on LOD1 or LOD3 (LOD3 makes sense on the physics side, but may be a bit rough, especially for some mods that have a bad LOD3).
Offset is measured from the vehicle origin to the center of the bounding box.
This packet would help generalize access to vehicle dimensions and wheel positions, without having to manually create a CAR_info.bin file (which assumes knowing what vehicles will be in the race/session), and can also help with the new AI control packets, as it gives us a way to measure distance to other vehicles, as well as determine where our own vehicle's wheels are.
Wheel damage would be either ignored entirely, or the wheel positions could be updated shortly after a car takes damage.
This packet could be requested by sending a corresponding SMALL_DIM packet with the PLID.
- Pressing O in the garage to generate the corresponding CAR_info.bin file
- For mods, directly reading the mod file (which requires decoding it)
Since the origin of a vehicle varies from vehicle to vehicle, it would be really useful if a new packet could be added to retrieve this data, which could be cached after being computed (if needed) when a player/AI leaves the pits, so it can be retrieved easily.
Assuming the vehicle origin is what the IS_MCI packet gives us, I propose the following format:
struct IS_DIM // vehicle DIMensions
{
byte Size; // 76
byte Type; // ISP_DIM
byte ReqI; // 0
byte PLID; // player's unique ID
float Length; // total length in metres
float Width; // total width in metres
float Height; // total height in metres
Vec/tor Offset; // offset from vehicle origin to box centre, local space (ints or floats in metres)
Vec/tor Wheels[4] // Offset to each contact patch center, local space (ints or floats in metres)
}
Total length/width/height represents the dimensions of the vehicle's bounding box, which could be based either on LOD1 or LOD3 (LOD3 makes sense on the physics side, but may be a bit rough, especially for some mods that have a bad LOD3).
Offset is measured from the vehicle origin to the center of the bounding box.
This packet would help generalize access to vehicle dimensions and wheel positions, without having to manually create a CAR_info.bin file (which assumes knowing what vehicles will be in the race/session), and can also help with the new AI control packets, as it gives us a way to measure distance to other vehicles, as well as determine where our own vehicle's wheels are.
Wheel damage would be either ignored entirely, or the wheel positions could be updated shortly after a car takes damage.
This packet could be requested by sending a corresponding SMALL_DIM packet with the PLID.