Skip to main content
6 events
when toggle format what by license comment
Apr 9, 2017 at 22:16 comment added Ian Young @Naros yes this is what I meant: Two Components, Transform, and (in my framework) SpatialData, which contains position, velocity, orientation, and angular velocity. The position and orientation are used to construct and update the Transform.
Apr 9, 2017 at 21:01 comment added Naros My preference is to combine all three, position, orientation, and scale into a single component and in cases where a specific subsystsem needs just a position or orientation, I'd advocate duplicating the data and synchronizing them at clearly defined points in the game loop.
Apr 9, 2017 at 20:59 comment added Naros @IanYoung Separating them could do more harm than good, potentially if you find you need position and orientation together more often than you do position or orientation separately. In that case, placing position and orientation data attributes in a single component can improve cache performance.
Apr 9, 2017 at 17:04 comment added Ian Young You are confusing position ( vector of 3 floats) with a Translation (transform matrix constructed from a position vector). A Transformation matrix is constructed from translation, rotation, and scale transforms. This is far more information than an AI system would need, though you certainly could extract the position vector from it. Personally though, I would separate position, orientation, and sizes out into their own component, and use them to create and update the Transform.
Apr 9, 2017 at 15:20 comment added CRefice Thanks for your suggestions. I have a question, though: why wouldn't the AI system need an object's position?
Apr 9, 2017 at 14:07 history answered Ian Young CC BY-SA 3.0