WIP: Feature/#415 use resource pointer directly as component
We use ResourcePointers directly instead of through Handle
Components which only wrap the resource pointer.
Please take a close look. I needed to declare the copy constructor and operator of Component
from delete
to default
. That should in general be no problem, since we store the components within the entities in unique_ptr
what makes them non-copyable.
Merge request reports
Activity
added 1 commit
- 7118faec - Removed type traits for resource pointer.
By Ali Can Demiralp on 2018-05-25T14:05:37 (imported from GitLab)
mentioned in merge request !130 (merged)
By Jonathan Ehret on 2018-05-28T08:32:16 (imported from GitLab)
- Resolved by Jan Delember
In !130 (merged) MeshHandles get a property wireframe, to render them as wireframes.
Copy of that discussion, since it belongs here:
Since we removed these handles in !129 (closed) maybe add a renderable component? Something were also the decision between different shaders etc. would go?
So add a
RenderComponent
?By Jonathan Ehret on 2018-05-28T15:32:15 (imported from GitLab)
- Resolved by Jan Delember
Blocked by #445 in !133 (merged)
By Jonathan Ehret on 2018-06-13T07:20:43 (imported from GitLab)
Edited by Jan Delember
To me, this change does not feel right as it is now. The problem is, that now we can have
Component
s without anEntity
. TheResourcePointer
is meant to be moved around a lot, while theComponent
is meant to be assigned to a certain entity. These are very different concepts that cannot be easily unified in one class.We might do a compromise and have a new
ResourceComponent
class that is aComponent
but holds a Resource pointer. We might also think about weakening the relationship betweenComponent
andEntity
.By Martin Bellgardt on 2018-06-19T10:41:41 (imported from GitLab)
Yes I think I am with @mbellgardt here, having a
ResourceComponent
would probably be a good compromise, although I am not sure what it should be called, we never addedComponent
to the name of the components, so maybeResourceHandle
although this sounds very artificial to me as well...By Jonathan Ehret on 2018-06-19T10:55:03 (imported from GitLab)
Onion peeling like
entity->get_component<resource_handle>()->get_resource()->as<mesh>()
is bad just inherit the resource base class from component or something along those lines instead.
By Ali Can Demiralp on 2018-06-25T20:13:11 (imported from GitLab)
Edited by Jan Delembermentioned in merge request !160 (merged)
By Jonathan Ehret on 2018-07-24T09:21:37 (imported from GitLab)
Now in !160 (merged)
By Jonathan Ehret on 2018-07-24T09:22:01 (imported from GitLab)