Skip to content

Commit

Permalink
Extend simple static 3d baking demo
Browse files Browse the repository at this point in the history
  • Loading branch information
Scony committed May 10, 2022
1 parent e9dd1dd commit d51b28c
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 7 deletions.
1 change: 1 addition & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
[submodule "addons/godot-advanced-navigation-plugin"]
path = addons/godot-advanced-navigation-plugin
url = git@github.com:lampe-games/godot-advanced-navigation-plugin.git
ignore = dirty
66 changes: 60 additions & 6 deletions 3d/SimpleStaticNavmesh.tscn
Original file line number Diff line number Diff line change
@@ -1,21 +1,75 @@
[gd_scene load_steps=3 format=2]
[gd_scene load_steps=10 format=2]

[ext_resource path="res://addons/godot-advanced-navigation-plugin/nodes/AdvancedNavigationMesh3D.gdns" type="Script" id=1]
[ext_resource path="res://addons/godot-advanced-navigation-plugin/advancednavigation.gdnlib" type="GDNativeLibrary" id=2]

[sub_resource type="CubeMesh" id=1]
size = Vector3( 0.5, 0.5, 0.5 )
[sub_resource type="NativeScript" id=8]
class_name = "RecastPolygonMeshConfig"
library = ExtResource( 2 )

[sub_resource type="Resource" id=9]
script = SubResource( 8 )
partitioning/algorithm = 0
cell/size = 0.3
cell/height = 0.2
agent/radius = 2
agent/height = 5
agent/max_climb = 1
agent/max_slope = 70.0
edge/max_legth = 40
edge/max_error = 1.3
region/min_area = 64
region/merge_area = 400
polygon/max_verts_per_poly = 6
detail/sample_distance = 1.8
detail/sample_max_error = 1.0
filter/low_hanging_walkable_obstacles = true
filter/ledge_spans = true
filter/walkable_low_height_spans = true
custom_aabb_enabled/enabled = false
custom_aabb_enabled/bmin = Vector3( -10, -10, -10 )
custom_aabb_enabled/bmax = Vector3( 0, 10, 0 )

[sub_resource type="PlaneMesh" id=1]
size = Vector2( 15, 15 )

[sub_resource type="CubeMesh" id=2]
size = Vector3( 5, 5, 5 )

[sub_resource type="CubeMesh" id=6]
size = Vector3( 0.6, 0.59, 0.6 )

[sub_resource type="CubeMesh" id=5]

[sub_resource type="CubeMesh" id=7]
size = Vector3( 2, 1.2, 2 )

[node name="Demo" type="Spatial"]

[node name="AdvancedNavigationMesh3D" type="Spatial" parent="."]
script = ExtResource( 1 )
baked = true
config = SubResource( 9 )

[node name="MeshInstance" type="MeshInstance" parent="."]
[node name="MeshInstance2" type="MeshInstance" parent="AdvancedNavigationMesh3D"]
mesh = SubResource( 1 )
material/0 = null
skeleton = NodePath("../..")

[node name="MeshInstance" type="MeshInstance" parent="AdvancedNavigationMesh3D"]
mesh = SubResource( 2 )

[node name="MeshInstance3" type="MeshInstance" parent="AdvancedNavigationMesh3D"]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -5.47, 0, 0 )
mesh = SubResource( 6 )

[node name="MeshInstance4" type="MeshInstance" parent="AdvancedNavigationMesh3D"]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -5.46955, 0, -4.77247 )
mesh = SubResource( 5 )

[node name="Camera" type="Camera" parent="."]
transform = Transform( 0.707107, -0.353553, 0.612372, 0, 0.866025, 0.5, -0.707107, -0.353553, 0.612372, 10.2029, 8.33063, 10.2029 )
projection = 1
size = 10.0

[node name="MeshInstance" type="MeshInstance" parent="."]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 6.32903, 0, 0 )
mesh = SubResource( 7 )
4 changes: 4 additions & 0 deletions project.godot
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ config/name="Advanced Navigation Plugin Demos"
run/main_scene="res://3d/SimpleStaticNavmesh.tscn"
config/icon="res://icon.png"

[autoload]

AdvancedNavigationServer3D="*res://addons/godot-advanced-navigation-plugin/nodes/AdvancedNavigationServer3D.gdns"

[editor_plugins]

enabled=PoolStringArray( "res://addons/godot-advanced-navigation-plugin/plugin.cfg" )
Expand Down

0 comments on commit d51b28c

Please sign in to comment.