| 119 | } |
| 120 | |
| 121 | void BspTree::loadBspTree(const ZenLoad::zCBspTreeData& data) |
| 122 | { |
| 123 | using namespace ZenLoad; |
| 124 | |
| 125 | m_Nodes.reserve(data.nodes.size()); |
| 126 | |
| 127 | // Extract the bsp-nodes |
| 128 | for (const zCBspNode& s : data.nodes) |
| 129 | { |
| 130 | m_Nodes.emplace_back(); |
| 131 | |
| 132 | BspNode& n = m_Nodes.back(); |
| 133 | n.front = s.front != zCBspNode::INVALID_NODE ? (int)s.front : -1; |
| 134 | n.back = s.back != zCBspNode::INVALID_NODE ? (int)s.back : -1; |
| 135 | n.parent = s.parent != zCBspNode::INVALID_NODE ? (int)s.parent : -1; |
| 136 | |
| 137 | n.bbox.min = s.bbox3dMin.v; |
| 138 | n.bbox.max = s.bbox3dMax.v; |
| 139 | |
| 140 | n.plane = s.plane.v; |
| 141 | } |
| 142 | } |
| 143 | |
| 144 | void BspTree::debugDraw() |
| 145 | { |