32 #include "servers/visual_server.h" 33 #include "scene/resources/material.h" 34 #include "scene/resources/shape.h" 36 #include "triangle_mesh.h" 43 RES_BASE_EXTENSION(
"msh");
49 NO_INDEX_ARRAY=VisualServer::NO_INDEX_ARRAY,
50 ARRAY_WEIGHTS_SIZE=VisualServer::ARRAY_WEIGHTS_SIZE
55 ARRAY_VERTEX=VisualServer::ARRAY_VERTEX,
56 ARRAY_NORMAL=VisualServer::ARRAY_NORMAL,
57 ARRAY_TANGENT=VisualServer::ARRAY_TANGENT,
58 ARRAY_COLOR=VisualServer::ARRAY_COLOR,
59 ARRAY_TEX_UV=VisualServer::ARRAY_TEX_UV,
60 ARRAY_TEX_UV2=VisualServer::ARRAY_TEX_UV2,
61 ARRAY_BONES=VisualServer::ARRAY_BONES,
62 ARRAY_WEIGHTS=VisualServer::ARRAY_WEIGHTS,
63 ARRAY_INDEX=VisualServer::ARRAY_INDEX,
64 ARRAY_MAX=VisualServer::ARRAY_MAX
70 ARRAY_FORMAT_VERTEX=1<<ARRAY_VERTEX,
71 ARRAY_FORMAT_NORMAL=1<<ARRAY_NORMAL,
72 ARRAY_FORMAT_TANGENT=1<<ARRAY_TANGENT,
73 ARRAY_FORMAT_COLOR=1<<ARRAY_COLOR,
74 ARRAY_FORMAT_TEX_UV=1<<ARRAY_TEX_UV,
75 ARRAY_FORMAT_TEX_UV2=1<<ARRAY_TEX_UV2,
76 ARRAY_FORMAT_BONES=1<<ARRAY_BONES,
77 ARRAY_FORMAT_WEIGHTS=1<<ARRAY_WEIGHTS,
78 ARRAY_FORMAT_INDEX=1<<ARRAY_INDEX,
83 PRIMITIVE_POINTS=VisualServer::PRIMITIVE_POINTS,
84 PRIMITIVE_LINES=VisualServer::PRIMITIVE_LINES,
85 PRIMITIVE_LINE_STRIP=VisualServer::PRIMITIVE_LINE_STRIP,
86 PRIMITIVE_LINE_LOOP=VisualServer::PRIMITIVE_LINE_LOOP,
87 PRIMITIVE_TRIANGLES=VisualServer::PRIMITIVE_TRIANGLES,
88 PRIMITIVE_TRIANGLE_STRIP=VisualServer::PRIMITIVE_TRIANGLE_STRIP,
89 PRIMITIVE_TRIANGLE_FAN=VisualServer::PRIMITIVE_TRIANGLE_FAN,
92 enum MorphTargetMode {
94 MORPH_MODE_NORMALIZED=VS::MORPH_MODE_NORMALIZED,
95 MORPH_MODE_RELATIVE=VS::MORPH_MODE_RELATIVE,
108 MorphTargetMode morph_target_mode;
115 void _recompute_aabb();
122 static void _bind_methods();
126 void add_surface(PrimitiveType p_primitive,
const Array& p_arrays,
const Array& p_blend_shapes=
Array(),
bool p_alphasort=
false);
127 Array surface_get_arrays(
int p_surface)
const;
128 virtual Array surface_get_morph_arrays(
int p_surface)
const;
130 void add_custom_surface(
const Variant& p_data);
132 void add_morph_target(
const StringName& p_name);
133 int get_morph_target_count()
const;
134 StringName get_morph_target_name(
int p_index)
const;
135 void clear_morph_targets();
137 void set_morph_target_mode(MorphTargetMode p_mode);
138 MorphTargetMode get_morph_target_mode()
const;
140 int get_surface_count()
const;
141 void surface_remove(
int p_idx);
143 void surface_set_custom_aabb(
int p_surface,
const AABB& p_aabb);
146 int surface_get_array_len(
int p_idx)
const;
147 int surface_get_array_index_len(
int p_idx)
const;
148 uint32_t surface_get_format(
int p_idx)
const;
149 PrimitiveType surface_get_primitive_type(
int p_idx)
const;
150 bool surface_is_alpha_sorting_enabled(
int p_idx)
const;
152 void surface_set_material(
int p_idx,
const Ref<Material>& p_material);
155 void surface_set_name(
int p_idx,
const String& p_name);
156 String surface_get_name(
int p_idx)
const;
160 void set_custom_aabb(
const AABB& p_custom);
161 AABB get_custom_aabb()
const;
163 AABB get_aabb()
const;
164 virtual RID get_rid()
const;
169 Ref<Mesh> create_outline(
float p_margin)
const;
171 void center_geometry();
172 void regen_normalmaps();
182 VARIANT_ENUM_CAST( Mesh::ArrayType );
183 VARIANT_ENUM_CAST( Mesh::PrimitiveType );
184 VARIANT_ENUM_CAST( Mesh::MorphTargetMode );
Definition: string_db.h:48
Definition: geometry.h:816
Definition: resource.h:89