mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-06 19:41:51 +00:00
refactor a bit
This commit is contained in:
parent
5fdff1f8f6
commit
29021d1178
6 changed files with 14 additions and 6 deletions
|
|
@ -29,13 +29,15 @@ std::unique_ptr<Content> ContentBuilder::build() {
|
|||
def.rt.id = blockDefsIndices.size();
|
||||
def.rt.emissive = *reinterpret_cast<uint32_t*>(def.emission);
|
||||
|
||||
// TODO: refactor
|
||||
def.defaults.rt.solid = def.defaults.model.type == BlockModelType::BLOCK;
|
||||
if (def.variants) {
|
||||
for (auto& variant : def.variants->variants) {
|
||||
variant.rt.solid = variant.model.type == BlockModelType::BLOCK;
|
||||
}
|
||||
def.defaults = def.variants->variants.at(0);
|
||||
} else {
|
||||
def.defaults.rt.solid = def.defaults.model.type == BlockModelType::BLOCK;
|
||||
}
|
||||
|
||||
const float EPSILON = 0.01f;
|
||||
def.rt.solid = glm::i8vec3(def.hitboxes[0].size() + EPSILON) == def.size;
|
||||
def.rt.extended = def.size.x > 1 || def.size.y > 1 || def.size.z > 1;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue