Add new files for instruments and tracker
This commit is contained in:
parent
681c313870
commit
5cf5a6f5a0
5 changed files with 143 additions and 0 deletions
1
project/addons/gdcef/plugin.gd.uid
Normal file
1
project/addons/gdcef/plugin.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://dmeep442e1nha
|
||||
74
project/instruments.gd
Normal file
74
project/instruments.gd
Normal file
|
|
@ -0,0 +1,74 @@
|
|||
extends Node
|
||||
|
||||
@export var browser_name: String = "browser"
|
||||
@export var url: String = "http://localhost:5555/pfd"
|
||||
|
||||
# ==============================================================================
|
||||
# Create a single browser named "browser_name" that is attached as child node to $CEF.
|
||||
# ==============================================================================
|
||||
func _ready():
|
||||
# See API.md for more details. CEF Configuration is:
|
||||
# resource_path := {"artifacts", CEF_ARTIFACTS_FOLDER}
|
||||
# resource_path := {"exported_artifacts", application_real_path()}
|
||||
# {"incognito":false}
|
||||
# {"cache_path", resource_path / "cache"}
|
||||
# {"root_cache_path", resource_path / "cache"}
|
||||
# {"browser_subprocess_path", resource_path / SUBPROCESS_NAME }
|
||||
# {"log_file", resource_path / "debug.log"}
|
||||
# {log_severity", "warning"}
|
||||
# {"remote_debugging_port", 7777}
|
||||
# {"exception_stack_size", 5}
|
||||
# {"enable_media_stream", false}
|
||||
#
|
||||
# Configurate CEF. In incognito mode cache directories not used and in-memory
|
||||
# caches are used instead and no data is persisted to disk.
|
||||
#
|
||||
# artifacts: allows path such as "build" or "res://cef_artifacts/". Note that "res://"
|
||||
# will use ProjectSettings.globalize_path but exported projects don't support globalize_path:
|
||||
# https://docs.godotengine.org/en/3.5/classes/class_projectsettings.html#class-projectsettings-method-globalize-path
|
||||
if !$CEF.initialize({"incognito":true, "locale":"en-US"}):
|
||||
push_error($CEF.get_error())
|
||||
get_tree().quit()
|
||||
return
|
||||
print("CEF version: " + $CEF.get_full_version())
|
||||
|
||||
# Wait one frame for the texture rect to get its size
|
||||
await get_tree().process_frame
|
||||
|
||||
# See API.md for more details. Browser configuration is:
|
||||
# {"frame_rate", 30}
|
||||
# {"javascript", true}
|
||||
# {"javascript_close_windows", false}
|
||||
# {"javascript_access_clipboard", false}
|
||||
# {"javascript_dom_paste", false}
|
||||
# {"image_loading", true}
|
||||
# {"databases", true}
|
||||
# {"webgl", true}
|
||||
var browser = $CEF.create_browser(url, $SubViewport/TextureRect, {
|
||||
"frame_rate": 90,
|
||||
"javascript": true,
|
||||
})
|
||||
browser.name = browser_name
|
||||
browser.connect("on_page_loaded", _on_page_loaded)
|
||||
browser.connect("on_page_failed_loading", _on_page_failed_loading)
|
||||
#browser.set_zoom_level(0.05)
|
||||
|
||||
# Required for lidia static assets
|
||||
browser.enable_ad_block(false)
|
||||
|
||||
# ==============================================================================
|
||||
# Callback when a page has ended to load: we print a message
|
||||
# ==============================================================================
|
||||
func _on_page_loaded(node):
|
||||
print(node.name + ": page " + node.get_url() + " loaded")
|
||||
|
||||
# ==============================================================================
|
||||
# Callback when a page has ended to load with failure.
|
||||
# Display a load error message using a data: URI.
|
||||
# ==============================================================================
|
||||
func _on_page_failed_loading(err_code, err_msg, node):
|
||||
if err_code == -3:
|
||||
return
|
||||
push_error("The browser " + node.name + " failed loading " + \
|
||||
node.get_url() + ": " + err_msg)
|
||||
pass
|
||||
1
project/instruments.gd.uid
Normal file
1
project/instruments.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://01bmfj4wthwg
|
||||
30
project/instruments.tscn
Normal file
30
project/instruments.tscn
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
[gd_scene load_steps=5 format=3 uid="uid://cis4s43ubuynp"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://01bmfj4wthwg" path="res://instruments.gd" id="1_h5at3"]
|
||||
|
||||
[sub_resource type="QuadMesh" id="QuadMesh_nowl7"]
|
||||
size = Vector2(1, 0.75)
|
||||
|
||||
[sub_resource type="ViewportTexture" id="ViewportTexture_8lpkn"]
|
||||
viewport_path = NodePath("SubViewport")
|
||||
|
||||
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_h5at3"]
|
||||
resource_local_to_scene = true
|
||||
albedo_texture = SubResource("ViewportTexture_8lpkn")
|
||||
|
||||
[node name="Instruments" type="Node3D"]
|
||||
script = ExtResource("1_h5at3")
|
||||
|
||||
[node name="SubViewport" type="SubViewport" parent="."]
|
||||
size = Vector2i(800, 600)
|
||||
|
||||
[node name="TextureRect" type="TextureRect" parent="SubViewport"]
|
||||
offset_right = 800.0
|
||||
offset_bottom = 600.0
|
||||
expand_mode = 5
|
||||
|
||||
[node name="Quad" type="MeshInstance3D" parent="."]
|
||||
mesh = SubResource("QuadMesh_nowl7")
|
||||
surface_material_override/0 = SubResource("StandardMaterial3D_h5at3")
|
||||
|
||||
[node name="CEF" type="GDCef" parent="."]
|
||||
37
project/reference_axes.tscn
Normal file
37
project/reference_axes.tscn
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
[gd_scene load_steps=6 format=3 uid="uid://fmygcraoturj"]
|
||||
|
||||
[sub_resource type="BoxMesh" id="BoxMesh_pt8uc"]
|
||||
size = Vector3(0.1, 0.1, 0.1)
|
||||
|
||||
[sub_resource type="BoxMesh" id="BoxMesh_xmmp6"]
|
||||
size = Vector3(0.9, 0.05, 0.05)
|
||||
|
||||
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_5xl2y"]
|
||||
albedo_color = Color(1, 0, 0, 1)
|
||||
|
||||
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_qml71"]
|
||||
albedo_color = Color(0, 1, 0, 1)
|
||||
|
||||
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_sb5rx"]
|
||||
albedo_color = Color(0, 0, 1, 1)
|
||||
|
||||
[node name="ReferenceAxes" type="Node3D"]
|
||||
|
||||
[node name="Center" type="MeshInstance3D" parent="."]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.05, 0.05, 0.05)
|
||||
mesh = SubResource("BoxMesh_pt8uc")
|
||||
|
||||
[node name="AxisX" type="MeshInstance3D" parent="."]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.55, 0.025, 0.025)
|
||||
mesh = SubResource("BoxMesh_xmmp6")
|
||||
surface_material_override/0 = SubResource("StandardMaterial3D_5xl2y")
|
||||
|
||||
[node name="AxisY" type="MeshInstance3D" parent="."]
|
||||
transform = Transform3D(-4.37114e-08, -1, 0, 1, -4.37114e-08, 0, 0, 0, 1, 0.025, 0.55, 0.025)
|
||||
mesh = SubResource("BoxMesh_xmmp6")
|
||||
surface_material_override/0 = SubResource("StandardMaterial3D_qml71")
|
||||
|
||||
[node name="AxisZ" type="MeshInstance3D" parent="."]
|
||||
transform = Transform3D(-4.37114e-08, 0, 1, 0, 1, 0, -1, 0, -4.37114e-08, 0.025, 0.025, 0.55)
|
||||
mesh = SubResource("BoxMesh_xmmp6")
|
||||
surface_material_override/0 = SubResource("StandardMaterial3D_sb5rx")
|
||||
Loading…
Add table
Add a link
Reference in a new issue