Fix #160 with suggestions from @A-lex-Ra

This commit is contained in:
InfiniteCoder
2024-02-24 17:09:11 +03:00
parent 7ee0c672f0
commit 3edf065550
7 changed files with 63 additions and 82 deletions
+3 -8
View File
@@ -82,16 +82,11 @@ Content* ContentBuilder::build() {
def->rt.solid = def->model == BlockModel::block;
if (def->rotatable) {
const AABB& hitbox = def->hitbox;
for (uint i = 0; i < BlockRotProfile::MAX_COUNT; i++) {
AABB aabb = hitbox;
def->rotations.variants[i].transform(aabb);
def->rt.hitboxes[i] = aabb;
def->rt.modelBoxes[i].reserve(def->modelBoxes.size());
for (AABB aabb : def->modelBoxes) {
def->rt.hitboxes[i].reserve(def->hitboxes.size());
for (AABB aabb : def->hitboxes) {
def->rotations.variants[i].transform(aabb);
def->rt.modelBoxes[i].push_back(aabb);
def->rt.hitboxes[i].push_back(aabb);
}
}
}