Grant-Nelson / ThreeDart

3D graphical rendering tool for websites written in Dart.
Other
16 stars 11 forks source link

Octree shape #133

Open Grant-Nelson opened 4 years ago

Grant-Nelson commented 4 years ago

Shape Octree Backing, Issue #44

Feature/Improvement

The octree should be a separate data structure so that it can be reused for many different uses. When starting this issue it should be broken up into as many sub-issues as needed and put in a project.

Scene

Currently all entities are stored in a hierarchy tree. It will continue being stored in the hierarchy tree so that it may be moved and updated correctly. However when rendering it should use AABBs in a octree which culls entities which aren't visible. This could also be used to help with future collision detection and physic add-ons.

Maybe this shouldn't be a requirement while running entities but some kind of add-on which can be set to entities so they could add to it and update as they need. Another option is to create one entity type which any children added to it are put into an octree. May need to experiment and try out what works best or do both.

Shape

Currently the vertices and elements are stored in lists. At some point the lists will be replaced by octrees. This will provide faster shape creation, faster collision detection, and new functionality, like shape union, intersection, and clipping.

Implementation

WIP

Review and Testing

TBD