Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
godot
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
community
godot
Commits
3841a647
Commit
3841a647
authored
Apr 06, 2020
by
jfons
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename all gizmo classes, using the 4.0 node names.
parent
11f31a73
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
102 additions
and
102 deletions
+102
-102
node_3d_editor_gizmos.cpp
editor/node_3d_editor_gizmos.cpp
+0
-0
node_3d_editor_gizmos.h
editor/node_3d_editor_gizmos.h
+51
-51
node_3d_editor_plugin.cpp
editor/plugins/node_3d_editor_plugin.cpp
+17
-17
path_3d_editor_plugin.cpp
editor/plugins/path_3d_editor_plugin.cpp
+13
-13
path_3d_editor_plugin.h
editor/plugins/path_3d_editor_plugin.h
+6
-6
csg_gizmos.cpp
modules/csg/csg_gizmos.cpp
+12
-12
csg_gizmos.h
modules/csg/csg_gizmos.h
+3
-3
No files found.
editor/node_3d_editor_gizmos.cpp
View file @
3841a647
This diff is collapsed.
Click to expand it.
editor/node_3d_editor_gizmos.h
View file @
3841a647
...
...
@@ -36,9 +36,9 @@
class
Camera3D
;
class
Light
Node
3DGizmoPlugin
:
public
EditorNode3DGizmoPlugin
{
class
Light3DGizmoPlugin
:
public
EditorNode3DGizmoPlugin
{
GDCLASS
(
Light
Node
3DGizmoPlugin
,
EditorNode3DGizmoPlugin
);
GDCLASS
(
Light3DGizmoPlugin
,
EditorNode3DGizmoPlugin
);
public
:
bool
has_gizmo
(
Node3D
*
p_spatial
);
...
...
@@ -51,12 +51,12 @@ public:
void
commit_handle
(
EditorNode3DGizmo
*
p_gizmo
,
int
p_idx
,
const
Variant
&
p_restore
,
bool
p_cancel
=
false
);
void
redraw
(
EditorNode3DGizmo
*
p_gizmo
);
Light
Node
3DGizmoPlugin
();
Light3DGizmoPlugin
();
};
class
AudioStreamPlayer3D
Node3D
GizmoPlugin
:
public
EditorNode3DGizmoPlugin
{
class
AudioStreamPlayer3DGizmoPlugin
:
public
EditorNode3DGizmoPlugin
{
GDCLASS
(
AudioStreamPlayer3D
Node3D
GizmoPlugin
,
EditorNode3DGizmoPlugin
);
GDCLASS
(
AudioStreamPlayer3DGizmoPlugin
,
EditorNode3DGizmoPlugin
);
public
:
bool
has_gizmo
(
Node3D
*
p_spatial
);
...
...
@@ -69,12 +69,12 @@ public:
void
commit_handle
(
EditorNode3DGizmo
*
p_gizmo
,
int
p_idx
,
const
Variant
&
p_restore
,
bool
p_cancel
=
false
);
void
redraw
(
EditorNode3DGizmo
*
p_gizmo
);
AudioStreamPlayer3D
Node3D
GizmoPlugin
();
AudioStreamPlayer3DGizmoPlugin
();
};
class
Camera
Node
3DGizmoPlugin
:
public
EditorNode3DGizmoPlugin
{
class
Camera3DGizmoPlugin
:
public
EditorNode3DGizmoPlugin
{
GDCLASS
(
Camera
Node
3DGizmoPlugin
,
EditorNode3DGizmoPlugin
);
GDCLASS
(
Camera3DGizmoPlugin
,
EditorNode3DGizmoPlugin
);
public
:
bool
has_gizmo
(
Node3D
*
p_spatial
);
...
...
@@ -87,12 +87,12 @@ public:
void
commit_handle
(
EditorNode3DGizmo
*
p_gizmo
,
int
p_idx
,
const
Variant
&
p_restore
,
bool
p_cancel
=
false
);
void
redraw
(
EditorNode3DGizmo
*
p_gizmo
);
Camera
Node
3DGizmoPlugin
();
Camera3DGizmoPlugin
();
};
class
MeshInstance
Node
3DGizmoPlugin
:
public
EditorNode3DGizmoPlugin
{
class
MeshInstance3DGizmoPlugin
:
public
EditorNode3DGizmoPlugin
{
GDCLASS
(
MeshInstance
Node
3DGizmoPlugin
,
EditorNode3DGizmoPlugin
);
GDCLASS
(
MeshInstance3DGizmoPlugin
,
EditorNode3DGizmoPlugin
);
public
:
bool
has_gizmo
(
Node3D
*
p_spatial
);
...
...
@@ -101,12 +101,12 @@ public:
bool
can_be_hidden
()
const
;
void
redraw
(
EditorNode3DGizmo
*
p_gizmo
);
MeshInstance
Node
3DGizmoPlugin
();
MeshInstance3DGizmoPlugin
();
};
class
Sprite3D
Node3D
GizmoPlugin
:
public
EditorNode3DGizmoPlugin
{
class
Sprite3DGizmoPlugin
:
public
EditorNode3DGizmoPlugin
{
GDCLASS
(
Sprite3D
Node3D
GizmoPlugin
,
EditorNode3DGizmoPlugin
);
GDCLASS
(
Sprite3DGizmoPlugin
,
EditorNode3DGizmoPlugin
);
public
:
bool
has_gizmo
(
Node3D
*
p_spatial
);
...
...
@@ -115,12 +115,12 @@ public:
bool
can_be_hidden
()
const
;
void
redraw
(
EditorNode3DGizmo
*
p_gizmo
);
Sprite3D
Node3D
GizmoPlugin
();
Sprite3DGizmoPlugin
();
};
class
Position3D
Node3D
GizmoPlugin
:
public
EditorNode3DGizmoPlugin
{
class
Position3DGizmoPlugin
:
public
EditorNode3DGizmoPlugin
{
GDCLASS
(
Position3D
Node3D
GizmoPlugin
,
EditorNode3DGizmoPlugin
);
GDCLASS
(
Position3DGizmoPlugin
,
EditorNode3DGizmoPlugin
);
Ref
<
ArrayMesh
>
pos3d_mesh
;
Vector
<
Vector3
>
cursor_points
;
...
...
@@ -131,12 +131,12 @@ public:
int
get_priority
()
const
;
void
redraw
(
EditorNode3DGizmo
*
p_gizmo
);
Position3D
Node3D
GizmoPlugin
();
Position3DGizmoPlugin
();
};
class
Skeleton
Node
3DGizmoPlugin
:
public
EditorNode3DGizmoPlugin
{
class
Skeleton3DGizmoPlugin
:
public
EditorNode3DGizmoPlugin
{
GDCLASS
(
Skeleton
Node
3DGizmoPlugin
,
EditorNode3DGizmoPlugin
);
GDCLASS
(
Skeleton3DGizmoPlugin
,
EditorNode3DGizmoPlugin
);
public
:
bool
has_gizmo
(
Node3D
*
p_spatial
);
...
...
@@ -144,12 +144,12 @@ public:
int
get_priority
()
const
;
void
redraw
(
EditorNode3DGizmo
*
p_gizmo
);
Skeleton
Node
3DGizmoPlugin
();
Skeleton3DGizmoPlugin
();
};
class
PhysicalBone
Node
3DGizmoPlugin
:
public
EditorNode3DGizmoPlugin
{
class
PhysicalBone3DGizmoPlugin
:
public
EditorNode3DGizmoPlugin
{
GDCLASS
(
PhysicalBone
Node
3DGizmoPlugin
,
EditorNode3DGizmoPlugin
);
GDCLASS
(
PhysicalBone3DGizmoPlugin
,
EditorNode3DGizmoPlugin
);
public
:
bool
has_gizmo
(
Node3D
*
p_spatial
);
...
...
@@ -157,12 +157,12 @@ public:
int
get_priority
()
const
;
void
redraw
(
EditorNode3DGizmo
*
p_gizmo
);
PhysicalBone
Node
3DGizmoPlugin
();
PhysicalBone3DGizmoPlugin
();
};
class
RayCast
Node
3DGizmoPlugin
:
public
EditorNode3DGizmoPlugin
{
class
RayCast3DGizmoPlugin
:
public
EditorNode3DGizmoPlugin
{
GDCLASS
(
RayCast
Node
3DGizmoPlugin
,
EditorNode3DGizmoPlugin
);
GDCLASS
(
RayCast3DGizmoPlugin
,
EditorNode3DGizmoPlugin
);
public
:
bool
has_gizmo
(
Node3D
*
p_spatial
);
...
...
@@ -170,12 +170,12 @@ public:
int
get_priority
()
const
;
void
redraw
(
EditorNode3DGizmo
*
p_gizmo
);
RayCast
Node
3DGizmoPlugin
();
RayCast3DGizmoPlugin
();
};
class
SpringArm
Node
3DGizmoPlugin
:
public
EditorNode3DGizmoPlugin
{
class
SpringArm3DGizmoPlugin
:
public
EditorNode3DGizmoPlugin
{
GDCLASS
(
SpringArm
Node
3DGizmoPlugin
,
EditorNode3DGizmoPlugin
);
GDCLASS
(
SpringArm3DGizmoPlugin
,
EditorNode3DGizmoPlugin
);
public
:
bool
has_gizmo
(
Node3D
*
p_spatial
);
...
...
@@ -183,12 +183,12 @@ public:
int
get_priority
()
const
;
void
redraw
(
EditorNode3DGizmo
*
p_gizmo
);
SpringArm
Node
3DGizmoPlugin
();
SpringArm3DGizmoPlugin
();
};
class
VehicleWheel
Node
3DGizmoPlugin
:
public
EditorNode3DGizmoPlugin
{
class
VehicleWheel3DGizmoPlugin
:
public
EditorNode3DGizmoPlugin
{
GDCLASS
(
VehicleWheel
Node
3DGizmoPlugin
,
EditorNode3DGizmoPlugin
);
GDCLASS
(
VehicleWheel3DGizmoPlugin
,
EditorNode3DGizmoPlugin
);
public
:
bool
has_gizmo
(
Node3D
*
p_spatial
);
...
...
@@ -196,12 +196,12 @@ public:
int
get_priority
()
const
;
void
redraw
(
EditorNode3DGizmo
*
p_gizmo
);
VehicleWheel
Node
3DGizmoPlugin
();
VehicleWheel3DGizmoPlugin
();
};
class
SoftBody
Node
3DGizmoPlugin
:
public
EditorNode3DGizmoPlugin
{
class
SoftBody3DGizmoPlugin
:
public
EditorNode3DGizmoPlugin
{
GDCLASS
(
SoftBody
Node
3DGizmoPlugin
,
EditorNode3DGizmoPlugin
);
GDCLASS
(
SoftBody3DGizmoPlugin
,
EditorNode3DGizmoPlugin
);
public
:
bool
has_gizmo
(
Node3D
*
p_spatial
);
...
...
@@ -215,12 +215,12 @@ public:
void
commit_handle
(
EditorNode3DGizmo
*
p_gizmo
,
int
p_idx
,
const
Variant
&
p_restore
,
bool
p_cancel
);
bool
is_handle_highlighted
(
const
EditorNode3DGizmo
*
p_gizmo
,
int
idx
)
const
;
SoftBody
Node
3DGizmoPlugin
();
SoftBody3DGizmoPlugin
();
};
class
VisibilityNotifierGizmoPlugin
:
public
EditorNode3DGizmoPlugin
{
class
VisibilityNotifier
3D
GizmoPlugin
:
public
EditorNode3DGizmoPlugin
{
GDCLASS
(
VisibilityNotifierGizmoPlugin
,
EditorNode3DGizmoPlugin
);
GDCLASS
(
VisibilityNotifier
3D
GizmoPlugin
,
EditorNode3DGizmoPlugin
);
public
:
bool
has_gizmo
(
Node3D
*
p_spatial
);
...
...
@@ -233,7 +233,7 @@ public:
void
set_handle
(
EditorNode3DGizmo
*
p_gizmo
,
int
p_idx
,
Camera3D
*
p_camera
,
const
Point2
&
p_point
);
void
commit_handle
(
EditorNode3DGizmo
*
p_gizmo
,
int
p_idx
,
const
Variant
&
p_restore
,
bool
p_cancel
=
false
);
VisibilityNotifierGizmoPlugin
();
VisibilityNotifier
3D
GizmoPlugin
();
};
class
CPUParticles3DGizmoPlugin
:
public
EditorNode3DGizmoPlugin
{
...
...
@@ -322,9 +322,9 @@ public:
BakedIndirectLightGizmoPlugin();
};
#endif
class
CollisionShape
Node
3DGizmoPlugin
:
public
EditorNode3DGizmoPlugin
{
class
CollisionShape3DGizmoPlugin
:
public
EditorNode3DGizmoPlugin
{
GDCLASS
(
CollisionShape
Node
3DGizmoPlugin
,
EditorNode3DGizmoPlugin
);
GDCLASS
(
CollisionShape3DGizmoPlugin
,
EditorNode3DGizmoPlugin
);
public
:
bool
has_gizmo
(
Node3D
*
p_spatial
);
...
...
@@ -337,23 +337,23 @@ public:
void
set_handle
(
EditorNode3DGizmo
*
p_gizmo
,
int
p_idx
,
Camera3D
*
p_camera
,
const
Point2
&
p_point
);
void
commit_handle
(
EditorNode3DGizmo
*
p_gizmo
,
int
p_idx
,
const
Variant
&
p_restore
,
bool
p_cancel
=
false
);
CollisionShape
Node
3DGizmoPlugin
();
CollisionShape3DGizmoPlugin
();
};
class
CollisionPolygon
Node
3DGizmoPlugin
:
public
EditorNode3DGizmoPlugin
{
GDCLASS
(
CollisionPolygon
Node
3DGizmoPlugin
,
EditorNode3DGizmoPlugin
);
class
CollisionPolygon3DGizmoPlugin
:
public
EditorNode3DGizmoPlugin
{
GDCLASS
(
CollisionPolygon3DGizmoPlugin
,
EditorNode3DGizmoPlugin
);
public
:
bool
has_gizmo
(
Node3D
*
p_spatial
);
String
get_name
()
const
;
int
get_priority
()
const
;
void
redraw
(
EditorNode3DGizmo
*
p_gizmo
);
CollisionPolygon
Node
3DGizmoPlugin
();
CollisionPolygon3DGizmoPlugin
();
};
class
Navigation
MeshNode
3DGizmoPlugin
:
public
EditorNode3DGizmoPlugin
{
class
Navigation
Region
3DGizmoPlugin
:
public
EditorNode3DGizmoPlugin
{
GDCLASS
(
Navigation
MeshNode
3DGizmoPlugin
,
EditorNode3DGizmoPlugin
);
GDCLASS
(
Navigation
Region
3DGizmoPlugin
,
EditorNode3DGizmoPlugin
);
struct
_EdgeKey
{
...
...
@@ -369,7 +369,7 @@ public:
int
get_priority
()
const
;
void
redraw
(
EditorNode3DGizmo
*
p_gizmo
);
Navigation
MeshNode
3DGizmoPlugin
();
Navigation
Region
3DGizmoPlugin
();
};
class
JointGizmosDrawer
{
...
...
@@ -387,9 +387,9 @@ public:
static
void
draw_cone
(
const
Transform
&
p_offset
,
const
Basis
&
p_base
,
real_t
p_swing
,
real_t
p_twist
,
Vector
<
Vector3
>
&
r_points
);
};
class
Joint
Node
3DGizmoPlugin
:
public
EditorNode3DGizmoPlugin
{
class
Joint3DGizmoPlugin
:
public
EditorNode3DGizmoPlugin
{
GDCLASS
(
Joint
Node
3DGizmoPlugin
,
EditorNode3DGizmoPlugin
);
GDCLASS
(
Joint3DGizmoPlugin
,
EditorNode3DGizmoPlugin
);
public
:
bool
has_gizmo
(
Node3D
*
p_spatial
);
...
...
@@ -428,7 +428,7 @@ public:
Vector
<
Vector3
>
*
r_body_a_points
,
Vector
<
Vector3
>
*
r_body_b_points
);
Joint
Node
3DGizmoPlugin
();
Joint3DGizmoPlugin
();
};
#endif // SPATIAL_EDITOR_GIZMOS_H
editor/plugins/node_3d_editor_plugin.cpp
View file @
3841a647
...
...
@@ -5907,28 +5907,28 @@ void Node3DEditor::_node_removed(Node *p_node) {
}
void
Node3DEditor
::
_register_all_gizmos
()
{
add_gizmo_plugin
(
Ref
<
Camera
Node3DGizmoPlugin
>
(
memnew
(
CameraNode
3DGizmoPlugin
)));
add_gizmo_plugin
(
Ref
<
Light
Node3DGizmoPlugin
>
(
memnew
(
LightNode
3DGizmoPlugin
)));
add_gizmo_plugin
(
Ref
<
AudioStreamPlayer3D
Node3DGizmoPlugin
>
(
memnew
(
AudioStreamPlayer3DNode
3DGizmoPlugin
)));
add_gizmo_plugin
(
Ref
<
MeshInstance
Node3DGizmoPlugin
>
(
memnew
(
MeshInstanceNod
e3DGizmoPlugin
)));
add_gizmo_plugin
(
Ref
<
SoftBody
Node3DGizmoPlugin
>
(
memnew
(
SoftBodyNode
3DGizmoPlugin
)));
add_gizmo_plugin
(
Ref
<
Sprite3D
Node3DGizmoPlugin
>
(
memnew
(
Sprite3DNod
e3DGizmoPlugin
)));
add_gizmo_plugin
(
Ref
<
Skeleton
Node3DGizmoPlugin
>
(
memnew
(
SkeletonNode
3DGizmoPlugin
)));
add_gizmo_plugin
(
Ref
<
Position3D
Node3DGizmoPlugin
>
(
memnew
(
Position3DNode
3DGizmoPlugin
)));
add_gizmo_plugin
(
Ref
<
RayCast
Node3DGizmoPlugin
>
(
memnew
(
RayCastNode
3DGizmoPlugin
)));
add_gizmo_plugin
(
Ref
<
SpringArm
Node3DGizmoPlugin
>
(
memnew
(
SpringArmNode
3DGizmoPlugin
)));
add_gizmo_plugin
(
Ref
<
VehicleWheel
Node3DGizmoPlugin
>
(
memnew
(
VehicleWheelNode
3DGizmoPlugin
)));
add_gizmo_plugin
(
Ref
<
VisibilityNotifier
GizmoPlugin
>
(
memnew
(
VisibilityNotifier
GizmoPlugin
)));
add_gizmo_plugin
(
Ref
<
Camera
3DGizmoPlugin
>
(
memnew
(
Camera
3DGizmoPlugin
)));
add_gizmo_plugin
(
Ref
<
Light
3DGizmoPlugin
>
(
memnew
(
Light
3DGizmoPlugin
)));
add_gizmo_plugin
(
Ref
<
AudioStreamPlayer3D
GizmoPlugin
>
(
memnew
(
AudioStreamPlayer
3DGizmoPlugin
)));
add_gizmo_plugin
(
Ref
<
MeshInstance
3DGizmoPlugin
>
(
memnew
(
MeshInstanc
e3DGizmoPlugin
)));
add_gizmo_plugin
(
Ref
<
SoftBody
3DGizmoPlugin
>
(
memnew
(
SoftBody
3DGizmoPlugin
)));
add_gizmo_plugin
(
Ref
<
Sprite3D
GizmoPlugin
>
(
memnew
(
Sprit
e3DGizmoPlugin
)));
add_gizmo_plugin
(
Ref
<
Skeleton
3DGizmoPlugin
>
(
memnew
(
Skeleton
3DGizmoPlugin
)));
add_gizmo_plugin
(
Ref
<
Position3D
GizmoPlugin
>
(
memnew
(
Position
3DGizmoPlugin
)));
add_gizmo_plugin
(
Ref
<
RayCast
3DGizmoPlugin
>
(
memnew
(
RayCast
3DGizmoPlugin
)));
add_gizmo_plugin
(
Ref
<
SpringArm
3DGizmoPlugin
>
(
memnew
(
SpringArm
3DGizmoPlugin
)));
add_gizmo_plugin
(
Ref
<
VehicleWheel
3DGizmoPlugin
>
(
memnew
(
VehicleWheel
3DGizmoPlugin
)));
add_gizmo_plugin
(
Ref
<
VisibilityNotifier
3DGizmoPlugin
>
(
memnew
(
VisibilityNotifier3D
GizmoPlugin
)));
add_gizmo_plugin
(
Ref
<
GPUParticles3DGizmoPlugin
>
(
memnew
(
GPUParticles3DGizmoPlugin
)));
add_gizmo_plugin
(
Ref
<
CPUParticles3DGizmoPlugin
>
(
memnew
(
CPUParticles3DGizmoPlugin
)));
add_gizmo_plugin
(
Ref
<
ReflectionProbeGizmoPlugin
>
(
memnew
(
ReflectionProbeGizmoPlugin
)));
add_gizmo_plugin
(
Ref
<
GIProbeGizmoPlugin
>
(
memnew
(
GIProbeGizmoPlugin
)));
// add_gizmo_plugin(Ref<BakedIndirectLightGizmoPlugin>(memnew(BakedIndirectLightGizmoPlugin)));
add_gizmo_plugin
(
Ref
<
CollisionShape
Node3DGizmoPlugin
>
(
memnew
(
CollisionShapeNod
e3DGizmoPlugin
)));
add_gizmo_plugin
(
Ref
<
CollisionPolygon
Node3DGizmoPlugin
>
(
memnew
(
CollisionPolygonNode
3DGizmoPlugin
)));
add_gizmo_plugin
(
Ref
<
Navigation
MeshNode3DGizmoPlugin
>
(
memnew
(
NavigationMeshNode
3DGizmoPlugin
)));
add_gizmo_plugin
(
Ref
<
Joint
Node3DGizmoPlugin
>
(
memnew
(
JointNode
3DGizmoPlugin
)));
add_gizmo_plugin
(
Ref
<
PhysicalBone
Node3DGizmoPlugin
>
(
memnew
(
PhysicalBoneNod
e3DGizmoPlugin
)));
add_gizmo_plugin
(
Ref
<
CollisionShape
3DGizmoPlugin
>
(
memnew
(
CollisionShap
e3DGizmoPlugin
)));
add_gizmo_plugin
(
Ref
<
CollisionPolygon
3DGizmoPlugin
>
(
memnew
(
CollisionPolygon
3DGizmoPlugin
)));
add_gizmo_plugin
(
Ref
<
Navigation
Region3DGizmoPlugin
>
(
memnew
(
NavigationRegion
3DGizmoPlugin
)));
add_gizmo_plugin
(
Ref
<
Joint
3DGizmoPlugin
>
(
memnew
(
Joint
3DGizmoPlugin
)));
add_gizmo_plugin
(
Ref
<
PhysicalBone
3DGizmoPlugin
>
(
memnew
(
PhysicalBon
e3DGizmoPlugin
)));
}
void
Node3DEditor
::
_bind_methods
()
{
...
...
editor/plugins/path_3d_editor_plugin.cpp
View file @
3841a647
...
...
@@ -34,7 +34,7 @@
#include "node_3d_editor_plugin.h"
#include "scene/resources/curve.h"
String
Path
Node
3DGizmo
::
get_handle_name
(
int
p_idx
)
const
{
String
Path3DGizmo
::
get_handle_name
(
int
p_idx
)
const
{
Ref
<
Curve3D
>
c
=
path
->
get_curve
();
if
(
c
.
is_null
())
...
...
@@ -57,7 +57,7 @@ String PathNode3DGizmo::get_handle_name(int p_idx) const {
return
n
;
}
Variant
Path
Node
3DGizmo
::
get_handle_value
(
int
p_idx
)
{
Variant
Path3DGizmo
::
get_handle_value
(
int
p_idx
)
{
Ref
<
Curve3D
>
c
=
path
->
get_curve
();
if
(
c
.
is_null
())
...
...
@@ -84,7 +84,7 @@ Variant PathNode3DGizmo::get_handle_value(int p_idx) {
return
ofs
;
}
void
Path
Node
3DGizmo
::
set_handle
(
int
p_idx
,
Camera3D
*
p_camera
,
const
Point2
&
p_point
)
{
void
Path3DGizmo
::
set_handle
(
int
p_idx
,
Camera3D
*
p_camera
,
const
Point2
&
p_point
)
{
Ref
<
Curve3D
>
c
=
path
->
get_curve
();
if
(
c
.
is_null
())
...
...
@@ -154,7 +154,7 @@ void PathNode3DGizmo::set_handle(int p_idx, Camera3D *p_camera, const Point2 &p_
}
}
void
Path
Node
3DGizmo
::
commit_handle
(
int
p_idx
,
const
Variant
&
p_restore
,
bool
p_cancel
)
{
void
Path3DGizmo
::
commit_handle
(
int
p_idx
,
const
Variant
&
p_restore
,
bool
p_cancel
)
{
Ref
<
Curve3D
>
c
=
path
->
get_curve
();
if
(
c
.
is_null
())
...
...
@@ -217,7 +217,7 @@ void PathNode3DGizmo::commit_handle(int p_idx, const Variant &p_restore, bool p_
}
}
void
Path
Node
3DGizmo
::
redraw
()
{
void
Path3DGizmo
::
redraw
()
{
clear
();
...
...
@@ -286,7 +286,7 @@ void PathNode3DGizmo::redraw() {
}
}
Path
Node3DGizmo
::
PathNode
3DGizmo
(
Path3D
*
p_path
)
{
Path
3DGizmo
::
Path
3DGizmo
(
Path3D
*
p_path
)
{
path
=
p_path
;
set_spatial_node
(
p_path
);
...
...
@@ -563,7 +563,7 @@ Path3DEditorPlugin::Path3DEditorPlugin(EditorNode *p_node) {
mirror_handle_angle
=
true
;
mirror_handle_length
=
true
;
Ref
<
Path
Node
3DGizmoPlugin
>
gizmo_plugin
;
Ref
<
Path3DGizmoPlugin
>
gizmo_plugin
;
gizmo_plugin
.
instance
();
Node3DEditor
::
get_singleton
()
->
add_gizmo_plugin
(
gizmo_plugin
);
...
...
@@ -627,24 +627,24 @@ Path3DEditorPlugin::Path3DEditorPlugin(EditorNode *p_node) {
Path3DEditorPlugin
::~
Path3DEditorPlugin
()
{
}
Ref
<
EditorNode3DGizmo
>
Path
Node
3DGizmoPlugin
::
create_gizmo
(
Node3D
*
p_spatial
)
{
Ref
<
Path
Node
3DGizmo
>
ref
;
Ref
<
EditorNode3DGizmo
>
Path3DGizmoPlugin
::
create_gizmo
(
Node3D
*
p_spatial
)
{
Ref
<
Path3DGizmo
>
ref
;
Path3D
*
path
=
Object
::
cast_to
<
Path3D
>
(
p_spatial
);
if
(
path
)
ref
=
Ref
<
Path
Node3DGizmo
>
(
memnew
(
PathNode
3DGizmo
(
path
)));
if
(
path
)
ref
=
Ref
<
Path
3DGizmo
>
(
memnew
(
Path
3DGizmo
(
path
)));
return
ref
;
}
String
Path
Node
3DGizmoPlugin
::
get_name
()
const
{
String
Path3DGizmoPlugin
::
get_name
()
const
{
return
"Path3D"
;
}
int
Path
Node
3DGizmoPlugin
::
get_priority
()
const
{
int
Path3DGizmoPlugin
::
get_priority
()
const
{
return
-
1
;
}
Path
Node3DGizmoPlugin
::
PathNode
3DGizmoPlugin
()
{
Path
3DGizmoPlugin
::
Path
3DGizmoPlugin
()
{
Color
path_color
=
EDITOR_DEF
(
"editors/3d_gizmos/gizmo_colors/path"
,
Color
(
0.5
,
0.5
,
1.0
,
0.8
));
create_material
(
"path_material"
,
path_color
);
...
...
editor/plugins/path_3d_editor_plugin.h
View file @
3841a647
...
...
@@ -34,9 +34,9 @@
#include "editor/node_3d_editor_gizmos.h"
#include "scene/3d/path_3d.h"
class
Path
Node
3DGizmo
:
public
EditorNode3DGizmo
{
class
Path3DGizmo
:
public
EditorNode3DGizmo
{
GDCLASS
(
Path
Node
3DGizmo
,
EditorNode3DGizmo
);
GDCLASS
(
Path3DGizmo
,
EditorNode3DGizmo
);
Path3D
*
path
;
mutable
Vector3
original
;
...
...
@@ -50,12 +50,12 @@ public:
virtual
void
commit_handle
(
int
p_idx
,
const
Variant
&
p_restore
,
bool
p_cancel
=
false
);
virtual
void
redraw
();
Path
Node
3DGizmo
(
Path3D
*
p_path
=
nullptr
);
Path3DGizmo
(
Path3D
*
p_path
=
nullptr
);
};
class
Path
Node
3DGizmoPlugin
:
public
EditorNode3DGizmoPlugin
{
class
Path3DGizmoPlugin
:
public
EditorNode3DGizmoPlugin
{
GDCLASS
(
Path
Node
3DGizmoPlugin
,
EditorNode3DGizmoPlugin
);
GDCLASS
(
Path3DGizmoPlugin
,
EditorNode3DGizmoPlugin
);
protected
:
Ref
<
EditorNode3DGizmo
>
create_gizmo
(
Node3D
*
p_spatial
);
...
...
@@ -63,7 +63,7 @@ protected:
public
:
String
get_name
()
const
;
int
get_priority
()
const
;
Path
Node
3DGizmoPlugin
();
Path3DGizmoPlugin
();
};
class
Path3DEditorPlugin
:
public
EditorPlugin
{
...
...
modules/csg/csg_gizmos.cpp
View file @
3841a647
...
...
@@ -32,7 +32,7 @@
///////////
CSGShape
Node3DGizmoPlugin
::
CSGShapeNod
e3DGizmoPlugin
()
{
CSGShape
3DGizmoPlugin
::
CSGShap
e3DGizmoPlugin
()
{
Color
gizmo_color
=
EDITOR_DEF
(
"editors/3d_gizmos/gizmo_colors/csg"
,
Color
(
0.0
,
0.4
,
1
,
0.15
));
create_material
(
"shape_union_material"
,
gizmo_color
);
...
...
@@ -49,7 +49,7 @@ CSGShapeNode3DGizmoPlugin::CSGShapeNode3DGizmoPlugin() {
create_handle_material
(
"handles"
);
}
String
CSGShape
Node
3DGizmoPlugin
::
get_handle_name
(
const
EditorNode3DGizmo
*
p_gizmo
,
int
p_idx
)
const
{
String
CSGShape3DGizmoPlugin
::
get_handle_name
(
const
EditorNode3DGizmo
*
p_gizmo
,
int
p_idx
)
const
{
CSGShape3D
*
cs
=
Object
::
cast_to
<
CSGShape3D
>
(
p_gizmo
->
get_spatial_node
());
...
...
@@ -76,7 +76,7 @@ String CSGShapeNode3DGizmoPlugin::get_handle_name(const EditorNode3DGizmo *p_giz
return
""
;
}
Variant
CSGShape
Node
3DGizmoPlugin
::
get_handle_value
(
EditorNode3DGizmo
*
p_gizmo
,
int
p_idx
)
const
{
Variant
CSGShape3DGizmoPlugin
::
get_handle_value
(
EditorNode3DGizmo
*
p_gizmo
,
int
p_idx
)
const
{
CSGShape3D
*
cs
=
Object
::
cast_to
<
CSGShape3D
>
(
p_gizmo
->
get_spatial_node
());
...
...
@@ -110,7 +110,7 @@ Variant CSGShapeNode3DGizmoPlugin::get_handle_value(EditorNode3DGizmo *p_gizmo,
return
Variant
();
}
void
CSGShape
Node
3DGizmoPlugin
::
set_handle
(
EditorNode3DGizmo
*
p_gizmo
,
int
p_idx
,
Camera3D
*
p_camera
,
const
Point2
&
p_point
)
{
void
CSGShape3DGizmoPlugin
::
set_handle
(
EditorNode3DGizmo
*
p_gizmo
,
int
p_idx
,
Camera3D
*
p_camera
,
const
Point2
&
p_point
)
{
CSGShape3D
*
cs
=
Object
::
cast_to
<
CSGShape3D
>
(
p_gizmo
->
get_spatial_node
());
...
...
@@ -207,7 +207,7 @@ void CSGShapeNode3DGizmoPlugin::set_handle(EditorNode3DGizmo *p_gizmo, int p_idx
s
->
set_outer_radius
(
d
);
}
}
void
CSGShape
Node
3DGizmoPlugin
::
commit_handle
(
EditorNode3DGizmo
*
p_gizmo
,
int
p_idx
,
const
Variant
&
p_restore
,
bool
p_cancel
)
{
void
CSGShape3DGizmoPlugin
::
commit_handle
(
EditorNode3DGizmo
*
p_gizmo
,
int
p_idx
,
const
Variant
&
p_restore
,
bool
p_cancel
)
{
CSGShape3D
*
cs
=
Object
::
cast_to
<
CSGShape3D
>
(
p_gizmo
->
get_spatial_node
());
...
...
@@ -299,23 +299,23 @@ void CSGShapeNode3DGizmoPlugin::commit_handle(EditorNode3DGizmo *p_gizmo, int p_
ur
->
commit_action
();
}
}
bool
CSGShape
Node
3DGizmoPlugin
::
has_gizmo
(
Node3D
*
p_spatial
)
{
bool
CSGShape3DGizmoPlugin
::
has_gizmo
(
Node3D
*
p_spatial
)
{
return
Object
::
cast_to
<
CSGSphere3D
>
(
p_spatial
)
||
Object
::
cast_to
<
CSGBox3D
>
(
p_spatial
)
||
Object
::
cast_to
<
CSGCylinder3D
>
(
p_spatial
)
||
Object
::
cast_to
<
CSGTorus3D
>
(
p_spatial
)
||
Object
::
cast_to
<
CSGMesh3D
>
(
p_spatial
)
||
Object
::
cast_to
<
CSGPolygon3D
>
(
p_spatial
);
}
String
CSGShape
Node
3DGizmoPlugin
::
get_name
()
const
{
return
"CSGShape
s
"
;
String
CSGShape3DGizmoPlugin
::
get_name
()
const
{
return
"CSGShape
3D
"
;
}
int
CSGShape
Node
3DGizmoPlugin
::
get_priority
()
const
{
int
CSGShape3DGizmoPlugin
::
get_priority
()
const
{
return
-
1
;
}
bool
CSGShape
Node
3DGizmoPlugin
::
is_selectable_when_hidden
()
const
{
bool
CSGShape3DGizmoPlugin
::
is_selectable_when_hidden
()
const
{
return
true
;
}
void
CSGShape
Node
3DGizmoPlugin
::
redraw
(
EditorNode3DGizmo
*
p_gizmo
)
{
void
CSGShape3DGizmoPlugin
::
redraw
(
EditorNode3DGizmo
*
p_gizmo
)
{
CSGShape3D
*
cs
=
Object
::
cast_to
<
CSGShape3D
>
(
p_gizmo
->
get_spatial_node
());
...
...
@@ -419,6 +419,6 @@ void CSGShapeNode3DGizmoPlugin::redraw(EditorNode3DGizmo *p_gizmo) {
}
EditorPluginCSG
::
EditorPluginCSG
(
EditorNode
*
p_editor
)
{
Ref
<
CSGShape
Node3DGizmoPlugin
>
gizmo_plugin
=
Ref
<
CSGShapeNode3DGizmoPlugin
>
(
memnew
(
CSGShapeNod
e3DGizmoPlugin
));
Ref
<
CSGShape
3DGizmoPlugin
>
gizmo_plugin
=
Ref
<
CSGShape3DGizmoPlugin
>
(
memnew
(
CSGShap
e3DGizmoPlugin
));
Node3DEditor
::
get_singleton
()
->
add_gizmo_plugin
(
gizmo_plugin
);
}
modules/csg/csg_gizmos.h
View file @
3841a647
...
...
@@ -35,9 +35,9 @@
#include "editor/editor_plugin.h"
#include "editor/node_3d_editor_gizmos.h"
class
CSGShape
Node
3DGizmoPlugin
:
public
EditorNode3DGizmoPlugin
{
class
CSGShape3DGizmoPlugin
:
public
EditorNode3DGizmoPlugin
{
GDCLASS
(
CSGShape
Node
3DGizmoPlugin
,
EditorNode3DGizmoPlugin
);
GDCLASS
(
CSGShape3DGizmoPlugin
,
EditorNode3DGizmoPlugin
);
public
:
bool
has_gizmo
(
Node3D
*
p_spatial
);
...
...
@@ -51,7 +51,7 @@ public:
void
set_handle
(
EditorNode3DGizmo
*
p_gizmo
,
int
p_idx
,
Camera3D
*
p_camera
,
const
Point2
&
p_point
);
void
commit_handle
(
EditorNode3DGizmo
*
p_gizmo
,
int
p_idx
,
const
Variant
&
p_restore
,
bool
p_cancel
);
CSGShape
Node
3DGizmoPlugin
();
CSGShape3DGizmoPlugin
();
};
class
EditorPluginCSG
:
public
EditorPlugin
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment