work on object system
This commit is contained in:
30
src/include/utils/Objects/Body.h
Normal file
30
src/include/utils/Objects/Body.h
Normal file
@@ -0,0 +1,30 @@
|
||||
#ifndef BODY_H
|
||||
#define BODY_H
|
||||
|
||||
#include "pch.hpp"
|
||||
|
||||
#include "extratools.h"
|
||||
|
||||
#include "Object.h"
|
||||
|
||||
namespace Archimedes {
|
||||
|
||||
class Body : public Object {
|
||||
|
||||
public:
|
||||
Body(RenderTarget rt, glm::mat4 t = glm::mat4(1.0f)) : mesh(rt), Object(t) {};
|
||||
|
||||
Body(VertexBuffer vb, IndexArray ia, VertexLayout vl, Shader s, glm::mat4 t = glm::mat4(1.0f))
|
||||
: mesh(vb, ia, vl, s), Object(t) {}
|
||||
|
||||
Body() {}
|
||||
|
||||
~Body() {};
|
||||
|
||||
private:
|
||||
|
||||
RenderTarget mesh;
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
||||
25
src/include/utils/Objects/Camera.h
Normal file
25
src/include/utils/Objects/Camera.h
Normal file
@@ -0,0 +1,25 @@
|
||||
#ifndef CAMERA_H
|
||||
#define CAMERA_H
|
||||
|
||||
#include "pch.hpp"
|
||||
|
||||
#include "extratools.h"
|
||||
|
||||
#include "Object.h"
|
||||
|
||||
namespace Archimedes {
|
||||
|
||||
class Camera : public Object {
|
||||
|
||||
public:
|
||||
Camera() {}
|
||||
|
||||
Camera(glm::mat4 t)
|
||||
: Object(t) {}
|
||||
|
||||
~Camera() {};
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -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;
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user