diff options
| author | daoge_cmd <3523206925@qq.com> | 2026-03-01 12:16:08 +0800 |
|---|---|---|
| committer | daoge_cmd <3523206925@qq.com> | 2026-03-01 12:16:08 +0800 |
| commit | b691c43c44ff180d10e7d4a9afc83b98551ff586 (patch) | |
| tree | 3e9849222cbc6ba49f2f1fc6e5fe7179632c7390 /Minecraft.World/BoundingBox.h | |
| parent | def8cb415354ac390b7e89052a50605285f1aca9 (diff) | |
Initial commit
Diffstat (limited to 'Minecraft.World/BoundingBox.h')
| -rw-r--r-- | Minecraft.World/BoundingBox.h | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/Minecraft.World/BoundingBox.h b/Minecraft.World/BoundingBox.h new file mode 100644 index 00000000..23abd66d --- /dev/null +++ b/Minecraft.World/BoundingBox.h @@ -0,0 +1,31 @@ +#pragma once + +class BoundingBox +{ +public: + int x0, y0, z0, x1, y1, z1; + + BoundingBox(); + static BoundingBox *getUnknownBox(); + static BoundingBox *orientBox(int footX, int footY, int footZ, int offX, int offY, int offZ, int width, int height, int depth, int orientation); + BoundingBox(BoundingBox *other); + BoundingBox(int x0, int y0, int z0, int x1, int y1, int z1); + BoundingBox(int x0, int z0, int x1, int z1); + bool intersects(BoundingBox *other); + bool intersects(int x0, int y0, int z0, int x1, int y1, int z1); + + bool intersects(int x0, int z0, int x1, int z1); + void expand(BoundingBox *other); + BoundingBox *getIntersection(BoundingBox *other); + void move(int dx, int dy, int dz); + bool isInside(int x, int y, int z); + + int getXSpan(); + int getYSpan(); + int getZSpan(); + int getXCenter(); + int getYCenter(); + int getZCenter(); + + wstring toString(); +};
\ No newline at end of file |
