feat: implemented point primitive gizmo
This commit is contained in:
parent
60865b74c7
commit
dfbe37a2e7
15 changed files with 330 additions and 60 deletions
8
project/assets/materials/peak_handle.tres
Normal file
8
project/assets/materials/peak_handle.tres
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
[gd_resource type="StandardMaterial3D" format=3 uid="uid://dgym4g3uxbvl3"]
|
||||
|
||||
[resource]
|
||||
render_priority = 10
|
||||
no_depth_test = true
|
||||
shading_mode = 0
|
||||
albedo_color = Color(0.36, 1, 0.594667, 1)
|
||||
point_size = 11.2
|
||||
BIN
project/assets/models/point_handle.blend
Normal file
BIN
project/assets/models/point_handle.blend
Normal file
Binary file not shown.
61
project/assets/models/point_handle.blend.import
Normal file
61
project/assets/models/point_handle.blend.import
Normal file
|
|
@ -0,0 +1,61 @@
|
|||
[remap]
|
||||
|
||||
importer="scene"
|
||||
importer_version=1
|
||||
type="PackedScene"
|
||||
uid="uid://bwrqsnetcn8yr"
|
||||
path="res://.godot/imported/point_handle.blend-262ed5ea08d47e6ba78fb31cb5cbab65.scn"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://assets/models/point_handle.blend"
|
||||
dest_files=["res://.godot/imported/point_handle.blend-262ed5ea08d47e6ba78fb31cb5cbab65.scn"]
|
||||
|
||||
[params]
|
||||
|
||||
nodes/root_type=""
|
||||
nodes/root_name=""
|
||||
nodes/apply_root_scale=true
|
||||
nodes/root_scale=1.0
|
||||
nodes/import_as_skeleton_bones=false
|
||||
nodes/use_node_type_suffixes=true
|
||||
meshes/ensure_tangents=true
|
||||
meshes/generate_lods=false
|
||||
meshes/create_shadow_meshes=true
|
||||
meshes/light_baking=1
|
||||
meshes/lightmap_texel_size=0.2
|
||||
meshes/force_disable_compression=false
|
||||
skins/use_named_skins=true
|
||||
animation/import=true
|
||||
animation/fps=30
|
||||
animation/trimming=false
|
||||
animation/remove_immutable_tracks=true
|
||||
animation/import_rest_as_RESET=false
|
||||
import_script/path=""
|
||||
_subresources={
|
||||
"materials": {
|
||||
"Material": {
|
||||
"use_external/enabled": true,
|
||||
"use_external/fallback_path": "res://assets/materials/peak_handle.tres",
|
||||
"use_external/path": "uid://dgym4g3uxbvl3"
|
||||
}
|
||||
}
|
||||
}
|
||||
blender/nodes/visible=0
|
||||
blender/nodes/active_collection_only=false
|
||||
blender/nodes/punctual_lights=true
|
||||
blender/nodes/cameras=true
|
||||
blender/nodes/custom_properties=true
|
||||
blender/nodes/modifiers=1
|
||||
blender/meshes/colors=false
|
||||
blender/meshes/uvs=true
|
||||
blender/meshes/normals=true
|
||||
blender/meshes/export_geometry_nodes_instances=false
|
||||
blender/meshes/tangents=true
|
||||
blender/meshes/skins=2
|
||||
blender/meshes/export_bones_deforming_mesh_only=false
|
||||
blender/materials/unpack_enabled=true
|
||||
blender/materials/export_materials=1
|
||||
blender/animation/limit_playback=true
|
||||
blender/animation/always_sample=true
|
||||
blender/animation/group_tracks=true
|
||||
BIN
project/assets/models/point_handle.blend1
Normal file
BIN
project/assets/models/point_handle.blend1
Normal file
Binary file not shown.
48
project/objects/primitive_nodes/point_primitive_node.tscn
Normal file
48
project/objects/primitive_nodes/point_primitive_node.tscn
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
[gd_scene load_steps=4 format=3 uid="uid://cnux2fqne284i"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://bwrqsnetcn8yr" path="res://assets/models/point_handle.blend" id="1_njtj3"]
|
||||
|
||||
[sub_resource type="GDScript" id="GDScript_njtj3"]
|
||||
script/source = "extends Area3D
|
||||
|
||||
var dragged : bool = false
|
||||
|
||||
func _input(event: InputEvent) -> void:
|
||||
if not dragged:
|
||||
return
|
||||
if event is InputEventMouseButton and not (event as InputEventMouseButton).is_pressed():
|
||||
dragged = false
|
||||
Input.mouse_mode = Input.MOUSE_MODE_VISIBLE
|
||||
$\"..\".push_transform_changes()
|
||||
elif event is InputEventMouseMotion:
|
||||
var motion := event as InputEventMouseMotion
|
||||
get_parent_node_3d().global_position.y -= motion.screen_relative.y
|
||||
get_viewport().set_input_as_handled()
|
||||
|
||||
func _input_event(_camera: Camera3D, event: InputEvent, _event_position: Vector3, _normal: Vector3, _shape_idx: int) -> void:
|
||||
if not dragged and event is InputEventMouseButton and (event as InputEventMouseButton).is_pressed():
|
||||
dragged = true
|
||||
Input.mouse_mode = Input.MOUSE_MODE_CAPTURED
|
||||
get_viewport().set_input_as_handled()
|
||||
"
|
||||
|
||||
[sub_resource type="CylinderShape3D" id="CylinderShape3D_mx0s0"]
|
||||
height = 9.59302
|
||||
radius = 4.85693
|
||||
|
||||
[node name="PointPrimitiveNode" type="PointPrimitiveNode"]
|
||||
|
||||
[node name="point_handle" parent="." instance=ExtResource("1_njtj3")]
|
||||
transform = Transform3D(10, 0, 0, 0, 10, 0, 0, 0, 10, 0, 0, 0)
|
||||
|
||||
[node name="Area3D" type="Area3D" parent="."]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 27.8381, 0)
|
||||
script = SubResource("GDScript_njtj3")
|
||||
|
||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="Area3D"]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 2.80421, 0)
|
||||
shape = SubResource("CylinderShape3D_mx0s0")
|
||||
|
||||
[node name="CollisionShape3D2" type="CollisionShape3D" parent="Area3D"]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -57.945, 0)
|
||||
shape = SubResource("CylinderShape3D_mx0s0")
|
||||
|
|
@ -11,5 +11,12 @@ config_version=5
|
|||
[application]
|
||||
|
||||
config/name="terrain_editor"
|
||||
config/features=PackedStringArray("4.4", "Forward Plus")
|
||||
run/main_scene="uid://xm383pc5pcnn"
|
||||
config/features=PackedStringArray("4.5", "Forward Plus")
|
||||
config/icon="res://icon.svg"
|
||||
|
||||
[rendering]
|
||||
|
||||
anti_aliasing/quality/msaa_2d=1
|
||||
anti_aliasing/quality/msaa_3d=2
|
||||
anti_aliasing/quality/use_debanding=true
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
Loading…
Add table
Add a link
Reference in a new issue