mirror of
https://github.com/PixelGuys/Cubyz.git
synced 2025-09-08 03:29:48 -04:00
Rotate item drops around their center.
This commit is contained in:
parent
3a6f55b8e7
commit
ce17aee034
@ -675,10 +675,11 @@ pub const ItemDropRenderer = struct { // MARK: ItemDropRenderer
|
||||
Vec3f{light >> 16 & 255, light >> 8 & 255, light & 255}/@as(Vec3f, @splat(255))
|
||||
)));
|
||||
pos -= playerPos;
|
||||
var modelMatrix = Mat4f.translation(@floatCast(pos));
|
||||
var modelMatrix = Mat4f.translation(@floatCast(pos + Vec3d{0.5, 0.5, 0.5}));
|
||||
modelMatrix = modelMatrix.mul(Mat4f.rotationX(-rot[0]));
|
||||
modelMatrix = modelMatrix.mul(Mat4f.rotationY(-rot[1]));
|
||||
modelMatrix = modelMatrix.mul(Mat4f.rotationZ(-rot[2]));
|
||||
modelMatrix = modelMatrix.mul(Mat4f.translation(.{-0.5, -0.5, -0.5}));
|
||||
c.glUniformMatrix4fv(itemUniforms.modelMatrix, 1, c.GL_TRUE, @ptrCast(&modelMatrix));
|
||||
|
||||
const model = getModel(item);
|
||||
|
Loading…
x
Reference in New Issue
Block a user