mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/4jcraft.git
synced 2026-07-18 13:38:28 +00:00
refactor: modernize AABB class
This commit is contained in:
@@ -147,8 +147,9 @@ void Throwable::tick() {
|
||||
|
||||
if (!level->isClientSide) {
|
||||
std::shared_ptr<Entity> hitEntity = nullptr;
|
||||
std::vector<std::shared_ptr<Entity> >* objects = level->getEntities(
|
||||
shared_from_this(), bb->expand(xd, yd, zd)->grow(1, 1, 1));
|
||||
AABB grown = bb->expand(xd, yd, zd).grow(1, 1, 1);
|
||||
std::vector<std::shared_ptr<Entity> >* objects =
|
||||
level->getEntities(shared_from_this(), &grown);
|
||||
double nearest = 0;
|
||||
std::shared_ptr<LivingEntity> owner = getOwner();
|
||||
for (int i = 0; i < objects->size(); i++) {
|
||||
@@ -156,8 +157,8 @@ void Throwable::tick() {
|
||||
if (!e->isPickable() || (e == owner && flightTime < 5)) continue;
|
||||
|
||||
float rr = 0.3f;
|
||||
AABB* bb = e->bb->grow(rr, rr, rr);
|
||||
HitResult* p = bb->clip(&from, &to);
|
||||
AABB bb = e->bb->grow(rr, rr, rr);
|
||||
HitResult* p = bb.clip(from, to);
|
||||
if (p != NULL) {
|
||||
double dd = from.distanceTo(p->pos);
|
||||
delete p;
|
||||
|
||||
Reference in New Issue
Block a user