optoctreeparser
Loading...
Searching...
No Matches
base_struct.hpp
Go to the documentation of this file.
1
8#pragma once
9
10#include <cstdint>
11#include <vector>
12
13namespace optoctreeparser {
14
15using byte = uint8_t;
16using OptocTreeView = std::vector<byte>;
17
18struct OptocTree; // Forward declaration
19struct OptocNode; // Forward declaration
20struct OptocRoot; // Forward declaration
21struct OptocPatchRoot; // Forward declaration
22struct OptocPatchBatch; // Forward declaration
23struct OptocPatchTree; // Forward declaration
24
25
32 int32_t version;
33 std::vector<OptocPatchBatch> batches;
34
35 bool operator==(const OptocPatchRoot& other) const = default;
36};
37
38
45 int16_t x_position;
46 int16_t y_position;
47 int16_t z_position;
49 std::vector<OptocPatchTree> octrees;
50
51 bool operator==(const OptocPatchBatch& other) const = default;
52};
53
54
62 uint16_t node_count;
63 std::vector<OptocNode> nodes;
64
65 bool operator==(const OptocPatchTree& other) const = default;
66};
67
68
72struct OptocRoot {
73 int32_t version;
74 std::vector<OptocTree> trees;
75
76 bool operator==(const OptocRoot& other) const = default;
77};
78
79
83struct OptocNode {
89
90 bool operator==(const OptocNode& other) const = default;
91};
92
93
97struct OptocTree {
98 uint16_t node_count;
99 std::vector<OptocNode> nodes;
100
101 bool operator==(const OptocTree& other) const = default;
102};
103
104} // namespace optoctreeparser
Basic structures for storing optoctree data.
Definition base_struct.hpp:13
std::vector< byte > OptocTreeView
Definition base_struct.hpp:16
uint8_t byte
Definition base_struct.hpp:15
One Optocnode. The smallest unit of information in an Optoctree.
Definition base_struct.hpp:83
bool operator==(const OptocNode &other) const =default
byte signed_distance
Definition base_struct.hpp:85
uint16_t first_child_node
Definition base_struct.hpp:87
byte material_type
Type of material. For example, 0 - empty, 37 - sand.
Definition base_struct.hpp:84
Patched batch of optoctreepatch file.
Definition base_struct.hpp:44
int16_t z_position
Z position of batch.
Definition base_struct.hpp:47
bool operator==(const OptocPatchBatch &other) const =default
int16_t y_position
Y position of batch.
Definition base_struct.hpp:46
int16_t x_position
X position of batch.
Definition base_struct.hpp:45
std::vector< OptocPatchTree > octrees
Octrees.
Definition base_struct.hpp:49
byte octree_count
Count of octrees.
Definition base_struct.hpp:48
Root of optoctreepatch file.
Definition base_struct.hpp:31
int32_t version
version of optoctreepatch file
Definition base_struct.hpp:32
bool operator==(const OptocPatchRoot &other) const =default
std::vector< OptocPatchBatch > batches
Patched batches.
Definition base_struct.hpp:33
Patched tree of optoctreepatch file.
Definition base_struct.hpp:60
byte octree_number
Number of octree.
Definition base_struct.hpp:61
uint16_t node_count
Count of nodes.
Definition base_struct.hpp:62
bool operator==(const OptocPatchTree &other) const =default
std::vector< OptocNode > nodes
Nodes.
Definition base_struct.hpp:63
Root of optoctree file.
Definition base_struct.hpp:72
bool operator==(const OptocRoot &other) const =default
int32_t version
version of optoctree file
Definition base_struct.hpp:73
std::vector< OptocTree > trees
Optoctrees.
Definition base_struct.hpp:74
One OctoTree.
Definition base_struct.hpp:97
std::vector< OptocNode > nodes
Nodes.
Definition base_struct.hpp:99
uint16_t node_count
Count of nodes.
Definition base_struct.hpp:98
bool operator==(const OptocTree &other) const =default