1234567891011121314151617 |
- #include "common/Block.h"
- #include "utils/Array.h"
- #include "utils/ArrayList.h"
- static Array<ArrayList<Box, 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<Box>& list, const Vector3& pos) {
- for(const Box& box : collisionBoxes[block]) {
- list.add(box.offset(pos));
- }
- }
|