开发Pong游戏以学习DirectX 11.这个Sprite / Model类是否在RenderingComponent类中声明为ECS设计?另外,精灵对于3D游戏没有意义,但如果我想换掉2D并使其成为3D,那该怎么办呢?它应该是Renderer实例吗?下面给出的例子。
class Entity
{
private:
Components* components;
};
class Component
{
// base class stuff here
};
class RenderingComponent : public Component
{
private:
Sprite* sprite; // (Q) SHOULD THIS BE A SPRITE OR MODEL OR RENDERER CLASS
// (if I want to swap out for 3d?)
};
class Sprite // (Q) MAYBE THIS SHOULD BE A MODEL OR RENDERER CLASS INSTEAD
}