- class Quad : public Entity
- {
- public:
- Quad(const Vector3 vertices[4], const std::string& texture,
- Tilemap::Index tileIndex) :
- tilemap_(texture),
- detail_(0),
- blending_(false),
- fog_(false)
- {
- for (int i = 0, num = 0; i < 4; ++i)
- {
- for (int j = 0; j < 3; ++j, ++num)
- {
- vertices_[num] = vertices[i][j];
- }
- }
-
- if (!tilemap_.getTileCoords(tileIndex, texCoords_))
- {
- std::cerr << "no coords for tile's texture" << std::endl;
- }
-
- aabb_.encloseVertices(vertices, 4);
- sphere_.point = aabb_.getCenter();
- sphere_.radius = (aabb_.min - sphere_.point).length();
- }
-
- void setDetail(long detail)
- {
- detail_ = detail;
- }