work on object system

This commit is contained in:
2026-02-17 14:09:20 -06:00
parent e9f1f49416
commit da1292d9e5
8 changed files with 173 additions and 77 deletions

View File

@@ -12,24 +12,25 @@ namespace Archimedes {
class Object {
public:
Object(RenderTarget rt) : mesh(rt) {};
Object(VertexBuffer vb, IndexArray ia, VertexLayout vl, Shader s, glm::mat4 t)
: mesh(vb, ia, vl, s), worldTransform(t) {}
Object() {};
Object() {}
Object(glm::mat4 t)
: worldTransform(t) {}
~Object() {};
///scales an object absolutely
void scaleTo() {}
void scaleRel() {}
//void scaleTo() {}
void scaleRel(float scale) { worldTransform = glm::scale(worldTransform, glm::vec3(scale)); }
void moveTo() {}
void moveRel() {}
//void moveTo(glm::vec3 pos) { worldTransform = glm::translate(worldTransform, pos); }
void moveRel(glm::vec3 pos) { worldTransform = glm::translate(worldTransform, pos); }
void rotateTo() {}
void rotateRel() {}
//void rotateTo() {}
void rotateRel(float radians, glm::vec3 axis) { worldTransform = glm::rotate(worldTransform, radians, axis); }
const glm::mat4& getTransform() { return worldTransform; }
private:
@@ -38,8 +39,6 @@ namespace Archimedes {
glm::mat4 worldTransform = glm::mat4(1.0f);
RenderTarget mesh;
};
}