Initial commit
This commit is contained in:
commit
d7302501f0
16 changed files with 225 additions and 0 deletions
4
.editorconfig
Normal file
4
.editorconfig
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
root = true
|
||||
|
||||
[*]
|
||||
charset = utf-8
|
||||
2
.gitattributes
vendored
Normal file
2
.gitattributes
vendored
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
# Normalize EOL for all files that Git considers text files.
|
||||
* text=auto eol=lf
|
||||
3
.gitignore
vendored
Normal file
3
.gitignore
vendored
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
# Godot 4+ specific ignores
|
||||
.godot/
|
||||
/android/
|
||||
7
assets/materials/glass.tres
Normal file
7
assets/materials/glass.tres
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
[gd_resource type="ORMMaterial3D" format=3 uid="uid://glk2rfkn4vcu"]
|
||||
|
||||
[resource]
|
||||
transparency = 4
|
||||
cull_mode = 2
|
||||
albedo_color = Color(1, 1, 1, 0.3882353)
|
||||
clearcoat_enabled = true
|
||||
7
assets/materials/glass_std.tres
Normal file
7
assets/materials/glass_std.tres
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
[gd_resource type="StandardMaterial3D" format=3 uid="uid://be2l68by8md8t"]
|
||||
|
||||
[resource]
|
||||
transparency = 4
|
||||
cull_mode = 2
|
||||
albedo_color = Color(1, 1, 1, 0.2784314)
|
||||
clearcoat_enabled = true
|
||||
BIN
assets/models/flask.glb
Normal file
BIN
assets/models/flask.glb
Normal file
Binary file not shown.
49
assets/models/flask.glb.import
Normal file
49
assets/models/flask.glb.import
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
[remap]
|
||||
|
||||
importer="scene"
|
||||
importer_version=1
|
||||
type="PackedScene"
|
||||
uid="uid://cybcaqajfr5jx"
|
||||
path="res://.godot/imported/flask.glb-2126b3646c073a6ae7a51eae46cf2a4b.scn"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://assets/models/flask.glb"
|
||||
dest_files=["res://.godot/imported/flask.glb-2126b3646c073a6ae7a51eae46cf2a4b.scn"]
|
||||
|
||||
[params]
|
||||
|
||||
nodes/root_type=""
|
||||
nodes/root_name=""
|
||||
nodes/root_script=null
|
||||
nodes/apply_root_scale=true
|
||||
nodes/root_scale=1.0
|
||||
nodes/import_as_skeleton_bones=false
|
||||
nodes/use_name_suffixes=true
|
||||
nodes/use_node_type_suffixes=true
|
||||
meshes/ensure_tangents=true
|
||||
meshes/generate_lods=true
|
||||
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=""
|
||||
materials/extract=0
|
||||
materials/extract_format=0
|
||||
materials/extract_path=""
|
||||
_subresources={
|
||||
"materials": {
|
||||
"@MATERIAL:0": {
|
||||
"use_external/enabled": true,
|
||||
"use_external/path": "uid://glk2rfkn4vcu"
|
||||
}
|
||||
}
|
||||
}
|
||||
gltf/naming_version=2
|
||||
gltf/embedded_image_handling=1
|
||||
1
icon.svg
Normal file
1
icon.svg
Normal file
|
|
@ -0,0 +1 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" width="128" height="128"><rect width="124" height="124" x="2" y="2" fill="#363d52" stroke="#212532" stroke-width="4" rx="14"/><g fill="#fff" transform="translate(12.322 12.322)scale(.101)"><path d="M105 673v33q407 354 814 0v-33z"/><path fill="#478cbf" d="m105 673 152 14q12 1 15 14l4 67 132 10 8-61q2-11 15-15h162q13 4 15 15l8 61 132-10 4-67q3-13 15-14l152-14V427q30-39 56-81-35-59-83-108-43 20-82 47-40-37-88-64 7-51 8-102-59-28-123-42-26 43-46 89-49-7-98 0-20-46-46-89-64 14-123 42 1 51 8 102-48 27-88 64-39-27-82-47-48 49-83 108 26 42 56 81zm0 33v39c0 276 813 276 814 0v-39l-134 12-5 69q-2 10-14 13l-162 11q-12 0-16-11l-10-65H446l-10 65q-4 11-16 11l-162-11q-12-3-14-13l-5-69z"/><path d="M483 600c0 34 58 34 58 0v-86c0-34-58-34-58 0z"/><circle cx="725" cy="526" r="90"/><circle cx="299" cy="526" r="90"/></g><g fill="#414042" transform="translate(12.322 12.322)scale(.101)"><circle cx="307" cy="532" r="60"/><circle cx="717" cy="532" r="60"/></g></svg>
|
||||
|
After Width: | Height: | Size: 995 B |
43
icon.svg.import
Normal file
43
icon.svg.import
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://bdyc1cwthn845"
|
||||
path="res://.godot/imported/icon.svg-218a8f2b3041327d8a5756f3a245f83b.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://icon.svg"
|
||||
dest_files=["res://.godot/imported/icon.svg-218a8f2b3041327d8a5756f3a245f83b.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/uastc_level=0
|
||||
compress/rdo_quality_loss=0.0
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/channel_remap/red=0
|
||||
process/channel_remap/green=1
|
||||
process/channel_remap/blue=2
|
||||
process/channel_remap/alpha=3
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
||||
svg/scale=1.0
|
||||
editor/scale_with_editor_scale=false
|
||||
editor/convert_colors_with_editor_theme=false
|
||||
28
project.godot
Normal file
28
project.godot
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
; Engine configuration file.
|
||||
; It's best edited using the editor UI and not directly,
|
||||
; since the parameters that go here are not all obvious.
|
||||
;
|
||||
; Format:
|
||||
; [section] ; section goes between []
|
||||
; param=value ; assign values to parameters
|
||||
|
||||
config_version=5
|
||||
|
||||
[application]
|
||||
|
||||
config/name="lab-electrolyte"
|
||||
run/main_scene="uid://c7r4rhgj3ucao"
|
||||
config/features=PackedStringArray("4.5", "Mobile")
|
||||
config/icon="res://icon.svg"
|
||||
|
||||
[input]
|
||||
|
||||
drag_camera={
|
||||
"deadzone": 0.2,
|
||||
"events": [Object(InputEventMouseButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"button_mask":2,"position":Vector2(641, 3),"global_position":Vector2(650, 51),"factor":1.0,"button_index":2,"canceled":false,"pressed":true,"double_click":false,"script":null)
|
||||
]
|
||||
}
|
||||
|
||||
[rendering]
|
||||
|
||||
renderer/rendering_method="mobile"
|
||||
27
scenes/draggable_object.tscn
Normal file
27
scenes/draggable_object.tscn
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
[gd_scene load_steps=5 format=3 uid="uid://bjxjcx2qu16q5"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://bjnv2g1ni0525" path="res://src/draggable_object.gd" id="1_vcwhe"]
|
||||
|
||||
[sub_resource type="SphereShape3D" id="SphereShape3D_vcwhe"]
|
||||
radius = 0.49570328
|
||||
|
||||
[sub_resource type="SphereShape3D" id="SphereShape3D_18ddp"]
|
||||
radius = 0.25
|
||||
|
||||
[sub_resource type="SphereMesh" id="SphereMesh_18ddp"]
|
||||
radius = 0.25
|
||||
height = 0.5
|
||||
|
||||
[node name="DraggableObject" type="Area3D"]
|
||||
script = ExtResource("1_vcwhe")
|
||||
|
||||
[node name="DragShape" type="CollisionShape3D" parent="."]
|
||||
shape = SubResource("SphereShape3D_vcwhe")
|
||||
|
||||
[node name="DragArea" type="Area3D" parent="."]
|
||||
|
||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="DragArea"]
|
||||
shape = SubResource("SphereShape3D_18ddp")
|
||||
|
||||
[node name="MeshInstance3D" type="MeshInstance3D" parent="."]
|
||||
mesh = SubResource("SphereMesh_18ddp")
|
||||
22
scenes/lab.tscn
Normal file
22
scenes/lab.tscn
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
[gd_scene load_steps=4 format=3 uid="uid://c7r4rhgj3ucao"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://bjxjcx2qu16q5" path="res://scenes/draggable_object.tscn" id="1_bb6uc"]
|
||||
[ext_resource type="Script" uid="uid://crjao0jjv5yqs" path="res://src/draggable_camera.gd" id="1_hem3r"]
|
||||
|
||||
[sub_resource type="BoxMesh" id="BoxMesh_cbcd7"]
|
||||
size = Vector3(3.535, 1, 1)
|
||||
|
||||
[node name="Lab" type="Node3D"]
|
||||
|
||||
[node name="MeshInstance3D" type="MeshInstance3D" parent="."]
|
||||
mesh = SubResource("BoxMesh_cbcd7")
|
||||
|
||||
[node name="Camera3D" type="Camera3D" parent="."]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -1.236948, 0.9448395, 1.8294222)
|
||||
script = ExtResource("1_hem3r")
|
||||
|
||||
[node name="DraggableObject" parent="." instance=ExtResource("1_bb6uc")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -1.236948, 0.9448395, 0.0039073825)
|
||||
|
||||
[node name="DirectionalLight3D" type="DirectionalLight3D" parent="."]
|
||||
transform = Transform3D(1, 0, 0, 0, 0.8403207, 0.5420896, 0, -0.5420896, 0.8403207, 0, 1.9293891, 0)
|
||||
7
src/draggable_camera.gd
Normal file
7
src/draggable_camera.gd
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
extends Camera3D
|
||||
|
||||
const SENSITIVITY = 0.05
|
||||
|
||||
func _input(event: InputEvent) -> void:
|
||||
if Input.is_action_pressed("drag_camera") and event is InputEventMouseMotion:
|
||||
global_position += get_ * Vector3(event.relative.x,event.relative.y,0)
|
||||
1
src/draggable_camera.gd.uid
Normal file
1
src/draggable_camera.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://crjao0jjv5yqs
|
||||
23
src/draggable_object.gd
Normal file
23
src/draggable_object.gd
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
extends Area3D
|
||||
|
||||
|
||||
var mouse_in: bool = false
|
||||
var dragged: bool = false
|
||||
|
||||
func _mouse_enter() -> void:
|
||||
mouse_in = true
|
||||
|
||||
func _mouse_exit() -> void:
|
||||
mouse_in = false
|
||||
dragged = false
|
||||
|
||||
func _process(delta: float) -> void:
|
||||
if dragged == false:
|
||||
return
|
||||
var camera: Camera3D = get_viewport().get_camera_3d()
|
||||
var new_position: Vector3 = camera.project_position(get_viewport().get_mouse_position(),(-camera.basis.z).dot(camera.to_local(global_position)))
|
||||
global_position = new_position
|
||||
|
||||
func _input(event: InputEvent) -> void:
|
||||
if mouse_in and event is InputEventMouseButton and event.button_index == MOUSE_BUTTON_LEFT:
|
||||
dragged = true if event.pressed else false
|
||||
1
src/draggable_object.gd.uid
Normal file
1
src/draggable_object.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://bjnv2g1ni0525
|
||||
Loading…
Add table
Add a link
Reference in a new issue