mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 18:41:51 +00:00
fix block solidity property
This commit is contained in:
parent
325f0b1f02
commit
5fdff1f8f6
3 changed files with 18 additions and 8 deletions
|
|
@ -28,13 +28,17 @@ std::unique_ptr<Content> ContentBuilder::build() {
|
|||
// Generating runtime info
|
||||
def.rt.id = blockDefsIndices.size();
|
||||
def.rt.emissive = *reinterpret_cast<uint32_t*>(def.emission);
|
||||
def.rt.solid = def.defaults.model.type == BlockModelType::BLOCK; // FIXME
|
||||
def.rt.extended = def.size.x > 1 || def.size.y > 1 || def.size.z > 1;
|
||||
|
||||
const float EPSILON = 0.01f;
|
||||
if (def.rt.extended && glm::i8vec3(def.hitboxes[0].size() + EPSILON) == def.size) {
|
||||
def.rt.solid = true;
|
||||
// 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;
|
||||
}
|
||||
}
|
||||
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;
|
||||
|
||||
if (def.rotatable) {
|
||||
for (uint i = 0; i < BlockRotProfile::MAX_COUNT; i++) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue