openmultiplayer / openmultiplayer/open.mp

Incorrect vehicle model size in GetVehicleModelInfo

Open
#813 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
C++
Stars
641
Forks
208
PR merge metrics
No merged PRs in 30d

Description

Describe the bug
If you use GetVehicleModelInfo with VEHICLE_MODEL_INFO_SIZE you will obtain for most of vanilla vehicle models that size is invalid.
Moreover: there is also problem that Axis Aligned Boundary Box is not centered at vehicle position.
So it would be better if GetVehicleModelInfo can give center of boundary in addition to correct sizes.
You can watch this video that demonstrate incorrect boundary: the white-black spheres are boundary by GetVehicleModelInfo, the red ones - by my parsing results (you can find it there. NOTE: there are only hull/chassis boundary (without wheels, damageable & moving parts).

To Reproduce

  1. GetVehicleModelInfo(modelid, VEHICLE_MODEL_INFO_SIZE, size_x, size_y, size_z);
  2. Make min & max for every axis with min_x = -0.5 * size_x; max_x = 0.5 * size_x;
  3. Attach some objects at corners.
  4. Compare with visible object.

Screenshots and/or logs
Video.

Release version
This problem begins in samp and still appears in omp up to v1.1.0.2612.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the GetVehicleModelInfo entry point and review how VEHICLE_MODEL_INFO_SIZE is calculated and how vehicle bounds are positioned. Compare the returned bounds with the linked ModelGeometryInfo-SAMP results and the reproduction steps. Done means vanilla vehicle sizes are correct and the API can provide the boundary center as requested.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
game-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.