Suggestion Optimising AABB

Discussion in 'Suggestions' started by XenialDan, Sep 9, 2018.

  1. XenialDan

    XenialDan Slime

    Messages:
    88
    GitHub:
    thebigsmilexd
    AABB is pretty poorly coded/usable

    I coded myself classes to extend it. In example:

    getSize: return a v3 with the size

    minX/Y/Z: v3 min

    maxX/Y/Z: v3 max

    Setting min/max positions will actually set min and max positions.. currently maxY can be 10 and minY can be 40.. without any checks if it is true that minY is actually smaller

    getCenter/getMiddle: v3 center

    Maybe you also got ideas how to improve this (sorry for the poorly written article)
     
  2. dktapps

    dktapps Administrator Staff Member PMMP Team

    Messages:
    611
    GitHub:
    dktapps
    don't forget that AxisAlignedBB is heavily used in hot paths, so any change you make to already-used functionality could have widespread effects on performance.
     
  3. XenialDan

    XenialDan Slime

    Messages:
    88
    GitHub:
    thebigsmilexd
    Adding stuff for improving the class and mire functions will not create any impact on performance. A person once said: "Do not care about microoptimisations in already heavy projects"

    Also, these things would bring more API to developers so not every plugin has to define these functions themself (which would be less performant than api functions.)
     
  4. dktapps

    dktapps Administrator Staff Member PMMP Team

    Messages:
    611
    GitHub:
    dktapps
    I said changes to already-used functionality. And the opposite is also true: mess with the wrong thing and it could have consequences far more costly than you know.

    Adding new API methods seems reasonable, but be careful changing things that already exist.
     
  5. SOFe

    SOFe Administrator Staff Member PMMP Team Poggit Admin Noobiest member in the PMMP Team

    Messages:
    1,702
    GitHub:
    sof3
    [​IMG]
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.