question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Feature Request] Binary Space Partition (BSP) structure

See original GitHub issue

I am creating this issue so people can contribute to this idea. This is a must-have feature for many 3d games.

BSP allows developers to work with just a subset of geometries at a given moment, it can be used to improve rendering and/or check collisions.

Draft interface:

public interface BSP {
    void insert(Object userObject, BoundingBox bounds);
    void insert(Object userObject, Sphere sphere);
    void insert(Object userObject, Triangle triangle);
    void insert(Object userObject, Vector3 point);
    /...

    void remove(Object userObject);

    // methods to query geometries
    Set<Object> queryNear(Frustum frustum);
    Set<Object> queryNear(Ray ray);
    Set<Object> queryNear(BoundingBox aabb);
}

What do you think?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

3reactions
mgsx-devcommented, Oct 14, 2020

I’ll surely use it in my 3D projects (i already need it actually), so I can help to maintain it. @yuripourre yes, let create an initial PR with minimum features (marking it as draft) then we could work on it to refine the design. Since Nathan is OK with it, i’m closing the request now.

1reaction
NathanSweetcommented, Oct 14, 2020

I’m open to adding it, though I probably won’t maintain it personally unless I can find a use for it in my projects. That means @yuripourre or others who do use it would need to maintain it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Binary Space Partitioning - GeeksforGeeks
Binary Space Partitioning is implemented for recursively subdividing a space into two convex sets by using hyperplanes as partitions.
Read more >
Geometry – BSP Tree Tutorial - Apache Commons
Binary space partitioning (BSP) trees are a geometric data structure used throughout Commons Geometry. They can be used for many purposes ...
Read more >
A Tutorial on Binary Space Partitioning Trees part of EG ...
The Binary Space Partitioning BSP tree algorithm was initially developed as an efficient method for ordering a set of polygons in order to...
Read more >
Space partition tree. “Smart data structures and dumb code…
Binary Space Partition tree (BSP Tree) is a tree where each node recursively divides space in two. And a node can contain an...
Read more >
How Much of a Genius-Level Move Was Using Binary Space ...
The following diagram shows the construction and traversal of a BSP tree representing a simple 2D scene. In 2D, the partitioning planes are ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found