HazJ 1289 Posted March 4, 2018 @Grumpy Old Man - Reason: ArmA 1 Share this post Link to post Share on other sites
xjoker_ 25 Posted June 20, 2018 On 04/03/2018 at 11:26 AM, Tankbuster said: I updated this slightly so it can accept other input; pdth_fnc_pointIsInBox = {// original by pedeathtrian. returns true if unit is in objs bounding box params ["_unit","_obj"]; private ["_pos"]; switch (typename _unit) do { case "STRING": {_pos = getMarkerPos _unit}; case "OBJECT": {_pos = getpos _unit}; case "ARRAY": {_pos = _unit}; }; _uPos = _obj worldToModel _pos; _oBox = boundingBoxReal _obj; _inHelper = { params ["_pt0", "_pt1"]; (_pt0 select 0 <= _pt1 select 0) && (_pt0 select 1 <= _pt1 select 1) && (_pt0 select 2 <= _pt1 select 2) }; ([_oBox select 0, _uPos] call _inHelper) && ([_uPos, _oBox select 1] call _inHelper) }; Hello , i'm testing this script but it doesn't seem to work everytime for example here it returns false : And here it returns true I just changed the chair's height between the screenshots I would like it to return true as soon as one box collides with the other edit : you'll understand the problem with this video Share this post Link to post Share on other sites
xjoker_ 25 Posted June 21, 2018 I changed this line case "OBJECT": {_pos = getpos _unit}; to this case "OBJECT": {_pos = ASLToAGL (getPosASL _unit)}; And i have better results. It would be even better if i could use the geometry lod instead of bounding box though Share this post Link to post Share on other sites
pierremgi 4888 Posted June 21, 2018 Are you trying to get this info in 3den editor (like the video) or in game? Share this post Link to post Share on other sites
xjoker_ 25 Posted June 21, 2018 The video is actually ingame, i just draw the boundingbox and move the chair with a script (while in spectator mode) :) Share this post Link to post Share on other sites
pierremgi 4888 Posted June 21, 2018 If you're expecting something while in game, you could test the event handler "epeContactStart". Something like: yourPot addEventHandler ["EpeContactStart", { params ["_object1", "_object2", "_selection1", "_selection2", "_force"]; hint str [_object1, _object2, _selection1, _selection2, _force]; }]; Share this post Link to post Share on other sites
Tankbuster 1746 Posted June 21, 2018 The physx eventhandlers only work with objects that support it (I don't know for sure chairs etc do) and even then, it's a nasty system to work with. 1 Share this post Link to post Share on other sites
pierremgi 4888 Posted June 21, 2018 Just now, Tankbuster said: The physx eventhandlers only work with objects that support it (I don't know for sure chairs etc do) and even then, it's a nasty system to work with. I have tested that before posting. Not saying that works at 100% but it worth to be tested. A good approach is to see what happen when you're running the preview with too close objects. In this case, the flowerPot falls. So, there is an epe contact. Share this post Link to post Share on other sites
Tankbuster 1746 Posted June 21, 2018 Your way is way better than trying to compute bounding box collisions then. Madness lies that way, surely? Share this post Link to post Share on other sites