First render.
This commit is contained in:
@@ -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();
|
||||
};
|
||||
}
|
@@ -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();
|
||||
|
@@ -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
|
||||
|
Reference in New Issue
Block a user