Ace3: getVehiclePos.sqf - Division by Zero

Created on 25 Jan 2018  路  4Comments  路  Source: acemod/ACE3

Arma 3 Version: 1.80.143869 (stable)
CBA Version: 3.5 (stable)
ACE3 Version: 3.12.1 (stable)

Mods:

- CBA_A3
- ace

Description:

The above line now throws an in-game error, as well as an RPT error for a division by zero if the bounding box is not defined on the object. If not set, the engine defaults it to -1. The abs math function is making that 1, and the -1 is making that 0, thus the division by zero error. Also potentially if a bounding box index is 1, it would throw the error too.

Steps to reproduce:

  • Look at the code.

Where did the issue occur?

  • Dedicated / Self-Hosted Multiplayer / Singleplayer / Editor (Singleplayer) / Editor (Multiplayer) / Virtual Arsenal

Placed Modules:

  • None

RPT log file:
-

kinbug

Most helpful comment

I have noticed the issue on the CUP FV432.

https://i.imgur.com/jXp9sRL.jpg

I am not sure as to why it is returning a -1 value for its Z coordinate, because it does have a bounding box defined in the config and p3d. The coordinates of the bounding box memory points do not have a -1 coordinate.

All 4 comments

Do you have an example of a object without a defined bounding box?

Yes, I first encountered this when editing the VR Wall and adding an interaction, the class name is 'VR_Billboard_01_F'. In this case, the X index is -1.

I just looped through the vanilla CfgVehicles to spawn all of them, then checked if one of their indices was -1, and logged it to clipboard. I got the following output:

Land_PlasticBarrier_01_line_x2_F - _bbx: -1, _bbY: -1, _bbZ: -0.285306
UserTexture_1x2_F - _bbx: -0.5, _bbY: 0, _bbZ: -1
VR_Area_01_square_2x2_grey_F - _bbx: -1, _bbY: -1, _bbZ: -0.0005
VR_Billboard_01_F - _bbx: -1, _bbY: -0.0801527, _bbZ: -2.28044
VR_Area_01_square_2x2_yellow_F - _bbx: -1, _bbY: -1, _bbZ: -0.0005
VR_GroundIcon_01_F - _bbx: -1, _bbY: -1, _bbZ: -0.0025
Sign_Sphere200cm_F - _bbx: -1, _bbY: -0.999999, _bbZ: -1
Land_ConcreteKerb_02_2m_F - _bbx: -1, _bbY: -0.68, _bbZ: -0.2125
Land_WoodenWall_01_m_d_F - _bbx: -0.679313, _bbY: -0.126185, _bbZ: -1
Land_SlumWall_01_s_2m_F - _bbx: -1, _bbY: -0.203993, _bbZ: -0.58134
Land_RoadCrack_01_6x2_F - _bbx: -1, _bbY: -3, _bbZ: -2
Land_RoadCrack_01_2x2_F - _bbx: -1, _bbY: -1, _bbZ: -1
Land_Puddle_01_F - _bbx: -1, _bbY: -1, _bbZ: -1
BloodPool_01_Large_Old_F - _bbx: -1, _bbY: -1, _bbZ: -0.005
BloodPool_01_Large_New_F - _bbx: -1, _bbY: -1, _bbZ: -0.005
Sign_Sphere200cm_Geometry_F - _bbx: -1, _bbY: -1, _bbZ: -1

I think this issue however will be most common with third party mods not defining a bounding box.

I have noticed the issue on the CUP FV432.

https://i.imgur.com/jXp9sRL.jpg

I am not sure as to why it is returning a -1 value for its Z coordinate, because it does have a bounding box defined in the config and p3d. The coordinates of the bounding box memory points do not have a -1 coordinate.

might have to do with the water/physX simulation

Was this page helpful?
0 / 5 - 0 ratings

Related issues

TheNightstalk3r picture TheNightstalk3r  路  3Comments

Hubok picture Hubok  路  4Comments

armyinf0703 picture armyinf0703  路  3Comments

thirald picture thirald  路  3Comments

austinjames314 picture austinjames314  路  4Comments