12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667 |
- #include "client/rendering/Renderer.h"
- Renderer::Renderer(Shader& shader, MatrixStack& stack) : shader(shader), stack(stack) {
- }
- void Renderer::pop() {
- stack.pop();
- }
- void Renderer::push() {
- stack.push();
- }
- Renderer& Renderer::update() {
- shader.setMatrix("model", stack.get().getValues());
- return *this;
- }
- Renderer& Renderer::scale(float sx, float sy, float sz) {
- stack.get().scale(sx, sy, sz);
- return *this;
- }
- Renderer& Renderer::scale(float s) {
- stack.get().scale(s);
- return *this;
- }
- Renderer& Renderer::translate(float tx, float ty, float tz) {
- stack.get().translate(tx, ty, tz);
- return *this;
- }
- Renderer& Renderer::translateX(float tx) {
- stack.get().translateX(tx);
- return *this;
- }
- Renderer& Renderer::translateY(float ty) {
- stack.get().translateY(ty);
- return *this;
- }
- Renderer& Renderer::translateZ(float tz) {
- stack.get().translateZ(tz);
- return *this;
- }
- Renderer& Renderer::translateTo(float tx, float ty, float tz) {
- stack.get().translateTo(tx, ty, tz);
- return *this;
- }
- Renderer& Renderer::rotateX(float degrees) {
- stack.get().rotateX(degrees);
- return *this;
- }
- Renderer& Renderer::rotateY(float degrees) {
- stack.get().rotateY(degrees);
- return *this;
- }
- Renderer& Renderer::rotateZ(float degrees) {
- stack.get().rotateZ(degrees);
- return *this;
- }
|