fixed default room size
This commit is contained in:
parent
1bf6d3f0b1
commit
243dd61209
10
Room.h
10
Room.h
@ -37,13 +37,19 @@ namespace ZL
|
|||||||
Room(const std::string& roomName) : name(roomName) {}
|
Room(const std::string& roomName) : name(roomName) {}
|
||||||
|
|
||||||
// Создаем меш комнаты (куб)
|
// Создаем меш комнаты (куб)
|
||||||
void createRoomMesh(float size = 500.0f)
|
void createRoomMesh(const std::string& texturePath)
|
||||||
{
|
{
|
||||||
roomMesh = CreateCube3D(size); // Создаем куб с размерами size
|
// Загружаем текстуру
|
||||||
|
auto texture = std::make_shared<Texture>(CreateTextureDataFromBmp24(texturePath));
|
||||||
|
addTexture(texture); // Добавляем текстуру в комнату
|
||||||
|
|
||||||
|
// Создаём меш комнаты на основе текстуры (например, прямоугольник)
|
||||||
|
roomMesh = CreateRect2D({0.0f, 0.0f}, {1024.0f, 1024.0f}, 1.0f);
|
||||||
roomMeshMutable.AssignFrom(roomMesh);
|
roomMeshMutable.AssignFrom(roomMesh);
|
||||||
roomMeshMutable.RefreshVBO();
|
roomMeshMutable.RefreshVBO();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void addTexture(std::shared_ptr<Texture> texture)
|
void addTexture(std::shared_ptr<Texture> texture)
|
||||||
{
|
{
|
||||||
textures.push_back(texture);
|
textures.push_back(texture);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user