Explosives - Taking bounding box into consideration when attaching#11335
Explosives - Taking bounding box into consideration when attaching#11335deBearN wants to merge 6 commits intoacemod:masterfrom
Conversation
DartRuffian
left a comment
There was a problem hiding this comment.
Formatting, make variables private
Co-authored-by: Dart <59131299+DartRuffian@users.noreply.github.com>
Co-authored-by: Dart <59131299+DartRuffian@users.noreply.github.com>
Co-authored-by: Dart <59131299+DartRuffian@users.noreply.github.com>
Co-authored-by: PabstMirror <pabstmirror@gmail.com>
Co-authored-by: PabstMirror <pabstmirror@gmail.com>
| if (_normal isEqualTo [0,0,0]) then { | ||
| _normal = surfaceNormal _posASL; | ||
| }; |
There was a problem hiding this comment.
What's this part of the code supposed to catch?
There was a problem hiding this comment.
Here? probably nothing, i got some of my code from one of my scripts that had vectors in them, so it was probably left-over from something, in case the object bottom was pointing at the sky resets it
There was a problem hiding this comment.
I'm not optimistic about uncertain code - either give it a comment or remove it. surfaceNormal returns the normal to the terrain at that location, so it seems out of place.
There was a problem hiding this comment.
Yeah, no, i will remove it, it was originally a code that would create an Ace circle tag where the explosive was, and when it was in a ramp in a certain modded object it returned 0,0,0 and would place a floating/clipping circle in the ramp, so that was a bandaid fix.
on the second hand, iirc if there isn't a FireGeo LOD it defaults to normal Geo right? i should probably replace "FireGeometry" here for for "Geometry" do you agree?
Previously objects would clip into the object it was being place in:

Now using their bounding box i move them so they stay right on the limit as if they were properly attached:

Seems to work with most modded explosives (i didn't find one it didn't work with).
The "problem" with the fix is having to re-calculate the
_basePosASLwhen you can place it, because i need the Object from _expSetupVehicle to get the bounding box, feel free to give me directions on how to improve it.also double check if i did this correctly because my fork path is ACE3>>MyUnitFork>>MyFork, so i had to create a branch, do a hard reset to upstream(ACE3) and then commit and publish, want to make sure it's all good.