mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-05 19:11:50 +00:00
Multiple Hitboxes
This commit is contained in:
parent
d1fbaaa28b
commit
5f551d6888
4 changed files with 42 additions and 17 deletions
|
|
@ -151,6 +151,15 @@ void ContentLoader::loadBlock(Block& def, std::string name, fs::path file) {
|
|||
aabb.a = glm::vec3(boxarr->num(0), boxarr->num(1), boxarr->num(2));
|
||||
aabb.b = glm::vec3(boxarr->num(3), boxarr->num(4), boxarr->num(5));
|
||||
aabb.b += aabb.a;
|
||||
def.hitboxExplicit = true;
|
||||
} else if (def.modelBoxes.empty()) {
|
||||
def.hitboxExplicit = true;
|
||||
} else {
|
||||
def.hitbox = def.modelBoxes[0];
|
||||
for (const auto& box : def.modelBoxes) {
|
||||
def.hitbox.a = glm::min(def.hitbox.a, box.a);
|
||||
def.hitbox.b = glm::max(def.hitbox.b, box.b);
|
||||
}
|
||||
}
|
||||
|
||||
// block light emission [r, g, b] where r,g,b in range [0..15]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue