mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 18:41:51 +00:00
add new block.get_AXIS functions overloads & add rotation support to base:falling_block
This commit is contained in:
parent
9a190acb8b
commit
ab5a62c3aa
9 changed files with 72 additions and 75 deletions
|
|
@ -237,9 +237,9 @@ void BlocksRenderer::blockAABB(
|
|||
if (block->rotatable) {
|
||||
auto& rotations = block->rotations;
|
||||
auto& orient = rotations.variants[rotation];
|
||||
X = orient.axisX;
|
||||
Y = orient.axisY;
|
||||
Z = orient.axisZ;
|
||||
X = orient.axes[0];
|
||||
Y = orient.axes[1];
|
||||
Z = orient.axes[2];
|
||||
orient.transform(hitbox);
|
||||
}
|
||||
coord -= glm::vec3(0.5f) - hitbox.center();
|
||||
|
|
@ -272,14 +272,13 @@ void BlocksRenderer::blockCustomModel(
|
|||
glm::vec3 X(1, 0, 0);
|
||||
glm::vec3 Y(0, 1, 0);
|
||||
glm::vec3 Z(0, 0, 1);
|
||||
CoordSystem orient(X,Y,Z);
|
||||
glm::vec3 coord(icoord);
|
||||
if (block->rotatable) {
|
||||
auto& rotations = block->rotations;
|
||||
orient = rotations.variants[rotation];
|
||||
X = orient.axisX;
|
||||
Y = orient.axisY;
|
||||
Z = orient.axisZ;
|
||||
CoordSystem orient = rotations.variants[rotation];
|
||||
X = orient.axes[0];
|
||||
Y = orient.axes[1];
|
||||
Z = orient.axes[2];
|
||||
}
|
||||
|
||||
const auto& model = cache.getModel(block->rt.id);
|
||||
|
|
@ -333,9 +332,9 @@ void BlocksRenderer::blockCube(
|
|||
if (block.rotatable) {
|
||||
auto& rotations = block.rotations;
|
||||
auto& orient = rotations.variants[states.rotation];
|
||||
X = orient.axisX;
|
||||
Y = orient.axisY;
|
||||
Z = orient.axisZ;
|
||||
X = orient.axes[0];
|
||||
Y = orient.axes[1];
|
||||
Z = orient.axes[2];
|
||||
}
|
||||
|
||||
if (ao) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue