Block.cpp 450 B

1234567891011121314151617
  1. #include "common/Block.h"
  2. #include "utils/Array.h"
  3. #include "utils/ArrayList.h"
  4. static Array<ArrayList<Box, 1>, Block::MAX> collisionBoxes;
  5. void Block::init() {
  6. for(int i = 1; i < collisionBoxes.getLength(); i++) {
  7. collisionBoxes[i].add(Vector3(1.0f, 1.0f, 1.0f));
  8. }
  9. }
  10. void Block::addBoxes(Id block, List<Box>& list, const Vector3& pos) {
  11. for(const Box& box : collisionBoxes[block]) {
  12. list.add(box.offset(pos));
  13. }
  14. }