pandemonium_engine/modules/terraman_2d/library/terrain_2d_surface.h

50 lines
1002 B
C++
Raw Normal View History

2022-03-17 22:33:22 +01:00
#ifndef TERRAIN_2D_SURFACE_H
#define TERRAIN_2D_SURFACE_H
2023-12-17 22:59:50 +01:00
2022-08-17 11:38:15 +02:00
#include "core/math/color.h"
#include "core/object/resource.h"
#include "core/containers/vector.h"
#include "core/math/rect2.h"
2023-12-10 14:59:22 +01:00
#include "scene/resources/material/material.h"
#include "terrain_2d_library.h"
class Terrain2DLibrary;
class Terrain2DSurface : public Resource {
GDCLASS(Terrain2DSurface, Resource)
public:
int get_id() const;
void set_id(const int value);
Rect2 get_rect() const;
void set_rect(const Rect2 &rect);
Ref<Terrain2DLibrary> get_library() const;
void set_library(Ref<Terrain2DLibrary> library);
Vector2 transform_uv(const Vector2 &p_uv) const;
Vector2 transform_uv_scaled(const Vector2 &p_uv, const int p_current_x, const int p_current_y, const int p_max) const;
virtual void refresh_rects();
Terrain2DSurface();
~Terrain2DSurface();
protected:
static void _bind_methods();
Terrain2DLibrary *_library;
int _id;
int _mesher_index;
bool _transparent;
bool _liquid;
Rect2 _rect;
};
#endif