mirror of
https://github.com/Linloir/SceneEditor.git
synced 2025-12-16 23:18:12 +08:00
[CORE][ADD] Renderable add API
- getters - position - rotation - scaleVal - normal - disposeLight
This commit is contained in:
parent
cad41559b1
commit
c1d8d8ed42
@ -59,6 +59,13 @@ void Renderable::makeLight() {
|
||||
_light = new ScopedLight(glm::vec3(0.0f));
|
||||
}
|
||||
|
||||
void Renderable::disposeLight() {
|
||||
if (_light != nullptr) {
|
||||
delete _light;
|
||||
_light = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
void Renderable::render(ShaderProgram shader) {
|
||||
// Check if initialized
|
||||
if (_model == nullptr) {
|
||||
|
||||
@ -32,6 +32,10 @@ public:
|
||||
~Renderable();
|
||||
|
||||
public:
|
||||
glm::vec3 position() const { return _position; }
|
||||
glm::mat4 rotation() const { return _rotation; }
|
||||
glm::vec3 scaleVal() const { return _scale; }
|
||||
|
||||
void setModel(Model* model);
|
||||
void move(glm::vec3 deltaVec);
|
||||
void setPosition(glm::vec3 position);
|
||||
@ -44,6 +48,7 @@ public:
|
||||
ScopedLight* originalLight() const; // pass out the light object to scene manager to set light attributes
|
||||
bool hasLight() const { return _light != nullptr; }
|
||||
void makeLight(); // create a light source in the object
|
||||
void disposeLight(); // remove the light source in the object
|
||||
|
||||
const Boundary& boundary() const { return _boundary; }
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user