You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
60 lines
2.1 KiB
60 lines
2.1 KiB
4 weeks ago
|
#pragma once
|
||
|
|
||
|
#include <container/stl_alias.hpp>
|
||
|
#include <container/hive.hpp>
|
||
|
#include <macros.h>
|
||
|
|
||
|
#include <internal_structs.hpp>
|
||
|
|
||
|
// ======================================================================
|
||
|
// Blobtree
|
||
|
// ======================================================================
|
||
|
|
||
|
// TODO: allows for holding an global transformation, and apply it to all primitives
|
||
|
EXTERN_C struct BS_API blobtree_t {
|
||
|
using node_type = internal::runtime_node_t;
|
||
|
|
||
|
public:
|
||
|
hive_mp<node_type> nodes{};
|
||
|
using iterator = typename hive_mp<node_type>::iterator;
|
||
|
|
||
|
public:
|
||
|
iterator push_primitive_node(const primitive* primitive_ptr);
|
||
|
iterator push_operation_node(internal::eNodeOperation op, iterator lhs, iterator rhs);
|
||
|
void pop_node(iterator node);
|
||
|
};
|
||
|
|
||
|
// ======================================================================
|
||
|
// Baked Blobtree
|
||
|
// ======================================================================
|
||
|
|
||
|
template <typename T>
|
||
|
struct object_with_index_mapping {
|
||
|
T* object_ptr{nullptr};
|
||
|
stl_vector_mp<uint32_t> index_mapping{};
|
||
|
};
|
||
|
|
||
|
EXTERN_C struct BS_API baked_blobtree_t {
|
||
|
using node_type = internal::node_t;
|
||
|
|
||
|
public:
|
||
|
stl_vector_mp<node_type> nodes{};
|
||
|
stl_vector_mp<uint32_t> leaf_indices{};
|
||
|
stl_vector_mp<object_with_index_mapping<primitive>> primitives{};
|
||
|
stl_vector_mp<object_with_index_mapping<subface>> subfaces{};
|
||
|
|
||
|
public:
|
||
|
baked_blobtree_t() = default;
|
||
|
baked_blobtree_t(const baked_blobtree_t&) = default;
|
||
|
baked_blobtree_t(baked_blobtree_t&&) = default;
|
||
|
baked_blobtree_t& operator=(const baked_blobtree_t&) = default;
|
||
|
baked_blobtree_t& operator=(baked_blobtree_t&&) = default;
|
||
|
~baked_blobtree_t() = default;
|
||
|
|
||
|
baked_blobtree_t(const blobtree_t&) noexcept;
|
||
|
|
||
|
size_t get_node_count() const noexcept;
|
||
|
size_t get_primitive_count() const noexcept;
|
||
|
internal::node_t& get_node(uint32_t index) noexcept;
|
||
|
primitive* get_primitive(uint32_t index) noexcept;
|
||
|
};
|