hi guys,
a question about game component design: what IS a component and what not? for example how is a position and/or orientation handled?
I've looked at the article in gdmag and in a figure there's a component "Position" mentioned.
I've also looked at the nebula3-sourcecode and there the physics- and rendering-components store their own transformation:
(this is from the physics-component handling new transform-message from the physics-engine)
and in the transform-update-handling in the rendering-component this is called:
(in this system a component can send a message to every other component in the same entity)
But this approach needs a messaging-system where messages are NOT broadcasted because then an update-trigger from the physics would generate an update OF the physics-component again (physics send a transform-update to the entity and this would call every component with this message(also the physics, which triggered the update)). This approach handle transforms in many components internally (for example in the physics- and rendering-component)
is it better to store the position and orientation in an extra component? this would require an mechanism to detect when the game triggered an transform-update from outside (and the physics-component would need an update of the transform; kinematic objects come to mind) or if the transform was changed from the physics itself (which would not require an update of the physics-component) under the assumtion that the phyics-component only contains an pointer to an rigid body which handles it's own transform-matrix.
any thoughts on this? and more in general, what is a component and what not?
thanks
a question about game component design: what IS a component and what not? for example how is a position and/or orientation handled?
I've looked at the article in gdmag and in a figure there's a component "Position" mentioned.
I've also looked at the nebula3-sourcecode and there the physics- and rendering-components store their own transformation:
(this is from the physics-component handling new transform-message from the physics-engine)
and in the transform-update-handling in the rendering-component this is called:
(in this system a component can send a message to every other component in the same entity)
But this approach needs a messaging-system where messages are NOT broadcasted because then an update-trigger from the physics would generate an update OF the physics-component again (physics send a transform-update to the entity and this would call every component with this message(also the physics, which triggered the update)). This approach handle transforms in many components internally (for example in the physics- and rendering-component)
is it better to store the position and orientation in an extra component? this would require an mechanism to detect when the game triggered an transform-update from outside (and the physics-component would need an update of the transform; kinematic objects come to mind) or if the transform was changed from the physics itself (which would not require an update of the physics-component) under the assumtion that the phyics-component only contains an pointer to an rigid body which handles it's own transform-matrix.
any thoughts on this? and more in general, what is a component and what not?
thanks