1234567891011121314151617 |
- #include "common/Block.h"
- #include "utils/Array.h"
- #include "utils/ArrayList.h"
- static Array<ArrayList<CollisionBox, 1>, Block::MAX> collisionBoxes;
- void Block::init() {
- for(int i = 1; i < collisionBoxes.getLength(); i++) {
- collisionBoxes[i].add(Vector3(1.0f, 1.0f, 1.0f));
- }
- }
- void Block::addBoxes(Id block, List<CollisionBox>& list, const Vector3& pos) {
- for(const CollisionBox& box : collisionBoxes[block]) {
- list.add(box.offset(pos));
- }
- }
|