mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
upright_sprite: Fix texture position for players Fixes #6471
This commit is contained in:
parent
396daf1be1
commit
875972ffa6
1 changed files with 10 additions and 0 deletions
|
@ -835,6 +835,11 @@ void GenericCAO::addToScene(scene::ISceneManager *smgr,
|
||||||
video::S3DVertex( dx, dy, 0, 0,0,0, c, 0,0),
|
video::S3DVertex( dx, dy, 0, 0,0,0, c, 0,0),
|
||||||
video::S3DVertex(-dx, dy, 0, 0,0,0, c, 1,0),
|
video::S3DVertex(-dx, dy, 0, 0,0,0, c, 1,0),
|
||||||
};
|
};
|
||||||
|
if (m_is_player) {
|
||||||
|
// Move minimal Y position to 0 (feet position)
|
||||||
|
for (video::S3DVertex &vertex : vertices)
|
||||||
|
vertex.Pos.Y += dy;
|
||||||
|
}
|
||||||
u16 indices[] = {0,1,2,2,3,0};
|
u16 indices[] = {0,1,2,2,3,0};
|
||||||
buf->append(vertices, 4, indices, 6);
|
buf->append(vertices, 4, indices, 6);
|
||||||
// Set material
|
// Set material
|
||||||
|
@ -854,6 +859,11 @@ void GenericCAO::addToScene(scene::ISceneManager *smgr,
|
||||||
video::S3DVertex(-dx, dy, 0, 0,0,0, c, 0,0),
|
video::S3DVertex(-dx, dy, 0, 0,0,0, c, 0,0),
|
||||||
video::S3DVertex( dx, dy, 0, 0,0,0, c, 1,0),
|
video::S3DVertex( dx, dy, 0, 0,0,0, c, 1,0),
|
||||||
};
|
};
|
||||||
|
if (m_is_player) {
|
||||||
|
// Move minimal Y position to 0 (feet position)
|
||||||
|
for (video::S3DVertex &vertex : vertices)
|
||||||
|
vertex.Pos.Y += dy;
|
||||||
|
}
|
||||||
u16 indices[] = {0,1,2,2,3,0};
|
u16 indices[] = {0,1,2,2,3,0};
|
||||||
buf->append(vertices, 4, indices, 6);
|
buf->append(vertices, 4, indices, 6);
|
||||||
// Set material
|
// Set material
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue