diff options
Diffstat (limited to 'scene/resources/mesh.h')
-rw-r--r-- | scene/resources/mesh.h | 44 |
1 files changed, 20 insertions, 24 deletions
diff --git a/scene/resources/mesh.h b/scene/resources/mesh.h index 25a9722046..642ae7e1b0 100644 --- a/scene/resources/mesh.h +++ b/scene/resources/mesh.h @@ -31,9 +31,9 @@ #ifndef MESH_H #define MESH_H +#include "core/io/resource.h" #include "core/math/face3.h" #include "core/math/triangle_mesh.h" -#include "core/resource.h" #include "scene/resources/material.h" #include "scene/resources/shape_3d.h" #include "servers/rendering_server.h" @@ -43,20 +43,18 @@ class Mesh : public Resource { mutable Ref<TriangleMesh> triangle_mesh; //cached mutable Vector<Vector3> debug_lines; - Size2 lightmap_size_hint; + Size2i lightmap_size_hint; protected: static void _bind_methods(); public: enum { - NO_INDEX_ARRAY = RenderingServer::NO_INDEX_ARRAY, ARRAY_WEIGHTS_SIZE = RenderingServer::ARRAY_WEIGHTS_SIZE }; enum ArrayType { - ARRAY_VERTEX = RenderingServer::ARRAY_VERTEX, ARRAY_NORMAL = RenderingServer::ARRAY_NORMAL, ARRAY_TANGENT = RenderingServer::ARRAY_TANGENT, @@ -107,7 +105,6 @@ public: }; enum BlendShapeMode { - BLEND_SHAPE_MODE_NORMALIZED = RS::BLEND_SHAPE_MODE_NORMALIZED, BLEND_SHAPE_MODE_RELATIVE = RS::BLEND_SHAPE_MODE_RELATIVE, }; @@ -138,8 +135,8 @@ public: virtual AABB get_aabb() const = 0; - void set_lightmap_size_hint(const Vector2 &p_size); - Size2 get_lightmap_size_hint() const; + void set_lightmap_size_hint(const Size2i &p_size); + Size2i get_lightmap_size_hint() const; void clear_cache() const; typedef Vector<Vector<Face3>> (*ConvexDecompositionFunc)(const Vector<Face3> &); @@ -152,7 +149,6 @@ public: }; class ArrayMesh : public Mesh { - GDCLASS(ArrayMesh, Mesh); RES_BASE_EXTENSION("mesh"); @@ -195,13 +191,13 @@ public: void add_surface(uint32_t p_format, PrimitiveType p_primitive, const Vector<uint8_t> &p_array, int p_vertex_count, const Vector<uint8_t> &p_index_array, int p_index_count, const AABB &p_aabb, const Vector<Vector<uint8_t>> &p_blend_shapes = Vector<Vector<uint8_t>>(), const Vector<AABB> &p_bone_aabbs = Vector<AABB>(), const Vector<RS::SurfaceData::LOD> &p_lods = Vector<RS::SurfaceData::LOD>()); - Array surface_get_arrays(int p_surface) const; - Array surface_get_blend_shape_arrays(int p_surface) const; - Dictionary surface_get_lods(int p_surface) const; + Array surface_get_arrays(int p_surface) const override; + Array surface_get_blend_shape_arrays(int p_surface) const override; + Dictionary surface_get_lods(int p_surface) const override; void add_blend_shape(const StringName &p_name); - int get_blend_shape_count() const; - StringName get_blend_shape_name(int p_index) const; + int get_blend_shape_count() const override; + StringName get_blend_shape_name(int p_index) const override; void clear_blend_shapes(); void set_blend_shape_mode(BlendShapeMode p_mode); @@ -209,21 +205,20 @@ public: void surface_update_region(int p_surface, int p_offset, const Vector<uint8_t> &p_data); - int get_surface_count() const; - void surface_remove(int p_idx); + int get_surface_count() const override; void clear_surfaces(); void surface_set_custom_aabb(int p_idx, const AABB &p_aabb); //only recognized by driver - int surface_get_array_len(int p_idx) const; - int surface_get_array_index_len(int p_idx) const; - uint32_t surface_get_format(int p_idx) const; - PrimitiveType surface_get_primitive_type(int p_idx) const; + int surface_get_array_len(int p_idx) const override; + int surface_get_array_index_len(int p_idx) const override; + uint32_t surface_get_format(int p_idx) const override; + PrimitiveType surface_get_primitive_type(int p_idx) const override; bool surface_is_alpha_sorting_enabled(int p_idx) const; - virtual void surface_set_material(int p_idx, const Ref<Material> &p_material); - virtual Ref<Material> surface_get_material(int p_idx) const; + virtual void surface_set_material(int p_idx, const Ref<Material> &p_material) override; + virtual Ref<Material> surface_get_material(int p_idx) const override; int surface_find_by_name(const String &p_name) const; void surface_set_name(int p_idx, const String &p_name); @@ -232,14 +227,15 @@ public: void set_custom_aabb(const AABB &p_custom); AABB get_custom_aabb() const; - AABB get_aabb() const; - virtual RID get_rid() const; + AABB get_aabb() const override; + virtual RID get_rid() const override; void regen_normalmaps(); Error lightmap_unwrap(const Transform &p_base_transform = Transform(), float p_texel_size = 0.05); + Error lightmap_unwrap_cached(int *&r_cache_data, unsigned int &r_cache_size, bool &r_used_cache, const Transform &p_base_transform = Transform(), float p_texel_size = 0.05); - virtual void reload_from_file(); + virtual void reload_from_file() override; ArrayMesh(); |