mirror of
https://github.com/godotengine/godot.git
synced 2025-10-19 07:53:26 +00:00
Backport Label3D node implementation and Sprite*3D material render priority.
This commit is contained in:
parent
241c267d9c
commit
dc6d8d6098
20 changed files with 2011 additions and 27 deletions
|
@ -38,6 +38,7 @@
|
|||
#include "scene/3d/collision_shape.h"
|
||||
#include "scene/3d/cpu_particles.h"
|
||||
#include "scene/3d/gi_probe.h"
|
||||
#include "scene/3d/label_3d.h"
|
||||
#include "scene/3d/light.h"
|
||||
#include "scene/3d/listener.h"
|
||||
#include "scene/3d/mesh_instance.h"
|
||||
|
@ -1563,6 +1564,38 @@ void Sprite3DSpatialGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) {
|
|||
|
||||
///
|
||||
|
||||
Label3DSpatialGizmoPlugin::Label3DSpatialGizmoPlugin() {
|
||||
}
|
||||
|
||||
bool Label3DSpatialGizmoPlugin::has_gizmo(Spatial *p_spatial) {
|
||||
return Object::cast_to<Label3D>(p_spatial) != nullptr;
|
||||
}
|
||||
|
||||
String Label3DSpatialGizmoPlugin::get_name() const {
|
||||
return "Label3D";
|
||||
}
|
||||
|
||||
int Label3DSpatialGizmoPlugin::get_priority() const {
|
||||
return -1;
|
||||
}
|
||||
|
||||
bool Label3DSpatialGizmoPlugin::can_be_hidden() const {
|
||||
return false;
|
||||
}
|
||||
|
||||
void Label3DSpatialGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) {
|
||||
Label3D *label = Object::cast_to<Label3D>(p_gizmo->get_spatial_node());
|
||||
|
||||
p_gizmo->clear();
|
||||
|
||||
Ref<TriangleMesh> tm = label->generate_triangle_mesh();
|
||||
if (tm.is_valid()) {
|
||||
p_gizmo->add_collision_triangles(tm);
|
||||
}
|
||||
}
|
||||
|
||||
///
|
||||
|
||||
Position3DSpatialGizmoPlugin::Position3DSpatialGizmoPlugin() {
|
||||
pos3d_mesh = Ref<ArrayMesh>(memnew(ArrayMesh));
|
||||
cursor_points = Vector<Vector3>();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue