mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-11-20 09:29:44 +00:00
cleanup a bit
This commit is contained in:
parent
ae082abaa2
commit
dbeeef90a8
3 changed files with 95 additions and 81 deletions
|
|
@ -82,6 +82,69 @@ inline glm::vec4 do_tint(float value) {
|
|||
return {value, value, value, 1.0f};
|
||||
}
|
||||
|
||||
void MainBatch::quad(
|
||||
const glm::vec3& pos,
|
||||
const glm::vec3& right,
|
||||
const glm::vec3& up,
|
||||
const glm::vec3& normal,
|
||||
const glm::vec2& size,
|
||||
const glm::vec4& light,
|
||||
const glm::vec4& tint,
|
||||
const UVRegion& subregion,
|
||||
float emission
|
||||
) {
|
||||
prepare(6);
|
||||
vertex(
|
||||
pos - right * size.x * 0.5f - up * size.y * 0.5f,
|
||||
{subregion.u1, subregion.v1},
|
||||
light,
|
||||
tint,
|
||||
normal,
|
||||
emission
|
||||
);
|
||||
vertex(
|
||||
pos + right * size.x * 0.5f - up * size.y * 0.5f,
|
||||
{subregion.u2, subregion.v1},
|
||||
light,
|
||||
tint,
|
||||
normal,
|
||||
emission
|
||||
);
|
||||
vertex(
|
||||
pos + right * size.x * 0.5f + up * size.y * 0.5f,
|
||||
{subregion.u2, subregion.v2},
|
||||
light,
|
||||
tint,
|
||||
normal,
|
||||
emission
|
||||
);
|
||||
|
||||
vertex(
|
||||
pos - right * size.x * 0.5f - up * size.y * 0.5f,
|
||||
{subregion.u1, subregion.v1},
|
||||
light,
|
||||
tint,
|
||||
normal,
|
||||
emission
|
||||
);
|
||||
vertex(
|
||||
pos + right * size.x * 0.5f + up * size.y * 0.5f,
|
||||
{subregion.u2, subregion.v2},
|
||||
light,
|
||||
tint,
|
||||
normal,
|
||||
emission
|
||||
);
|
||||
vertex(
|
||||
pos - right * size.x * 0.5f + up * size.y * 0.5f,
|
||||
{subregion.u1, subregion.v2},
|
||||
light,
|
||||
tint,
|
||||
normal,
|
||||
emission
|
||||
);
|
||||
}
|
||||
|
||||
void MainBatch::cube(
|
||||
const glm::vec3& coord,
|
||||
const glm::vec3& size,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue