Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add boolean operator nodes in 2D (CSG) #39

Merged
merged 66 commits into from
Dec 9, 2020
Merged

Add boolean operator nodes in 2D (CSG) #39

merged 66 commits into from
Dec 9, 2020

Commits on Nov 22, 2020

  1. Convert PolyNode2D to Node2D

    Xrayez committed Nov 22, 2020
    Configuration menu
    Copy the full SHA
    fc3756a View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    745308e View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    b83a274 View commit details
    Browse the repository at this point in the history
  4. Require boolean_polypaths_tree to point to existing node

    This is only done in C++, the binding code still constructs a new node.
    Xrayez committed Nov 22, 2020
    Configuration menu
    Copy the full SHA
    e4409b5 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    0cb9c64 View commit details
    Browse the repository at this point in the history
  6. Allow to draw PolyNode2D objects individually

    Fixes drawing with final transform, introduces color property per each node.
    
    Added a bunch of other methods to collect polygons and polylines.
    Xrayez committed Nov 22, 2020
    Configuration menu
    Copy the full SHA
    22aa0c9 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    e177084 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    4e68dda View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    c050e2d View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    567069c View commit details
    Browse the repository at this point in the history
  11. Do not treat inner nodes as holes in PolyNode2D

    Greatly simplifies boolean operations, `is_hole` renamed to `is_inner`
    to denote hierarchical representation of nodes, and not necessarily
    geometrical meaning.
    Xrayez committed Nov 22, 2020
    Configuration menu
    Copy the full SHA
    677a668 View commit details
    Browse the repository at this point in the history
  12. Remove unused/irrelevant code from PolyNode2D

    Some of these may still make sense, but can be reimplemented later.
    Xrayez committed Nov 22, 2020
    Configuration menu
    Copy the full SHA
    26d0c46 View commit details
    Browse the repository at this point in the history
  13. Do not clip with no operation, resurrect drawing in PolyNode2D

    Drawing is per node now, but mostly parent is responsible.
    Outlines from operations such as difference can be implemented
    in canvas editor plugin instead.
    Xrayez committed Nov 22, 2020
    Configuration menu
    Copy the full SHA
    aa12979 View commit details
    Browse the repository at this point in the history
  14. Configuration menu
    Copy the full SHA
    9912b56 View commit details
    Browse the repository at this point in the history
  15. Add PolyCircle2D class

    Xrayez committed Nov 22, 2020
    Configuration menu
    Copy the full SHA
    d14c646 View commit details
    Browse the repository at this point in the history
  16. Configuration menu
    Copy the full SHA
    b002eff View commit details
    Browse the repository at this point in the history
  17. Add PolyNode2D editor plugin

    Allows to edit points.
    Xrayez committed Nov 22, 2020
    Configuration menu
    Copy the full SHA
    5953c8f View commit details
    Browse the repository at this point in the history
  18. Configuration menu
    Copy the full SHA
    45858bb View commit details
    Browse the repository at this point in the history
  19. Configuration menu
    Copy the full SHA
    7fd5879 View commit details
    Browse the repository at this point in the history
  20. Configuration menu
    Copy the full SHA
    97cbaba View commit details
    Browse the repository at this point in the history
  21. Prevent PolyNode2D derived classes to be edited as polygons

    The warning suggests that such nodes should be converted to `PolyNode2D` instead, this will be implemented.
    
    One issue still persists: I haven't found a way to move `PolyCircle2D` in the editor unless you use the move tool explicitly.
    Xrayez committed Nov 22, 2020
    Configuration menu
    Copy the full SHA
    66a6955 View commit details
    Browse the repository at this point in the history
  22. Configuration menu
    Copy the full SHA
    bd50fa5 View commit details
    Browse the repository at this point in the history
  23. Configuration menu
    Copy the full SHA
    82d54c9 View commit details
    Browse the repository at this point in the history
  24. Configuration menu
    Copy the full SHA
    5648da3 View commit details
    Browse the repository at this point in the history
  25. Configuration menu
    Copy the full SHA
    d807edf View commit details
    Browse the repository at this point in the history
  26. Configuration menu
    Copy the full SHA
    5f2771c View commit details
    Browse the repository at this point in the history
  27. Configuration menu
    Copy the full SHA
    60ccb4a View commit details
    Browse the repository at this point in the history
  28. Fix converting PolyNode2D with points to a single path

    `replace_node` keeps properties, but that also overrides our previously set points too...
    Xrayez committed Nov 22, 2020
    Configuration menu
    Copy the full SHA
    ea6ec2c View commit details
    Browse the repository at this point in the history
  29. Configuration menu
    Copy the full SHA
    d51d9f9 View commit details
    Browse the repository at this point in the history
  30. Fix editor picking for PolyNode2D derived classes

    They do not generate points, which caused wrong execution path.
    Xrayez committed Nov 22, 2020
    Configuration menu
    Copy the full SHA
    c1fa6d0 View commit details
    Browse the repository at this point in the history
  31. Hide PolyNode2D button upon editor start

    Also modify tooltip message.
    Xrayez committed Nov 22, 2020
    Configuration menu
    Copy the full SHA
    4f497f9 View commit details
    Browse the repository at this point in the history
  32. Use union operation for PolyNode2D by default

    This ensures that the outlines of the parent node shall be defined
    at all times, unless `OP_NONE` is set explicitly, which would also allow
    to draw different texture for such a node.
    Xrayez committed Nov 22, 2020
    Configuration menu
    Copy the full SHA
    2977132 View commit details
    Browse the repository at this point in the history
  33. Configuration menu
    Copy the full SHA
    04dd8c5 View commit details
    Browse the repository at this point in the history
  34. Make extents a Vector2 in PolyRect2D

    Makes it consistent with `RectangleShape2D` in Godot.
    Xrayez committed Nov 22, 2020
    Configuration menu
    Copy the full SHA
    828e5b3 View commit details
    Browse the repository at this point in the history
  35. Rename PolyRect2D to PolyRectangle2D

    Makes it consistent with `RectangleShape2D` in Godot.
    Xrayez committed Nov 22, 2020
    Configuration menu
    Copy the full SHA
    a7e3737 View commit details
    Browse the repository at this point in the history
  36. Add antialiasing option for PolyNode2D

    Doesn't work well for closed outlines where drawing is done
    with triangle array in Godot 3.2, see discussion in:
    
    godotengine/godot#10645
    
    Seems to work better for line drawing.
    Xrayez committed Nov 22, 2020
    Configuration menu
    Copy the full SHA
    8a5d2fb View commit details
    Browse the repository at this point in the history
  37. Configuration menu
    Copy the full SHA
    3eaf531 View commit details
    Browse the repository at this point in the history
  38. Add PolyMesh2D class

    Works by decomposing `PolyNode2D` children into shapes such as
    triangles, convex polygons etc.
    
    This does not yet add collision stuff, this will be implemented in
    a node derived from `PolyMesh2D`.
    Xrayez committed Nov 22, 2020
    Configuration menu
    Copy the full SHA
    d27778f View commit details
    Browse the repository at this point in the history
  39. Add PolyCollision2D class

    Extends `PolyMesh2D`, uses `PolyNode2D`s to define its shape similarly.
    
    The class is analogous to `CollisionPolygon2D`, except that the build
    mode is defined in parent mesh class, and the shape is edited through
    `PolyNode2D`s at all times, this makes it quite flexible and reusable.
    Xrayez committed Nov 22, 2020
    Configuration menu
    Copy the full SHA
    459da6c View commit details
    Browse the repository at this point in the history
  40. Rename PolyCollision2D to PolyCollisionShape2D

    For consistency and ease of discoverty along with Godot's
    `CollisionShape2D`. Cannot rename this to `PolyCollisionPolygon2D`,
    as `Poly*` already suggests so.
    Xrayez committed Nov 22, 2020
    Configuration menu
    Copy the full SHA
    e6ff948 View commit details
    Browse the repository at this point in the history
  41. Apply shapes in parent PolyMesh2D class

    By design, derived classes can override this.
    Xrayez committed Nov 22, 2020
    Configuration menu
    Copy the full SHA
    f9e82a4 View commit details
    Browse the repository at this point in the history
  42. Configuration menu
    Copy the full SHA
    b237ec3 View commit details
    Browse the repository at this point in the history
  43. Rename PolyMesh2D to PolyShape2D

    This may be confusing with CSG nodes in 3D, as mesh is used there
    for one of the CSG shape generators.
    
    We don't use `Shape` terminology here in `PolyNode2D` like for
    `PolyCircle2D` or `PolyRectangle2D` as it's not necessarily about boolean
    operators, but also representing an hierarchy of nested outlines, so
    Goost reserves `Shape` terminology to lean closer to collision shapes.
    Xrayez committed Nov 22, 2020
    Configuration menu
    Copy the full SHA
    b6c10e1 View commit details
    Browse the repository at this point in the history
  44. Configuration menu
    Copy the full SHA
    7e67f1d View commit details
    Browse the repository at this point in the history
  45. Configuration menu
    Copy the full SHA
    6e4088d View commit details
    Browse the repository at this point in the history
  46. Configuration menu
    Copy the full SHA
    3eaf15d View commit details
    Browse the repository at this point in the history

