james7132 / DanmakU

An open source Danmaku development kit for Unity3D.
https://danmaku.jamessliu.com/
MIT License
240 stars 50 forks source link

Probably incorrect bounds2D intersects condition #33

Closed hdmmY closed 6 years ago

hdmmY commented 6 years ago

At Method in Asset/DanmakU/Runtime/Bounds2D line 115.

Method "Intersects":

public bool Intersects(Bounds2D bounds) {
    return (Math.Abs(Center.x - bounds.Center.x) < Extents.x + bounds.Size.x) &&
            (Math.Abs(Center.y - bounds.Center.y) < Extents.y + bounds.Extents.y);
}

I think the correct condition is

public bool Intersects(Bounds2D bounds) {
    return (Math.Abs(Center.x - bounds.Center.x) < Extents.x + bounds.Extents.x) &&
            (Math.Abs(Center.y - bounds.Center.y) < Extents.y + bounds.Extents.y);
}
james7132 commented 6 years ago

In the cases of these small issues, it may make more sense in the future to submit a pull request from your own personal fork rather than propose a change via an issue.

hdmmY commented 6 years ago

OK, I know. Thanks!