Skip to content

Commit

Permalink
Fix teleporter blend/glb files to add missing materials. (GodotVR#648)
Browse files Browse the repository at this point in the history
Simplify teleporter disabling.
  • Loading branch information
Malcolmnixon authored Jun 25, 2024
1 parent 5097d07 commit 7269ed6
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 24 deletions.
Binary file modified assets/meshes/teleport/teleport.blend
Binary file not shown.
14 changes: 9 additions & 5 deletions assets/meshes/teleport/teleport.gd
Original file line number Diff line number Diff line change
Expand Up @@ -148,11 +148,15 @@ func _property_get_revert(property : StringName): # Variant
return Transform3D.IDENTITY


func set_collision_disabled(value):
if !Engine.is_editor_hint():
for child in get_node("TeleportBody").get_children():
if child is CollisionShape3D:
child.disabled = value
func set_collision_disabled(p_disable : bool) -> void:
if Engine.is_editor_hint():
return

# Update processing (PROCESS_MODE_DISABLED turns off physics)
if p_disable:
process_mode = PROCESS_MODE_DISABLED
else:
process_mode = PROCESS_MODE_INHERIT


func _set_spawn_data(p_spawn_data : SpawnDataType) -> void:
Expand Down
Binary file modified assets/meshes/teleport/teleport.glb
Binary file not shown.
27 changes: 26 additions & 1 deletion assets/meshes/teleport/teleport.glb.import
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,31 @@ animation/fps=15
animation/trimming=false
animation/remove_immutable_tracks=true
import_script/path=""
_subresources={}
_subresources={
"materials": {
"Body": {
"use_external/enabled": true,
"use_external/path": "res://assets/maps/holodeck/materials/base.material"
},
"Teleport": {
"use_external/enabled": true,
"use_external/path": "res://assets/meshes/teleport/teleport_area_shader.tres"
},
"Title": {
"use_external/enabled": true,
"use_external/path": "res://assets/meshes/teleport/teleport_title_material.tres"
}
},
"nodes": {
"PATH:Base": {
"generate/physics": true,
"physics/shape_type": 1
},
"PATH:Top": {
"generate/physics": true,
"physics/shape_type": 1
}
}
}
gltf/naming_version=0
gltf/embedded_image_handling=1
21 changes: 3 additions & 18 deletions assets/meshes/teleport/teleport.tscn
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
[gd_scene load_steps=9 format=3 uid="uid://3a6wjr3a13vd"]
[gd_scene load_steps=6 format=3 uid="uid://3a6wjr3a13vd"]

[ext_resource type="Script" path="res://assets/meshes/teleport/teleport.gd" id="1_mkuv0"]
[ext_resource type="PackedScene" uid="uid://vhtqagtfb4m4" path="res://assets/meshes/teleport/teleport.glb" id="2_k3yit"]
[ext_resource type="Material" uid="uid://cliyhjfvy8pfd" path="res://assets/maps/holodeck/materials/base.material" id="2_kj6s5"]
[ext_resource type="Material" uid="uid://c26e12f2whdrj" path="res://assets/meshes/teleport/teleport_title_material.tres" id="3_sl3q4"]
[ext_resource type="Material" uid="uid://d4nr1joloeff8" path="res://assets/meshes/teleport/teleport_area_shader.tres" id="4_2bbe5"]
[ext_resource type="Shape3D" uid="uid://vweyq3qwvhpi" path="res://assets/meshes/teleport/teleport_area_base.shape" id="6_wdetv"]
[ext_resource type="Shape3D" uid="uid://bxr6sjb8invtw" path="res://assets/meshes/teleport/teleport_area_top.shape" id="7_67eq3"]

[sub_resource type="CylinderShape3D" id="CylinderShape3D_bekon"]
[sub_resource type="CylinderShape3D" id="CylinderShape3D_pk0bj"]
height = 2.8
radius = 0.85

Expand All @@ -20,31 +17,19 @@ spawn_point_transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0)

[node name="teleport" parent="." instance=ExtResource("2_k3yit")]

[node name="Base" parent="teleport" index="0"]
surface_material_override/0 = ExtResource("2_kj6s5")

[node name="Top" parent="teleport" index="1"]
surface_material_override/0 = ExtResource("2_kj6s5")
surface_material_override/1 = ExtResource("3_sl3q4")

[node name="Cylinder" parent="teleport" index="2"]
surface_material_override/0 = ExtResource("4_2bbe5")

[node name="TeleportBody" type="StaticBody3D" parent="."]

[node name="BaseCollisionShape" type="CollisionShape3D" parent="TeleportBody"]
shape = ExtResource("6_wdetv")

[node name="TopCollisionShape" type="CollisionShape3D" parent="TeleportBody"]
shape = ExtResource("7_67eq3")

[node name="TeleportArea" type="Area3D" parent="."]
collision_layer = 0
collision_mask = 524288

[node name="CollisionShape3d" type="CollisionShape3D" parent="TeleportArea"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.5, 0)
shape = SubResource("CylinderShape3D_bekon")
shape = SubResource("CylinderShape3D_pk0bj")

[connection signal="body_entered" from="TeleportArea" to="." method="_on_TeleportArea_body_entered"]

Expand Down

0 comments on commit 7269ed6

Please sign in to comment.