Commits on Nov 23, 2020

  1. Configuration menu
    Copy the full SHA
    5453699 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    4f8446b View commit details
    Browse the repository at this point in the history

Commits on Nov 26, 2020

  1. Rename BUILD_CONCAVE to BUILD_SEGMENTS in PolyShape2D

    Convexivity should not be important here, it's about what constitutes the shape.
    Xrayez committed Nov 26, 2020
    Configuration menu
    Copy the full SHA
    a993d3e View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    be79df2 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    97b7b06 View commit details
    Browse the repository at this point in the history
  4. Document PolyNode2D classes

    Xrayez committed Nov 26, 2020
    Configuration menu
    Copy the full SHA
    429ac7d View commit details
    Browse the repository at this point in the history

Commits on Nov 28, 2020

  1. Add editor icons for PolyNode2D classes

    No `PolyShape2D` icon is added, because it's only used as
    a base for implementing other classes, as the case with
    `PolyCollisionShape2D`.
    Xrayez committed Nov 28, 2020
    Configuration menu
    Copy the full SHA
    dad06a6 View commit details
    Browse the repository at this point in the history

Commits on Nov 29, 2020

  1. Configuration menu
    Copy the full SHA
    6836dfd View commit details
    Browse the repository at this point in the history

Commits on Nov 30, 2020

  1. Configuration menu
    Copy the full SHA
    a0e8fc3 View commit details
    Browse the repository at this point in the history

Commits on Dec 3, 2020

  1. Configuration menu
    Copy the full SHA
    f97f21f View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    100e1b7 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    f691e62 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    71fb2d4 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    26a4b95 View commit details
    Browse the repository at this point in the history

Commits on Dec 9, 2020

  1. Rename PolyNode2D tool to "Flatten Outlines"

    "Path" may be misleading because there's `Path/Path2D` nodes...
    Xrayez committed Dec 9, 2020
    Configuration menu
    Copy the full SHA
    bd0d0b4 View commit details
    Browse the repository at this point in the history
  2. Add tests for PolyNode2D

    Xrayez committed Dec 9, 2020
    Configuration menu
    Copy the full SHA
    f9540cc View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    e3a7494 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    0d57249 View commit details
    Browse the repository at this point in the history
  5. Gut: Update to 7.1.0

    Had to fix poly tests as well.
    Xrayez committed Dec 9, 2020
    Configuration menu
    Copy the full SHA
    2b58465 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    9674e51 View commit details
    Browse the repository at this point in the history