Change getVolume to use visual clipping type #1130
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When merged this pull request will:
Arma 3's 1.92 update changed boundingBoxReal so that it can be passed a number for clipping type. Visual clipping type (0) gives more precise measurements when estimating the volume of an object compared to general clipping type (3).
Real bounding boxes with visual and general clipping types are shown below for certain objects (a vehicle, an ammo box, and a building) where the differences are profound. Some objects have almost identical real bounding boxes despite different clipping types (e.g., a Strider has less than 1% difference in volume). Real bounding boxes with visual clipping type are colored in white and those with general clipping type are colored in black.
Figure 1. Real bounding box of a vehicle (I_Truck_02_fuel_F). Visual clipping type: 105.406 m³. General clipping type: 280.191 m³. Difference: ≈62%.
Figure 2. Real bounding of an ammo box (Box_T_East_Ammo_F). Visual clipping type: 0.171219 m³. General clipping type: 1.37109 m³. Difference: ≈88%.
Figure 3. Real bounding box of a building (Land_cargo_house_slum_F). Visual clipping type: 69.1653 m³. General clipping type: 174.096 m³. Difference: ≈140%.
There exists two other clipping types: shadow (1) and geometry (2). For the tested objects there were no differences in volume between shadow, geometry, and general clipping types. Regarding performance, there was no noticeable difference between any of the four clipping types. It thus seems motivated to use visual.