Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Ivmi-Builder
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Damien Marchal
Ivmi-Builder
Commits
da5afd48
Commit
da5afd48
authored
1 year ago
by
Florent Berthaut
Browse files
Options
Downloads
Patches
Plain Diff
Fixed array in tunnels and midi values
parent
8ac31f1c
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
core/IvmiNode.gd
+1
-1
1 addition, 1 deletion
core/IvmiNode.gd
techniques/control/Tunnel/Tunnel.gd
+10
-4
10 additions, 4 deletions
techniques/control/Tunnel/Tunnel.gd
techniques/control/Tunnel/TunnelPreset.tscn
+3
-3
3 additions, 3 deletions
techniques/control/Tunnel/TunnelPreset.tscn
with
14 additions
and
8 deletions
core/IvmiNode.gd
+
1
−
1
View file @
da5afd48
...
@@ -136,7 +136,7 @@ func _get_ivmi_type():
...
@@ -136,7 +136,7 @@ func _get_ivmi_type():
return
_ivmi_type
return
_ivmi_type
func
_process
(
delta
):
func
_process
(
delta
):
if
!
Engine
.
is_editor_hint
():
if
is_inside_tree
():
#get cam dist if needed
#get cam dist if needed
if
_properties
[
"distance_to_camera"
]
.
_listen
:
if
_properties
[
"distance_to_camera"
]
.
_listen
:
var
cam_pos
=
get_viewport
()
.
get_camera_3d
()
.
to_global
(
Vector3
(
0
,
0
,
0
))
var
cam_pos
=
get_viewport
()
.
get_camera_3d
()
.
to_global
(
Vector3
(
0
,
0
,
0
))
...
...
This diff is collapsed.
Click to expand it.
techniques/control/Tunnel/Tunnel.gd
+
10
−
4
View file @
da5afd48
...
@@ -56,11 +56,14 @@ func _update_slices() :
...
@@ -56,11 +56,14 @@ func _update_slices() :
s
.
scale
.
z
=
0.5
s
.
scale
.
z
=
0.5
s
.
rotation_degrees
.
x
=
0
s
.
rotation_degrees
.
x
=
0
for
param
in
tunnel_preset_array
[
_preset_index
]:
for
param
in
tunnel_preset_array
[
_preset_index
]:
var
value
var
value
:
float
if
param
.
data_type
==
DATA_TYPE
.
array
:
if
param
.
data_type
==
DATA_TYPE
.
array
:
value
=
_find_value_in_array
(
ratio
,
param
.
array
)
value
=
_find_value_in_array
(
ratio
,
param
.
array
)
else
:
else
:
value
=
param
.
curve
.
sample
(
ratio
)
value
=
param
.
curve
.
sample
(
ratio
)
if
value
>
1.0
:
value
/=
127
match
param
.
name
:
match
param
.
name
:
"tunnel_color_scale"
:
"tunnel_color_scale"
:
...
@@ -94,6 +97,8 @@ func _physics_process(delta):
...
@@ -94,6 +97,8 @@ func _physics_process(delta):
value
=
_find_value_in_array
(
ratio
,
param
.
array
)
value
=
_find_value_in_array
(
ratio
,
param
.
array
)
else
:
else
:
value
=
param
.
curve
.
sample
(
ratio
)
value
=
param
.
curve
.
sample
(
ratio
)
if
value
>
1.0
:
value
/=
127
col
.
set_property
(
param
.
name
,
[
value
])
col
.
set_property
(
param
.
name
,
[
value
])
func
get_extent
():
func
get_extent
():
...
@@ -101,10 +106,11 @@ func get_extent():
...
@@ -101,10 +106,11 @@ func get_extent():
# Find the highest vec.x < x in the array
# Find the highest vec.x < x in the array
func
_find_value_in_array
(
x
,
array
):
func
_find_value_in_array
(
x
,
array
):
var
val
:
float
=
array
[
array
.
size
()
-
1
]
.
y
for
vec
in
array
:
for
vec
in
array
:
if
x
<=
vec
.
x
:
if
vec
.
x
<=
x
:
return
vec
.
y
val
=
vec
.
y
return
array
[
array
.
size
()
-
1
]
.
y
return
val
func
_cycle_preset
():
func
_cycle_preset
():
_preset_index
=
(
_preset_index
+
1
)
%
tunnel_preset_array
.
size
()
_preset_index
=
(
_preset_index
+
1
)
%
tunnel_preset_array
.
size
()
...
...
This diff is collapsed.
Click to expand it.
techniques/control/Tunnel/TunnelPreset.tscn
+
3
−
3
View file @
da5afd48
[gd_scene load_steps=2 format=
2
]
[gd_scene load_steps=2 format=
3 uid="uid://dnssxrdl7c38r"
]
[ext_resource path="res://addons/ivmi-builder/techniques/control/Tunnel/TunnelPreset.gd"
type="Script" id=1
]
[ext_resource
type="Script"
path="res://addons/ivmi-builder/techniques/control/Tunnel/TunnelPreset.gd"
id="1"
]
[node name="TunnelPreset" type="Node3D"]
[node name="TunnelPreset" type="Node3D"]
script = ExtResource(
1
)
script = ExtResource(
"1"
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment