summaryrefslogtreecommitdiff
path: root/editor
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2019-06-15 23:45:24 -0300
committerJuan Linietsky <reduzio@gmail.com>2020-02-11 11:53:27 +0100
commit9b0dd4f571ff431e23b9097e7f29746f4157be12 (patch)
treeaa18fc6803e8733f8f270666e691153c72b6066d /editor
parent836c2109a0b1371653e3c82100199dfdabd47da9 (diff)
A lot of progress with canvas rendering, still far from working.
Diffstat (limited to 'editor')
-rw-r--r--editor/import/editor_scene_importer_gltf.cpp9
-rw-r--r--editor/spatial_editor_gizmos.cpp10
2 files changed, 14 insertions, 5 deletions
diff --git a/editor/import/editor_scene_importer_gltf.cpp b/editor/import/editor_scene_importer_gltf.cpp
index abdbdd29a9..419f007cec 100644
--- a/editor/import/editor_scene_importer_gltf.cpp
+++ b/editor/import/editor_scene_importer_gltf.cpp
@@ -984,11 +984,12 @@ Error EditorSceneImporterGLTF::_parse_meshes(GLTFState &state) {
static const Mesh::PrimitiveType primitives2[7] = {
Mesh::PRIMITIVE_POINTS,
Mesh::PRIMITIVE_LINES,
- Mesh::PRIMITIVE_LINE_LOOP,
- Mesh::PRIMITIVE_LINE_STRIP,
+ Mesh::PRIMITIVE_LINES,
+ Mesh::PRIMITIVE_LINES,
+ Mesh::PRIMITIVE_TRIANGLES,
+ Mesh::PRIMITIVE_TRIANGLES,
Mesh::PRIMITIVE_TRIANGLES,
- Mesh::PRIMITIVE_TRIANGLE_STRIP,
- Mesh::PRIMITIVE_TRIANGLE_FAN,
+#warning these will have to be decomposed into proper primitive now that lineloop/strip,etc no longer supported
};
primitive = primitives2[mode];
diff --git a/editor/spatial_editor_gizmos.cpp b/editor/spatial_editor_gizmos.cpp
index d012b2f821..beee7b87f0 100644
--- a/editor/spatial_editor_gizmos.cpp
+++ b/editor/spatial_editor_gizmos.cpp
@@ -280,8 +280,16 @@ void EditorSpatialGizmo::add_unscaled_billboard(const Ref<Material> &p_material,
a.resize(Mesh::ARRAY_MAX);
a[Mesh::ARRAY_VERTEX] = vs;
a[Mesh::ARRAY_TEX_UV] = uv;
+ Vector<int> indices;
+ indices.push_back(0);
+ indices.push_back(1);
+ indices.push_back(2);
+ indices.push_back(0);
+ indices.push_back(2);
+ indices.push_back(3);
+ a[Mesh::ARRAY_INDEX] = indices;
a[Mesh::ARRAY_COLOR] = colors;
- mesh->add_surface_from_arrays(Mesh::PRIMITIVE_TRIANGLE_FAN, a);
+ mesh->add_surface_from_arrays(Mesh::PRIMITIVE_TRIANGLES, a);
mesh->surface_set_material(0, p_material);
float md = 0;