mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 18:41:51 +00:00
add ModelBatch.translate(...), .rotate(...), .scale(...)
This commit is contained in:
parent
8e26ead76c
commit
a9640fff36
3 changed files with 25 additions and 6 deletions
|
|
@ -116,6 +116,18 @@ static glm::mat4 extract_rotation(glm::mat4 matrix) {
|
|||
return glm::toMat3(rotation);
|
||||
}
|
||||
|
||||
void ModelBatch::translate(glm::vec3 vec) {
|
||||
pushMatrix(glm::translate(glm::mat4(1.0f), vec));
|
||||
}
|
||||
|
||||
void ModelBatch::rotate(glm::vec3 axis, float angle) {
|
||||
pushMatrix(glm::rotate(glm::mat4(1.0f), angle, axis));
|
||||
}
|
||||
|
||||
void ModelBatch::scale(glm::vec3 vec) {
|
||||
pushMatrix(glm::scale(glm::mat4(1.0f), vec));
|
||||
}
|
||||
|
||||
void ModelBatch::pushMatrix(glm::mat4 matrix) {
|
||||
matrices.push_back(combined);
|
||||
combined = combined * matrix;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue