First render.

This commit is contained in:
2023-11-17 00:02:04 -06:00
parent 55f629c7b5
commit 490da9d0c1
43 changed files with 1039 additions and 67 deletions

View File

@@ -49,6 +49,20 @@ namespace Dawn {
return component;
}
/**
* Returns a list of components that match the given type.
*
* @return List of components matching the type.
*/
template<class T>
std::shared_ptr<T> getComponent() {
for(auto component : this->components) {
auto cast = std::dynamic_pointer_cast<T>(component);
if(cast) return cast;
}
return nullptr;
}
virtual ~SceneItemComponents();
};
}

View File

@@ -84,6 +84,10 @@ glm::mat4 SceneItemTransform::getLocalTransform() {
return this->transformLocal;
}
glm::mat4 SceneItemTransform::getWorldTransform() {
return this->transformWorld;
}
void SceneItemTransform::setWorldTransform(const glm::mat4 transform) {
this->transformWorld = transform;
this->updateLocalTransformFromWorldTransform();

View File

@@ -68,6 +68,13 @@ namespace Dawn {
* @return Local transform of this item.
*/
glm::mat4 getLocalTransform();
/**
* Returns the world transform of this item (relative to scene root).
*
* @return World transform of this item.
*/
glm::mat4 getWorldTransform();
/**
* Sets the transform of this item within world space (relative to scene