mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-09 21:11:50 +00:00
Block rotation profiles
This commit is contained in:
parent
9ded9b63f8
commit
8bc8eb14bd
6 changed files with 53 additions and 16 deletions
|
|
@ -2,6 +2,7 @@
|
|||
#define VOXELS_BLOCK_H_
|
||||
|
||||
#include <string>
|
||||
#include <glm/glm.hpp>
|
||||
|
||||
#include "../maths/aabb.h"
|
||||
#include "../typedefs.h"
|
||||
|
|
@ -15,6 +16,23 @@
|
|||
|
||||
#define BLOCK_AABB_GRID 16
|
||||
|
||||
struct CoordSystem {
|
||||
glm::ivec3 axisX;
|
||||
glm::ivec3 axisY;
|
||||
glm::ivec3 axisZ;
|
||||
// Grid 3d position fix offset (for negative vectors)
|
||||
glm::ivec3 fix;
|
||||
};
|
||||
|
||||
struct BlockRotProfile {
|
||||
CoordSystem variants[16];
|
||||
|
||||
/* Wood logs, pillars, pipes
|
||||
3 orientations supported
|
||||
*/
|
||||
static BlockRotProfile PIPE;
|
||||
};
|
||||
|
||||
enum class BlockModel {
|
||||
none, // invisible
|
||||
block, // default shape
|
||||
|
|
@ -38,6 +56,7 @@ public:
|
|||
bool breakable = true;
|
||||
bool rotatable = false;
|
||||
AABB hitbox;
|
||||
BlockRotProfile rotations;
|
||||
|
||||
struct {
|
||||
blockid_t id;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue