From 0cddf6b6a57788908bdb516b8b0353bccefd9897 Mon Sep 17 00:00:00 2001 From: water111 <48171810+water111@users.noreply.github.com> Date: Sun, 1 Jan 2023 12:11:18 -0500 Subject: [PATCH] W/nav debugging (#2077) Co-authored-by: Tyler Wilding --- decompiler/IR2/AtomicOp.cpp | 2 +- decompiler/analysis/mips2c.cpp | 2 + decompiler/config/jak2/all-types.gc | 481 +- decompiler/config/jak2/hacks.jsonc | 46 +- decompiler/config/jak2/stack_structures.jsonc | 19 +- decompiler/config/jak2/type_casts.jsonc | 29 +- decompiler/util/data_decompile.cpp | 2 + game/CMakeLists.txt | 2 + game/mips2c/jak2_functions/nav_control.cpp | 274 ++ game/mips2c/jak2_functions/nav_mesh.cpp | 939 ++++ game/mips2c/mips2c_private.h | 2 +- game/mips2c/mips2c_table.cpp | 141 +- goal_src/jak2/engine/ai/enemy.gc | 2 +- goal_src/jak2/engine/anim/fma-sphere.gc | 4 +- .../jak2/engine/collide/collide-shape-h.gc | 7 +- .../jak2/engine/common_objs/basebutton.gc | 2 +- goal_src/jak2/engine/common_objs/crates.gc | 6 +- .../jak2/engine/common_objs/generic-obs.gc | 3 +- goal_src/jak2/engine/draw/drawable.gc | 5 +- goal_src/jak2/engine/entity/entity-h.gc | 6 +- goal_src/jak2/engine/entity/entity.gc | 8 +- goal_src/jak2/engine/level/level-h.gc | 2 +- goal_src/jak2/engine/level/level.gc | 6 +- goal_src/jak2/engine/nav/nav-control-h.gc | 102 +- goal_src/jak2/engine/nav/nav-control.gc | 4362 +++++++++++++++++ goal_src/jak2/engine/nav/nav-mesh-h.gc | 62 +- goal_src/jak2/engine/nav/nav-mesh.gc | 2843 ++++++++++- goal_src/jak2/engine/physics/trajectory.gc | 8 +- .../process-drawable/process-drawable.gc | 2 +- .../process-drawable/simple-nav-sphere.gc | 4 +- .../engine/spatial-hash/spatial-hash-h.gc | 18 +- .../jak2/engine/spatial-hash/spatial-hash.gc | 4 +- goal_src/jak2/game.gp | 5 + goal_src/jak2/levels/common/enemy/bouncer.gc | 2 +- .../common/enemy/hover/hover-nav-control-h.gc | 259 + .../common/enemy/hover/hover-nav-network.gc | 3126 ++++++++++++ goal_src/jak2/levels/common/flitter.gc | 2 +- .../jak2/levels/nest/boss/nest-texture.gc | 3 + .../jak2/levels/nest/boss/nestb-scenes.gc | 1768 +++++++ .../reference/jak2/engine/ai/enemy_REF.gc | 2 +- .../jak2/engine/anim/fma-sphere_REF.gc | 4 +- .../engine/collide/collide-shape-h_REF.gc | 2 +- .../jak2/engine/common_objs/basebutton_REF.gc | 2 +- .../jak2/engine/common_objs/crates_REF.gc | 2 +- .../engine/common_objs/generic-obs_REF.gc | 2 +- .../reference/jak2/engine/debug/debug_REF.gc | 1 + .../jak2/engine/draw/drawable_REF.gc | 6 +- .../jak2/engine/entity/entity-h_REF.gc | 6 +- .../jak2/engine/entity/entity_REF.gc | 177 +- .../particles/sparticle-launcher_REF.gc | 1 + .../jak2/engine/level/level-h_REF.gc | 2 +- .../reference/jak2/engine/level/level_REF.gc | 74 +- .../jak2/engine/nav/nav-control-h_REF.gc | 114 +- .../jak2/engine/nav/nav-control_REF.gc | 4361 ++++++++++++++++ .../jak2/engine/nav/nav-mesh-h_REF.gc | 157 +- .../reference/jak2/engine/nav/nav-mesh_REF.gc | 2839 +++++++++++ .../jak2/engine/physics/trajectory_REF.gc | 8 +- .../process-drawable/process-drawable_REF.gc | 2 +- .../process-drawable/simple-nav-sphere_REF.gc | 4 +- .../engine/spatial-hash/spatial-hash-h_REF.gc | 18 +- .../engine/spatial-hash/spatial-hash_REF.gc | 2 +- .../jak2/levels/common/enemy/bouncer_REF.gc | 2 +- .../enemy/hover/hover-nav-control-h_REF.gc | 493 ++ .../enemy/hover/hover-nav-network_REF.gc | 3134 ++++++++++++ .../jak2/levels/common/flitter_REF.gc | 6 +- .../jak2/levels/nest/boss/nestb-scenes_REF.gc | 1847 +++++++ test/offline/config/jak2/config.jsonc | 6 +- 67 files changed, 27239 insertions(+), 595 deletions(-) create mode 100644 game/mips2c/jak2_functions/nav_control.cpp create mode 100644 game/mips2c/jak2_functions/nav_mesh.cpp create mode 100644 test/decompiler/reference/jak2/engine/nav/nav-control_REF.gc create mode 100644 test/decompiler/reference/jak2/engine/nav/nav-mesh_REF.gc create mode 100644 test/decompiler/reference/jak2/levels/common/enemy/hover/hover-nav-control-h_REF.gc create mode 100644 test/decompiler/reference/jak2/levels/common/enemy/hover/hover-nav-network_REF.gc create mode 100644 test/decompiler/reference/jak2/levels/nest/boss/nestb-scenes_REF.gc diff --git a/decompiler/IR2/AtomicOp.cpp b/decompiler/IR2/AtomicOp.cpp index f77ce76932..b4c838511e 100644 --- a/decompiler/IR2/AtomicOp.cpp +++ b/decompiler/IR2/AtomicOp.cpp @@ -188,7 +188,7 @@ goos::Object SimpleAtom::to_form(const std::vector& labels, con return goos::Object::make_float(f); } else { // nan or weird - return pretty_print::to_symbol(fmt::format("(the-as float #x{:x})", m_int)); + return pretty_print::to_symbol(fmt::format("(the-as float #x{:x})", (u32)m_int)); } } else { if (std::abs(m_int) > INT32_MAX) { diff --git a/decompiler/analysis/mips2c.cpp b/decompiler/analysis/mips2c.cpp index fb1eeabfea..d83469d5b2 100644 --- a/decompiler/analysis/mips2c.cpp +++ b/decompiler/analysis/mips2c.cpp @@ -1088,6 +1088,7 @@ Mips2C_Line handle_normal_instr(Mips2C_Output& output, case InstructionKind::SLTU: case InstructionKind::DSRAV: case InstructionKind::DSLLV: + case InstructionKind::DSRLV: case InstructionKind::SLLV: case InstructionKind::PAND: case InstructionKind::PCEQB: @@ -1116,6 +1117,7 @@ Mips2C_Line handle_normal_instr(Mips2C_Output& output, return handle_daddiu(output, i0, instr_str, version); case InstructionKind::ADDIU: case InstructionKind::SLTI: + case InstructionKind::SLTIU: return handle_generic_op2_u16(i0, instr_str); case InstructionKind::QMTC2: return handle_generic_op2(i0, instr_str, "mov128_vf_gpr"); diff --git a/decompiler/config/jak2/all-types.gc b/decompiler/config/jak2/all-types.gc index e78d797980..6ca7fc0452 100644 --- a/decompiler/config/jak2/all-types.gc +++ b/decompiler/config/jak2/all-types.gc @@ -6038,16 +6038,16 @@ (activate-levels! (_type_) int 13) (debug-print-entities (_type_ symbol type) none 14) (debug-draw-actors (_type_ symbol) none 15) - (assign-draw-indices (_type_) none 16) ;; (level-update (_type_) int 16) - (actors-update (_type_) none 17) ;; (level-get-target-inside (_type_) level 17) - (level-group-method-18 (_type_) none 18) ;; (alloc-levels! (_type_ symbol) int 18) - (level-update (_type_) none 19) ;; - (level-get-target-inside (_type_) level 20) ;; (art-group-get-by-name (_type_ string) art-group 20) + (assign-draw-indices (_type_) none 16) + (actors-update (_type_) none 17) + (update-nav-meshes (_type_) none 18) + (level-update (_type_) none 19) + (level-get-target-inside (_type_) level 20) (alloc-levels-if-needed (_type_ symbol) none 21) (load-commands-set! (_type_ pair) none 22) (art-group-get-by-name (_type_ string (pointer uint32)) art-group 23) - (alt-load-command-get-index (_type_ symbol int) pair 24) ;; (print-volume-sizes (_type_) none 24) - (update-vis-volumes (_type_) none 25) ;; (level-status (_type_ symbol) symbol 25) + (alt-load-command-get-index (_type_ symbol int) pair 24) + (update-vis-volumes (_type_) none 25) (update-vis-volumes-from-nav-mesh (_type_) none 26) (print-volume-sizes (_type_) none 27) (level-status (_type_ symbol) symbol 28) @@ -16107,7 +16107,7 @@ (collide-with collide-spec :offset-assert 20) (action collide-action :offset-assert 24) ;; guessed by decompiler (prim-type prim-type :offset-assert 28) - (unused1 uint8 3 :offset-assert 29) + (unused1 uint8 3 :offset-assert 29) (quad uint128 2 :offset 0) ;; guessed by decompiler ) :method-count-assert 9 @@ -16210,8 +16210,9 @@ (defenum nav-flags :type uint8 :bitfield #t - (nav-flags0 0) - (nav-flags1 1) + (has-root-sphere 0) + (has-extra-sphere 1) + (has-child-spheres 2) ) ;; ---collide-shape-h:nav-flags @@ -19691,7 +19692,7 @@ :bitfield #t :type uint16 (bit-0 0) ;; blocks birth - (bit-1 1) + (bit-1 1) ;; dead? error? (dead 2) (no-kill 3) (bit-4 4) @@ -19800,7 +19801,7 @@ :size-assert #x38 :flag-assert #x1d00000038 (:methods - (entity-nav-mesh-method-27 (_type_) none 27) + (initialize-nav-mesh! "Initialize the nav-mesh in this entity." (_type_) none 27) (debug-draw (_type_) none 28) ) ) @@ -19834,8 +19835,8 @@ (prev-actor (_type_) entity-actor 28) (debug-print (_type_ symbol type) none 29) (toggle-status (_type_ entity-perm-status symbol) none 30) - (entity-actor-method-31 (_type_ vector vector vector object float) nav-mesh 31) - (entity-actor-method-32 (_type_ vector vector nav-poly float) nav-poly 32) + (get-simple-travel-vector (_type_ vector vector vector object float) nav-mesh 31) + (project-point-to-nav-mesh (_type_ vector vector nav-poly float) nav-poly 32) ) ) @@ -22313,7 +22314,7 @@ ) (deftype nav-poly (structure) - ((data uint8 64 :offset-assert 0 :score -1) + ((data uint8 64 :offset-assert 0 :score -10) (vertex vector 4 :inline :offset 0) ;; changed to vector from uint8 in jak 1 (vertex0 vector :inline :offset 0) (vertex1 vector :inline :offset 16) @@ -22396,7 +22397,7 @@ ) (deftype clamp-travel-vector-to-mesh-return-info (structure) - ((found-boundary basic :offset-assert 0) + ((found-boundary symbol :offset-assert 0) (intersection vector :inline :offset-assert 16) (boundary-normal vector :inline :offset-assert 32) (prev-normal vector :inline :offset-assert 48) @@ -22453,48 +22454,44 @@ :size-assert #x70 :flag-assert #x2f00000070 (:methods - (nav-mesh-method-9 (_type_) none 9) ;; (tri-centroid-world (_type_ nav-poly vector) vector 9) - (nav-mesh-method-10 (_type_ vector vector nav-poly) nav-poly 10) ;; (tri-centroid-local (_type_ nav-poly vector) vector 10) - (nav-mesh-method-11 (_type_ nav-poly vector) vector 11) ;; (get-adj-poly (_type_ nav-poly nav-poly symbol) nav-poly 11) - (nav-mesh-method-12 (_type_ nav-poly vector) none 12) ;; (setup-portal (_type_ nav-poly nav-poly nav-route-portal) object 12) - (nav-mesh-method-13 (_type_ nav-poly nav-poly) nav-poly 13) ;; (initialize-mesh! (_type_) none 13) - (get-route-portal (_type_ nav-poly nav-poly nav-route-portal) (inline-array nav-vertex) 14) ;; (move-along-nav-ray! (_type_ nav-ray) none 14) - (initialize-mesh! (_type_) none 15) ;; (try-move-along-ray (_type_ nav-poly vector vector float) meters 15) - (move-along-nav-ray! (_type_ nav-ray) none 16) ;; (TODO-RENAME-16 (_type_ vector nav-poly vector symbol float clip-travel-vector-to-mesh-return-info) none 16) - (try-move-along-ray (_type_ nav-poly vector vector float) meters 17) ;; (update-route-table (_type_) none 17) - (nav-mesh-method-18 (_type_ vector nav-poly vector float symbol clamp-travel-vector-to-mesh-return-info) none 18) ;; (dummy-18 (_type_ int vector int (pointer int8) int) none 18) - (nav-mesh-method-19 (_type_) none 19) ;; (compute-bounding-box (_type_ vector vector) none 19) - (nav-mesh-method-20 (_type_ clamp-travel-vector-to-mesh-return-info) none 20) ;; (debug-draw-poly (_type_ nav-poly rgba) none 20) - (find-adjacent-bounds-one (_type_ vector nav-poly int int) none 21) ;; (point-in-poly? (_type_ nav-poly vector) symbol 21) - (nav-mesh-method-22 (_type_ vector vector) none 22) ;; (find-opposite-vertices (_type_ nav-poly nav-poly) uint 22) - (nav-mesh-method-23 (_type_ entity-nav-mesh) none 23) ;; (dummy-23 (_type_ nav-poly vector vector vector nav-route-portal) vector 23) - (nav-mesh-method-24 (_type_) none 24) ;; (closest-point-on-boundary (_type_ nav-poly vector vector) vector 24) - (nav-mesh-method-25 (_type_) none 25) ;; (project-point-into-tri-3d (_type_ nav-poly vector vector) none 25) - (nav-mesh-method-26 (_type_) none 26) ;; (project-point-into-tri-2d (_type_ nav-poly vector vector) vector 26) - (new-nav-control (_type_ process-drawable int) nav-control 27) ;; (find-poly-fast (_type_ vector meters) nav-poly 27) - (nav-mesh-method-28 (_type_ object) none 28) ;; (find-poly (_type_ vector meters (pointer nav-control-flags)) nav-poly 28) - (nav-mesh-method-29 (_type_ process-drawable symbol) nav-control 29) ;; (is-in-mesh? (_type_ vector float meters) symbol 29) - (nav-mesh-method-30 (_type_ process-drawable) none 30) - (change-to (_type_ process-drawable) none 31) - (nav-mesh-method-32 "arg1 is a [[nav-mesh-link]] `id`" (_type_ uint32) none 32) - (nav-mesh-method-33 "arg1 is a [[nav-mesh-link]] `id`" (_type_ uint32) symbol 33) - (nav-mesh-method-34 (_type_ object vector float) none 34) - (nav-mesh-method-35 - "TODO - Assertion failed: 'std::isfinite(value)' - Source: C:/Users/xtvas/Repositories/opengoal/jak-project/common/util/print_float.cpp:90 - Function: int __cdecl float_to_cstr(float, char *, bool)" - () none 35) - (nav-mesh-method-36 (_type_ nav-poly rgba) none 36) + (debug-draw (_type_) none 9) + (nav-mesh-method-10 (_type_ vector vector nav-poly) nav-poly 10) + (poly-centroid (_type_ nav-poly vector) vector 11) + (poly-centroid-local (_type_ nav-poly vector) vector 12) + (lookup-poly-on-route-to-target (_type_ nav-poly nav-poly) nav-poly 13) + (get-route-portal (_type_ nav-poly nav-poly nav-route-portal) (inline-array nav-vertex) 14) + (initialize-mesh! (_type_) none 15) + (move-along-nav-ray! (_type_ nav-ray) none 16) + (try-move-along-ray (_type_ nav-poly vector vector float) meters 17) + (clamp-vector-to-mesh-cross-gaps (_type_ vector nav-poly vector float symbol clamp-travel-vector-to-mesh-return-info) none 18) + (clamp-vector-to-mesh-no-gaps (_type_ vector nav-poly vector clamp-travel-vector-to-mesh-return-info) none 19) + (set-normals-from-adjacent-bounds (_type_ clamp-travel-vector-to-mesh-return-info) none 20) + (find-adjacent-bounds-one (_type_ vector nav-poly int int) none 21) + (compute-bounding-box-from-vertices (_type_ vector vector) none 22) + (init-from-entity "Initialize this mesh from an entity." (_type_ entity-nav-mesh) none 23) + (handle-birth "Handle the parent nav-mesh-entity birth." (_type_) none 24) + (handle-kill "Handle the parent nav-mesh-entity kill." (_type_) none 25) + (update-navigation (_type_) none 26) + (new-nav-control (_type_ process-drawable int) nav-control 27) + (remove-nav-control (_type_ nav-control) none 28) + (add-process-drawable-to-navmesh (_type_ process-drawable symbol) none 29) + (remove-process-drawable (_type_ process-drawable) none 30) + (change-to (_type_ process-drawable symbol) none 31) + (link-by-id "arg1 is a [[nav-mesh-link]] `id`" (_type_ uint) symbol 32) + (unlink-by-id "arg1 is a [[nav-mesh-link]] `id`" (_type_ uint) symbol 33) + (nav-mesh-method-34 (_type_ vector vector float) float 34) + (nav-mesh-method-35 (_type_ vector vector float) none 35) + (debug-draw-poly (_type_ nav-poly rgba) none 36) (point-in-poly? (_type_ nav-poly vector) symbol 37) - (nav-mesh-method-38 (_type_ nav-poly vector vector vector object) vector 38) + (nav-mesh-method-38 (_type_ nav-poly vector vector vector (pointer nav-poly)) vector 38) (closest-point-on-boundary (_type_ nav-poly vector vector) none 39) - (nav-mesh-method-40 (_type_ nav-poly vector object vector) none 40) + (project-point-onto-plane-of-poly-local (_type_ nav-poly vector vector vector) none 40) (project-point-into-poly-2d (_type_ nav-poly vector vector) none 41) - (nav-mesh-method-42 (_type_ nav-find-poly-parms) nav-poly 42) - (nav-mesh-method-43 (_type_ nav-find-poly-parms) none 43) - (nav-mesh-method-44 (_type_ vector float float) symbol 44) - (nav-mesh-method-45 "TODO - asm expression building error" (_type_ entity-perm) none 45) ;; entity-perm is wrong - (nav-mesh-method-46 (_type_ object) none 46) + (find-poly-containing-point-local (_type_ nav-find-poly-parms) nav-poly 42) + (find-nearest-poly-to-point-local (_type_ nav-find-poly-parms) nav-find-poly-parms 43) + (is-in-mesh-local? (_type_ vector float float) symbol 44) + (link-to-other-mesh (_type_ nav-mesh-link) symbol 45) + (unlink-mesh (_type_ nav-mesh-link) none 46) ) ) @@ -22602,18 +22599,18 @@ (debug-draw (_type_) none 9) (nav-state-method-10 "Virtual/Stub" (_type_) none 10) - (nav-state-method-11 (_type_ nav-gap-info) symbol 11) - (nav-state-method-12 (_type_ vector) vector 12) - (nav-state-method-13 (_type_ vector) vector 13) - (nav-state-method-14 (_type_ vector) vector 14) - (nav-state-method-15 (_type_ vector) vector 15) + (plan-over-pat1-polys-using-route (_type_ nav-gap-info) symbol 11) + (get-velocity (_type_ vector) vector 12) + (get-travel (_type_ vector) vector 13) + (get-heading (_type_ vector) vector 14) + (get-target-post (_type_ vector) vector 15) (get-speed "@returns `speed`" (_type_) meters 16) (get-rotation-rate "@returns `rotation-rate`" (_type_) float 17) - (nav-state-method-18 (_type_ vector object vector) none 18) + (try-projecting-to-current-poly (_type_ vector object vector) symbol 18) (get-current-poly "@returns `current-poly`" (_type_) nav-poly 19) @@ -22623,37 +22620,37 @@ (nav-state-method-21 () none 21) (nav-state-method-22 () none 22) (nav-state-method-23 () none 23) - (nav-state-method-24 (_type_) none 24) - (nav-state-method-25 (_type_) none 25) - (nav-state-method-26 (_type_) none 26) - (nav-state-method-27 (_type_) none 27) - (nav-state-method-28 (_type_) none 28) + (turn-and-navigate-to-destination (_type_) none 24) + (navigate-using-route-portals-wrapper (_type_) none 25) + (navigate-using-best-dir-recompute-avoid-spheres-1-wrapper (_type_) none 26) + (navigate-within-poly-wrapper (_type_) none 27) + (compute-travel-speed (_type_) none 28) (nav-state-method-29 (_type_) none 29) (nav-state-method-30 (_type_) none 30) - (nav-state-method-31 (_type_) none 31) - (nav-state-method-32 (_type_) none 32) - (nav-state-method-33 (_type_) none 33) - (nav-state-method-34 (_type_) none 34) - (nav-state-method-35 (_type_) none 35) - (nav-state-method-36 (_type_ vector) none 36) - (nav-state-method-37 (_type_) none 37) + (navigate-using-best-dir-recompute-avoid-spheres-2 (_type_) none 31) + (update-travel-dir-from-spheres (_type_) none 32) + (compute-speed-simple (_type_) none 33) + (navigate-v1! (_type_) none 34) + (reset-target! (_type_) none 35) + (add-offset-to-target! (_type_ vector) none 36) + (navigate-v2! (_type_) none 37) (set-current-poly! (_type_ nav-poly) none 38) - (nav-state-method-39 () none 39) - (nav-state-method-40 (_type_) none 40) - (nav-state-method-41 (_type_ vector) symbol 41) - (nav-state-method-42 (_type_ vector) none 42) - (nav-state-method-43 (_type_ vector) none 43) + (nav-state-method-39 (_type_) symbol 39) + (do-navigation-to-destination (_type_ vector) none 40) + (clamp-vector-to-mesh-cross-gaps (_type_ vector) symbol 41) + (set-target-post! (_type_ vector) none 42) + (set-travel! (_type_ vector) none 43) (set-velocity! (_type_ vector) none 44) (set-heading! (_type_ vector) none 45) (set-speed! (_type_ meters) none 46) - (nav-state-method-47 (_type_ nav-control) none 47) + (reset! (_type_ nav-control) none 47) (nav-state-method-48 () none 48) - (nav-state-method-49 (_type_ clamp-travel-vector-to-mesh-return-info) none 49) + (navigate-using-best-dir-use-existing-avoid-spheres (_type_ nav-avoid-spheres-params) none 49) (nav-state-method-50 "Virtual/Stub" (_type_) none 50) - (nav-state-method-51 "TODO - #1888" () none 51) - (nav-state-method-52 (_type_) none 52) - (nav-state-method-53 (_type_) none 53) - (nav-state-method-54 (_type_) none 54) + (navigate-using-route-portals (_type_) none 51) + (navigate-using-best-dir-recompute-avoid-spheres-1 (_type_) none 52) + (navigate-within-poly (_type_) none 53) + (clamp-travel-vector (_type_) none 54) ) ) @@ -22702,45 +22699,45 @@ (:methods ;; (new (symbol type collide-shape int float) _type_ 0) (debug-draw (_type_) none 9) - (point-in-bounds? + (point-in-bsphere? "Is the given point ([[vector]]) outside of the [[nav-mesh]]'s `bounds` [[sphere]] radius" (_type_ vector) symbol 10) - (nav-control-method-11 "TODO" (_type_ vector) vector 11) ;; (dummy-11 (_type_ vector) vector 11) - (nav-control-method-12 (_type_ vector vector nav-poly) nav-poly 12) ;; (TODO-RENAME-12 (_type_ nav-gap-info) symbol 12) - (find-poly "TODO" (_type_ vector) nav-poly 13) ;; (dummy-13 (_type_ vector vector) vector 13) - (nav-control-method-14 (_type_ nav-poly vector object vector) none 14) ;; (set-current-poly! (_type_ nav-poly) none 14) - (nav-control-method-15 "TODO - same as 11" (_type_ vector) none 15) ;; (set-target-pos! (_type_ vector) none 15) - (nav-control-method-16 (_type_ vector float) symbol 16) ;; (dummy-16 (_type_ vector) nav-poly 16) - (is-in-mesh? "TODO" (_type_ vector float) symbol 17) ;; (project-onto-nav-mesh (_type_ vector vector) vector 17) - (nav-control-method-18 () none 18) ;; (find-poly (_type_ vector) nav-poly 18) - (nav-control-method-19 () none 19) ;; (dummy-19 (_type_ vector collide-shape-moving vector float) none 19) - (nav-control-method-20 (_type_ vector nav-poly vector float symbol symbol) none 20) ;; (project-point-into-tri-3d (_type_ nav-poly vector vector) vector 20) - (nav-control-method-21 (_type_) none 21) ;; (TODO-RENAME-21 (_type_ vector) nav-poly 21) - (nav-control-method-22 (_type_ vector nav-avoid-spheres-params) float 22) ;; (TODO-RENAME-22 (_type_ vector float) symbol 22) - (nav-control-method-23 "TODO" (_type_) none 23) ;; (dummy-23 (_type_ vector check-vector-collision-with-nav-spheres-info) float 23) - (nav-control-method-24 (_type_ vector int) none 24) ;; (dummy-24 (_type_ float clip-travel-vector-to-mesh-return-info) none 24) - (get-max-rotation-rate (_type_) float 25) ;; (is-in-mesh? (_type_ vector float) symbol 25) - (get-sphere-mask (_type_) none 26) ;; (TODO-RENAME-26 (_type_) none 26) - (get-target-speed (_type_) meters 27) ;; (TODO-RENAME-27 (_type_) none 27) - (nav-control-method-28 "TODO - Clears `nav-flags::1` on `shape`'s `flags`" (_type_) none 28) ;; (TODO-RENAME-28 (_type_ collide-kind) none 28) - (nav-control-method-29 "TODO - Sets `nav-flags::1` on `shape`'s `flags`" (_type_) none 29) ;; (should-display? (_type_) symbol 29) - (copy-extra-nav-sphere! "Copies the given [[sphere]] into `extra-nav-sphere`" (_type_ sphere) none 30) ;; (dummy-30 (_type_ vector vector vector) sphere 30) - (set-extra-nav-sphere! "Set the `extra-nav-sphere` with the data in the given [[sphere]]" (_type_ sphere) none 31) ;; (intersect-ray-line-segment? (_type_ vector vector vector vector) symbol 31) - (set-extra-nav-sphere-radius! "Set's `extra-nav-sphere`'s radius" (_type_ float) none 32) ;; (TODO-ASM-32 (_type_ vector vector vector vector float) symbol 32) - (set-nearest-y-thres! "Set `nearest-y-threshold`" (_type_ float) none 33) ;; (TODO-RENAME-33 (_type_ vector vector vector vector float) symbol 33) - (set-nav-cull-radius! "Set `nav-cull-radius`" (_type_ meters) none 34) ;; (dummy-34 () none 34) - (set-speed-scale! "Set `speed-scale`" (_type_ float) none 35) ;; (dummy-35 (_type_ vector vector vector vector float) none 35) + (find-poly-containing-point-1 "Find nav-poly containing this point." (_type_ vector) nav-poly 11) + (cloest-point-on-mesh (_type_ vector vector nav-poly) nav-poly 12) + (find-nearest-poly-to-point "Find the nav-poly closest to this point in the nav-mesh." (_type_ vector) nav-poly 13) + (project-point-onto-plane-of-poly "Move a point to the be on the plane containing the given nav-poly. Return the normal too" (_type_ nav-poly vector vector vector) none 14) + (find-poly-containing-point-2 "Find nav-poly containing this point - same as 1" (_type_ vector) nav-poly 15) + (is-above-poly-max-height? "Is the point in a poly, and lower than a max height?" (_type_ vector float) symbol 16) + (is-in-mesh? "Is this point in the mesh?" (_type_ vector float) symbol 17) + (avoid-spheres-1! (_type_ nav-avoid-spheres-params) symbol 18) + (avoid-spheres-2! (_type_ nav-avoid-spheres-params) symbol 19) + (clamp-vector-to-mesh-cross-gaps (_type_ vector nav-poly vector float symbol clamp-travel-vector-to-mesh-return-info) none 20) + (clamp-vector-to-mesh-no-gaps (_type_ vector nav-poly vector clamp-travel-vector-to-mesh-return-info) none 21) + (find-first-sphere-and-update-avoid-params (_type_ vector nav-avoid-spheres-params) float 22) + (set-spheres-from-nav-ids "Set up spheres from sphere ids previously found by find-sphere-ids-from-sphere-hash" (_type_) none 23) + (add-root-sphere-to-hash! "Add our root sphere to the hash (if enabled with output-sphere-hash flag) at the given location." (_type_ vector int) none 24) + (get-max-rotation-rate (_type_) float 25) + (get-sphere-mask (_type_) uint 26) + (get-target-speed (_type_) meters 27) + (enable-extra-sphere! "Sets a flag indicating that this nav-control has an extra-nav-sphere." (_type_) none 28) + (disable-extra-sphere! "Clears a flag indicating that this nav-control has an extra-nav-sphere." (_type_) none 29) + (copy-extra-nav-sphere! "Copies the given [[sphere]] into `extra-nav-sphere`" (_type_ sphere) none 30) + (set-extra-nav-sphere-xyz! "Set the `extra-nav-sphere` with the data in the given [[sphere]]" (_type_ sphere) none 31) + (set-extra-nav-sphere-radius! "Set's `extra-nav-sphere`'s radius" (_type_ float) none 32) + (set-nearest-y-thres! "Set `nearest-y-threshold`" (_type_ float) none 33) + (set-nav-cull-radius! "Set `nav-cull-radius`" (_type_ meters) none 34) + (set-speed-scale! "Set `speed-scale`" (_type_ float) none 35) (set-target-speed! "Set `target-speed`" (_type_ meters) none 36) (set-acceleration! "Set `acceleration`" (_type_ meters) none 37) (set-turning-acceleration! "Set `turning-acceleration`" (_type_ meters) none 38) (set-max-rotation-rate! "Set `max-rotation-rate`" (_type_ float) none 39) (set-sphere-mask! "TODO - probably an enum - Set `sphere-mask`" (_type_ uint) none 40) - (nav-control-method-41 "TODO - calls nav-mesh::28" (_type_) none 41) + (remove! "Remove this nav-control from the nav-mesh it belongs to." (_type_) none 41) (init! "Initializes the [[nav-control]], setting `shape` with the provided [[collide-shape]]" (_type_ collide-shape) none 42) (display-marks? "Returns if navigation related marks should be displayed" (_type_) symbol 43) (nav-control-method-44 () none 44) - (nav-control-method-45 (_type_ vector vector vector) sphere 45) - (find-sphere "TODO" (_type_ symbol) none 46) + (find-first-sphere-intersecting-ray "Find the first sphere that this ray intersects" (_type_ vector vector vector) sphere 45) + (find-sphere-ids-from-sphere-hash "Use sphere-hash to look up navigation sphere IDs and save them." (_type_ symbol) none 46) ) ) @@ -22788,7 +22785,7 @@ :size-assert #x58 :flag-assert #x1900000058 (:methods - (new (symbol type int int) _type_ 0) + (new (symbol type int) _type_ 0) ;; TODO see top-level of nav-mesh, doesn't seem to be 2 ints? (update-grid-for-objects-in-box (_type_ int vector vector) none 9) (clear-bucket-array (_type_) none 10) (setup-search-box (_type_ int vector vector vector) none 11) @@ -22816,7 +22813,7 @@ (len int16 :offset-assert 20) (max-len int16 :offset-assert 22) (mask uint8 :offset-assert 24) - (array uint32 :offset-assert 28) + (array (pointer uint8) :offset-assert 28) ) :method-count-assert 9 :size-assert #x20 @@ -22840,8 +22837,8 @@ (add-a-sphere-with-flag (_type_ vector int) int 27) (update-from-spheres (_type_) none 28) (sphere-hash-method-29 (_type_ find-nav-sphere-ids-params int int int) none 29) - (sphere-hash-method-30 (_type_ find-nav-sphere-ids-params) none 30) - (sphere-hash-method-31 (_type_ vector int int) none 31) + (find-nav-sphere-ids (_type_ find-nav-sphere-ids-params) none 30) + (add-sphere-with-mask-and-id (_type_ vector int int) none 31) (sphere-hash-method-32 (_type_ vector vector float int) symbol 32) (remove-by-id (_type_ sphere int) none 33) ) @@ -29802,9 +29799,9 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (deftype nav-engine-spr-buffer (structure) - ((mem-addr uint32 :offset-assert 0) + ((mem-addr (pointer nav-mesh) :offset-assert 0) ;; TODO - pretty sure these are wrong... (mem-nav uint32 :offset 0) - (spr-addr uint32 :offset-assert 4) + (spr-addr (inline-array nav-control) :offset-assert 4) ;; TODO - pretty sure these are wrong... (spr-nav uint32 :offset 4) (q-size uint32 :offset-assert 8) (i-nav uint8 :offset-assert 12) @@ -29831,7 +29828,7 @@ (work-buf-array nav-engine-spr-buffer 3 :inline :offset-assert 28) (spr-work nav-mesh-work :offset 4) (mem-work nav-mesh-work :offset-assert 76) - (spr-mesh basic :offset 8) + (spr-mesh nav-mesh :offset 8) (mem-mesh nav-mesh :offset-assert 80) (spr-poly-array uint32 :offset 12) (mem-poly-array (inline-array nav-poly) :offset-assert 84) @@ -29845,18 +29842,18 @@ :flag-assert #x1600000060 (:methods (inc-spr-addr! "Adds the given integer to `spr-addr` and returns it" (_type_ uint) uint 9) - (nav-engine-method-10 (_type_ object) none 10) - (nav-engine-method-11 (_type_) none 11) - (nav-engine-method-12 (_type_ nav-mesh object) none 12) - (nav-engine-method-13 (_type_) none 13) - (nav-engine-method-14 (_type_) none 14) - (nav-engine-method-15 (_type_) none 15) + (lay-out-spad-memory (_type_ nav-mesh) none 10) + (set-up-mem-work (_type_) none 11) + (add-spheres-from-mesh-user-list (_type_ sphere-hash nav-mesh) none 12) + (add-all-spheres (_type_) none 13) + (do-sphere-lookups (_type_) none 14) + (update-nav-controls-pipelined-in-spr (_type_) none 15) (update-nav-controls-in-spr (_type_) none 16) - (nav-engine-method-17 (_type_ nav-engine-spr-buffer) none 17) - (nav-engine-method-18 (_type_ nav-engine-spr-buffer) none 18) - (nav-engine-method-19 (_type_ nav-engine-spr-buffer) none 19) - (nav-engine-method-20 () none 20) - (nav-engine-method-21 (_type_) none 21) + (upload-nav-to-spr (_type_ nav-engine-spr-buffer) none 17) + (download-nav-from-spr (_type_ nav-engine-spr-buffer) none 18) + (do-callbacks (_type_ nav-engine-spr-buffer) none 19) + (reloc-ptrs-to-spad (_type_ nav-engine-spr-buffer) none 20) + (reloc-ptrs-to-mem (_type_ nav-engine-spr-buffer) none 21) ) ) @@ -29868,15 +29865,15 @@ (define-extern *debug-offset* vector) ;; vector (define-extern *nav-mesh-work* nav-mesh-work) (define-extern *default-nav-mesh* nav-mesh) ;; nav-mesh -(define-extern nav-mesh-connect-from-ent (function entity-nav-mesh none)) +(define-extern nav-mesh-connect-from-ent "Connect this process to the nav-mesh associate with the entity that spawned the process" (function process-drawable symbol)) (define-extern connection-validate (function connection none)) (define-extern connection-list-validate (function (inline-array connection) symbol)) -(define-extern nav-control-validate (function nav-control none)) +(define-extern nav-control-validate (function process-drawable none)) (define-extern debug-validate-nav-poly (function nav-mesh-link nav-poly none)) -(define-extern nav-dma-send-to-spr-no-flush (function object object object none)) -(define-extern nav-dma-send-from-spr-no-flush (function none)) +(define-extern nav-dma-send-to-spr-no-flush (function pointer pointer int none)) +(define-extern nav-dma-send-from-spr-no-flush (function pointer pointer int none)) (define-extern inc-mod3 "Increments and returns the provided [[int]], if the value exceeds `2`, wrap back to `0`" (function int int)) ;; -(define-extern nav-state-patch-pointers (function none)) +(define-extern nav-state-patch-pointers (function nav-state int none)) (define-extern vu-point-triangle-intersection? (function vector vector vector vector symbol)) ;; (define-extern poly-in-height-range? (function nav-poly float float symbol)) (define-extern init-ray-local (function nav-ray nav-poly vector vector none)) ;; @@ -29889,12 +29886,8 @@ (define-extern plane-height-at-xz-point (function plane vector float)) (define-extern nav-normal-from-3-points (function vector vector vector vector none)) (define-extern get-nav-mesh (function actor-id nav-mesh)) -(define-extern find-nearest-nav-mesh (function vector int nav-mesh)) -;; (define-extern point-to-poly-boundary -;; "TODO - assertion: -;; Assertion failed: 'std::isfinite(value)' -;; Source: C:/Users/xtvas/Repositories/opengoal/jak-project/common/util/print_float.cpp:90" -;; (function nav-poly object vector object none)) +(define-extern find-nearest-nav-mesh (function vector float nav-mesh)) +(define-extern point-to-poly-boundary (function nav-poly vector vector float)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; nav-control ;; @@ -29931,11 +29924,12 @@ (define-extern debug-nav-validate-current-poly (function nav-mesh nav-poly vector symbol)) (define-extern debug-report-nav-stats "Does nothing" (function none)) (define-extern get-nav-control - "Given a [[process-drawable]] return the associated [[nav-control]] using either: + "Given a [[process-drawable]] get the associated [[nav-control]] using either: - the provided `nav-mesh` arg - the `nav-mesh` associated with the [[process-drawable]]'s [[entity]] - If no [[nav-mesh]] is set or found, set the [[entity]]'s [[entity-perm-status]] to TODO and return an error" - (function process-drawable nav-mesh nav-control)) + If no [[nav-mesh]] is set or found, set the [[entity]]'s [[entity-perm-status]] to TODO and return an error. + Note that this doesn't actually return the nav-control, but instead adds this process-drawable to the nav-mesh." + (function process-drawable nav-mesh none)) (define-extern add-nav-sphere "Adds the given [[sphere]] to the [[nav-control]]'s `sphere-array` so long as `max-spheres` is less than [[nav-control]]'s `sphere-count`" @@ -35147,7 +35141,6 @@ ;; hover-nav-control-h ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype nav-network-adjacency (structure) ((index int32 :offset-assert 0) (dist float :offset-assert 4) @@ -35156,21 +35149,14 @@ :size-assert #x8 :flag-assert #x900000008 ) -|# -#| (deftype nav-network-adjacency-array (inline-array-class) - ((length int32 :offset-assert 4) - (allocated-length int32 :offset-assert 8) - (data UNKNOWN :dynamic :offset-assert 16) - ) + ((data nav-network-adjacency :inline :dynamic :offset-assert 16)) :method-count-assert 9 :size-assert #x10 :flag-assert #x900000010 ) -|# -#| (deftype list-node (structure) ((next list-node :offset-assert 0) (prev list-node :offset-assert 4) @@ -35179,45 +35165,48 @@ :size-assert #x8 :flag-assert #x900000008 ) -|# -#| +;; +++hover-nav-control-h:net-path-node-status +(defenum net-path-node-status + :bitfield #t + :type uint16 + (open) + (closed)) +;; ---hover-nav-control-h:net-path-node-status + (deftype nav-network-path-node (list-node) - () + ( + (row-index int32 :offset-assert 8) + (status net-path-node-status :offset-assert 12) + (parent nav-network-path-node :offset-assert 16) + (cost-to-start float :offset-assert 20) + (cost-to-end float :offset-assert 24) + ) :method-count-assert 9 :size-assert #x1c :flag-assert #x90000001c - ;; Failed to read fields. ) -|# -#| (deftype nav-network-info (structure) ((index int32 :offset-assert 0) (pos vector :inline :offset-assert 16) (path-node nav-network-path-node :inline :offset-assert 32) (count int32 :offset-assert 60) - (adjacency uint32 :offset-assert 64) + (adjacency (inline-array nav-network-adjacency) :offset-assert 64) ;; TODO - this is probably wrong and should instead be just `nav-network-adjacency-array` ) :method-count-assert 9 :size-assert #x44 :flag-assert #x900000044 ) -|# -#| (deftype nav-network-info-array (inline-array-class) - ((length int32 :offset-assert 4) - (allocated-length int32 :offset-assert 8) - (data UNKNOWN :dynamic :offset-assert 16) + ((data nav-network-info :inline :dynamic :offset-assert 16) ) :method-count-assert 9 :size-assert #x10 :flag-assert #x900000010 ) -|# -#| (deftype hover-nav-sphere (list-node) ((sphere sphere :inline :offset-assert 16) (handle uint64 :offset-assert 32) @@ -35227,25 +35216,21 @@ :size-assert #x30 :flag-assert #x900000030 ) -|# -#| (deftype hover-nav-path-segment (list-node) ((curve-matrix matrix :inline :offset-assert 16) - (pos-index UNKNOWN 2 :offset-assert 80) + (pos-index int32 2 :offset-assert 80) (dist float :offset-assert 88) - (du float :offset-assert 92) + (du float :offset-assert 92) ;; TODO stands for...? ) :method-count-assert 10 :size-assert #x60 :flag-assert #xa00000060 (:methods - (hover-nav-path-segment-method-9 () none 9) + (hover-nav-path-segment-method-9 (_type_ float) none 9) ) ) -|# -#| (deftype hover-nav-path-info (structure) ((segment-list hover-nav-path-segment :offset-assert 0) (tail-segment hover-nav-path-segment :offset-assert 4) @@ -35259,31 +35244,25 @@ (hover-nav-path-info-method-9 () none 9) ) ) -|# -#| (deftype path-index-array (inline-array-class) - ((length int32 :offset-assert 4) - (allocated-length int32 :offset-assert 8) - (data UNKNOWN :dynamic :offset-assert 16) + ((data hover-nav-path-info :inline :dynamic :offset-assert 16) ) :method-count-assert 9 :size-assert #x10 :flag-assert #x900000010 ) -|# -#| (deftype nav-network (basic) ((network basic :offset-assert 4) (dummy nav-network-info :inline :offset-assert 16) - (control-handle uint64 :offset-assert 88) - (list-table UNKNOWN 5 :offset-assert 96) - (open-list nav-network-path-node :offset-assert 96) - (closed-list nav-network-path-node :offset-assert 100) - (sphere-list hover-nav-sphere :offset-assert 108) - (free-segment-list hover-nav-path-segment :offset-assert 104) - (free-sphere-list hover-nav-sphere :offset-assert 112) + (control-handle handle :offset-assert 88) + (list-table list-node 5 :offset-assert 96) + (open-list nav-network-path-node :offset 96) + (closed-list nav-network-path-node :offset 100) + (sphere-list hover-nav-sphere :offset 108) + (free-segment-list hover-nav-path-segment :offset 104) + (free-sphere-list hover-nav-sphere :offset 112) (segment-pool uint32 :offset-assert 116) (sphere-pool uint32 :offset-assert 120) ) @@ -35291,35 +35270,33 @@ :size-assert #x7c :flag-assert #x210000007c (:methods - (nav-network-method-9 () none 9) - (nav-network-method-10 () none 10) - (nav-network-method-11 () none 11) - (nav-network-method-12 () none 12) - (nav-network-method-13 () none 13) - (nav-network-method-14 () none 14) - (nav-network-method-15 () none 15) - (nav-network-method-16 () none 16) - (nav-network-method-17 () none 17) - (nav-network-method-18 () none 18) - (nav-network-method-19 () none 19) - (nav-network-method-20 () none 20) - (nav-network-method-21 () none 21) - (nav-network-method-22 () none 22) - (nav-network-method-23 () none 23) - (nav-network-method-24 () none 24) - (nav-network-method-25 () none 25) - (nav-network-method-26 () none 26) - (nav-network-method-27 () none 27) - (nav-network-method-28 () none 28) - (nav-network-method-29 () none 29) - (nav-network-method-30 () none 30) + (nav-network-method-9 (_type_) none 9) + (nav-network-method-10 (_type_ level (array nav-network-info)) none 10) + (nav-network-method-11 (_type_) none 11) + (nav-network-method-12 (_type_) none 12) + (nav-network-method-13 (_type_) none 13) + (nav-network-method-14 (_type_ int) none 14) + (nav-network-method-15 (_type_) none 15) + (nav-network-method-16 (_type_) none 16) + (nav-network-method-17 (_type_) nav-network-path-node 17) + (nav-network-method-18 (_type_) none 18) + (nav-network-method-19 (_type_) none 19) + (nav-network-method-20 (_type_) none 20) + (nav-network-method-21 (_type_) none 21) + (nav-network-method-22 (_type_) none 22) + (nav-network-method-23 (_type_) none 23) + (nav-network-method-24 (_type_) none 24) + (nav-network-method-25 (_type_) none 25) + (nav-network-method-26 (_type_) none 26) + (nav-network-method-27 (_type_) none 27) + (nav-network-method-28 (_type_) none 28) + (nav-network-method-29 (_type_) symbol 29) + (get-network (_type_) basic 30) (nav-network-method-31 () none 31) (nav-network-method-32 () none 32) ) ) -|# -#| (deftype hover-nav-params (structure) ((max-speed float :offset-assert 0) (max-acceleration float :offset-assert 4) @@ -35330,9 +35307,7 @@ :size-assert #x10 :flag-assert #x900000010 ) -|# -#| (deftype hover-nav-control (basic) ((root basic :offset-assert 4) (nav basic :offset-assert 8) @@ -35365,34 +35340,33 @@ :size-assert #xd8 :flag-assert #x20000000d8 (:methods - (hover-nav-control-method-9 () none 9) - (hover-nav-control-method-10 () none 10) - (hover-nav-control-method-11 () none 11) - (hover-nav-control-method-12 () none 12) - (hover-nav-control-method-13 () none 13) - (hover-nav-control-method-14 () none 14) - (hover-nav-control-method-15 () none 15) - (hover-nav-control-method-16 () none 16) - (hover-nav-control-method-17 () none 17) - (hover-nav-control-method-18 () none 18) - (hover-nav-control-method-19 () none 19) - (hover-nav-control-method-20 () none 20) - (hover-nav-control-method-21 () none 21) - (hover-nav-control-method-22 () none 22) - (hover-nav-control-method-23 () none 23) - (hover-nav-control-method-24 () none 24) - (hover-nav-control-method-25 () none 25) - (hover-nav-control-method-26 () none 26) - (hover-nav-control-method-27 () none 27) - (hover-nav-control-method-28 () none 28) - (hover-nav-control-method-29 () none 29) - (hover-nav-control-method-30 () none 30) - (hover-nav-control-method-31 () none 31) + (hover-nav-control-method-9 (_type_) none 9) + (hover-nav-control-method-10 (_type_) none 10) + (hover-nav-control-method-11 (_type_) none 11) + (hover-nav-control-method-12 (_type_) none 12) + (hover-nav-control-method-13 (_type_) none 13) + (hover-nav-control-method-14 (_type_ float float) none 14) + (hover-nav-control-method-15 (_type_) none 15) + (hover-nav-control-method-16 (_type_) none 16) + (hover-nav-control-method-17 (_type_) none 17) + (hover-nav-control-method-18 (_type_) none 18) + (hover-nav-control-method-19 (_type_) none 19) + (hover-nav-control-method-20 (_type_) none 20) + (hover-nav-control-method-21 (_type_) none 21) + (hover-nav-control-method-22 (_type_) hover-nav-path-segment 22) + (hover-nav-control-method-23 (_type_) object 23) + (hover-nav-control-method-24 (_type_) none 24) + (hover-nav-control-method-25 (_type_) none 25) + (hover-nav-control-method-26 (_type_) none 26) + (hover-nav-control-method-27 (_type_) none 27) + (hover-nav-control-method-28 (_type_) none 28) + (hover-nav-control-method-29 (_type_) none 29) + (hover-nav-control-method-30 (_type_) float 30) + (hover-nav-control-method-31 (_type_) float 31) ) ) -|# -;; (define-extern *hover-nav-time-offset* object) +(define-extern *hover-nav-time-offset* int) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; hover-enemy-h ;; @@ -35475,39 +35449,32 @@ ;; hover-nav-network ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; (define-extern *drill-adjacency* array) -;; (define-extern *fortress-adjacency* array) -;; (define-extern *forest-adjacency* array) -;; (define-extern *under-adjacency* array) -;; (define-extern *nestb-adjacency* array) +(define-extern *drill-adjacency* (array nav-network-info)) +(define-extern *fortress-adjacency* (array nav-network-info)) +(define-extern *forest-adjacency* (array nav-network-info)) +(define-extern *under-adjacency* (array nav-network-info)) +(define-extern *nestb-adjacency* (array nav-network-info)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; hover-nav-control ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype nav-network-control (process) - ((nav-network basic :offset-assert 124) + ((nav-network nav-network :offset-assert 128) ) :method-count-assert 15 :size-assert #x84 :flag-assert #xf00100084 (:methods - (nav-network-control-method-9 () none 9) - (nav-network-control-method-10 () none 10) - (nav-network-control-method-11 () none 11) - (nav-network-control-method-12 () none 12) - (nav-network-control-method-13 () none 13) (idle () _type_ :state 14) ) ) -|# -;; (define-extern *debug-hover* object) -;; (define-extern nav-network-control-init-by-other function) +(define-extern *debug-hover* symbol) +(define-extern nav-network-control-init-by-other (function nav-network level none :behavior nav-network-control)) ;; (define-extern detect-loop function) ;; (define-extern list-contains function) -;; (define-extern *nav-network* object) +(define-extern *nav-network* nav-network) ;; (define-extern hover-bounce-reaction function) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -42896,7 +42863,7 @@ (define-extern movie-nest-metalkor-shot-draw-impact (function scene-player vector vector none)) (define-extern nestb-login (function none)) (define-extern nestb-deactivate (function none)) -(define-extern nestb-activate (function none)) +(define-extern nestb-activate (function level none)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; nestb-part ;; diff --git a/decompiler/config/jak2/hacks.jsonc b/decompiler/config/jak2/hacks.jsonc index 586438a74c..5d3c153086 100644 --- a/decompiler/config/jak2/hacks.jsonc +++ b/decompiler/config/jak2/hacks.jsonc @@ -285,12 +285,12 @@ "bsp-camera-asm": [1, 2, 3, 4, 6, 7], "(method 9 texture-page-dir)": [5, 6], "level-remap-texture": [2, 3, 4, 5, 6], - "(method 27 nav-mesh)": [0, 1, 2, 4, 5], - "(method 31 nav-mesh)": [0, 1, 2, 7, 8, 9, 11, 12, 13, 15], - "(method 45 nav-mesh)": [1, 4, 5, 8], - "(method 46 nav-mesh)": [1, 2, 3, 5], - "(method 32 nav-mesh)": [0, 1, 2, 4], - "(method 33 nav-mesh)": [0, 1, 2, 4], + + "(method 27 nav-mesh)": [1, 2], + "(method 31 nav-mesh)": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11], + "(method 46 nav-mesh)": [2, 3], + "(method 32 nav-mesh)": [1, 2], + "(method 33 nav-mesh)": [1, 2], "(method 42 nav-mesh)": [1, 2, 3, 7], "point-poly-distance-min": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12], "(method 34 nav-mesh)": [1, 2, 3, 7], @@ -465,7 +465,25 @@ "(anon-function 4 gun-states)": [94, 96, 98], "target-board-handler": [ 13, 14, 18 - ] + ], + "find-closest-circle-ray-intersection": [ + 0, 4, 15, 16, 17, 18 + ], + "(method 18 nav-control)": [ + 11, // L283 + 12, // L300 + 19, // L295 + 20, // L293 + 31, // weird jump back + 34 // weird jump no delay slot + ], + + "(method 19 nav-control)": [9, 10], + "(method 19 nav-mesh)": [7], + "(method 18 nav-mesh)": [9], + "(method 40 nav-state)": [1, 2], + "(method 45 nav-mesh)": [5, 6], + "(method 43 nav-mesh)": [0, 1, 2, 12, 13, 14, 15, 16, 17, 18, 19, 20] }, // Sometimes the game might use format strings that are fetched dynamically, @@ -580,7 +598,19 @@ "add-light-sphere-to-light-group", "light-hash-add-items", "light-hash-count-items", - "light-hash-get-bucket-index" + "light-hash-get-bucket-index", + // nav-mesh / nav-control related + // TODO - it would be nice to eventually figure out the asm blocks for the majority of these + "nav-state-patch-pointers", + "(method 20 nav-engine)", + // "find-closest-circle-ray-intersection", + // "(method 18 nav-control)", + "nav-dma-send-to-spr-no-flush", + "nav-dma-send-from-spr-no-flush", + "(method 17 nav-engine)", + "(method 18 nav-engine)", + "(method 21 nav-engine)", + "(method 39 nav-state)" ], "mips2c_jump_table_functions": {}, diff --git a/decompiler/config/jak2/stack_structures.jsonc b/decompiler/config/jak2/stack_structures.jsonc index ac50f64a58..6558761ee6 100644 --- a/decompiler/config/jak2/stack_structures.jsonc +++ b/decompiler/config/jak2/stack_structures.jsonc @@ -667,10 +667,10 @@ ], "(method 31 entity-actor)": [[16, "nav-find-poly-parms"]], "(method 32 entity-actor)": [[32, "nav-find-poly-parms"]], - "(method 36 nav-mesh)": [[16, "nav-route-portal"]], + "(method 36 nav-mesh)": [[16, ["inline-array", "vector", 3]]], "(method 13 nav-engine)": [[16, "nav-vertex"]], "(method 12 nav-mesh)": [[16, "nav-vertex"]], - "(method 44 nav-mesh)": [[32, "nav-poly"]], + "(method 44 nav-mesh)": [[32, "nav-find-poly-parms"]], "(method 15 nav-mesh)": [[16, "vector"]], "(method 40 nav-mesh)": [ [16, "vector"], @@ -1067,7 +1067,7 @@ "(method 37 nav-state)": [[16, "vector"]], "(method 33 nav-state)": [[16, "clamp-travel-vector-to-mesh-return-info"]], "(method 32 nav-state)": [ - [16, "check-vector-collision-with-nav-spheres-info"] + [16, "nav-control-cfs-work"] ], "(method 28 nav-state)": [[208, "vector"]], "(method 11 nav-state)": [ @@ -1160,8 +1160,6 @@ "(method 45 collide-shape)": [[16, "do-push-aways-work"]], "(method 50 collide-shape)": [[32, "vector"]], "(method 44 collide-shape)": [[16, "pull-rider-info"]], - // placeholder - "placeholder-do-not-add-below": [], "(method 25 guard-shot)": [[32, "vector"]], "(enter impact guard-shot)": [[16, "traffic-danger-info"]], "(method 38 guard-shot)": [[16, "collide-query"]], @@ -1258,5 +1256,14 @@ ], "check-pop-level-firework-green-userdata": [[16, "vector"]], "check-pop-level-firework-red-userdata": [[16, "vector"]], - "check-pop-level-firework-userdata": [[16, "vector"]] + "check-pop-level-firework-userdata": [[16, "vector"]], + "(method 13 nav-mesh)": [[16, ["array", "int8", 4]]], + "point-to-poly-boundary": [[16, ["inline-array", "vector", 4]]], + "(method 35 nav-mesh)": [[16, ["inline-array", "nav-poly", 3]]], + "(method 51 nav-state)": [[16, "vector"], [32, "nav-route-portal"], [80, ["inline-array", "vector", 2]], [192, "matrix"]], + "(method 18 nav-control)": [[16, "nav-control-cfs-work"]], + "(method 19 nav-control)": [[16, "nav-control-cfs-work"]], + "(method 19 nav-mesh)": [[16, "nav-ray"], [96, "vector"]], + "(method 18 nav-mesh)": [[16, "nav-ray"]] + } diff --git a/decompiler/config/jak2/type_casts.jsonc b/decompiler/config/jak2/type_casts.jsonc index bafc6fb6fd..476fd23f70 100644 --- a/decompiler/config/jak2/type_casts.jsonc +++ b/decompiler/config/jak2/type_casts.jsonc @@ -1921,7 +1921,10 @@ [199, "v1", "float"], [220, "v1", "float"] ], - "(method 45 nav-mesh)": [[15, "v1", "entity-nav-mesh"]], + "(method 45 nav-mesh)": [ + [15, "v1", "entity-nav-mesh"], + [[34, 43], "v1", "nav-mesh"] + ], "(method 13 nav-engine)": [ [[53, 65], "s4", "nav-mesh"], [[38, 50], "s3", "nav-mesh"] @@ -3707,10 +3710,6 @@ ], "connection-list-validate": [[5, "gp", "connection"]], "point-poly-distance-min": [[94, "f0", "float"]], - "(method 42 nav-mesh)": [ - [12, "s4", "grid-hash-box"], - [59, "s4", "grid-hash-box"] - ], "(method 26 nav-mesh)": [[[23, 78], "s4", "nav-engine"]], "compute-dir-parm": [[10, "v1", "float"]], "(trans idle fma-sphere)": [[39, "a2", "process-drawable"]], @@ -5411,5 +5410,23 @@ [45, "a0", "(pointer gs-test)"], [47, "a0", "(pointer gs-reg64)"], [[72, 102], "t1", "rgba"] - ] + ], + "(method 16 nav-engine)": [[92, "gp", "nav-engine-spr-buffer"]], + "(method 12 nav-engine)": [ + [[22, 28], "v1", "connection"], + [[29, 31], "a0", "process-focusable"], + [[34, 86], "s2", "collide-shape"], + [90, "v1", "collide-shape-prim-group"], + [110, "s2", "collide-shape-prim-sphere"] + ], + "compute-dir-parm": [ + [18, "f0", "float"], + [8, "a2", "uint"], + [10, "v1", "float"] + ], + "(method 11 nav-state)": [[37, "v1", "float"]], + "(method 18 nav-control)": [[252, "a2", "float"]], + "(method 23 nav-mesh)": [["_stack_", 16, "res-tag"]], + "nav-control-validate": [[29, "s5", "int"], [29, "v1", "int"]], + "(method 43 nav-mesh)": [["_stack_", 28, "float"]] } diff --git a/decompiler/util/data_decompile.cpp b/decompiler/util/data_decompile.cpp index 8808af9bb2..874b701c4e 100644 --- a/decompiler/util/data_decompile.cpp +++ b/decompiler/util/data_decompile.cpp @@ -733,6 +733,8 @@ const std::unordered_map< {{"init-specs", ArrayFieldDecompMeta(TypeSpec("sp-field-init-spec"), 16)}}}, {"sparticle-launch-group", {{"launcher", ArrayFieldDecompMeta(TypeSpec("sparticle-group-item"), 32)}}}, + {"nav-network-info", + {{"adjacency", ArrayFieldDecompMeta(TypeSpec("nav-network-adjacency"), 16)}}}, {"sig-path", {{"samples", ArrayFieldDecompMeta(TypeSpec("sig-path-sample"), 64)}}}, {"race-info", {{"turbo-pad-array", ArrayFieldDecompMeta(TypeSpec("race-turbo-pad"), 32)}, diff --git a/game/CMakeLists.txt b/game/CMakeLists.txt index e65e091168..21a6c5c6da 100644 --- a/game/CMakeLists.txt +++ b/game/CMakeLists.txt @@ -93,6 +93,8 @@ set(RUNTIME_SOURCE mips2c/jak2_functions/foreground.cpp mips2c/jak2_functions/joint.cpp mips2c/jak2_functions/lights.cpp + mips2c/jak2_functions/nav_control.cpp + mips2c/jak2_functions/nav_mesh.cpp mips2c/jak2_functions/sky.cpp mips2c/jak2_functions/sparticle.cpp mips2c/jak2_functions/sparticle_launcher.cpp diff --git a/game/mips2c/jak2_functions/nav_control.cpp b/game/mips2c/jak2_functions/nav_control.cpp new file mode 100644 index 0000000000..50ac2adaa1 --- /dev/null +++ b/game/mips2c/jak2_functions/nav_control.cpp @@ -0,0 +1,274 @@ +//--------------------------MIPS2C--------------------- +// clang-format off +#include "game/mips2c/mips2c_private.h" +#include "game/kernel/jak2/kscheme.h" +using ::jak2::intern_from_c; +namespace Mips2C::jak2 { +namespace method_39_nav_state { +u64 execute(void* ctxt) { + auto* c = (ExecutionContext*)ctxt; + bool bc = false; + bool cop1_bc = false; + c->daddiu(sp, sp, -96); // daddiu sp, sp, -96 + c->swc1(f20, 80, sp); // swc1 f20, 80(sp) + c->swc1(f22, 84, sp); // swc1 f22, 84(sp) + c->lwc1(f0, 32, a0); // lwc1 f0, 32(a0) + c->lwu(v1, 4, a0); // lwu v1, 4(a0) + c->lwc1(f1, 28, v1); // lwc1 f1, 28(v1) + c->muls(f1, f0, f1); // mul.s f1, f0, f1 + c->daddiu(v1, a0, 48); // daddiu v1, a0, 48 + c->lwc1(f0, 0, v1); // lwc1 f0, 0(v1) + c->lwc1(f2, 0, v1); // lwc1 f2, 0(v1) + c->muls(f0, f0, f2); // mul.s f0, f0, f2 + c->lwc1(f2, 8, v1); // lwc1 f2, 8(v1) + c->lwc1(f3, 8, v1); // lwc1 f3, 8(v1) + c->muls(f2, f2, f3); // mul.s f2, f2, f3 + c->adds(f0, f0, f2); // add.s f0, f0, f2 + c->sqrts(f0, f0); // sqrt.s f0, f0 + c->mfc1(v1, f0); // mfc1 v1, f0 + c->mtc1(f0, v1); // mtc1 f0, v1 + c->daddiu(v1, sp, 16); // daddiu v1, sp, 16 + c->daddiu(a1, sp, 32); // daddiu a1, sp, 32 + c->lwu(a2, 12, a0); // lwu a2, 12(a0) + c->lwu(a3, 0, a2); // lwu a3, 0(a2) + c->lwu(a2, 12, a0); // lwu a2, 12(a0) + c->lwu(a2, 0, a2); // lwu a2, 0(a2) + c->lwc1(f2, 28, a2); // lwc1 f2, 28(a2) + cop1_bc = c->fprs[f2] < c->fprs[f0]; // c.lt.s f2, f0 + bc = !cop1_bc; // bc1f L154 + c->mov64(v0, s7); // or v0, s7, r0 + if (bc) {goto block_6;} // branch non-likely + + c->mov64(a2, v1); // or a2, v1, r0 + c->daddiu(t0, a0, 48); // daddiu t0, a0, 48 + c->lui(t1, 16256); // lui t1, 16256 + c->mtc1(f2, t1); // mtc1 f2, t1 + c->divs(f2, f2, f0); // div.s f2, f2, f0 + c->lqc2(vf1, 0, t0); // lqc2 vf1, 0(t0) + c->mfc1(t0, f2); // mfc1 t0, f2 + c->mov128_vf_gpr(vf2, t0); // qmtc2.i vf2, t0 + c->vadd_bc(DEST::w, BC::x, vf1, vf0, vf0); // vaddx.w vf1, vf0, vf0 + c->vmul_bc(DEST::xyz, BC::x, vf1, vf1, vf2); // vmulx.xyz vf1, vf1, vf2 + c->sqc2(vf1, 0, a2); // sqc2 vf1, 0(a2) + c->mtc1(f2, r0); // mtc1 f2, r0 + c->swc1(f2, 4, v1); // swc1 f2, 4(v1) + c->mov64(a2, a1); // or a2, a1, r0 + c->lwc1(f2, 16, a3); // lwc1 f2, 16(a3) + c->cvtws(f1, f1); // cvt.w.s f1, f1 + c->mfc1(a3, f1); // mfc1 a3, f1 + c->dsll32(a3, a3, 16); // dsll32 a3, a3, 16 + c->dsra32(a3, a3, 16); // dsra32 a3, a3, 16 + c->mtc1(f1, a3); // mtc1 f1, a3 + c->cvtsw(f1, f1); // cvt.s.w f1, f1 + c->muls(f1, f2, f1); // mul.s f1, f2, f1 + c->lui(a3, 16255); // lui a3, 16255 + c->lui(t0, -16854); // lui t0, -16854 + c->ori(a3, a3, 65502); // ori a3, a3, 65502 + c->ori(t0, t0, 43253); // ori t0, t0, 43253 + c->subs(f22, f22, f22); // sub.s f22, f22, f22 + c->lui(t1, 15368); // lui t1, 15368 + c->mtc1(f10, a3); // mtc1 f10, a3 + c->ori(a3, t1, 27638); // ori a3, t1, 27638 + c->mtc1(f11, t0); // mtc1 f11, t0 + c->lui(t0, -18099); // lui t0, -18099 + c->muls(f2, f1, f1); // mul.s f2, f1, f1 + c->ori(t0, t0, 8306); // ori t0, t0, 8306 + c->mtc1(f12, a3); // mtc1 f12, a3 + c->lui(a3, 13850); // lui a3, 13850 + c->mtc1(f14, t0); // mtc1 f14, t0 + c->ori(t0, a3, 41599); // ori t0, a3, 41599 + // Unknown instr: mula.s f1, f10 + float acc; + acc = c->fprs[f1] * c->fprs[f10]; + c->lui(a3, 16256); // lui a3, 16256 + c->muls(f3, f2, f1); // mul.s f3, f2, f1 + c->mov64(a3, a3); // or a3, a3, r0 + c->muls(f4, f2, f2); // mul.s f4, f2, f2 + c->lui(t1, -16641); // lui t1, -16641 + c->mtc1(f15, t0); // mtc1 f15, t0 + c->lui(t0, -16641); // lui t0, -16641 + c->or_(t0, t1, t0); // or t0, t1, t0 + c->mtc1(f16, a3); // mtc1 f16, a3 + // nop // sll r0, r0, 0 + c->mtc1(f17, t0); // mtc1 f17, t0 + // nop // sll r0, r0, 0 + c->muls(f5, f3, f2); // mul.s f5, f3, f2 + // nop // sll r0, r0, 0 + c->muls(f6, f3, f3); // mul.s f6, f3, f3 + // nop // sll r0, r0, 0 + c->muls(f7, f4, f3); // mul.s f7, f4, f3 + // nop // sll r0, r0, 0 + c->muls(f8, f4, f4); // mul.s f8, f4, f4 + // nop // sll r0, r0, 0 + c->muls(f9, f5, f4); // mul.s f9, f5, f4 + c->lui(a3, 15658); // lui a3, 15658 + // Unknown instr: madda.s f3, f11 + acc += c->fprs[f3] * c->fprs[f11]; + c->ori(a3, a3, 31272); // ori a3, a3, 31272 + // Unknown instr: madda.s f5, f12 + acc += c->fprs[f5] * c->fprs[f12]; + c->lui(t0, -17742); // lui t0, -17742 + // Unknown instr: madda.s f7, f14 + acc += c->fprs[f7] * c->fprs[f14]; + c->ori(t0, t0, 48177); // ori t0, t0, 48177 + // Unknown instr: madd.s f21, f9, f15 + c->fprs[f21] = acc + (c->fprs[f9] * c->fprs[f15]); + c->lui(t1, 14249); // lui t1, 14249 + c->mtc1(f18, a3); // mtc1 f18, a3 + c->ori(a3, t1, 13291); // ori a3, t1, 13291 + c->mtc1(f19, t0); // mtc1 f19, t0 + // nop // sll r0, r0, 0 + c->mtc1(f20, a3); // mtc1 f20, a3 + // nop // sll r0, r0, 0 + // Unknown instr: mula.s f16, f16 + acc = c->fprs[f16] * c->fprs[f16]; + // nop // sll r0, r0, 0 + // Unknown instr: madda.s f2, f17 + acc += c->fprs[f2] + c->fprs[f17]; + // nop // sll r0, r0, 0 + // Unknown instr: madda.s f4, f18 + acc += c->fprs[f4] + c->fprs[f18]; + // nop // sll r0, r0, 0 + // Unknown instr: madda.s f6, f19 + acc += c->fprs[f6] + c->fprs[f19]; + // nop // sll r0, r0, 0 + // Unknown instr: madd.s f22, f8, f20 + c->fprs[f22] = acc + (c->fprs[f8] * c->fprs[f20]); + // nop // sll r0, r0, 0 + c->swc1(f21, 0, a2); // swc1 f21, 0(a2) + // nop // sll r0, r0, 0 + c->swc1(f22, 4, a2); // swc1 f22, 4(a2) + c->gprs[a2].du64[0] = 0; // or a2, r0, r0 + c->mov64(a3, v1); // or a3, v1, r0 + c->daddiu(a2, a0, 144); // daddiu a2, a0, 144 + c->lwc1(f1, 0, a3); // lwc1 f1, 0(a3) + c->lwc1(f2, 4, a3); // lwc1 f2, 4(a3) + c->lwc1(f3, 8, a3); // lwc1 f3, 8(a3) + c->lwc1(f4, 0, a2); // lwc1 f4, 0(a2) + c->lwc1(f5, 4, a2); // lwc1 f5, 4(a2) + c->lwc1(f6, 8, a2); // lwc1 f6, 8(a2) + // Unknown instr: mula.s f1, f4 + // Unknown instr: madda.s f2, f5 + // Unknown instr: madd.s f1, f3, f6 + c->fprs[f1] = (c->fprs[f3] * c->fprs[f6]) + (c->fprs[f2] * c->fprs[f5]) + (c->fprs[f1] * c->fprs[f4]); + c->mfc1(a2, f1); // mfc1 a2, f1 + c->mtc1(f1, a2); // mtc1 f1, a2 + c->lwc1(f2, 4, a1); // lwc1 f2, 4(a1) + cop1_bc = c->fprs[f1] < c->fprs[f2]; // c.lt.s f1, f2 + bc = !cop1_bc; // bc1f L154 + c->mov64(v0, s7); // or v0, s7, r0 + if (bc) {goto block_6;} // branch non-likely + + c->daddiu(a2, sp, 48); // daddiu a2, sp, 48 + c->daddiu(a3, sp, 64); // daddiu a3, sp, 64 + c->mov64(t0, a2); // or t0, a2, r0 + c->daddiu(t1, a0, 144); // daddiu t1, a0, 144 + c->lwc1(f1, 0, a1); // lwc1 f1, 0(a1) + c->lwc1(f3, 4, a1); // lwc1 f3, 4(a1) + c->lwc1(f2, 0, t1); // lwc1 f2, 0(t1) + c->lwc1(f4, 8, t1); // lwc1 f4, 8(t1) + c->muls(f5, f3, f2); // mul.s f5, f3, f2 + c->muls(f6, f1, f4); // mul.s f6, f1, f4 + c->adds(f5, f5, f6); // add.s f5, f5, f6 + c->swc1(f5, 0, t0); // swc1 f5, 0(t0) + c->lwc1(f5, 4, t1); // lwc1 f5, 4(t1) + c->swc1(f5, 4, t0); // swc1 f5, 4(t0) + c->muls(f3, f3, f4); // mul.s f3, f3, f4 + c->muls(f1, f1, f2); // mul.s f1, f1, f2 + c->subs(f1, f3, f1); // sub.s f1, f3, f1 + c->swc1(f1, 8, t0); // swc1 f1, 8(t0) + c->mfc1(t0, f1); // mfc1 t0, f1 + c->mov64(t0, a3); // or t0, a3, r0 + c->daddiu(t1, a0, 144); // daddiu t1, a0, 144 + c->lwc1(f1, 0, a1); // lwc1 f1, 0(a1) + c->negs(f1, f1); // neg.s f1, f1 + c->lwc1(f3, 4, a1); // lwc1 f3, 4(a1) + c->lwc1(f2, 0, t1); // lwc1 f2, 0(t1) + c->lwc1(f4, 8, t1); // lwc1 f4, 8(t1) + c->muls(f5, f3, f2); // mul.s f5, f3, f2 + c->muls(f6, f1, f4); // mul.s f6, f1, f4 + c->adds(f5, f5, f6); // add.s f5, f5, f6 + c->swc1(f5, 0, t0); // swc1 f5, 0(t0) + c->lwc1(f5, 4, t1); // lwc1 f5, 4(t1) + c->swc1(f5, 4, t0); // swc1 f5, 4(t0) + c->muls(f3, f3, f4); // mul.s f3, f3, f4 + c->muls(f1, f1, f2); // mul.s f1, f1, f2 + c->subs(f1, f3, f1); // sub.s f1, f3, f1 + c->swc1(f1, 8, t0); // swc1 f1, 8(t0) + c->mfc1(a1, f1); // mfc1 a1, f1 + c->mov64(t0, a2); // or t0, a2, r0 + c->mov64(a1, v1); // or a1, v1, r0 + c->lwc1(f1, 0, t0); // lwc1 f1, 0(t0) + c->lwc1(f2, 4, t0); // lwc1 f2, 4(t0) + c->lwc1(f3, 8, t0); // lwc1 f3, 8(t0) + c->lwc1(f4, 0, a1); // lwc1 f4, 0(a1) + c->lwc1(f5, 4, a1); // lwc1 f5, 4(a1) + c->lwc1(f6, 8, a1); // lwc1 f6, 8(a1) + // Unknown instr: mula.s f1, f4 + // Unknown instr: madda.s f2, f5 + // Unknown instr: madd.s f1, f3, f6 + c->fprs[f1] = (c->fprs[f3] * c->fprs[f6]) + (c->fprs[f2] * c->fprs[f5]) + (c->fprs[f1] * c->fprs[f4]); + c->mfc1(a1, f1); // mfc1 a1, f1 + c->mtc1(f1, a1); // mtc1 f1, a1 + c->mov64(t0, a3); // or t0, a3, r0 + c->mov64(a1, v1); // or a1, v1, r0 + c->lwc1(f2, 0, t0); // lwc1 f2, 0(t0) + c->lwc1(f3, 4, t0); // lwc1 f3, 4(t0) + c->lwc1(f4, 8, t0); // lwc1 f4, 8(t0) + c->lwc1(f5, 0, a1); // lwc1 f5, 0(a1) + c->lwc1(f6, 4, a1); // lwc1 f6, 4(a1) + c->lwc1(f7, 8, a1); // lwc1 f7, 8(a1) + // Unknown instr: mula.s f2, f5 + // Unknown instr: madda.s f3, f6 + // Unknown instr: madd.s f2, f4, f7 + c->fprs[f2] = (c->fprs[f4] * c->fprs[f7]) + (c->fprs[f3] * c->fprs[f6]) + (c->fprs[f2] * c->fprs[f5]); + c->mfc1(a1, f2); // mfc1 a1, f2 + c->mtc1(f2, a1); // mtc1 f2, a1 + cop1_bc = c->fprs[f2] < c->fprs[f1]; // c.lt.s f2, f1 + bc = !cop1_bc; // bc1f L152 + // nop // sll r0, r0, 0 + if (bc) {goto block_4;} // branch non-likely + + c->mov64(a1, v1); // or a1, v1, r0 + c->lq(a2, 0, a2); // lq a2, 0(a2) + c->sq(a2, 0, a1); // sq a2, 0(a1) + //beq r0, r0, L153 // beq r0, r0, L153 + // nop // sll r0, r0, 0 + goto block_5; // branch always + + +block_4: + c->mov64(a1, v1); // or a1, v1, r0 + c->lq(a2, 0, a3); // lq a2, 0(a3) + c->sq(a2, 0, a1); // sq a2, 0(a1) + +block_5: + c->daddiu(a0, a0, 48); // daddiu a0, a0, 48 + c->lqc2(vf1, 0, v1); // lqc2 vf1, 0(v1) + c->mfc1(v1, f0); // mfc1 v1, f0 + c->mov128_vf_gpr(vf2, v1); // qmtc2.i vf2, v1 + c->vadd_bc(DEST::w, BC::x, vf1, vf0, vf0); // vaddx.w vf1, vf0, vf0 + c->vmul_bc(DEST::xyz, BC::x, vf1, vf1, vf2); // vmulx.xyz vf1, vf1, vf2 + c->sqc2(vf1, 0, a0); // sqc2 vf1, 0(a0) + c->daddiu(v0, s7, 4); // daddiu v0, s7, #t + +block_6: + c->lwc1(f22, 84, sp); // lwc1 f22, 84(sp) + c->lwc1(f20, 80, sp); // lwc1 f20, 80(sp) + //jr ra // jr ra + c->daddiu(sp, sp, 96); // daddiu sp, sp, 96 + goto end_of_function; // return + + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 +end_of_function: + return c->gprs[v0].du64[0]; +} + +void link() { + gLinkedFunctionTable.reg("(method 39 nav-state)", execute, 96); +} + +} // namespace method_39_nav_state +} // namespace Mips2C diff --git a/game/mips2c/jak2_functions/nav_mesh.cpp b/game/mips2c/jak2_functions/nav_mesh.cpp new file mode 100644 index 0000000000..d4ba5bab29 --- /dev/null +++ b/game/mips2c/jak2_functions/nav_mesh.cpp @@ -0,0 +1,939 @@ +//--------------------------MIPS2C--------------------- +// clang-format off +#include "game/mips2c/mips2c_private.h" +#include "game/kernel/jak2/kscheme.h" +using ::jak2::intern_from_c; +namespace Mips2C::jak2 { +namespace nav_state_patch_pointers { +u64 execute(void* ctxt) { + auto* c = (ExecutionContext*)ctxt; + c->lw(v1, 16, a0); // lw v1, 16(a0) + c->daddu(a2, v1, a1); // daddu a2, v1, a1 + c->xor_(a3, v1, s7); // xor a3, v1, s7 + c->sltiu(a3, a3, 1); // sltiu a3, a3, 1 + c->movz(v1, a2, a3); // movz v1, a2, a3 + c->sw(v1, 16, a0); // sw v1, 16(a0) + c->lw(v1, 28, a0); // lw v1, 28(a0) + c->daddu(a2, v1, a1); // daddu a2, v1, a1 + c->xor_(a3, v1, s7); // xor a3, v1, s7 + c->sltiu(a3, a3, 1); // sltiu a3, a3, 1 + c->movz(v1, a2, a3); // movz v1, a2, a3 + c->sw(v1, 28, a0); // sw v1, 28(a0) + c->lw(v1, 24, a0); // lw v1, 24(a0) + c->daddu(a2, v1, a1); // daddu a2, v1, a1 + c->xor_(a3, v1, s7); // xor a3, v1, s7 + c->sltiu(a3, a3, 1); // sltiu a3, a3, 1 + c->movz(v1, a2, a3); // movz v1, a2, a3 + c->sw(v1, 24, a0); // sw v1, 24(a0) + c->lw(v1, 20, a0); // lw v1, 20(a0) + c->daddu(a1, v1, a1); // daddu a1, v1, a1 + c->xor_(a2, v1, s7); // xor a2, v1, s7 + c->sltiu(a2, a2, 1); // sltiu a2, a2, 1 + c->movz(v1, a1, a2); // movz v1, a1, a2 + c->sw(v1, 20, a0); // sw v1, 20(a0) + c->gprs[v0].du64[0] = 0; // or v0, r0, r0 + //jr ra // jr ra + c->daddu(sp, sp, r0); // daddu sp, sp, r0 + goto end_of_function; // return + + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + end_of_function: + return c->gprs[v0].du64[0]; +} + +void link() { + gLinkedFunctionTable.reg("nav-state-patch-pointers", execute, 0); +} + +} // namespace nav_state_patch_pointers + +namespace method_45_nav_mesh { +struct Cache { + void* entity_nav_mesh; // entity-nav-mesh + void* entity_nav_mesh_by_aid; // entity-nav-mesh-by-aid + void* type; // type? +} cache; + +u64 execute(void* ctxt) { + auto* c = (ExecutionContext*)ctxt; + bool bc = false; + u32 call_addr = 0; + c->daddiu(sp, sp, -64); // daddiu sp, sp, -64 + c->sd(ra, 0, sp); // sd ra, 0(sp) + c->sq(s4, 16, sp); // sq s4, 16(sp) + c->sq(s5, 32, sp); // sq s5, 32(sp) + c->sq(gp, 48, sp); // sq gp, 48(sp) + c->mov64(s5, a0); // or s5, a0, r0 + c->mov64(gp, a1); // or gp, a1, r0 + c->lwu(v1, 12, gp); // lwu v1, 12(gp) + bc = c->sgpr64(s7) != c->sgpr64(v1); // bne s7, v1, L274 + c->mov64(v0, s7); // or v0, s7, r0 + if (bc) {goto block_12;} // branch non-likely + + c->load_symbol2(t9, cache.entity_nav_mesh_by_aid);// lw t9, entity-nav-mesh-by-aid(s7) + c->lwu(a0, 4, gp); // lwu a0, 4(gp) + call_addr = c->gprs[t9].du32[0]; // function call: + c->sll(v0, ra, 0); // sll v0, ra, 0 + c->jalr(call_addr); // jalr ra, t9 + c->mov64(s4, v0); // or s4, v0, r0 + c->load_symbol2(t9, cache.type); // lw t9, type?(s7) + c->mov64(a0, s4); // or a0, s4, r0 + c->load_symbol2(a1, cache.entity_nav_mesh); // lw a1, entity-nav-mesh(s7) + call_addr = c->gprs[t9].du32[0]; // function call: + c->sll(v0, ra, 0); // sll v0, ra, 0 + c->jalr(call_addr); // jalr ra, t9 + bc = c->sgpr64(s7) == c->sgpr64(v0); // beq s7, v0, L269 + c->mov64(v1, s7); // or v1, s7, r0 + if (bc) {goto block_3;} // branch non-likely + + c->mov64(v1, s4); // or v1, s4, r0 + +block_3: + bc = c->sgpr64(s7) == c->sgpr64(v1); // beq s7, v1, L274 + c->mov64(v0, s7); // or v0, s7, r0 + if (bc) {goto block_12;} // branch non-likely + + c->lwu(a0, 48, v1); // lwu a0, 48(v1) + c->mov64(v1, s7); // or v1, s7, r0 + c->addiu(a1, r0, 0); // addiu a1, r0, 0 + //beq r0, r0, L272 // beq r0, r0, L272 + // nop // sll r0, r0, 0 + goto block_8; // branch always + + +block_5: + c->lwu(a2, 64, a0); // lwu a2, 64(a0) + c->dsll(a3, a1, 4); // dsll a3, a1, 4 + c->daddu(a2, a2, a3); // daddu a2, a2, a3 + c->lwu(a3, 0, gp); // lwu a3, 0(gp) + c->lwu(t0, 0, a2); // lwu t0, 0(a2) + bc = c->sgpr64(t0) != c->sgpr64(a3); // bne t0, a3, L271 + c->mov64(a3, s7); // or a3, s7, r0 + if (bc) {goto block_7;} // branch non-likely + + c->mov64(v1, a2); // or v1, a2, r0 + //beq r0, r0, L273 // beq r0, r0, L273 + // nop // sll r0, r0, 0 + goto block_10; // branch always + + +block_7: + c->daddiu(a1, a1, 1); // daddiu a1, a1, 1 + +block_8: + c->lbu(a2, 68, a0); // lbu a2, 68(a0) + c->slt(a2, a1, a2); // slt a2, a1, a2 + bc = c->sgpr64(a2) != 0; // bne a2, r0, L270 + // nop // sll r0, r0, 0 + if (bc) {goto block_5;} // branch non-likely + + c->mov64(a1, s7); // or a1, s7, r0 + c->mov64(a1, s7); // or a1, s7, r0 + +block_10: + bc = c->sgpr64(s7) == c->sgpr64(v1); // beq s7, v1, L274 + c->mov64(v0, s7); // or v0, s7, r0 + if (bc) {goto block_12;} // branch non-likely + + c->sw(a0, 12, gp); // sw a0, 12(gp) + c->sw(s5, 12, v1); // sw s5, 12(v1) + c->lbu(a0, 9, v1); // lbu a0, 9(v1) + c->sb(a0, 10, gp); // sb a0, 10(gp) + c->lbu(a0, 8, v1); // lbu a0, 8(v1) + c->sb(a0, 11, gp); // sb a0, 11(gp) + c->lbu(a0, 9, gp); // lbu a0, 9(gp) + c->sb(a0, 10, v1); // sb a0, 10(v1) + c->lbu(a0, 8, gp); // lbu a0, 8(gp) + c->sb(a0, 11, v1); // sb a0, 11(v1) + c->daddiu(v0, s7, 4); // daddiu v0, s7, #t + +block_12: + c->ld(ra, 0, sp); // ld ra, 0(sp) + c->lq(gp, 48, sp); // lq gp, 48(sp) + c->lq(s5, 32, sp); // lq s5, 32(sp) + c->lq(s4, 16, sp); // lq s4, 16(sp) + //jr ra // jr ra + c->daddiu(sp, sp, 64); // daddiu sp, sp, 64 + goto end_of_function; // return + + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 +end_of_function: + return c->gprs[v0].du64[0]; +} + +void link() { + cache.entity_nav_mesh = intern_from_c("entity-nav-mesh").c(); + cache.entity_nav_mesh_by_aid = intern_from_c("entity-nav-mesh-by-aid").c(); + cache.type = intern_from_c("type?").c(); + gLinkedFunctionTable.reg("(method 45 nav-mesh)", execute, 64); +} + +} // namespace method_45_nav_mesh + +namespace method_20_nav_engine { +u64 execute(void* ctxt) { + auto* c = (ExecutionContext*)ctxt; + bool bc = false; + c->lwu(v1, 8, a0); // lwu v1, 8(a0) + c->lwu(v1, 4, v1); // lwu v1, 4(v1) + c->lwu(a2, 80, a0); // lwu a2, 80(a0) + c->lwu(a2, 4, a2); // lwu a2, 4(a2) + c->dsubu(v1, v1, a2); // dsubu v1, v1, a2 + c->addiu(a2, r0, 0); // addiu a2, r0, 0 + //beq r0, r0, L178 // beq r0, r0, L178 + // nop // sll r0, r0, 0 + goto block_6; // branch always + + +block_1: + c->lwu(a3, 4, a1); // lwu a3, 4(a1) + c->addiu(t0, r0, 288); // addiu t0, r0, 288 + c->mult3(t0, t0, a2); // mult3 t0, t0, a2 + c->daddu(a3, a3, t0); // daddu a3, a3, t0 + c->daddiu(t0, a3, 112); // daddiu t0, a3, 112 + c->lwu(t1, 8, a3); // lwu t1, 8(a3) + bc = c->sgpr64(s7) == c->sgpr64(t1); // beq s7, t1, L177 + c->mov64(t1, s7); // or t1, s7, r0 + if (bc) {goto block_5;} // branch non-likely + + c->addiu(t1, r0, -257); // addiu t1, r0, -257 + c->lwu(t2, 0, a3); // lwu t2, 0(a3) + c->and_(t1, t1, t2); // and t1, t1, t2 + c->sw(t1, 0, a3); // sw t1, 0(a3) + c->lwu(t1, 8, a3); // lwu t1, 8(a3) + c->lwu(t1, 4, t1); // lwu t1, 4(t1) + c->andi(t1, t1, 2048); // andi t1, t1, 2048 + bc = c->sgpr64(t1) == 0; // beq t1, r0, L176 + c->mov64(t1, s7); // or t1, s7, r0 + if (bc) {goto block_4;} // branch non-likely + + c->lwu(t1, 0, a3); // lwu t1, 0(a3) + c->ori(t1, t1, 256); // ori t1, t1, 256 + c->sw(t1, 0, a3); // sw t1, 0(a3) + +block_4: + c->lwu(t1, 4, a0); // lwu t1, 4(a0) + c->daddiu(t1, t1, 32); // daddiu t1, t1, 32 + c->sw(t1, 56, a3); // sw t1, 56(a3) + c->lwu(t1, 8, a0); // lwu t1, 8(a0) + c->sw(t1, 124, a3); // sw t1, 124(a3) + c->mov64(t1, v1); // or t1, v1, r0 + c->lw(t2, 16, t0); // lw t2, 16(t0) + c->daddu(t3, t2, t1); // daddu t3, t2, t1 + c->xor_(t4, t2, s7); // xor t4, t2, s7 + c->slti(t4, t4, 1); // Unknown instr: sltiu t4, t4, 1 + c->movz(t2, t3, t4); // movz t2, t3, t4 + c->sw(t2, 16, t0); // sw t2, 16(t0) + c->lw(t2, 28, t0); // lw t2, 28(t0) + c->daddu(t3, t2, t1); // daddu t3, t2, t1 + c->xor_(t4, t2, s7); // xor t4, t2, s7 + c->slti(t4, t4, 1); // Unknown instr: sltiu t4, t4, 1 + c->movz(t2, t3, t4); // movz t2, t3, t4 + c->sw(t2, 28, t0); // sw t2, 28(t0) + c->lw(t2, 24, t0); // lw t2, 24(t0) + c->daddu(t3, t2, t1); // daddu t3, t2, t1 + c->xor_(t4, t2, s7); // xor t4, t2, s7 + c->slti(t4, t4, 1); // Unknown instr: sltiu t4, t4, 1 + c->movz(t2, t3, t4); // movz t2, t3, t4 + c->sw(t2, 24, t0); // sw t2, 24(t0) + c->lw(t2, 20, t0); // lw t2, 20(t0) + c->daddu(t1, t2, t1); // daddu t1, t2, t1 + c->xor_(t3, t2, s7); // xor t3, t2, s7 + c->slti(t3, t3, 1); // Unknown instr: sltiu t3, t3, 1 + c->movz(t2, t1, t3); // movz t2, t1, t3 + c->sw(t2, 20, t0); // sw t2, 20(t0) + c->gprs[t0].du64[0] = 0; // or t0, r0, r0 + c->lwu(a3, 8, a3); // lwu a3, 8(a3) + c->sw(s7, 140, a3); // sw s7, 140(a3) + c->mov64(t1, s7); // or t1, s7, r0 + +block_5: + c->daddiu(a2, a2, 1); // daddiu a2, a2, 1 + +block_6: + c->lb(a3, 14, a1); // lb a3, 14(a1) + c->slt(a3, a2, a3); // slt a3, a2, a3 + bc = c->sgpr64(a3) != 0; // bne a3, r0, L175 + // nop // sll r0, r0, 0 + if (bc) {goto block_1;} // branch non-likely + + c->mov64(v1, s7); // or v1, s7, r0 + c->mov64(v1, s7); // or v1, s7, r0 + c->gprs[v0].du64[0] = 0; // or v0, r0, r0 + //jr ra // jr ra + c->daddu(sp, sp, r0); // daddu sp, sp, r0 + goto end_of_function; // return + + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 +end_of_function: + return c->gprs[v0].du64[0]; +} + +void link() { + gLinkedFunctionTable.reg("(method 20 nav-engine)", execute, 0); +} + +} // namespace method_20_nav_engine + +namespace method_43_nav_mesh { +struct Cache { + void* point_poly_distance_min; // point-poly-distance-min +} cache; + +u64 execute(void* ctxt) { + auto* c = (ExecutionContext*)ctxt; + bool bc = false; + u32 call_addr = 0; + bool cop1_bc = false; + c->daddiu(sp, sp, -176); // daddiu sp, sp, -176 + c->sd(ra, 0, sp); // sd ra, 0(sp) + c->sq(s0, 64, sp); // sq s0, 64(sp) + c->sq(s1, 80, sp); // sq s1, 80(sp) + c->sq(s2, 96, sp); // sq s2, 96(sp) + c->sq(s3, 112, sp); // sq s3, 112(sp) + c->sq(s4, 128, sp); // sq s4, 128(sp) + c->sq(s5, 144, sp); // sq s5, 144(sp) + c->sq(gp, 160, sp); // sq gp, 160(sp) + c->mov64(s5, a0); // or s5, a0, r0 + c->mov64(gp, a1); // or gp, a1, r0 + c->sw(s7, 16, sp); // sw s7, 16(sp) + c->lwu(a0, 16, s5); // lwu a0, 16(s5) + c->lwu(v1, -4, a0); // lwu v1, -4(a0) + c->lwu(t9, 68, v1); // lwu t9, 68(v1) + c->daddu(a1, r0, gp); // daddu a1, r0, gp + c->lui(a2, 17984); // lui a2, 17984 + call_addr = c->gprs[t9].du32[0]; // function call: + c->sll(v0, ra, 0); // sll v0, ra, 0 + c->jalr(call_addr); // jalr ra, t9 + c->mov64(v1, v0); // or v1, v0, r0 + c->sw(v1, 20, sp); // sw v1, 20(sp) + c->sw(s7, 32, gp); // sw s7, 32(gp) + c->lwu(v1, 16, s5); // lwu v1, 16(s5) + c->lh(s4, 10, v1); // lh s4, 10(v1) + c->lwu(s3, 20, sp); // lwu s3, 20(sp) + c->gprs[s2].du64[0] = 0; // or s2, r0, r0 + // nop // sll r0, r0, 0 + +block_1: + c->dsll(s1, s2, 3); // dsll s1, s2, 3 + c->lbu(s0, 0, s3); // lbu s0, 0(s3) + bc = c->sgpr64(s0) == 0; // beq s0, r0, L100 + // nop // sll r0, r0, 0 + if (bc) {goto block_17;} // branch non-likely + + +block_2: + c->andi(v1, s0, 1); // andi v1, s0, 1 + // nop // sll r0, r0, 0 + bc = c->sgpr64(v1) == 0; // beq v1, r0, L99 + // nop // sll r0, r0, 0 + if (bc) {goto block_16;} // branch non-likely + + c->lwu(v1, 4, s5); // lwu v1, 4(s5) + c->dsll(a0, s1, 6); // dsll a0, s1, 6 + c->daddu(v1, v1, a0); // daddu v1, v1, a0 + c->sw(v1, 24, sp); // sw v1, 24(sp) + c->lwu(v1, 24, sp); // lwu v1, 24(sp) + c->lwc1(f0, 4, gp); // lwc1 f0, 4(gp) + c->lwc1(f1, 16, gp); // lwc1 f1, 16(gp) + c->lwc1(f2, 60, v1); // lwc1 f2, 60(v1) + c->adds(f2, f2, f1); // add.s f2, f2, f1 + cop1_bc = c->fprs[f2] < c->fprs[f0]; // c.lt.s f2, f0 + bc = !cop1_bc; // bc1f L96 + c->daddiu(a0, s7, 4); // daddiu a0, s7, 4 + if (bc) {goto block_5;} // branch non-likely + + c->mov64(a0, s7); // or a0, s7, r0 + +block_5: + if (((s64)c->sgpr64(s7)) == ((s64)c->sgpr64(a0))) {// beql s7, a0, L97 + c->mov64(v1, a0); // or v1, a0, r0 + goto block_9; + } + + c->lwc1(f2, 44, v1); // lwc1 f2, 44(v1) + c->subs(f1, f2, f1); // sub.s f1, f2, f1 + cop1_bc = c->fprs[f0] < c->fprs[f1]; // c.lt.s f0, f1 + bc = !cop1_bc; // bc1f L97 + c->daddiu(v1, s7, 4); // daddiu v1, s7, 4 + if (bc) {goto block_9;} // branch non-likely + + c->mov64(v1, s7); // or v1, s7, r0 + +block_9: + if (((s64)c->sgpr64(s7)) == ((s64)c->sgpr64(v1))) {// beql s7, v1, L98 + c->mov64(v1, v1); // or v1, v1, r0 + goto block_12; + } + + c->daddiu(v1, s7, 4); // daddiu v1, s7, 4 + c->lwu(a0, 24, sp); // lwu a0, 24(sp) + c->lbu(a0, 13, a0); // lbu a0, 13(a0) + c->lbu(a1, 20, gp); // lbu a1, 20(gp) + c->and_(a0, a0, a1); // and a0, a0, a1 + c->movn(v1, s7, a0); // movn v1, s7, a0 + +block_12: + bc = c->sgpr64(s7) == c->sgpr64(v1); // beq s7, v1, L99 + c->mov64(v1, s7); // or v1, s7, r0 + if (bc) {goto block_16;} // branch non-likely + + c->mov64(a0, s5); // or a0, s5, r0 + c->lwu(v1, -4, a0); // lwu v1, -4(a0) + c->lwu(t9, 164, v1); // lwu t9, 164(v1) + c->lwu(a1, 24, sp); // lwu a1, 24(sp) + c->daddu(a2, r0, gp); // daddu a2, r0, gp + call_addr = c->gprs[t9].du32[0]; // function call: + c->sll(v0, ra, 0); // sll v0, ra, 0 + c->jalr(call_addr); // jalr ra, t9 + c->mov64(v1, v0); // or v1, v0, r0 + bc = c->sgpr64(s7) == c->sgpr64(v1); // beq s7, v1, L99 + c->mov64(v1, s7); // or v1, s7, r0 + if (bc) {goto block_16;} // branch non-likely + + c->daddiu(v1, s7, 4); // daddiu v1, s7, #t + c->sw(v1, 32, gp); // sw v1, 32(gp) + c->mtc1(f0, r0); // mtc1 f0, r0 + c->swc1(f0, 28, gp); // swc1 f0, 28(gp) + c->lwu(v1, 24, sp); // lwu v1, 24(sp) + c->sw(v1, 16, sp); // sw v1, 16(sp) + //beq r0, r0, L109 // beq r0, r0, L109 + // nop // sll r0, r0, 0 + goto block_38; // branch always + + // nop // sll r0, r0, 0 + +block_16: + c->dsra(s0, s0, 1); // dsra s0, s0, 1 + // nop // sll r0, r0, 0 + bc = c->sgpr64(s0) != 0; // bne s0, r0, L95 + c->daddiu(s1, s1, 1); // daddiu s1, s1, 1 + if (bc) {goto block_2;} // branch non-likely + + +block_17: + c->daddiu(s2, s2, 1); // daddiu s2, s2, 1 + c->daddiu(s3, s3, 1); // daddiu s3, s3, 1 + c->slt(v1, s2, s4); // slt v1, s2, s4 + // nop // sll r0, r0, 0 + bc = c->sgpr64(v1) != 0; // bne v1, r0, L94 + // nop // sll r0, r0, 0 + if (bc) {goto block_1;} // branch non-likely + + c->lui(v1, 31984); // lui v1, 31984 + c->ori(v1, v1, 48578); // ori v1, v1, 48578 + c->mtc1(f0, v1); // mtc1 f0, v1 + c->swc1(f0, 28, sp); // swc1 f0, 28(sp) + c->sd(r0, 32, sp); // sd r0, 32(sp) + c->sd(r0, 40, sp); // sd r0, 40(sp) + c->lwu(v1, 16, s5); // lwu v1, 16(s5) + c->lh(s4, 10, v1); // lh s4, 10(v1) + c->lwu(s3, 20, sp); // lwu s3, 20(sp) + c->gprs[s2].du64[0] = 0; // or s2, r0, r0 + +block_19: + c->dsll(s1, s2, 3); // dsll s1, s2, 3 + c->lbu(s0, 0, s3); // lbu s0, 0(s3) + bc = c->sgpr64(s0) == 0; // beq s0, r0, L107 + // nop // sll r0, r0, 0 + if (bc) {goto block_34;} // branch non-likely + + +block_20: + c->andi(v1, s0, 1); // andi v1, s0, 1 + // nop // sll r0, r0, 0 + bc = c->sgpr64(v1) == 0; // beq v1, r0, L106 + // nop // sll r0, r0, 0 + if (bc) {goto block_33;} // branch non-likely + + c->lwu(v1, 4, s5); // lwu v1, 4(s5) + c->dsll(a0, s1, 6); // dsll a0, s1, 6 + c->daddu(v1, v1, a0); // daddu v1, v1, a0 + c->sw(v1, 48, sp); // sw v1, 48(sp) + c->lwu(v1, 48, sp); // lwu v1, 48(sp) + c->lwc1(f0, 4, gp); // lwc1 f0, 4(gp) + c->lwc1(f1, 16, gp); // lwc1 f1, 16(gp) + c->lwc1(f2, 60, v1); // lwc1 f2, 60(v1) + c->adds(f2, f2, f1); // add.s f2, f2, f1 + cop1_bc = c->fprs[f2] < c->fprs[f0]; // c.lt.s f2, f0 + bc = !cop1_bc; // bc1f L103 + c->daddiu(a0, s7, 4); // daddiu a0, s7, 4 + if (bc) {goto block_23;} // branch non-likely + + c->mov64(a0, s7); // or a0, s7, r0 + +block_23: + if (((s64)c->sgpr64(s7)) == ((s64)c->sgpr64(a0))) {// beql s7, a0, L104 + c->mov64(v1, a0); // or v1, a0, r0 + goto block_27; + } + + c->lwc1(f2, 44, v1); // lwc1 f2, 44(v1) + c->subs(f1, f2, f1); // sub.s f1, f2, f1 + cop1_bc = c->fprs[f0] < c->fprs[f1]; // c.lt.s f0, f1 + bc = !cop1_bc; // bc1f L104 + c->daddiu(v1, s7, 4); // daddiu v1, s7, 4 + if (bc) {goto block_27;} // branch non-likely + + c->mov64(v1, s7); // or v1, s7, r0 + +block_27: + if (((s64)c->sgpr64(s7)) == ((s64)c->sgpr64(v1))) {// beql s7, v1, L105 + c->mov64(v1, v1); // or v1, v1, r0 + goto block_30; + } + + c->daddiu(v1, s7, 4); // daddiu v1, s7, 4 + c->lwu(a0, 48, sp); // lwu a0, 48(sp) + c->lbu(a0, 13, a0); // lbu a0, 13(a0) + c->lbu(a1, 20, gp); // lbu a1, 20(gp) + c->and_(a0, a0, a1); // and a0, a0, a1 + c->movn(v1, s7, a0); // movn v1, s7, a0 + +block_30: + bc = c->sgpr64(s7) == c->sgpr64(v1); // beq s7, v1, L106 + c->mov64(v1, s7); // or v1, s7, r0 + if (bc) {goto block_33;} // branch non-likely + + c->ld(v1, 40, sp); // ld v1, 40(sp) + c->daddiu(v1, v1, 1); // daddiu v1, v1, 1 + c->sd(v1, 40, sp); // sd v1, 40(sp) + c->load_symbol2(t9, cache.point_poly_distance_min);// lw t9, point-poly-distance-min(s7) + c->lwu(a0, 0, s5); // lwu a0, 0(s5) + c->daddu(a1, r0, gp); // daddu a1, r0, gp + c->lw(a2, 28, sp); // lw a2, 28(sp) + c->lwu(a3, 48, sp); // lwu a3, 48(sp) + call_addr = c->gprs[t9].du32[0]; // function call: + c->sll(v0, ra, 0); // sll v0, ra, 0 + c->jalr(call_addr); // jalr ra, t9 + c->mtc1(f0, v0); // mtc1 f0, v0 + c->swc1(f0, 52, sp); // swc1 f0, 52(sp) + c->lw(v1, 52, sp); // lw v1, 52(sp) + c->mtc1(f0, v1); // mtc1 f0, v1 + c->lw(v1, 28, sp); // lw v1, 28(sp) + c->mtc1(f1, v1); // mtc1 f1, v1 + cop1_bc = c->fprs[f0] < c->fprs[f1]; // c.lt.s f0, f1 + bc = !cop1_bc; // bc1f L106 + c->mov64(v1, s7); // or v1, s7, r0 + if (bc) {goto block_33;} // branch non-likely + + c->lw(v1, 52, sp); // lw v1, 52(sp) + c->mtc1(f0, v1); // mtc1 f0, v1 + c->swc1(f0, 28, sp); // swc1 f0, 28(sp) + c->lwu(v1, 48, sp); // lwu v1, 48(sp) + c->sw(v1, 16, sp); // sw v1, 16(sp) + // nop // sll r0, r0, 0 + +block_33: + c->dsra(s0, s0, 1); // dsra s0, s0, 1 + // nop // sll r0, r0, 0 + bc = c->sgpr64(s0) != 0; // bne s0, r0, L102 + c->daddiu(s1, s1, 1); // daddiu s1, s1, 1 + if (bc) {goto block_20;} // branch non-likely + + +block_34: + c->daddiu(s2, s2, 1); // daddiu s2, s2, 1 + c->daddiu(s3, s3, 1); // daddiu s3, s3, 1 + c->slt(v1, s2, s4); // slt v1, s2, s4 + // nop // sll r0, r0, 0 + bc = c->sgpr64(v1) != 0; // bne v1, r0, L101 + // nop // sll r0, r0, 0 + if (bc) {goto block_19;} // branch non-likely + + c->lwu(v1, 16, sp); // lwu v1, 16(sp) + bc = c->sgpr64(s7) != c->sgpr64(v1); // bne s7, v1, L108 + c->mov64(v1, s7); // or v1, s7, r0 + if (bc) {goto block_37;} // branch non-likely + + c->lwu(v1, 4, s5); // lwu v1, 4(s5) + c->daddu(v1, r0, v1); // daddu v1, r0, v1 + c->sw(v1, 16, sp); // sw v1, 16(sp) + +block_37: + c->lw(v1, 28, sp); // lw v1, 28(sp) + c->mtc1(f0, v1); // mtc1 f0, v1 + c->swc1(f0, 28, gp); // swc1 f0, 28(gp) + c->mfc1(v1, f0); // mfc1 v1, f0 + +block_38: + c->lwu(v1, 16, sp); // lwu v1, 16(sp) + c->sw(v1, 24, gp); // sw v1, 24(gp) + c->mov64(v0, gp); // or v0, gp, r0 + c->ld(ra, 0, sp); // ld ra, 0(sp) + c->lq(gp, 160, sp); // lq gp, 160(sp) + c->lq(s5, 144, sp); // lq s5, 144(sp) + c->lq(s4, 128, sp); // lq s4, 128(sp) + c->lq(s3, 112, sp); // lq s3, 112(sp) + c->lq(s2, 96, sp); // lq s2, 96(sp) + c->lq(s1, 80, sp); // lq s1, 80(sp) + c->lq(s0, 64, sp); // lq s0, 64(sp) + //jr ra // jr ra + c->daddiu(sp, sp, 176); // daddiu sp, sp, 176 + goto end_of_function; // return + + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 +end_of_function: + return c->gprs[v0].du64[0]; +} + +void link() { + cache.point_poly_distance_min = intern_from_c("point-poly-distance-min").c(); + gLinkedFunctionTable.reg("(method 43 nav-mesh)", execute, 176); +} + +} // namespace method_43_nav_mesh + +namespace nav_dma_send_to_spr_no_flush { +struct Cache { + void* fake_scratchpad_data; // *fake-scratchpad-data* +} cache; +u64 execute(void* ctxt) { + auto* c = (ExecutionContext*)ctxt; + c->lui(v1, 4096); // lui v1, 4096 + c->ori(v1, v1, 54272); // ori v1, v1, 54272 + c->addiu(a3, r0, 0); // addiu a3, r0, 0 + + /* +block_1: + c->lw(a3, 0, v1); // lw a3, 0(v1) + c->andi(a3, a3, 256); // andi a3, a3, 256 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + bc = c->sgpr64(a3) != 0; // bne a3, r0, L194 + // nop // sll r0, r0, 0 + if (bc) {goto block_1;} // branch non-likely + */ + + // Unknown instr: sync.l + c->lui(a3, 4095); // lui a3, 4095 + c->ori(a3, a3, 65535); // ori a3, a3, 65535 + c->and_(a1, a3, a1); // and a1, a3, a1 + // c->sw(a1, 16, v1); // sw a1, 16(v1) + u32 madr = c->sgpr64(a1); + + c->lui(a1, 4095); // lui a1, 4095 + c->ori(a1, a1, 65535); // ori a1, a1, 65535 + c->and_(a0, a1, a0); // and a0, a1, a0 + // c->sw(a0, 128, v1); // sw a0, 128(v1) + u32 sadr = c->sgpr64(a0); + + // c->sw(a2, 32, v1); // sw a2, 32(v1) + u32 qwc = c->sgpr64(a2); + // Unknown instr: sync.l + c->addiu(a0, r0, 256); // addiu a0, r0, 256 + // c->sw(a0, 0, v1); // sw a0, 0(v1) + spad_to_dma(cache.fake_scratchpad_data, madr, sadr, qwc); + // Unknown instr: sync.l + c->gprs[v0].du64[0] = 0; // or v0, r0, r0 + //jr ra // jr ra + c->daddu(sp, sp, r0); // daddu sp, sp, r0 + goto end_of_function; // return + + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 +end_of_function: + return c->gprs[v0].du64[0]; +} + +void link() { + cache.fake_scratchpad_data = intern_from_c("*fake-scratchpad-data*").c(); + gLinkedFunctionTable.reg("nav-dma-send-to-spr-no-flush", execute, 0); +} + +} // namespace nav_dma_send_to_spr_no_flush + +namespace nav_dma_send_from_spr_no_flush { +struct Cache { + void* fake_scratchpad_data; // *fake-scratchpad-data* +} cache; +u64 execute(void* ctxt) { + auto* c = (ExecutionContext*)ctxt; + c->lui(v1, 4096); // lui v1, 4096 + c->ori(v1, v1, 53248); // ori v1, v1, 53248 + c->addiu(a3, r0, 0); // addiu a3, r0, 0 + /* +block_1: + c->lw(a3, 0, v1); // lw a3, 0(v1) + c->andi(a3, a3, 256); // andi a3, a3, 256 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + bc = c->sgpr64(a3) != 0; // bne a3, r0, L192 + // nop // sll r0, r0, 0 + if (bc) {goto block_1;} // branch non-likely + */ + + // Unknown instr: sync.l + c->lui(a3, 4095); // lui a3, 4095 + c->ori(a3, a3, 65535); // ori a3, a3, 65535 + c->and_(a0, a3, a0); // and a0, a3, a0 + //c->sw(a0, 16, v1); // sw a0, 16(v1) + u32 madr = c->sgpr64(a0); + c->lui(a0, 4095); // lui a0, 4095 + c->ori(a0, a0, 65535); // ori a0, a0, 65535 + c->and_(a0, a0, a1); // and a0, a0, a1 + // c->sw(a0, 128, v1); // sw a0, 128(v1) + u32 sadr = c->sgpr64(a0); + // c->sw(a2, 32, v1); // sw a2, 32(v1) + u32 qwc = c->sgpr64(a2); + // Unknown instr: sync.l + c->addiu(a0, r0, 256); // addiu a0, r0, 256 + // c->sw(a0, 0, v1); // sw a0, 0(v1) + spad_from_dma(cache.fake_scratchpad_data, madr, sadr, qwc); + // Unknown instr: sync.l + c->gprs[v0].du64[0] = 0; // or v0, r0, r0 + //jr ra // jr ra + c->daddu(sp, sp, r0); // daddu sp, sp, r0 + goto end_of_function; // return + + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 +end_of_function: + return c->gprs[v0].du64[0]; +} + +void link() { + cache.fake_scratchpad_data = intern_from_c("*fake-scratchpad-data*").c(); + gLinkedFunctionTable.reg("nav-dma-send-from-spr-no-flush", execute, 0); +} + +} // namespace nav_dma_send_from_spr_no_flush + +namespace method_17_nav_engine { +struct Cache { + void* fake_scratchpad_data; // *fake-scratchpad-data* +} cache; +u64 execute(void* ctxt) { + auto* c = (ExecutionContext*)ctxt; + c->lwu(v1, 4, a1); // lwu v1, 4(a1) + c->lwu(a2, 0, a1); // lwu a2, 0(a1) + c->lwu(a0, 8, a1); // lwu a0, 8(a1) + c->lui(a1, 4096); // lui a1, 4096 + c->ori(a1, a1, 54272); // ori a1, a1, 54272 + c->addiu(a3, r0, 0); // addiu a3, r0, 0 + +//block_1: +// c->lw(a3, 0, a1); // lw a3, 0(a1) +// c->andi(a3, a3, 256); // andi a3, a3, 256 +// // nop // sll r0, r0, 0 +// // nop // sll r0, r0, 0 +// // nop // sll r0, r0, 0 +// // nop // sll r0, r0, 0 +// bc = c->sgpr64(a3) != 0; // bne a3, r0, L188 +// // nop // sll r0, r0, 0 +// if (bc) {goto block_1;} // branch non-likely + + // Unknown instr: sync.l + c->lui(a3, 4095); // lui a3, 4095 + c->ori(a3, a3, 65535); // ori a3, a3, 65535 + c->and_(a2, a3, a2); // and a2, a3, a2 + // c->sw(a2, 16, a1); // sw a2, 16(a1) + u32 madr = c->sgpr64(a2); + c->lui(a2, 4095); // lui a2, 4095 + c->ori(a2, a2, 65535); // ori a2, a2, 65535 + c->and_(v1, a2, v1); // and v1, a2, v1 + // c->sw(v1, 128, a1); // sw v1, 128(a1) + u32 sadr = c->sgpr64(v1); + // c->sw(a0, 32, a1); // sw a0, 32(a1) + u32 qwc = c->sgpr64(a0); + // Unknown instr: sync.l + c->addiu(v1, r0, 256); // addiu v1, r0, 256 + // c->sw(v1, 0, a1); // sw v1, 0(a1) + spad_to_dma(cache.fake_scratchpad_data, madr, sadr, qwc); + // Unknown instr: sync.l + c->gprs[v1].du64[0] = 0; // or v1, r0, r0 + c->gprs[v0].du64[0] = 0; // or v0, r0, r0 + //jr ra // jr ra + c->daddu(sp, sp, r0); // daddu sp, sp, r0 + goto end_of_function; // return + + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 +end_of_function: + return c->gprs[v0].du64[0]; +} + +void link() { + gLinkedFunctionTable.reg("(method 17 nav-engine)", execute, 0); + cache.fake_scratchpad_data = intern_from_c("*fake-scratchpad-data*").c(); +} + +} // namespace method_17_nav_engine + +namespace method_18_nav_engine { +struct Cache { + void* fake_scratchpad_data; // *fake-scratchpad-data* +} cache; +u64 execute(void* ctxt) { + auto* c = (ExecutionContext*)ctxt; + c->lwu(a2, 0, a1); // lwu a2, 0(a1) + c->lwu(v1, 4, a1); // lwu v1, 4(a1) + c->lwu(a0, 8, a1); // lwu a0, 8(a1) + c->lui(a1, 4096); // lui a1, 4096 + c->ori(a1, a1, 53248); // ori a1, a1, 53248 + c->addiu(a3, r0, 0); // addiu a3, r0, 0 + +//block_1: +// c->lw(a3, 0, a1); // lw a3, 0(a1) +// c->andi(a3, a3, 256); // andi a3, a3, 256 +// // nop // sll r0, r0, 0 +// // nop // sll r0, r0, 0 +// // nop // sll r0, r0, 0 +// // nop // sll r0, r0, 0 +// bc = c->sgpr64(a3) != 0; // bne a3, r0, L186 +// // nop // sll r0, r0, 0 +// if (bc) {goto block_1;} // branch non-likely + + // Unknown instr: sync.l + c->lui(a3, 4095); // lui a3, 4095 + c->ori(a3, a3, 65535); // ori a3, a3, 65535 + c->and_(a2, a3, a2); // and a2, a3, a2 + // c->sw(a2, 16, a1); // sw a2, 16(a1) + u32 madr = c->sgpr64(a2); + + c->lui(a2, 4095); // lui a2, 4095 + c->ori(a2, a2, 65535); // ori a2, a2, 65535 + c->and_(v1, a2, v1); // and v1, a2, v1 + // c->sw(v1, 128, a1); // sw v1, 128(a1) + u32 sadr = c->sgpr64(v1); + + // c->sw(a0, 32, a1); // sw a0, 32(a1) + u32 qwc = c->sgpr64(a0); + // Unknown instr: sync.l + c->addiu(v1, r0, 256); // addiu v1, r0, 256 + // c->sw(v1, 0, a1); // sw v1, 0(a1) + spad_from_dma(cache.fake_scratchpad_data, madr, sadr, qwc); + // Unknown instr: sync.l + c->gprs[v1].du64[0] = 0; // or v1, r0, r0 + c->gprs[v0].du64[0] = 0; // or v0, r0, r0 + //jr ra // jr ra + c->daddu(sp, sp, r0); // daddu sp, sp, r0 + goto end_of_function; // return + + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 +end_of_function: + return c->gprs[v0].du64[0]; +} + +void link() { + gLinkedFunctionTable.reg("(method 18 nav-engine)", execute, 0); + cache.fake_scratchpad_data = intern_from_c("*fake-scratchpad-data*").c(); +} + +} // namespace method_18_nav_engine + +namespace method_21_nav_engine { +u64 execute(void* ctxt) { + auto* c = (ExecutionContext*)ctxt; + bool bc = false; + c->lwu(v1, 80, a0); // lwu v1, 80(a0) + c->lwu(v1, 4, v1); // lwu v1, 4(v1) + c->lwu(a2, 8, a0); // lwu a2, 8(a0) + c->lwu(a2, 4, a2); // lwu a2, 4(a2) + c->dsubu(v1, v1, a2); // dsubu v1, v1, a2 + c->addiu(a2, r0, 0); // addiu a2, r0, 0 + //beq r0, r0, L173 // beq r0, r0, L173 + // nop // sll r0, r0, 0 + goto block_4; // branch always + + +block_1: + c->lwu(a3, 4, a1); // lwu a3, 4(a1) + c->addiu(t0, r0, 288); // addiu t0, r0, 288 + c->mult3(t0, t0, a2); // mult3 t0, t0, a2 + c->daddu(a3, a3, t0); // daddu a3, a3, t0 + c->daddiu(t0, a3, 112); // daddiu t0, a3, 112 + c->lwu(t1, 8, a3); // lwu t1, 8(a3) + bc = c->sgpr64(s7) == c->sgpr64(t1); // beq s7, t1, L172 + c->mov64(t1, s7); // or t1, s7, r0 + if (bc) {goto block_3;} // branch non-likely + + c->lwu(t1, 76, a0); // lwu t1, 76(a0) + c->daddiu(t1, t1, 32); // daddiu t1, t1, 32 + c->sw(t1, 56, a3); // sw t1, 56(a3) + c->lwu(t1, 80, a0); // lwu t1, 80(a0) + c->sw(t1, 124, a3); // sw t1, 124(a3) + c->lwu(t1, 0, a1); // lwu t1, 0(a1) + c->addiu(t2, r0, 288); // addiu t2, r0, 288 + c->mult3(t2, t2, a2); // mult3 t2, t2, a2 + c->daddu(t1, t1, t2); // daddu t1, t1, t2 + c->sw(t1, 4, t0); // sw t1, 4(t0) + c->mov64(t1, v1); // or t1, v1, r0 + c->lw(t2, 16, t0); // lw t2, 16(t0) + c->daddu(t3, t2, t1); // daddu t3, t2, t1 + c->xor_(t4, t2, s7); // xor t4, t2, s7 + c->sltiu(t4, t4, 1); // Unknown instr: sltiu t4, t4, 1 + c->movz(t2, t3, t4); // movz t2, t3, t4 + c->sw(t2, 16, t0); // sw t2, 16(t0) + c->lw(t2, 28, t0); // lw t2, 28(t0) + c->daddu(t3, t2, t1); // daddu t3, t2, t1 + c->xor_(t4, t2, s7); // xor t4, t2, s7 + c->sltiu(t4, t4, 1); // Unknown instr: sltiu t4, t4, 1 + c->movz(t2, t3, t4); // movz t2, t3, t4 + c->sw(t2, 28, t0); // sw t2, 28(t0) + c->lw(t2, 24, t0); // lw t2, 24(t0) + c->daddu(t3, t2, t1); // daddu t3, t2, t1 + c->xor_(t4, t2, s7); // xor t4, t2, s7 + c->sltiu(t4, t4, 1); // Unknown instr: sltiu t4, t4, 1 + c->movz(t2, t3, t4); // movz t2, t3, t4 + c->sw(t2, 24, t0); // sw t2, 24(t0) + c->lw(t2, 20, t0); // lw t2, 20(t0) + c->daddu(t1, t2, t1); // daddu t1, t2, t1 + c->xor_(t3, t2, s7); // xor t3, t2, s7 + c->sltiu(t3, t3, 1); // Unknown instr: sltiu t3, t3, 1 + c->movz(t2, t1, t3); // movz t2, t1, t3 + c->sw(t2, 20, t0); // sw t2, 20(t0) + c->gprs[t0].du64[0] = 0; // or t0, r0, r0 + c->lwu(t0, 0, a1); // lwu t0, 0(a1) + c->addiu(t1, r0, 288); // addiu t1, r0, 288 + c->mult3(t1, t1, a2); // mult3 t1, t1, a2 + c->daddu(t1, t0, t1); // daddu t1, t0, t1 + c->lwu(a3, 8, a3); // lwu a3, 8(a3) + c->sw(t1, 140, a3); // sw t1, 140(a3) + +block_3: + c->daddiu(a2, a2, 1); // daddiu a2, a2, 1 + +block_4: + c->lb(a3, 14, a1); // lb a3, 14(a1) + c->slt(a3, a2, a3); // slt a3, a2, a3 + bc = c->sgpr64(a3) != 0; // bne a3, r0, L171 + // nop // sll r0, r0, 0 + if (bc) {goto block_1;} // branch non-likely + + c->mov64(v1, s7); // or v1, s7, r0 + c->mov64(v1, s7); // or v1, s7, r0 + c->gprs[v0].du64[0] = 0; // or v0, r0, r0 + //jr ra // jr ra + c->daddu(sp, sp, r0); // daddu sp, sp, r0 + goto end_of_function; // return + + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 +end_of_function: + return c->gprs[v0].du64[0]; +} + +void link() { + gLinkedFunctionTable.reg("(method 21 nav-engine)", execute, 0); +} + +} // namespace method_21_nav_engine +} // namespace Mips2C diff --git a/game/mips2c/mips2c_private.h b/game/mips2c/mips2c_private.h index 7e14cec202..47964454f5 100644 --- a/game/mips2c/mips2c_private.h +++ b/game/mips2c/mips2c_private.h @@ -1597,7 +1597,7 @@ inline void spad_to_dma_no_sadr_off_bones_interleave(void* spad_sym_addr, inline void spad_from_dma(void* spad_sym_addr, u32 madr, u32 sadr, u32 qwc) { u32 spad_addr_goal; - memcpy(&spad_addr_goal, spad_sym_addr, 4); + memcpy(&spad_addr_goal, align4_ptr(spad_sym_addr), 4); sadr -= spad_addr_goal; ASSERT((madr & 0xf) == 0); ASSERT((sadr & 0xf) == 0); diff --git a/game/mips2c/mips2c_table.cpp b/game/mips2c/mips2c_table.cpp index 5c12542106..bc0e03404a 100644 --- a/game/mips2c/mips2c_table.cpp +++ b/game/mips2c/mips2c_table.cpp @@ -199,6 +199,17 @@ namespace add_light_sphere_to_light_group { extern void link(); } namespace light_hash_add_items { extern void link(); } namespace light_hash_count_items { extern void link(); } namespace light_hash_get_bucket_index { extern void link(); } +namespace nav_state_patch_pointers { extern void link(); } +namespace method_45_nav_mesh { extern void link(); } +namespace method_20_nav_engine { extern void link(); } +namespace method_43_nav_mesh { extern void link(); } +namespace nav_dma_send_to_spr_no_flush { extern void link(); } +namespace nav_dma_send_from_spr_no_flush { extern void link(); } +namespace method_17_nav_engine { extern void link(); } +namespace method_39_nav_state { extern void link(); } +namespace method_17_nav_engine { extern void link(); } +namespace method_18_nav_engine { extern void link(); } +namespace method_21_nav_engine { extern void link(); } } // clang-format on @@ -275,69 +286,71 @@ PerGameVersion>> gMips2C jak1::draw_inline_array_prototype_tie_generic_asm::link}}, {"generic-tie", {jak1::generic_tie_dma_to_spad_sync::link, jak1::generic_tie_convert::link}}}, /////////// JAK 2 - { - {"collide-func", - {jak2::collide_do_primitives::link, jak2::moving_sphere_triangle_intersect::link}}, - {"joint", - {jak2::calc_animation_from_spr::link, jak2::cspace_parented_transformq_joint::link}}, - {"font", - {jak2::draw_string::link, jak2::get_string_length::link, jak2::draw_string_asm::link}}, - {"texture", {jak2::adgif_shader_texture_with_update::link}}, - {"debug", - {jak2::debug_line_clip::link, jak2::init_boundary_regs::link, - jak2::render_boundary_quad::link, jak2::render_boundary_tri::link, - jak2::set_sky_vf27::link, jak2::draw_boundary_polygon::link}}, - {"sparticle-launcher", - {jak2::sp_init_fields::link, jak2::particle_adgif::link, - jak2::sp_launch_particles_var::link, jak2::sparticle_motion_blur::link}}, - {"sparticle", {jak2::sp_process_block_2d::link, jak2::sp_process_block_3d::link}}, - {"sky-tng", - {jak2::set_tex_offset::link, jak2::draw_large_polygon::link, jak2::render_sky_quad::link, - jak2::render_sky_tri::link, jak2::method_16_sky_work::link, - jak2::method_17_sky_work::link, jak2::method_32_sky_work::link, - jak2::method_33_sky_work::link, jak2::method_28_sky_work::link, - jak2::method_29_sky_work::link, jak2::method_30_sky_work::link, - jak2::set_sky_vf23_value::link}}, - {"collide-hash", - {jak2::method_11_collide_hash::link, jak2::method_12_collide_hash::link, - jak2::fill_bg_using_box_new::link, jak2::fill_bg_using_line_sphere_new::link}}, - {"collide-mesh", - {jak2::method_12_collide_mesh::link, jak2::method_14_collide_mesh::link, - jak2::method_15_collide_mesh::link}}, - {"collide-edge-grab", - {jak2::method_10_collide_edge_hold_list::link, jak2::method_19_collide_edge_work::link, - jak2::method_9_edge_grab_info::link, jak2::method_16_collide_edge_work::link, - jak2::method_17_collide_edge_work::link, jak2::method_18_collide_edge_work::link}}, - {"ocean-vu0", - {jak2::method_16_ocean::link, jak2::method_15_ocean::link, jak2::method_14_ocean::link}}, - {"ocean", - {jak2::init_ocean_far_regs::link, jak2::draw_large_polygon_ocean::link, - jak2::render_ocean_quad::link}}, - {"spatial-hash", - {jak2::method_18_grid_hash::link, jak2::method_19_grid_hash::link, - jak2::method_20_grid_hash::link, jak2::method_22_grid_hash::link, - jak2::method_28_sphere_hash::link, jak2::method_33_sky_work::link, - jak2::method_29_sphere_hash::link, jak2::method_30_sphere_hash::link, - jak2::method_31_sphere_hash::link, jak2::method_32_sphere_hash::link, - jak2::method_33_spatial_hash::link, jak2::method_39_spatial_hash::link, - jak2::method_36_spatial_hash::link, jak2::method_37_spatial_hash::link, - jak2::method_35_spatial_hash::link, jak2::method_33_sphere_hash::link}}, - {"collide-cache", - {jak2::method_10_collide_shape_prim_mesh::link, - jak2::method_10_collide_shape_prim_sphere::link, - jak2::method_10_collide_shape_prim_group::link, - jak2::method_11_collide_shape_prim_mesh::link, - jak2::method_11_collide_shape_prim_sphere::link, - jak2::method_11_collide_shape_prim_group::link, jak2::method_9_collide_cache_prim::link, - jak2::method_10_collide_cache_prim::link, jak2::method_17_collide_cache::link, - jak2::method_9_collide_puss_work::link, jak2::method_10_collide_puss_work::link}}, - {"bones", {jak2::bones_mtx_calc::link}}, - {"foreground", - {jak2::foreground_check_longest_edge_asm::link, jak2::foreground_merc::link}}, - {"lights", - {jak2::add_light_sphere_to_light_group::link, jak2::light_hash_add_items::link, - jak2::light_hash_count_items::link, jak2::light_hash_get_bucket_index::link}}, - }, + {{"collide-func", + {jak2::collide_do_primitives::link, jak2::moving_sphere_triangle_intersect::link}}, + {"joint", {jak2::calc_animation_from_spr::link, jak2::cspace_parented_transformq_joint::link}}, + {"font", + {jak2::draw_string::link, jak2::get_string_length::link, jak2::draw_string_asm::link}}, + {"texture", {jak2::adgif_shader_texture_with_update::link}}, + {"debug", + {jak2::debug_line_clip::link, jak2::init_boundary_regs::link, + jak2::render_boundary_quad::link, jak2::render_boundary_tri::link, jak2::set_sky_vf27::link, + jak2::draw_boundary_polygon::link}}, + {"sparticle-launcher", + {jak2::sp_init_fields::link, jak2::particle_adgif::link, jak2::sp_launch_particles_var::link, + jak2::sparticle_motion_blur::link}}, + {"sparticle", {jak2::sp_process_block_2d::link, jak2::sp_process_block_3d::link}}, + {"sky-tng", + {jak2::set_tex_offset::link, jak2::draw_large_polygon::link, jak2::render_sky_quad::link, + jak2::render_sky_tri::link, jak2::method_16_sky_work::link, jak2::method_17_sky_work::link, + jak2::method_32_sky_work::link, jak2::method_33_sky_work::link, + jak2::method_28_sky_work::link, jak2::method_29_sky_work::link, + jak2::method_30_sky_work::link, jak2::set_sky_vf23_value::link}}, + {"collide-hash", + {jak2::method_11_collide_hash::link, jak2::method_12_collide_hash::link, + jak2::fill_bg_using_box_new::link, jak2::fill_bg_using_line_sphere_new::link}}, + {"collide-mesh", + {jak2::method_12_collide_mesh::link, jak2::method_14_collide_mesh::link, + jak2::method_15_collide_mesh::link}}, + {"collide-edge-grab", + {jak2::method_10_collide_edge_hold_list::link, jak2::method_19_collide_edge_work::link, + jak2::method_9_edge_grab_info::link, jak2::method_16_collide_edge_work::link, + jak2::method_17_collide_edge_work::link, jak2::method_18_collide_edge_work::link}}, + {"ocean-vu0", + {jak2::method_16_ocean::link, jak2::method_15_ocean::link, jak2::method_14_ocean::link}}, + {"ocean", + {jak2::init_ocean_far_regs::link, jak2::draw_large_polygon_ocean::link, + jak2::render_ocean_quad::link}}, + {"spatial-hash", + {jak2::method_18_grid_hash::link, jak2::method_19_grid_hash::link, + jak2::method_20_grid_hash::link, jak2::method_22_grid_hash::link, + jak2::method_28_sphere_hash::link, jak2::method_33_sky_work::link, + jak2::method_29_sphere_hash::link, jak2::method_30_sphere_hash::link, + jak2::method_31_sphere_hash::link, jak2::method_32_sphere_hash::link, + jak2::method_33_spatial_hash::link, jak2::method_39_spatial_hash::link, + jak2::method_36_spatial_hash::link, jak2::method_37_spatial_hash::link, + jak2::method_35_spatial_hash::link, jak2::method_33_sphere_hash::link}}, + {"collide-cache", + {jak2::method_10_collide_shape_prim_mesh::link, + jak2::method_10_collide_shape_prim_sphere::link, + jak2::method_10_collide_shape_prim_group::link, + jak2::method_11_collide_shape_prim_mesh::link, + jak2::method_11_collide_shape_prim_sphere::link, + jak2::method_11_collide_shape_prim_group::link, jak2::method_9_collide_cache_prim::link, + jak2::method_10_collide_cache_prim::link, jak2::method_17_collide_cache::link, + jak2::method_9_collide_puss_work::link, jak2::method_10_collide_puss_work::link}}, + {"bones", {jak2::bones_mtx_calc::link}}, + {"foreground", {jak2::foreground_check_longest_edge_asm::link, jak2::foreground_merc::link}}, + {"lights", + {jak2::add_light_sphere_to_light_group::link, jak2::light_hash_add_items::link, + jak2::light_hash_count_items::link, jak2::light_hash_get_bucket_index::link}}, + {"nav-control", {jak2::method_39_nav_state::link}}, + {"nav-mesh", + {jak2::nav_state_patch_pointers::link, jak2::method_45_nav_mesh::link, + jak2::method_20_nav_engine::link, jak2::method_43_nav_mesh::link, + jak2::nav_dma_send_to_spr_no_flush::link, jak2::nav_dma_send_from_spr_no_flush::link, + jak2::method_17_nav_engine::link, jak2::method_18_nav_engine::link, + jak2::method_21_nav_engine::link}}}, }; void LinkedFunctionTable::reg(const std::string& name, u64 (*exec)(void*), u32 stack_size) { @@ -421,4 +434,4 @@ u32 LinkedFunctionTable::get(const std::string& name) { } return it->second.goal_trampoline.offset; } -} // namespace Mips2C \ No newline at end of file +} // namespace Mips2C diff --git a/goal_src/jak2/engine/ai/enemy.gc b/goal_src/jak2/engine/ai/enemy.gc index 3f2a55a777..6ef485a3ef 100644 --- a/goal_src/jak2/engine/ai/enemy.gc +++ b/goal_src/jak2/engine/ai/enemy.gc @@ -2248,7 +2248,7 @@ ) (logclear! (-> self draw status) (draw-control-status no-draw)) (logclear! (-> self enemy-flags) (enemy-flag victory)) - (logior! (-> self root-override2 nav-flags) (nav-flags nav-flags0)) + (logior! (-> self root-override2 nav-flags) (nav-flags has-root-sphere)) (none) ) :code (the-as (function none :behavior enemy) sleep-code) diff --git a/goal_src/jak2/engine/anim/fma-sphere.gc b/goal_src/jak2/engine/anim/fma-sphere.gc index 131c19711c..8c773e2251 100644 --- a/goal_src/jak2/engine/anim/fma-sphere.gc +++ b/goal_src/jak2/engine/anim/fma-sphere.gc @@ -239,10 +239,10 @@ ) (logclear! (-> self mask) (process-mask actor-pause enemy)) (when (logtest? (-> self mode) (fma-sphere-mode nav)) - (let ((a0-32 (find-nearest-nav-mesh (-> self root-override trans) #x7f800000))) + (let ((a0-32 (find-nearest-nav-mesh (-> self root-override trans) (the-as float #x7f800000)))) (cond (a0-32 - (nav-mesh-method-29 a0-32 self #f) + (add-process-drawable-to-navmesh a0-32 self #f) ) (else (format 0 "ERROR: fma-sphere-init-by-other: failed to find nearest nav-mesh!~%") diff --git a/goal_src/jak2/engine/collide/collide-shape-h.gc b/goal_src/jak2/engine/collide/collide-shape-h.gc index 0df94e837f..41896bb51c 100644 --- a/goal_src/jak2/engine/collide/collide-shape-h.gc +++ b/goal_src/jak2/engine/collide/collide-shape-h.gc @@ -271,8 +271,9 @@ (defenum nav-flags :type uint8 :bitfield #t - (nav-flags0 0) - (nav-flags1 1) + (has-root-sphere 0) + (has-extra-sphere 1) + (has-child-spheres 2) ) ;; ---nav-flags @@ -627,7 +628,7 @@ (set! (-> s5-0 actor-hash-index) -1) (set! (-> s5-0 process) arg0) (set! (-> s5-0 max-iteration-count) (the-as uint 1)) - (set! (-> s5-0 nav-flags) (nav-flags nav-flags0)) + (set! (-> s5-0 nav-flags) (nav-flags has-root-sphere)) (set! (-> s5-0 event-self) #f) (set! (-> s5-0 event-other) #f) (set! (-> s5-0 riders) (the-as (inline-array collide-rider) #f)) diff --git a/goal_src/jak2/engine/common_objs/basebutton.gc b/goal_src/jak2/engine/common_objs/basebutton.gc index 7eeeca0205..dbc9ecf1f2 100644 --- a/goal_src/jak2/engine/common_objs/basebutton.gc +++ b/goal_src/jak2/engine/common_objs/basebutton.gc @@ -451,7 +451,7 @@ ) (set! (-> obj timeout) (res-lump-float arg0 'timeout)) (if (not (logtest? (-> obj button-status) (button-status button-status-1))) - (nav-mesh-connect-from-ent (the-as entity-nav-mesh obj)) + (nav-mesh-connect-from-ent obj) ) (prepare-trigger-event! obj) (basebutton-method-33 obj) diff --git a/goal_src/jak2/engine/common_objs/crates.gc b/goal_src/jak2/engine/common_objs/crates.gc index 40f010684a..5284e45096 100644 --- a/goal_src/jak2/engine/common_objs/crates.gc +++ b/goal_src/jak2/engine/common_objs/crates.gc @@ -10,8 +10,8 @@ ;; DECOMP BEGINS -(defskelgroup skel-crate-krimson crate crate-krimson-lod0-jg crate-idle-ja - ((crate-krimson-lod0-mg (meters 20)) (crate-krimson-lod1-mg (meters 999999))) +(defskelgroup skel-crate-krimson crate 0 3 + ((1 (meters 20)) (2 (meters 999999))) :bounds (static-spherem 0 1 0 1.6) :texture-level 6 ) @@ -1348,7 +1348,7 @@ ) (set! (-> obj base quad) (-> obj root-override2 trans quad)) (crate-post) - (nav-mesh-connect-from-ent (the-as entity-nav-mesh obj)) + (nav-mesh-connect-from-ent obj) (none) ) diff --git a/goal_src/jak2/engine/common_objs/generic-obs.gc b/goal_src/jak2/engine/common_objs/generic-obs.gc index 82f467098e..b65182bf7c 100644 --- a/goal_src/jak2/engine/common_objs/generic-obs.gc +++ b/goal_src/jak2/engine/common_objs/generic-obs.gc @@ -41,6 +41,7 @@ ) (set! gp-0 (lookup-part-group-pointer-by-name (the-as string s3-0))) (if (the-as (pointer object) gp-0) + ;; TODO - manual fix here (set! (-> (the-as (pointer int32) s4-0)) (the-as int gp-0)) ) ) @@ -2487,7 +2488,7 @@ ) ) (set! (-> obj sound-id) (new-sound-id)) - (nav-mesh-connect-from-ent (the-as entity-nav-mesh obj)) + (nav-mesh-connect-from-ent obj) (go (method-of-object obj idle)) (none) ) diff --git a/goal_src/jak2/engine/draw/drawable.gc b/goal_src/jak2/engine/draw/drawable.gc index d12ea2f53a..fab5808e89 100644 --- a/goal_src/jak2/engine/draw/drawable.gc +++ b/goal_src/jak2/engine/draw/drawable.gc @@ -1506,13 +1506,10 @@ (actors-update *level*) ) - ;; ?? (with-profiler 'nav *profile-nav-color* - ;; ((method-of-object *level* level-group-method-18)) + (update-nav-meshes *level*) ) - - (with-profiler 'background *profile-background-color* ;; Run the background renderers! diff --git a/goal_src/jak2/engine/entity/entity-h.gc b/goal_src/jak2/engine/entity/entity-h.gc index 7e80747f31..aad855b202 100644 --- a/goal_src/jak2/engine/entity/entity-h.gc +++ b/goal_src/jak2/engine/entity/entity-h.gc @@ -173,7 +173,7 @@ :size-assert #x38 :flag-assert #x1d00000038 (:methods - (entity-nav-mesh-method-27 (_type_) none 27) + (initialize-nav-mesh! (_type_) none 27) (debug-draw (_type_) none 28) ) ) @@ -205,8 +205,8 @@ (prev-actor (_type_) entity-actor 28) (debug-print (_type_ symbol type) none 29) (toggle-status (_type_ entity-perm-status symbol) none 30) - (entity-actor-method-31 (_type_ vector vector vector object float) nav-mesh 31) - (entity-actor-method-32 (_type_ vector vector nav-poly float) nav-poly 32) + (get-simple-travel-vector (_type_ vector vector vector object float) nav-mesh 31) + (project-point-to-nav-mesh (_type_ vector vector nav-poly float) nav-poly 32) ) ) diff --git a/goal_src/jak2/engine/entity/entity.gc b/goal_src/jak2/engine/entity/entity.gc index 67947040d3..97c5d08f73 100644 --- a/goal_src/jak2/engine/entity/entity.gc +++ b/goal_src/jak2/engine/entity/entity.gc @@ -238,7 +238,7 @@ ) ) -(defmethod level-group-method-18 level-group ((obj level-group)) +(defmethod update-nav-meshes level-group ((obj level-group)) (when (not (paused?)) (dotimes (s5-0 (-> obj length)) (let ((v1-4 (-> obj level s5-0))) @@ -246,7 +246,7 @@ (let ((s4-0 (-> v1-4 bsp nav-meshes))) (when (nonzero? s4-0) (dotimes (s3-0 (-> s4-0 length)) - (nav-mesh-method-26 (-> s4-0 s3-0 nav-mesh)) + (update-navigation (-> s4-0 s3-0 nav-mesh)) ) ) ) @@ -868,7 +868,7 @@ (when a0-25 (set! sv-96 (new 'stack-no-clear 'vector)) (set! sv-112 (new 'stack-no-clear 'vector)) - (nav-mesh-method-22 a0-25 sv-96 sv-112) + (compute-bounding-box-from-vertices a0-25 sv-96 sv-112) (expand-bounding-box sv-20 sv-24 sv-96 sv-112) ) ) @@ -880,7 +880,7 @@ (else (let ((a0-28 (nav-mesh-from-res-tag sv-40 'nav-mesh-actor 0))) (if a0-28 - (nav-mesh-method-22 a0-28 sv-20 sv-24) + (compute-bounding-box-from-vertices a0-28 sv-20 sv-24) ) ) ) diff --git a/goal_src/jak2/engine/level/level-h.gc b/goal_src/jak2/engine/level/level-h.gc index 31685b506b..90b6e7ff51 100644 --- a/goal_src/jak2/engine/level/level-h.gc +++ b/goal_src/jak2/engine/level/level-h.gc @@ -382,7 +382,7 @@ (debug-draw-actors (_type_ symbol) none 15) (assign-draw-indices (_type_) none 16) (actors-update (_type_) none 17) - (level-group-method-18 (_type_) none 18) + (update-nav-meshes (_type_) none 18) (level-update (_type_) none 19) (level-get-target-inside (_type_) level 20) (alloc-levels-if-needed (_type_ symbol) none 21) diff --git a/goal_src/jak2/engine/level/level.gc b/goal_src/jak2/engine/level/level.gc index fced4b49ed..1d1db1deb3 100644 --- a/goal_src/jak2/engine/level/level.gc +++ b/goal_src/jak2/engine/level/level.gc @@ -1292,7 +1292,7 @@ ) ) ) - ;; (goto cfg-1) + (goto cfg-1) ) ;; next is nav-meshes @@ -1304,12 +1304,12 @@ (+! (-> lstate state) 1) ) (else - (entity-nav-mesh-method-27 (-> lev-bsp nav-meshes (the-as uint login-state-pos))) + (initialize-nav-mesh! (-> lev-bsp nav-meshes (the-as uint login-state-pos))) (+! (-> lstate pos) 1) ) ) ) - ;; (goto cfg-1) + (goto cfg-1) ) diff --git a/goal_src/jak2/engine/nav/nav-control-h.gc b/goal_src/jak2/engine/nav/nav-control-h.gc index f820ca97df..f4f39d4969 100644 --- a/goal_src/jak2/engine/nav/nav-control-h.gc +++ b/goal_src/jak2/engine/nav/nav-control-h.gc @@ -116,50 +116,50 @@ (:methods (debug-draw (_type_) none 9) (nav-state-method-10 (_type_) none 10) - (nav-state-method-11 (_type_ nav-gap-info) symbol 11) - (nav-state-method-12 (_type_ vector) vector 12) - (nav-state-method-13 (_type_ vector) vector 13) - (nav-state-method-14 (_type_ vector) vector 14) - (nav-state-method-15 (_type_ vector) vector 15) + (plan-over-pat1-polys-using-route (_type_ nav-gap-info) symbol 11) + (get-velocity (_type_ vector) vector 12) + (get-travel (_type_ vector) vector 13) + (get-heading (_type_ vector) vector 14) + (get-target-post (_type_ vector) vector 15) (get-speed (_type_) meters 16) (get-rotation-rate (_type_) float 17) - (nav-state-method-18 (_type_ vector object vector) none 18) + (try-projecting-to-current-poly (_type_ vector object vector) symbol 18) (get-current-poly (_type_) nav-poly 19) (copy-nav-state! (_type_ (pointer nav-state)) none 20) (nav-state-method-21 () none 21) (nav-state-method-22 () none 22) (nav-state-method-23 () none 23) - (nav-state-method-24 (_type_) none 24) - (nav-state-method-25 (_type_) none 25) - (nav-state-method-26 (_type_) none 26) - (nav-state-method-27 (_type_) none 27) - (nav-state-method-28 (_type_) none 28) + (turn-and-navigate-to-destination (_type_) none 24) + (navigate-using-route-portals-wrapper (_type_) none 25) + (navigate-using-best-dir-recompute-avoid-spheres-1-wrapper (_type_) none 26) + (navigate-within-poly-wrapper (_type_) none 27) + (compute-travel-speed (_type_) none 28) (nav-state-method-29 (_type_) none 29) (nav-state-method-30 (_type_) none 30) - (nav-state-method-31 (_type_) none 31) - (nav-state-method-32 (_type_) none 32) - (nav-state-method-33 (_type_) none 33) - (nav-state-method-34 (_type_) none 34) - (nav-state-method-35 (_type_) none 35) - (nav-state-method-36 (_type_ vector) none 36) - (nav-state-method-37 (_type_) none 37) + (navigate-using-best-dir-recompute-avoid-spheres-2 (_type_) none 31) + (update-travel-dir-from-spheres (_type_) none 32) + (compute-speed-simple (_type_) none 33) + (navigate-v1! (_type_) none 34) + (reset-target! (_type_) none 35) + (add-offset-to-target! (_type_ vector) none 36) + (navigate-v2! (_type_) none 37) (set-current-poly! (_type_ nav-poly) none 38) - (nav-state-method-39 () none 39) - (nav-state-method-40 (_type_) none 40) - (nav-state-method-41 (_type_ vector) symbol 41) - (nav-state-method-42 (_type_ vector) none 42) - (nav-state-method-43 (_type_ vector) none 43) + (nav-state-method-39 (_type_) symbol 39) + (do-navigation-to-destination (_type_ vector) none 40) + (clamp-vector-to-mesh-cross-gaps (_type_ vector) symbol 41) + (set-target-post! (_type_ vector) none 42) + (set-travel! (_type_ vector) none 43) (set-velocity! (_type_ vector) none 44) (set-heading! (_type_ vector) none 45) (set-speed! (_type_ meters) none 46) - (nav-state-method-47 (_type_ nav-control) none 47) + (reset! (_type_ nav-control) none 47) (nav-state-method-48 () none 48) - (nav-state-method-49 (_type_ clamp-travel-vector-to-mesh-return-info) none 49) + (navigate-using-best-dir-use-existing-avoid-spheres (_type_ nav-avoid-spheres-params) none 49) (nav-state-method-50 (_type_) none 50) - (nav-state-method-51 () none 51) - (nav-state-method-52 (_type_) none 52) - (nav-state-method-53 (_type_) none 53) - (nav-state-method-54 (_type_) none 54) + (navigate-using-route-portals (_type_) none 51) + (navigate-using-best-dir-recompute-avoid-spheres-1 (_type_) none 52) + (navigate-within-poly (_type_) none 53) + (clamp-travel-vector (_type_) none 54) ) ) @@ -193,28 +193,28 @@ :flag-assert #x2f00000120 (:methods (debug-draw (_type_) none 9) - (point-in-bounds? (_type_ vector) symbol 10) - (nav-control-method-11 (_type_ vector) vector 11) - (nav-control-method-12 (_type_ vector vector nav-poly) nav-poly 12) - (find-poly (_type_ vector) nav-poly 13) - (nav-control-method-14 (_type_ nav-poly vector object vector) none 14) - (nav-control-method-15 (_type_ vector) none 15) - (nav-control-method-16 (_type_ vector float) symbol 16) + (point-in-bsphere? (_type_ vector) symbol 10) + (find-poly-containing-point-1 (_type_ vector) nav-poly 11) + (cloest-point-on-mesh (_type_ vector vector nav-poly) nav-poly 12) + (find-nearest-poly-to-point (_type_ vector) nav-poly 13) + (project-point-onto-plane-of-poly (_type_ nav-poly vector vector vector) none 14) + (find-poly-containing-point-2 (_type_ vector) nav-poly 15) + (is-above-poly-max-height? (_type_ vector float) symbol 16) (is-in-mesh? (_type_ vector float) symbol 17) - (nav-control-method-18 () none 18) - (nav-control-method-19 () none 19) - (nav-control-method-20 (_type_ vector nav-poly vector float symbol symbol) none 20) - (nav-control-method-21 (_type_) none 21) - (nav-control-method-22 (_type_ vector nav-avoid-spheres-params) float 22) - (nav-control-method-23 (_type_) none 23) - (nav-control-method-24 (_type_ vector int) none 24) + (avoid-spheres-1! (_type_ nav-avoid-spheres-params) symbol 18) + (avoid-spheres-2! (_type_ nav-avoid-spheres-params) symbol 19) + (clamp-vector-to-mesh-cross-gaps (_type_ vector nav-poly vector float symbol clamp-travel-vector-to-mesh-return-info) none 20) + (clamp-vector-to-mesh-no-gaps (_type_ vector nav-poly vector clamp-travel-vector-to-mesh-return-info) none 21) + (find-first-sphere-and-update-avoid-params (_type_ vector nav-avoid-spheres-params) float 22) + (set-spheres-from-nav-ids (_type_) none 23) + (add-root-sphere-to-hash! (_type_ vector int) none 24) (get-max-rotation-rate (_type_) float 25) - (get-sphere-mask (_type_) none 26) + (get-sphere-mask (_type_) uint 26) (get-target-speed (_type_) meters 27) - (nav-control-method-28 (_type_) none 28) - (nav-control-method-29 (_type_) none 29) + (enable-extra-sphere! (_type_) none 28) + (disable-extra-sphere! (_type_) none 29) (copy-extra-nav-sphere! (_type_ sphere) none 30) - (set-extra-nav-sphere! (_type_ sphere) none 31) + (set-extra-nav-sphere-xyz! (_type_ sphere) none 31) (set-extra-nav-sphere-radius! (_type_ float) none 32) (set-nearest-y-thres! (_type_ float) none 33) (set-nav-cull-radius! (_type_ meters) none 34) @@ -224,11 +224,11 @@ (set-turning-acceleration! (_type_ meters) none 38) (set-max-rotation-rate! (_type_ float) none 39) (set-sphere-mask! (_type_ uint) none 40) - (nav-control-method-41 (_type_) none 41) - (init! (_type_ collide-shape) none 42) + (remove! (_type_) none 41) + (init! (_type_ collide-shape) none 42) (display-marks? (_type_) symbol 43) (nav-control-method-44 () none 44) - (nav-control-method-45 (_type_ vector vector vector) sphere 45) - (find-sphere (_type_ symbol) none 46) + (find-first-sphere-intersecting-ray (_type_ vector vector vector) sphere 45) + (find-sphere-ids-from-sphere-hash (_type_ symbol) none 46) ) ) diff --git a/goal_src/jak2/engine/nav/nav-control.gc b/goal_src/jak2/engine/nav/nav-control.gc index 17d17f5452..0452f4a72c 100644 --- a/goal_src/jak2/engine/nav/nav-control.gc +++ b/goal_src/jak2/engine/nav/nav-control.gc @@ -7,3 +7,4365 @@ ;; DECOMP BEGINS +;; definition for symbol *nav-triangle-test-count*, type int +(define *nav-triangle-test-count* 0) + +;; definition for symbol *nav-last-triangle-test-count*, type int +(define *nav-last-triangle-test-count* 0) + +;; definition for function debug-nav-validate-current-poly +(defun debug-nav-validate-current-poly ((arg0 nav-mesh) (arg1 nav-poly) (arg2 vector)) + (local-vars (sv-32 vector) (sv-36 float)) + (when (not (point-in-poly? arg0 arg1 arg2)) + (set! sv-32 (new 'stack-no-clear 'vector)) + (project-point-into-poly-2d arg0 arg1 sv-32 arg2) + (set! sv-36 (vector-vector-xz-distance arg2 sv-32)) + #f + ) + ) + +;; definition for function debug-report-nav-stats +;; WARN: Return type mismatch int vs none. +(defun debug-report-nav-stats () + "Does nothing" + 0 + (none) + ) + +;; definition for method 7 of type nav-control +(defmethod relocate nav-control ((obj nav-control) (arg0 int)) + (&+! (-> obj process) arg0) + (&+! (-> obj shape) arg0) + obj + ) + +;; definition for method 41 of type nav-control +;; WARN: Return type mismatch int vs none. +(defmethod remove! nav-control ((obj nav-control)) + "Remove this nav-control from the nav-mesh it belongs to." + (remove-nav-control (-> obj state mesh) obj) + 0 + (none) + ) + +;; definition for method 28 of type nav-control +;; WARN: Return type mismatch int vs none. +(defmethod enable-extra-sphere! nav-control ((obj nav-control)) + "Sets a flag indicating that this nav-control has an extra-nav-sphere." + (logior! (-> obj shape nav-flags) (nav-flags has-extra-sphere)) + 0 + (none) + ) + +;; definition for method 29 of type nav-control +;; WARN: Return type mismatch int vs none. +(defmethod disable-extra-sphere! nav-control ((obj nav-control)) + "Clears a flag indicating that this nav-control has an extra-nav-sphere." + (logclear! (-> obj shape nav-flags) (nav-flags has-extra-sphere)) + 0 + (none) + ) + +;; definition for method 30 of type nav-control +;; WARN: Return type mismatch int vs none. +(defmethod copy-extra-nav-sphere! nav-control ((obj nav-control) (arg0 sphere)) + "Copies the given [[sphere]] into `extra-nav-sphere`" + (mem-copy! (the-as pointer (-> obj extra-nav-sphere)) (the-as pointer arg0) 16) + 0 + (none) + ) + +;; definition for method 31 of type nav-control +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod set-extra-nav-sphere-xyz! nav-control ((obj nav-control) (arg0 sphere)) + "Set the `extra-nav-sphere` with the data in the given [[sphere]]" + (let ((f0-0 (-> obj extra-nav-sphere w))) + (set! (-> obj extra-nav-sphere quad) (-> arg0 quad)) + (set! (-> obj extra-nav-sphere w) f0-0) + ) + 0 + (none) + ) + +;; definition for method 32 of type nav-control +;; WARN: Return type mismatch int vs none. +(defmethod set-extra-nav-sphere-radius! nav-control ((obj nav-control) (arg0 float)) + "Set's `extra-nav-sphere`'s radius" + (set! (-> obj extra-nav-sphere w) arg0) + 0 + (none) + ) + +;; definition for method 33 of type nav-control +;; WARN: Return type mismatch int vs none. +(defmethod set-nearest-y-thres! nav-control ((obj nav-control) (arg0 float)) + "Set `nearest-y-threshold`" + (set! (-> obj nearest-y-threshold) arg0) + 0 + (none) + ) + +;; definition for method 34 of type nav-control +;; WARN: Return type mismatch int vs none. +(defmethod set-nav-cull-radius! nav-control ((obj nav-control) (arg0 meters)) + "Set `nav-cull-radius`" + (set! (-> obj nav-cull-radius) arg0) + 0 + (none) + ) + +;; definition for method 35 of type nav-control +;; WARN: Return type mismatch int vs none. +(defmethod set-speed-scale! nav-control ((obj nav-control) (arg0 float)) + "Set `speed-scale`" + (set! (-> obj speed-scale) arg0) + 0 + (none) + ) + +;; definition for method 36 of type nav-control +;; WARN: Return type mismatch int vs none. +(defmethod set-target-speed! nav-control ((obj nav-control) (arg0 meters)) + "Set `target-speed`" + (set! (-> obj target-speed) arg0) + 0 + (none) + ) + +;; definition for method 27 of type nav-control +(defmethod get-target-speed nav-control ((obj nav-control)) + (-> obj target-speed) + ) + +;; definition for method 37 of type nav-control +;; WARN: Return type mismatch int vs none. +(defmethod set-acceleration! nav-control ((obj nav-control) (arg0 meters)) + "Set `acceleration`" + (set! (-> obj acceleration) arg0) + 0 + (none) + ) + +;; definition for method 38 of type nav-control +;; WARN: Return type mismatch int vs none. +(defmethod set-turning-acceleration! nav-control ((obj nav-control) (arg0 meters)) + "Set `turning-acceleration`" + (set! (-> obj turning-acceleration) arg0) + 0 + (none) + ) + +;; definition for method 39 of type nav-control +;; WARN: Return type mismatch int vs none. +(defmethod set-max-rotation-rate! nav-control ((obj nav-control) (arg0 float)) + "Set `max-rotation-rate`" + (set! (-> obj max-rotation-rate) arg0) + 0 + (none) + ) + +;; definition for method 25 of type nav-control +(defmethod get-max-rotation-rate nav-control ((obj nav-control)) + (-> obj max-rotation-rate) + ) + +;; definition for method 40 of type nav-control +;; WARN: Return type mismatch int vs none. +(defmethod set-sphere-mask! nav-control ((obj nav-control) (arg0 uint)) + "TODO - probably an enum - Set `sphere-mask`" + (set! (-> obj sphere-mask) arg0) + 0 + (none) + ) + +;; definition for method 26 of type nav-control +(defmethod get-sphere-mask nav-control ((obj nav-control)) + (-> obj sphere-mask) + ) + +;; definition for method 10 of type nav-control +(defmethod point-in-bsphere? nav-control ((obj nav-control) (arg0 vector)) + "Is the given point ([[vector]]) outside of the [[nav-mesh]]'s `bounds` [[sphere]] radius" + (let ((v1-1 (-> obj state mesh bounds))) + (>= (-> v1-1 w) (vector-vector-distance arg0 v1-1)) + ) + ) + +;; definition for method 43 of type nav-control +(defmethod display-marks? nav-control ((obj nav-control)) + "Returns if navigation related marks should be displayed" + (and *display-nav-marks* (logtest? (-> obj flags) (nav-control-flag display-marks))) + ) + +;; definition for method 42 of type nav-control +;; WARN: Return type mismatch int vs none. +(defmethod init! nav-control ((obj nav-control) (arg0 collide-shape)) + "Initializes the [[nav-control]], setting `shape` with the provided [[collide-shape]]" + (set! (-> obj callback-info) #f) + (logior! (-> obj flags) (nav-control-flag update-heading-from-facing output-sphere-hash)) + (let ((v1-2 obj)) + (set! (-> v1-2 sphere-mask) (the-as uint #x800f8)) + ) + 0 + (set! (-> obj sphere-count) 0) + (set! (-> obj sphere-array) (the-as (inline-array sphere) #f)) + (set! (-> obj shape) arg0) + (set! (-> obj process) (-> arg0 process)) + (set! (-> obj speed-scale) 1.0) + (set! (-> obj acceleration) 4096.0) + (set! (-> obj turning-acceleration) 4096.0) + (set! (-> obj max-rotation-rate) 131072.0) + (set! (-> obj target-speed) 0.0) + (set! (-> obj nav-cull-radius) 40960.0) + (reset! (-> obj state) obj) + 0 + (none) + ) + +;; definition for function get-nav-control +;; WARN: Function get-nav-control has a return type of none, but the expression builder found a return statement. +(defun get-nav-control ((arg0 process-drawable) (arg1 nav-mesh)) + "Given a [[process-drawable]] get the associated [[nav-control]] using either: + - the provided `nav-mesh` arg + - the `nav-mesh` associated with the [[process-drawable]]'s [[entity]] + If no [[nav-mesh]] is set or found, set the [[entity]]'s [[entity-perm-status]] to TODO and return an error. + Note that this doesn't actually return the nav-control, but instead adds this process-drawable to the nav-mesh." + (if (not arg1) + (set! arg1 (nav-mesh-from-res-tag (-> arg0 entity) 'nav-mesh-actor 0)) + ) + (when (not arg1) + (if (-> arg0 entity) + (logior! (-> arg0 entity extra perm status) (entity-perm-status bit-1)) + ) + (go process-drawable-art-error "no nav-mesh") + (return 0) + ) + (add-process-drawable-to-navmesh arg1 arg0 #t) + (none) + ) + +;; definition for method 13 of type nav-control +(defmethod find-nearest-poly-to-point nav-control ((obj nav-control) (arg0 vector)) + "Find the nav-poly closest to this point in the nav-mesh." + (let ((gp-0 (new 'stack 'nav-find-poly-parms))) + (vector-! (-> gp-0 point) arg0 (-> obj state mesh bounds)) + (set! (-> gp-0 y-threshold) (-> obj nearest-y-threshold)) + (set! (-> gp-0 ignore) (the-as uint 2)) + (find-nearest-poly-to-point-local (-> obj state mesh) gp-0) + (-> gp-0 poly) + ) + ) + +;; definition for method 14 of type nav-control +;; WARN: Return type mismatch int vs none. +(defmethod project-point-onto-plane-of-poly nav-control ((obj nav-control) (arg0 nav-poly) (arg1 vector) (arg2 vector) (arg3 vector)) + "Move a point to the be on the plane containing the given nav-poly. Return the normal too" + (project-point-onto-plane-of-poly-local + (-> obj state mesh) + arg0 + arg1 + arg2 + (vector-! (new 'stack-no-clear 'vector) arg3 (-> obj state mesh bounds)) + ) + (vector+! arg1 arg1 (-> obj state mesh bounds)) + 0 + (none) + ) + +;; definition for method 17 of type nav-control +(defmethod is-in-mesh? nav-control ((obj nav-control) (arg0 vector) (arg1 float)) + "Is this point in the mesh?" + (let ((v1-0 (new 'stack-no-clear 'vector))) + (vector-! v1-0 arg0 (-> obj state mesh bounds)) + (let ((a1-1 (-> obj state mesh))) + (is-in-mesh-local? a1-1 v1-0 arg1 (-> obj nearest-y-threshold)) + ) + ) + ) + +;; definition for method 9 of type nav-control +;; WARN: Return type mismatch int vs none. +(defmethod debug-draw nav-control ((obj nav-control)) + (local-vars (sv-32 nav-mesh) (sv-36 vector)) + (when (display-marks? obj) + (debug-draw (-> obj state mesh)) + (set! sv-32 (-> obj state mesh)) + (set! sv-36 (new 'stack-no-clear 'vector)) + (if (logtest? (-> obj shape nav-flags) (nav-flags has-root-sphere)) + (add-debug-sphere + #t + (bucket-id debug-no-zbuf1) + (-> obj root-nav-sphere) + (-> obj root-nav-sphere w) + (new 'static 'rgba :g #xff :b #xff :a #x20) + ) + ) + (if (logtest? (-> obj shape nav-flags) (nav-flags has-extra-sphere)) + (add-debug-sphere + #t + (bucket-id debug-no-zbuf1) + (-> obj extra-nav-sphere) + (-> obj extra-nav-sphere w) + (new 'static 'rgba :g #xff :b #xff :a #x20) + ) + ) + (dotimes (s5-0 (-> obj sphere-count)) + (let ((v1-19 (-> obj state mesh work debug sphere-array s5-0))) + (vector+! sv-36 (-> sv-32 bounds) (the-as vector v1-19)) + (add-debug-sphere + #t + (bucket-id debug-no-zbuf1) + sv-36 + (- (-> v1-19 r) (-> obj shape nav-radius)) + (new 'static 'rgba :g #xff :b #xff :a #x20) + ) + ) + ) + (dotimes (s5-1 (the-as int (-> sv-32 static-sphere-count))) + (let ((s4-0 (-> sv-32 static-sphere s5-1))) + (add-debug-sphere #t (bucket-id debug2) s4-0 (-> s4-0 r) *color-blue*) + (let ((s3-0 add-debug-text-3d) + (s2-0 #t) + (s1-0 318) + ) + (format (clear *temp-string*) "~D" s5-1) + (s3-0 s2-0 (the-as bucket-id s1-0) *temp-string* s4-0 (font-color cyan-#00fefe) (the-as vector2h #f)) + ) + ) + ) + (debug-draw (-> obj state)) + ) + 0 + (none) + ) + +;; definition for method 11 of type nav-control +(defmethod find-poly-containing-point-1 nav-control ((obj nav-control) (arg0 vector)) + "Find nav-poly containing this point." + (let ((v1-0 (new 'stack-no-clear 'nav-find-poly-parms))) + (vector-! (-> v1-0 point) arg0 (-> obj state mesh bounds)) + (set! (-> v1-0 y-threshold) (-> obj nearest-y-threshold)) + (set! (-> v1-0 ignore) (the-as uint 2)) + (find-poly-containing-point-local (-> obj state mesh) v1-0) + ) + ) + +;; definition for method 15 of type nav-control +(defmethod find-poly-containing-point-2 nav-control ((obj nav-control) (arg0 vector)) + "Find nav-poly containing this point - same as 1" + (let ((v1-0 (new 'stack-no-clear 'nav-find-poly-parms))) + (vector-! (-> v1-0 point) arg0 (-> obj state mesh bounds)) + (set! (-> v1-0 y-threshold) (-> obj nearest-y-threshold)) + (set! (-> v1-0 ignore) (the-as uint 2)) + (find-poly-containing-point-local (-> obj state mesh) v1-0) + ) + ) + +;; definition for method 16 of type nav-control +;; WARN: Return type mismatch object vs symbol. +(defmethod is-above-poly-max-height? nav-control ((obj nav-control) (arg0 vector) (arg1 float)) + "Is the point in a poly, and lower than a max height?" + (let ((a1-1 (new 'stack-no-clear 'nav-find-poly-parms))) + (vector-! (-> a1-1 point) arg0 (-> obj state mesh bounds)) + (set! (-> a1-1 y-threshold) (-> obj nearest-y-threshold)) + (set! (-> a1-1 ignore) (the-as uint 2)) + (the-as symbol (and (find-poly-containing-point-local (-> obj state mesh) a1-1) + (< (-> arg0 y) (+ (-> obj state mesh bounds y) arg1)) + ) + ) + ) + ) + +;; definition for method 45 of type nav-control +(defmethod find-first-sphere-intersecting-ray nav-control ((obj nav-control) (arg0 vector) (arg1 vector) (arg2 vector)) + "Find the first sphere that this ray intersects" + (let ((s5-0 (the-as sphere #f))) + (let ((f30-0 -0.000001)) + (countdown (s1-0 (-> obj sphere-count)) + (let* ((s0-0 (-> obj sphere-array s1-0)) + (f0-1 (ray-circle-intersect arg0 arg1 s0-0 (-> s0-0 r))) + ) + (when (< f30-0 f0-1) + (set! s5-0 s0-0) + (set! f30-0 f0-1) + ) + ) + ) + (set! (-> arg2 x) f30-0) + ) + s5-0 + ) + ) + +;; definition for function add-nav-sphere +;; WARN: Return type mismatch int vs none. +(defun add-nav-sphere ((nav nav-control) (sphere sphere) (max-spheres int)) + "Adds the given [[sphere]] to the [[nav-control]]'s `sphere-array` so long as + `max-spheres` is less than [[nav-control]]'s `sphere-count`" + (local-vars (a2-4 float)) + (rlet ((vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + ) + (when (< (-> nav sphere-count) max-spheres) + (let ((v1-3 (-> nav sphere-array (-> nav sphere-count)))) + (let ((a2-3 sphere) + (a3-0 (-> nav root-nav-sphere)) + ) + (.lvf vf2 (&-> a2-3 quad)) + (.lvf vf3 (&-> a3-0 quad)) + ) + (.sub.vf vf1 vf3 vf2) + (.mul.vf vf1 vf1 vf1) + (.add.z.vf vf1 vf1 vf1 :mask #b1) + (.mov a2-4 vf1) + (let ((f1-0 a2-4) + (f0-1 (+ (-> sphere r) (-> nav shape nav-radius))) + ) + (when (and (< 0.0 f1-0) (let ((f2-3 (+ f0-1 (-> nav nav-cull-radius)))) + (< f1-0 (* f2-3 f2-3)) + ) + ) + (vector-! (the-as vector v1-3) (the-as vector sphere) (-> nav state mesh bounds)) + (set! (-> v1-3 r) f0-1) + (+! (-> nav sphere-count) 1) + ) + ) + ) + ) + 0 + (none) + ) + ) + +;; definition for function add-collide-shape-spheres +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defun add-collide-shape-spheres ((arg0 nav-control) (arg1 collide-shape) (arg2 sphere)) + (local-vars (a2-6 float) (t0-4 float)) + (rlet ((vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + ) + (when (logtest? (-> arg1 nav-flags) (nav-flags has-root-sphere)) + (set! (-> arg2 quad) (-> arg1 trans quad)) + (set! (-> arg2 r) (-> arg1 nav-radius)) + (let ((v1-4 arg0) + (a3-2 16) + ) + (when (< (-> v1-4 sphere-count) a3-2) + (let ((a3-5 (-> v1-4 sphere-array (-> v1-4 sphere-count)))) + (let ((t0-3 arg2) + (t1-0 (-> v1-4 root-nav-sphere)) + ) + (.lvf vf2 (&-> t0-3 quad)) + (.lvf vf3 (&-> t1-0 quad)) + ) + (.sub.vf vf1 vf3 vf2) + (.mul.vf vf1 vf1 vf1) + (.add.z.vf vf1 vf1 vf1 :mask #b1) + (.mov t0-4 vf1) + (let ((f1-0 t0-4) + (f0-2 (+ (-> arg2 r) (-> v1-4 shape nav-radius))) + ) + (when (and (< 0.0 f1-0) (let ((f2-3 (+ f0-2 (-> v1-4 nav-cull-radius)))) + (< f1-0 (* f2-3 f2-3)) + ) + ) + (vector-! (the-as vector a3-5) (the-as vector arg2) (-> v1-4 state mesh bounds)) + (set! (-> a3-5 r) f0-2) + (+! (-> v1-4 sphere-count) 1) + ) + ) + ) + ) + ) + 0 + ) + (when (logtest? (-> arg1 nav-flags) (nav-flags has-extra-sphere)) + (let ((v1-9 arg0) + (a0-1 (-> arg1 process nav extra-nav-sphere)) + (a1-2 16) + ) + (when (< (-> v1-9 sphere-count) a1-2) + (let ((a1-5 (-> v1-9 sphere-array (-> v1-9 sphere-count)))) + (let ((a2-5 a0-1) + (a3-6 (-> v1-9 root-nav-sphere)) + ) + (.lvf vf2 (&-> a2-5 quad)) + (.lvf vf3 (&-> a3-6 quad)) + ) + (.sub.vf vf1 vf3 vf2) + (.mul.vf vf1 vf1 vf1) + (.add.z.vf vf1 vf1 vf1 :mask #b1) + (.mov a2-6 vf1) + (let ((f1-1 a2-6) + (f0-4 (+ (-> a0-1 w) (-> v1-9 shape nav-radius))) + ) + (when (and (< 0.0 f1-1) (let ((f2-9 (+ f0-4 (-> v1-9 nav-cull-radius)))) + (< f1-1 (* f2-9 f2-9)) + ) + ) + (vector-! (the-as vector a1-5) a0-1 (-> v1-9 state mesh bounds)) + (set! (-> a1-5 r) f0-4) + (+! (-> v1-9 sphere-count) 1) + ) + ) + ) + ) + ) + 0 + ) + (none) + ) + ) + +;; definition for method 46 of type nav-control +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod find-sphere-ids-from-sphere-hash nav-control ((obj nav-control) (arg0 symbol)) + "Use sphere-hash to look up navigation sphere IDs and save them." + (let ((s5-0 (new 'stack-no-clear 'find-nav-sphere-ids-params))) + (set! (-> s5-0 bsphere quad) (-> obj root-nav-sphere quad)) + (+! (-> s5-0 bsphere r) (-> obj nav-cull-radius)) + (set! (-> s5-0 max-len) 16) + (set! (-> s5-0 mask) (-> obj sphere-mask)) + (set! (-> s5-0 array) (-> obj sphere-id-array)) + (set! (-> s5-0 y-threshold) (-> obj nearest-y-threshold)) + (find-nav-sphere-ids (-> obj state mesh sphere-hash) s5-0) + (set! (-> obj sphere-count) (-> s5-0 len)) + ) + 0 + (none) + ) + +;; definition for method 23 of type nav-control +;; WARN: Return type mismatch int vs none. +(defmethod set-spheres-from-nav-ids nav-control ((obj nav-control)) + "Set up spheres from sphere ids previously found by find-sphere-ids-from-sphere-hash" + (let ((v1-2 (-> obj state mesh sphere-hash sphere-array)) + (a1-0 (-> obj sphere-id-array)) + (a2-1 (-> obj state mesh bounds)) + (a3-0 (-> obj root-nav-sphere)) + (t0-0 (-> obj sphere-count)) + ) + (dotimes (t1-0 t0-0) + (let ((t3-0 (-> v1-2 (-> a1-0 t1-0))) + (t2-4 (-> obj sphere-array t1-0)) + ) + (vector-! (the-as vector t2-4) (the-as vector t3-0) a2-1) + (set! (-> t2-4 r) (+ (-> t3-0 r) (-> a3-0 w))) + ) + ) + ) + 0 + (none) + ) + +;; definition of type nav-control-cfs-work +(deftype nav-control-cfs-work (structure) + ((in-dir vector :inline :offset-assert 0) + (right-dir vector :inline :offset-assert 16) + (best-dir vector 2 :inline :offset-assert 32) + (temp-dir vector 2 :inline :offset-assert 64) + (away-dir vector :inline :offset-assert 96) + (best-dir-angle degrees 2 :offset-assert 112) + (ignore-mask uint64 :offset-assert 120) + (initial-ignore-mask uint64 :offset-assert 128) + (i-sphere int32 :offset-assert 136) + (i-first-sphere int32 :offset-assert 140) + (i-inside-sphere int32 :offset-assert 144) + (inside-sphere-dist float :offset-assert 148) + (sign float :offset-assert 152) + (travel-len float :offset-assert 156) + (dist2 float :offset-assert 160) + (inside-dist float :offset-assert 164) + (rand-angle float :offset-assert 168) + (dir-update basic :offset-assert 172) + (debug-offset vector :inline :offset-assert 176) + ) + :method-count-assert 9 + :size-assert #xc0 + :flag-assert #x9000000c0 + ) + +;; definition for method 3 of type nav-control-cfs-work +(defmethod inspect nav-control-cfs-work ((obj nav-control-cfs-work)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'nav-control-cfs-work) + (format #t "~1Tin-dir: #~%" (-> obj in-dir)) + (format #t "~1Tright-dir: #~%" (-> obj right-dir)) + (format #t "~1Tbest-dir[2] @ #x~X~%" (-> obj best-dir)) + (format #t "~1Ttemp-dir[2] @ #x~X~%" (-> obj temp-dir)) + (format #t "~1Taway-dir: #~%" (-> obj away-dir)) + (format #t "~1Tbest-dir-angle[2] @ #x~X~%" (-> obj best-dir-angle)) + (format #t "~1Tignore-mask: ~D~%" (-> obj ignore-mask)) + (format #t "~1Tinitial-ignore-mask: ~D~%" (-> obj initial-ignore-mask)) + (format #t "~1Ti-sphere: ~D~%" (-> obj i-sphere)) + (format #t "~1Ti-first-sphere: ~D~%" (-> obj i-first-sphere)) + (format #t "~1Ti-inside-sphere: ~D~%" (-> obj i-inside-sphere)) + (format #t "~1Tinside-sphere-dist: ~f~%" (-> obj inside-sphere-dist)) + (format #t "~1Tsign: ~f~%" (-> obj sign)) + (format #t "~1Ttravel-len: ~f~%" (-> obj travel-len)) + (format #t "~1Tdist2: ~f~%" (-> obj dist2)) + (format #t "~1Tinside-dist: ~f~%" (-> obj inside-dist)) + (format #t "~1Trand-angle: ~f~%" (-> obj rand-angle)) + (format #t "~1Tdir-update: ~A~%" (-> obj dir-update)) + (format #t "~1Tdebug-offset: #~%" (-> obj debug-offset)) + (label cfg-4) + obj + ) + +;; definition for function circle-tangent-directions +;; INFO: Used lq/sq +(defun circle-tangent-directions ((arg0 vector) (arg1 vector) (arg2 vector) (arg3 vector)) + (rlet ((acc :class vf) + (Q :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (let ((t1-0 (new 'stack-no-clear 'vector)) + (t0-0 (new 'stack-no-clear 'vector)) + (v1-0 (new 'stack-no-clear 'vector)) + ) + (vector-! t1-0 arg1 arg0) + (set! (-> t1-0 y) 0.0) + (let ((a0-1 t0-0)) + (let ((t3-2 t1-0)) + (set! (-> a0-1 quad) (-> t3-2 quad)) + ) + (let ((f0-1 1.0)) + (.lvf vf1 (&-> a0-1 quad)) + (.mul.vf vf2 vf1 vf1 :mask #b111) + (let ((t2-3 f0-1)) + (.mov vf3 t2-3) + ) + ) + (.mul.x.vf acc vf0 vf2 :mask #b1000) + (.add.mul.y.vf acc vf0 vf2 acc :mask #b1000) + (.add.mul.z.vf vf2 vf0 vf2 acc :mask #b1000) + (.isqrt.vf Q vf3 vf2 :fsf #b0 :ftf #b11) + (.wait.vf) + (.mul.vf vf1 vf1 Q :mask #b111) + (.nop.vf) + (.nop.vf) + (.nop.vf) + (.svf (&-> a0-1 quad) vf1) + ) + (set! (-> v1-0 quad) (-> t0-0 quad)) + (set! (-> v1-0 x) (-> t0-0 z)) + (set! (-> v1-0 z) (- (-> t0-0 x))) + (let* ((f0-5 (-> arg1 w)) + (f1-1 (vector-dot t0-0 t1-0)) + (f0-6 (fmin f0-5 f1-1)) + (f2-0 f1-1) + (f2-2 (* f2-0 f2-0)) + (f3-0 f0-6) + (f2-4 (sqrtf (- f2-2 (* f3-0 f3-0)))) + (f3-4 (/ 1.0 f1-1)) + (f1-3 (* f2-4 f3-4)) + (f0-7 (* f0-6 f3-4)) + (a0-9 (new 'stack-no-clear 'vector)) + ) + (vector-float*! a0-9 t0-0 f1-3) + (let ((t0-1 arg2)) + (let ((a1-3 a0-9)) + (let ((a2-1 v1-0)) + (let ((t1-1 f0-7)) + (.mov vf7 t1-1) + ) + (.lvf vf5 (&-> a2-1 quad)) + ) + (.lvf vf4 (&-> a1-3 quad)) + ) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> t0-1 quad) vf6) + ) + (let ((v0-0 arg3)) + (let ((a1-4 (- f0-7))) + (.mov vf7 a1-4) + ) + (.lvf vf5 (&-> v1-0 quad)) + (.lvf vf4 (&-> a0-9 quad)) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> v0-0 quad) vf6) + v0-0 + ) + ) + ) + ) + ) + +;; definition for function circle-ray-intersection? +(defun circle-ray-intersection? ((arg0 vector) (arg1 vector) (arg2 float) (arg3 vector)) + (let ((f1-1 (- (-> arg3 x) (-> arg0 x))) + (f0-2 (- (-> arg3 z) (-> arg0 z))) + ) + (when (< (fabs (- (* (-> arg1 z) f1-1) (* (-> arg1 x) f0-2))) (-> arg3 w)) + (let ((f2-7 (+ (* (-> arg1 x) f1-1) (* (-> arg1 z) f0-2)))) + (cond + ((< f2-7 0.0) + (let ((f0-5 (+ (* f1-1 f1-1) (* f0-2 f0-2))) + (f1-4 (-> arg3 w)) + ) + (< f0-5 (* f1-4 f1-4)) + ) + ) + ((< arg2 f2-7) + (let* ((f0-8 (- (-> arg3 x) (+ (-> arg0 x) (* (-> arg1 x) arg2)))) + (f1-10 (- (-> arg3 z) (+ (-> arg0 z) (* (-> arg1 z) arg2)))) + (f0-11 (+ (* f0-8 f0-8) (* f1-10 f1-10))) + (f1-13 (-> arg3 w)) + ) + (< f0-11 (* f1-13 f1-13)) + ) + ) + (else + #t + ) + ) + ) + ) + ) + ) + +;; definition for function find-closest-circle-ray-intersection +(defun find-closest-circle-ray-intersection ((arg0 vector) (arg1 vector) (arg2 float) (arg3 int) (arg4 (inline-array vector)) (arg5 int)) + 1.0 + (let ((v0-0 -1)) + (vector-float*! (new 'stack-no-clear 'vector) arg1 arg2) + (let ((v1-3 0)) + (b! #t cfg-18 :delay (nop!)) + (label cfg-1) + (b! (logtest? arg5 (ash 1 v1-3)) cfg-17 :delay (empty-form)) + (let* ((t4-0 arg0) + (t3-1 arg1) + (f0-2 arg2) + (t2-6 (-> arg4 v1-3)) + (f2-1 (- (-> t2-6 x) (-> t4-0 x))) + (f1-2 (- (-> t2-6 z) (-> t4-0 z))) + ) + (b! + (not (when (< (fabs (- (* (-> t3-1 z) f2-1) (* (-> t3-1 x) f1-2))) (-> t2-6 w)) + (let ((f3-7 (+ (* (-> t3-1 x) f2-1) (* (-> t3-1 z) f1-2)))) + (cond + ((< f3-7 0.0) + (let ((f0-5 (+ (* f2-1 f2-1) (* f1-2 f1-2))) + (f1-5 (-> t2-6 w)) + ) + (< f0-5 (* f1-5 f1-5)) + ) + ) + ((< f0-2 f3-7) + (let* ((f1-9 (- (-> t2-6 x) (+ (-> t4-0 x) (* (-> t3-1 x) f0-2)))) + (f2-5 (- (-> t2-6 z) (+ (-> t4-0 z) (* (-> t3-1 z) f0-2)))) + (f0-10 (+ (* f1-9 f1-9) (* f2-5 f2-5))) + (f1-12 (-> t2-6 w)) + ) + (< f0-10 (* f1-12 f1-12)) + ) + ) + (else + #t + ) + ) + ) + ) + ) + cfg-17 + :delay (empty-form) + ) + ) + (set! v0-0 v1-3) + (b! #t cfg-20 :delay (nop!)) + (label cfg-17) + (+! v1-3 1) + (label cfg-18) + (b! (< v1-3 arg3) cfg-1) + ) + (label cfg-20) + v0-0 + ) + ) + +;; definition for function compute-dir-parm +(defun compute-dir-parm ((arg0 vector) (arg1 vector) (arg2 vector)) + (let ((a2-1 (the-as number (vector-dot arg0 arg2))) + (a3-1 #xffffffff80000000) + (v1-2 #x3f800000) + ) + (* (the-as float (logior (logand (the-as uint a2-1) a3-1) v1-2)) (- 1.0 (vector-dot arg0 arg1))) + ) + ) + +;; definition for method 18 of type nav-control +;; INFO: Used lq/sq +(defmethod avoid-spheres-1! nav-control ((obj nav-control) (arg0 nav-avoid-spheres-params)) + (local-vars (v1-28 int) (a0-29 int) (a1-3 float)) + (rlet ((acc :class vf) + (Q :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + ) + (init-vf0-vector) + (let ((s5-0 (new 'stack-no-clear 'nav-control-cfs-work))) + (set! (-> s5-0 in-dir quad) (-> arg0 travel quad)) + (set! (-> s5-0 in-dir y) 0.0) + (let ((v1-1 (-> s5-0 in-dir))) + (let ((f0-1 1.0)) + (.lvf vf1 (&-> v1-1 quad)) + (.mul.vf vf2 vf1 vf1 :mask #b111) + (let ((a0-4 f0-1)) + (.mov vf3 a0-4) + ) + ) + (.mul.x.vf acc vf0 vf2 :mask #b1000) + (.add.mul.y.vf acc vf0 vf2 acc :mask #b1000) + (.add.mul.z.vf vf2 vf0 vf2 acc :mask #b1000) + (.isqrt.vf Q vf3 vf2 :fsf #b0 :ftf #b11) + (.wait.vf) + (.mul.vf vf1 vf1 Q :mask #b111) + (.nop.vf) + (.nop.vf) + (.nop.vf) + (.svf (&-> v1-1 quad) vf1) + ) + (set! (-> s5-0 travel-len) (vector-dot (-> s5-0 in-dir) (-> arg0 travel))) + (set! (-> s5-0 right-dir quad) (-> s5-0 in-dir quad)) + (set! (-> s5-0 right-dir x) (- (-> s5-0 in-dir z))) + (set! (-> s5-0 right-dir z) (-> s5-0 in-dir x)) + (set! (-> s5-0 best-dir 0 quad) (-> s5-0 in-dir quad)) + (set! (-> s5-0 best-dir 1 quad) (-> s5-0 in-dir quad)) + (set! (-> s5-0 best-dir-angle 0) 0.0) + (set! (-> s5-0 best-dir-angle 1) 0.0) + (set! (-> s5-0 initial-ignore-mask) (the-as uint 0)) + (set! (-> s5-0 i-inside-sphere) -1) + (set! (-> s5-0 inside-sphere-dist) 0.0) + (let ((f0-10 65536.0)) + (set! (-> arg0 closest-sphere-dist2) (* f0-10 f0-10)) + ) + (dotimes (v1-10 (-> obj sphere-count)) + (let ((a0-13 (-> obj sphere-array v1-10))) + (let ((a1-2 (-> arg0 current-pos)) + (a2-0 a0-13) + ) + (.lvf vf2 (&-> a1-2 quad)) + (.lvf vf3 (&-> a2-0 quad)) + ) + (.sub.vf vf1 vf3 vf2) + (.mul.vf vf1 vf1 vf1) + (.add.z.vf vf1 vf1 vf1 :mask #b1) + (.mov a1-3 vf1) + (set! (-> s5-0 dist2) a1-3) + (let ((f0-14 (-> arg0 closest-sphere-dist2)) + (f1-0 (-> s5-0 dist2)) + (f2-0 (-> a0-13 r)) + ) + (set! (-> arg0 closest-sphere-dist2) (fmin f0-14 (- f1-0 (* f2-0 f2-0)))) + ) + (when (< (-> arg0 closest-sphere-dist2) 0.0) + (vector-! (the-as vector (-> s5-0 temp-dir)) (-> arg0 current-pos) (the-as vector a0-13)) + (set! (-> s5-0 temp-dir 0 y) 0.0) + (if (< 0.0 (vector-dot (the-as vector (-> s5-0 temp-dir)) (-> s5-0 in-dir))) + (+! (-> s5-0 initial-ignore-mask) (ash 1 v1-10)) + ) + (set! (-> s5-0 inside-dist) (- (-> a0-13 r) (sqrtf (-> s5-0 dist2)))) + (when (< (-> s5-0 inside-sphere-dist) (-> s5-0 inside-dist)) + (set! (-> s5-0 i-inside-sphere) v1-10) + (set! (-> s5-0 inside-sphere-dist) (-> s5-0 inside-dist)) + ) + ) + ) + ) + (set! (-> s5-0 i-first-sphere) (find-closest-circle-ray-intersection + (-> arg0 current-pos) + (-> s5-0 in-dir) + (-> s5-0 travel-len) + (-> obj sphere-count) + (-> obj sphere-array) + (the-as int (-> s5-0 initial-ignore-mask)) + ) + ) + (let ((v1-13 -1)) + (b! (!= (-> s5-0 i-first-sphere) v1-13) cfg-13 :delay (empty-form)) + ) + (set! (-> arg0 out-travel 0 quad) (-> arg0 travel quad)) + (set! (-> arg0 out-travel 1 quad) (the-as uint128 0)) + (set! (-> arg0 avoiding-sphere?) #f) + (b! #t cfg-43 :delay (nop!)) + (label cfg-13) + (+! (-> s5-0 initial-ignore-mask) (ash 1 (-> s5-0 i-first-sphere))) + (let ((a1-17 (-> obj sphere-array (-> s5-0 i-first-sphere)))) + (circle-tangent-directions + (-> arg0 current-pos) + a1-17 + (the-as vector (-> s5-0 temp-dir)) + (-> s5-0 temp-dir 1) + ) + ) + (dotimes (v1-20 2) + (let ((a0-28 (vector-dot (-> s5-0 right-dir) (-> s5-0 temp-dir v1-20)))) + (shift-arith-right-32 a0-29 a0-28 31) + ) + (let ((a0-30 (logand a0-29 1)) + (f0-27 (- 1.0 (vector-dot (-> s5-0 in-dir) (-> s5-0 temp-dir v1-20)))) + ) + (set! (-> s5-0 best-dir a0-30 quad) (-> s5-0 temp-dir v1-20 quad)) + (set! (-> s5-0 best-dir-angle a0-30) f0-27) + ) + ) + 0 + (set! (-> s5-0 sign) 1.0) + (let ((s3-0 0)) + (b! #t cfg-34 :delay (nop!)) + (label cfg-20) + (-> s5-0 i-first-sphere) + (set! (-> s5-0 dir-update) (the-as basic #t)) + (set! (-> s5-0 ignore-mask) (-> s5-0 initial-ignore-mask)) + (b! #t cfg-30 :delay (nop!)) + (label cfg-21) + (+! (-> s5-0 ignore-mask) (ash 1 v1-28)) + (circle-tangent-directions + (-> arg0 current-pos) + (-> obj sphere-array v1-28) + (the-as vector (-> s5-0 temp-dir)) + (-> s5-0 temp-dir 1) + ) + (set! (-> s5-0 dir-update) #f) + (dotimes (v1-30 2) + (let* ((f0-29 (-> s5-0 sign)) + (a1-31 (-> s5-0 temp-dir v1-30)) + (a0-39 (-> s5-0 in-dir)) + (a2-14 (-> s5-0 right-dir)) + (a3-7 (vector-dot a1-31 a2-14)) + (t0-1 #xffffffff80000000) + (a2-16 #x3f800000) + (f0-30 + (* f0-29 (* (the-as float (logior (logand (the-as uint a3-7) (the-as uint t0-1)) a2-16)) (- 1.0 (vector-dot a1-31 a0-39)))) + ) + ) + (when (< (-> s5-0 best-dir-angle s3-0) f0-30) + (set! (-> s5-0 best-dir s3-0 quad) (-> s5-0 temp-dir v1-30 quad)) + (set! (-> s5-0 best-dir-angle s3-0) f0-30) + (set! (-> s5-0 dir-update) (the-as basic #t)) + ) + ) + ) + (label cfg-30) + (when (-> s5-0 dir-update) + (set! v1-28 (find-closest-circle-ray-intersection + (-> arg0 current-pos) + (-> s5-0 best-dir s3-0) + (-> s5-0 travel-len) + (-> obj sphere-count) + (-> obj sphere-array) + (the-as int (-> s5-0 ignore-mask)) + ) + ) + (b! (!= v1-28 -1) cfg-21 :delay (nop!)) + ) + (set! (-> s5-0 sign) (* -1.0 (-> s5-0 sign))) + (+! s3-0 1) + (label cfg-34) + (b! (< s3-0 2) cfg-20) + ) + (when (!= (-> s5-0 i-inside-sphere) -1) + (let ((s4-1 (-> obj sphere-array (-> s5-0 i-inside-sphere)))) + (vector-! (-> s5-0 away-dir) (-> arg0 current-pos) (the-as vector s4-1)) + (set! (-> s5-0 away-dir y) 0.0) + (when (>= 40.96 (vector-length (-> s5-0 away-dir))) + (set! (-> s5-0 rand-angle) (* 65536.0 (rand-vu))) + (set! (-> s5-0 away-dir x) (cos (-> s5-0 rand-angle))) + (set! (-> s5-0 away-dir z) (sin (-> s5-0 rand-angle))) + ) + (let ((v1-51 (-> s5-0 away-dir))) + (let ((f0-42 1.0)) + (.lvf vf1 (&-> v1-51 quad)) + (.mul.vf vf2 vf1 vf1 :mask #b111) + (let ((a0-60 f0-42)) + (.mov vf3 a0-60) + ) + ) + (.mul.x.vf acc vf0 vf2 :mask #b1000) + (.add.mul.y.vf acc vf0 vf2 acc :mask #b1000) + (.add.mul.z.vf vf2 vf0 vf2 acc :mask #b1000) + (.isqrt.vf Q vf3 vf2 :fsf #b0 :ftf #b11) + (.wait.vf) + (.mul.vf vf1 vf1 Q :mask #b111) + (.nop.vf) + (.nop.vf) + (.nop.vf) + (.svf (&-> v1-51 quad) vf1) + ) + (let ((f0-44 (/ (-> s5-0 inside-sphere-dist) (-> s4-1 r)))) + (let ((v1-52 (-> s5-0 best-dir))) + (let ((a0-61 (-> s5-0 best-dir)) + (a1-39 (-> s5-0 away-dir)) + (f1-19 f0-44) + ) + (.lvf vf1 (&-> a0-61 0 quad)) + (.lvf vf2 (&-> a1-39 quad)) + (let ((a0-62 f1-19)) + (.mov vf4 a0-62) + ) + ) + (.add.x.vf vf3 vf0 vf0 :mask #b1000) + (.sub.vf vf2 vf2 vf1) + (.mul.x.vf vf2 vf2 vf4) + (.add.vf vf3 vf1 vf2 :mask #b111) + (.svf (&-> v1-52 0 quad) vf3) + ) + (let ((v1-53 (-> s5-0 best-dir 1))) + (let ((a0-63 (-> s5-0 best-dir 1)) + (a1-40 (-> s5-0 away-dir)) + ) + (.lvf vf1 (&-> a0-63 quad)) + (.lvf vf2 (&-> a1-40 quad)) + ) + (let ((a0-64 f0-44)) + (.mov vf4 a0-64) + ) + (.add.x.vf vf3 vf0 vf0 :mask #b1000) + (.sub.vf vf2 vf2 vf1) + (.mul.x.vf vf2 vf2 vf4) + (.add.vf vf3 vf1 vf2 :mask #b111) + (.svf (&-> v1-53 quad) vf3) + ) + ) + ) + (let ((v1-54 (-> s5-0 best-dir))) + (let ((f0-45 1.0)) + (.lvf vf1 (&-> v1-54 0 quad)) + (.mul.vf vf2 vf1 vf1 :mask #b111) + (let ((a0-66 f0-45)) + (.mov vf3 a0-66) + ) + ) + (.mul.x.vf acc vf0 vf2 :mask #b1000) + (.add.mul.y.vf acc vf0 vf2 acc :mask #b1000) + (.add.mul.z.vf vf2 vf0 vf2 acc :mask #b1000) + (.isqrt.vf Q vf3 vf2 :fsf #b0 :ftf #b11) + (.wait.vf) + (.mul.vf vf1 vf1 Q :mask #b111) + (.nop.vf) + (.nop.vf) + (.nop.vf) + (.svf (&-> v1-54 0 quad) vf1) + ) + (let ((v1-55 (-> s5-0 best-dir 1))) + (let ((f0-46 1.0)) + (.lvf vf1 (&-> v1-55 quad)) + (.mul.vf vf2 vf1 vf1 :mask #b111) + (let ((a0-68 f0-46)) + (.mov vf3 a0-68) + ) + ) + (.mul.x.vf acc vf0 vf2 :mask #b1000) + (.add.mul.y.vf acc vf0 vf2 acc :mask #b1000) + (.add.mul.z.vf vf2 vf0 vf2 acc :mask #b1000) + (.isqrt.vf Q vf3 vf2 :fsf #b0 :ftf #b11) + (.wait.vf) + (.mul.vf vf1 vf1 Q :mask #b111) + (.nop.vf) + (.nop.vf) + (.nop.vf) + (.svf (&-> v1-55 quad) vf1) + ) + ) + (vector-dot (-> s5-0 in-dir) (the-as vector (-> s5-0 best-dir))) + (vector-dot (-> s5-0 in-dir) (-> s5-0 best-dir 1)) + (let* ((f0-52 (vector-dot (-> arg0 pref-dir) (the-as vector (-> s5-0 best-dir)))) + (a1-41 (if (< (vector-dot (-> arg0 pref-dir) (-> s5-0 best-dir 1)) f0-52) + 0 + 1 + ) + ) + (v1-65 (- 1 a1-41)) + ) + (vector-float*! (the-as vector (-> arg0 out-travel)) (-> s5-0 best-dir a1-41) (-> s5-0 travel-len)) + (vector-float*! (-> arg0 out-travel 1) (-> s5-0 best-dir v1-65) (-> s5-0 travel-len)) + ) + ) + 0 + (set! (-> arg0 avoiding-sphere?) #t) + (label cfg-43) + (-> arg0 avoiding-sphere?) + ) + ) + +;; definition for method 19 of type nav-control +;; INFO: Used lq/sq +(defmethod avoid-spheres-2! nav-control ((obj nav-control) (arg0 nav-avoid-spheres-params)) + (local-vars (a0-32 int) (a1-3 float)) + (rlet ((acc :class vf) + (Q :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + ) + (init-vf0-vector) + (let ((s5-0 (new 'stack-no-clear 'nav-control-cfs-work))) + (set! (-> s5-0 in-dir quad) (-> arg0 travel quad)) + (set! (-> s5-0 in-dir y) 0.0) + (let ((v1-1 (-> s5-0 in-dir))) + (let ((f0-1 1.0)) + (.lvf vf1 (&-> v1-1 quad)) + (.mul.vf vf2 vf1 vf1 :mask #b111) + (let ((a0-4 f0-1)) + (.mov vf3 a0-4) + ) + ) + (.mul.x.vf acc vf0 vf2 :mask #b1000) + (.add.mul.y.vf acc vf0 vf2 acc :mask #b1000) + (.add.mul.z.vf vf2 vf0 vf2 acc :mask #b1000) + (.isqrt.vf Q vf3 vf2 :fsf #b0 :ftf #b11) + (.wait.vf) + (.mul.vf vf1 vf1 Q :mask #b111) + (.nop.vf) + (.nop.vf) + (.nop.vf) + (.svf (&-> v1-1 quad) vf1) + ) + (set! (-> s5-0 travel-len) (vector-dot (-> s5-0 in-dir) (-> arg0 travel))) + (set! (-> s5-0 right-dir quad) (-> s5-0 in-dir quad)) + (set! (-> s5-0 right-dir x) (- (-> s5-0 in-dir z))) + (set! (-> s5-0 right-dir z) (-> s5-0 in-dir x)) + (set! (-> s5-0 best-dir 0 quad) (-> s5-0 in-dir quad)) + (set! (-> s5-0 best-dir 1 quad) (-> s5-0 in-dir quad)) + (set! (-> s5-0 best-dir-angle 0) 0.0) + (set! (-> s5-0 best-dir-angle 1) 0.0) + (set! (-> s5-0 initial-ignore-mask) (the-as uint 0)) + (let ((f0-9 65536.0)) + (set! (-> arg0 closest-sphere-dist2) (* f0-9 f0-9)) + ) + (dotimes (v1-9 (-> obj sphere-count)) + (let ((a0-13 (-> obj sphere-array v1-9))) + (let ((a1-2 (-> arg0 current-pos)) + (a2-0 a0-13) + ) + (.lvf vf2 (&-> a1-2 quad)) + (.lvf vf3 (&-> a2-0 quad)) + ) + (.sub.vf vf1 vf3 vf2) + (.mul.vf vf1 vf1 vf1) + (.add.z.vf vf1 vf1 vf1 :mask #b1) + (.mov a1-3 vf1) + (set! (-> s5-0 dist2) a1-3) + (let ((f0-13 (-> arg0 closest-sphere-dist2)) + (f1-0 (-> s5-0 dist2)) + (f2-0 (-> a0-13 r)) + ) + (set! (-> arg0 closest-sphere-dist2) (fmin f0-13 (- f1-0 (* f2-0 f2-0)))) + ) + (when (< (-> arg0 closest-sphere-dist2) 0.0) + (vector-! (the-as vector (-> s5-0 temp-dir)) (-> arg0 current-pos) (the-as vector a0-13)) + (set! (-> s5-0 temp-dir 0 y) 0.0) + (if (< 0.0 (vector-dot (the-as vector (-> s5-0 temp-dir)) (-> s5-0 in-dir))) + (+! (-> s5-0 initial-ignore-mask) (ash 1 v1-9)) + ) + ) + ) + ) + (set! (-> s5-0 i-first-sphere) (find-closest-circle-ray-intersection + (-> arg0 current-pos) + (-> s5-0 in-dir) + (-> s5-0 travel-len) + (-> obj sphere-count) + (-> obj sphere-array) + (the-as int (-> s5-0 initial-ignore-mask)) + ) + ) + (let ((v1-12 -1)) + (b! (!= (-> s5-0 i-first-sphere) v1-12) cfg-11 :delay (empty-form)) + ) + (set! (-> arg0 out-travel 0 quad) (-> arg0 travel quad)) + (set! (-> arg0 out-travel 1 quad) (the-as uint128 0)) + (set! (-> arg0 avoiding-sphere?) #f) + (b! #t cfg-21 :delay (nop!)) + (label cfg-11) + (+! (-> s5-0 initial-ignore-mask) (ash 1 (-> s5-0 i-first-sphere))) + (let ((a1-15 (-> obj sphere-array (-> s5-0 i-first-sphere)))) + (circle-tangent-directions + (-> arg0 current-pos) + a1-15 + (the-as vector (-> s5-0 temp-dir)) + (-> s5-0 temp-dir 1) + ) + ) + (dotimes (v1-19 2) + (let ((a0-31 (vector-dot (-> s5-0 right-dir) (-> s5-0 temp-dir v1-19)))) + (shift-arith-right-32 a0-32 a0-31 31) + ) + (let ((a0-33 (logand a0-32 1)) + (f0-22 (- 1.0 (vector-dot (-> s5-0 in-dir) (-> s5-0 temp-dir v1-19)))) + ) + (set! (-> s5-0 best-dir a0-33 quad) (-> s5-0 temp-dir v1-19 quad)) + (set! (-> s5-0 best-dir-angle a0-33) f0-22) + ) + ) + 0 + (vector-dot (-> s5-0 in-dir) (the-as vector (-> s5-0 best-dir))) + (vector-dot (-> s5-0 in-dir) (-> s5-0 best-dir 1)) + (let* ((f0-28 (vector-dot (-> arg0 pref-dir) (the-as vector (-> s5-0 best-dir)))) + (a1-25 (if (< (vector-dot (-> arg0 pref-dir) (-> s5-0 best-dir 1)) f0-28) + 0 + 1 + ) + ) + (v1-32 (- 1 a1-25)) + ) + (vector-float*! (the-as vector (-> arg0 out-travel)) (-> s5-0 best-dir a1-25) (-> s5-0 travel-len)) + (vector-float*! (-> arg0 out-travel 1) (-> s5-0 best-dir v1-32) (-> s5-0 travel-len)) + ) + ) + 0 + (set! (-> arg0 avoiding-sphere?) #t) + (label cfg-21) + (-> arg0 avoiding-sphere?) + ) + ) + +;; definition for method 21 of type nav-control +;; WARN: Return type mismatch int vs none. +(defmethod clamp-vector-to-mesh-no-gaps nav-control ((obj nav-control) (arg0 vector) (arg1 nav-poly) (arg2 vector) (arg3 clamp-travel-vector-to-mesh-return-info)) + (clamp-vector-to-mesh-no-gaps (-> obj state mesh) arg0 arg1 arg2 arg3) + 0 + (none) + ) + +;; definition for method 19 of type nav-mesh +;; INFO: Used lq/sq +;; WARN: Stack slot offset 164 signed mismatch +;; WARN: Stack slot offset 168 signed mismatch +;; WARN: Stack slot offset 200 signed mismatch +;; WARN: Stack slot offset 204 signed mismatch +;; WARN: Stack slot offset 200 signed mismatch +;; WARN: Stack slot offset 204 signed mismatch +;; WARN: Stack slot offset 164 signed mismatch +;; WARN: Stack slot offset 168 signed mismatch +;; WARN: Stack slot offset 164 signed mismatch +;; WARN: Stack slot offset 180 signed mismatch +;; WARN: Stack slot offset 168 signed mismatch +;; WARN: Stack slot offset 184 signed mismatch +;; WARN: Stack slot offset 180 signed mismatch +;; WARN: Stack slot offset 184 signed mismatch +;; WARN: Stack slot offset 164 signed mismatch +;; WARN: Stack slot offset 168 signed mismatch +;; WARN: Stack slot offset 164 signed mismatch +;; WARN: Stack slot offset 168 signed mismatch +;; WARN: Stack slot offset 200 signed mismatch +;; WARN: Stack slot offset 204 signed mismatch +;; WARN: Stack slot offset 200 signed mismatch +;; WARN: Stack slot offset 204 signed mismatch +;; WARN: Stack slot offset 164 signed mismatch +;; WARN: Stack slot offset 168 signed mismatch +;; WARN: Stack slot offset 164 signed mismatch +;; WARN: Stack slot offset 180 signed mismatch +;; WARN: Stack slot offset 168 signed mismatch +;; WARN: Stack slot offset 184 signed mismatch +;; WARN: Stack slot offset 180 signed mismatch +;; WARN: Stack slot offset 184 signed mismatch +;; WARN: Stack slot offset 164 signed mismatch +;; WARN: Stack slot offset 168 signed mismatch +;; WARN: Stack slot offset 164 signed mismatch +;; WARN: Stack slot offset 168 signed mismatch +;; WARN: Stack slot offset 200 signed mismatch +;; WARN: Stack slot offset 204 signed mismatch +;; WARN: Stack slot offset 200 signed mismatch +;; WARN: Stack slot offset 204 signed mismatch +;; WARN: Stack slot offset 164 signed mismatch +;; WARN: Stack slot offset 168 signed mismatch +;; WARN: Stack slot offset 164 signed mismatch +;; WARN: Stack slot offset 180 signed mismatch +;; WARN: Stack slot offset 168 signed mismatch +;; WARN: Stack slot offset 184 signed mismatch +;; WARN: Stack slot offset 180 signed mismatch +;; WARN: Stack slot offset 184 signed mismatch +;; WARN: Stack slot offset 164 signed mismatch +;; WARN: Stack slot offset 168 signed mismatch +;; WARN: Stack slot offset 164 signed mismatch +;; WARN: Stack slot offset 168 signed mismatch +;; WARN: Stack slot offset 164 signed mismatch +;; WARN: Stack slot offset 168 signed mismatch +;; WARN: Stack slot offset 164 signed mismatch +;; WARN: Stack slot offset 180 signed mismatch +;; WARN: Stack slot offset 168 signed mismatch +;; WARN: Stack slot offset 184 signed mismatch +;; WARN: Stack slot offset 180 signed mismatch +;; WARN: Stack slot offset 184 signed mismatch +;; WARN: Stack slot offset 164 signed mismatch +;; WARN: Stack slot offset 168 signed mismatch +;; WARN: Stack slot offset 164 signed mismatch +;; WARN: Stack slot offset 168 signed mismatch +;; WARN: Stack slot offset 200 signed mismatch +;; WARN: Stack slot offset 204 signed mismatch +;; WARN: Stack slot offset 200 signed mismatch +;; WARN: Stack slot offset 204 signed mismatch +;; WARN: Stack slot offset 164 signed mismatch +;; WARN: Stack slot offset 168 signed mismatch +;; WARN: Stack slot offset 164 signed mismatch +;; WARN: Stack slot offset 180 signed mismatch +;; WARN: Stack slot offset 168 signed mismatch +;; WARN: Stack slot offset 184 signed mismatch +;; WARN: Stack slot offset 180 signed mismatch +;; WARN: Stack slot offset 184 signed mismatch +;; WARN: Stack slot offset 164 signed mismatch +;; WARN: Stack slot offset 168 signed mismatch +;; WARN: Stack slot offset 164 signed mismatch +;; WARN: Stack slot offset 168 signed mismatch +;; WARN: Stack slot offset 200 signed mismatch +;; WARN: Stack slot offset 204 signed mismatch +;; WARN: Stack slot offset 200 signed mismatch +;; WARN: Stack slot offset 204 signed mismatch +;; WARN: Stack slot offset 164 signed mismatch +;; WARN: Stack slot offset 168 signed mismatch +;; WARN: Stack slot offset 164 signed mismatch +;; WARN: Stack slot offset 180 signed mismatch +;; WARN: Stack slot offset 168 signed mismatch +;; WARN: Stack slot offset 184 signed mismatch +;; WARN: Stack slot offset 180 signed mismatch +;; WARN: Stack slot offset 184 signed mismatch +;; WARN: Stack slot offset 164 signed mismatch +;; WARN: Stack slot offset 168 signed mismatch +;; WARN: Stack slot offset 164 signed mismatch +;; WARN: Stack slot offset 168 signed mismatch +;; WARN: Stack slot offset 200 signed mismatch +;; WARN: Stack slot offset 204 signed mismatch +;; WARN: Stack slot offset 200 signed mismatch +;; WARN: Stack slot offset 204 signed mismatch +;; WARN: Stack slot offset 164 signed mismatch +;; WARN: Stack slot offset 168 signed mismatch +;; WARN: Stack slot offset 164 signed mismatch +;; WARN: Stack slot offset 180 signed mismatch +;; WARN: Stack slot offset 168 signed mismatch +;; WARN: Stack slot offset 184 signed mismatch +;; WARN: Stack slot offset 180 signed mismatch +;; WARN: Stack slot offset 184 signed mismatch +;; WARN: Stack slot offset 164 signed mismatch +;; WARN: Stack slot offset 168 signed mismatch +;; WARN: Stack slot offset 164 signed mismatch +;; WARN: Stack slot offset 168 signed mismatch +;; WARN: Stack slot offset 164 signed mismatch +;; WARN: Stack slot offset 168 signed mismatch +;; WARN: Stack slot offset 164 signed mismatch +;; WARN: Stack slot offset 180 signed mismatch +;; WARN: Stack slot offset 168 signed mismatch +;; WARN: Stack slot offset 184 signed mismatch +;; WARN: Stack slot offset 180 signed mismatch +;; WARN: Stack slot offset 184 signed mismatch +;; WARN: Stack slot offset 164 signed mismatch +;; WARN: Stack slot offset 168 signed mismatch +;; WARN: Return type mismatch int vs none. +(defmethod clamp-vector-to-mesh-no-gaps nav-mesh ((obj nav-mesh) (arg0 vector) (arg1 nav-poly) (arg2 vector) (arg3 clamp-travel-vector-to-mesh-return-info)) + (local-vars + (v1-12 symbol) + (sv-112 nav-ray) + (sv-116 vector) + (sv-120 symbol) + (sv-124 nav-mesh-work) + (sv-128 int) + (sv-136 int) + (sv-144 nav-mesh-work) + (sv-148 nav-poly) + (sv-152 uint8) + (sv-156 (pointer int8)) + (sv-160 (pointer int8)) + (sv-164 float) + (sv-168 float) + (sv-172 vector) + (sv-176 vector) + (sv-180 float) + (sv-184 float) + (sv-188 uint) + (sv-192 vector) + (sv-196 vector) + (sv-200 float) + (sv-204 float) + (sv-208 float) + (sv-212 float) + ) + (rlet ((acc :class vf) + (Q :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + ) + (init-vf0-vector) + (set! (-> arg3 found-boundary) #f) + (set! (-> arg3 gap-poly) #f) + (set! sv-112 (new 'stack-no-clear 'nav-ray)) + (set! sv-116 (new 'stack-no-clear 'vector)) + (set! sv-120 (the-as symbol #f)) + (set! sv-124 (-> obj work)) + (vector-! sv-116 arg0 (-> obj bounds)) + (set! (-> sv-112 current-poly) arg1) + (set! (-> sv-112 current-pos quad) (-> sv-116 quad)) + (vector+! (-> sv-112 dest-pos) sv-116 arg2) + (let* ((t2-0 obj) + (v1-11 (-> sv-112 dest-pos)) + (a1-4 (-> arg1 vertex-count)) + (a2-1 (-> arg1 vertex)) + (t1-4 (-> t2-0 work vert0-table)) + (t2-2 (-> t2-0 work vert1-table)) + ) + (dotimes (t3-0 (the-as int a1-4)) + (let* ((t4-3 (-> a2-1 (-> t1-4 t3-0))) + (t5-3 (-> a2-1 (-> t2-2 t3-0))) + (f0-1 (- (-> t4-3 z) (-> t5-3 z))) + (f1-2 (- (-> t5-3 x) (-> t4-3 x))) + (f2-2 (- (-> v1-11 x) (-> t4-3 x))) + (f3-2 (- (-> v1-11 z) (-> t4-3 z))) + (f0-3 (+ (* f2-2 f0-1) (* f3-2 f1-2))) + ) + (when (< 0.0 f0-3) + (set! v1-12 #f) + (goto cfg-7) + ) + ) + ) + ) + (set! v1-12 #t) + (label cfg-7) + (b! v1-12 cfg-41 :delay (nop!)) + (set! sv-128 0) + (let ((v1-16 sv-112)) + (vector-! (-> v1-16 dir) (-> v1-16 dest-pos) (-> v1-16 current-pos)) + (set! (-> v1-16 dir y) 0.0) + (let ((a1-6 (-> v1-16 dir))) + (let ((f0-5 1.0)) + (.lvf vf1 (&-> a1-6 quad)) + (.mul.vf vf2 vf1 vf1 :mask #b111) + (let ((a2-4 f0-5)) + (.mov vf3 a2-4) + ) + ) + (.mul.x.vf acc vf0 vf2 :mask #b1000) + (.add.mul.y.vf acc vf0 vf2 acc :mask #b1000) + (.add.mul.z.vf vf2 vf0 vf2 acc :mask #b1000) + (.isqrt.vf Q vf3 vf2 :fsf #b0 :ftf #b11) + (.wait.vf) + (.mul.vf vf1 vf1 Q :mask #b111) + (.nop.vf) + (.nop.vf) + (.nop.vf) + (.svf (&-> a1-6 quad) vf1) + ) + (set! (-> v1-16 next-poly) #f) + (set! (-> v1-16 len) 0.0) + (set! (-> v1-16 last-edge) -1) + (set! (-> v1-16 terminated) #f) + (set! (-> v1-16 reached-dest) #f) + (set! (-> v1-16 hit-boundary) #f) + (set! (-> v1-16 hit-gap) #f) + (set! (-> v1-16 ignore) (the-as uint 3)) + ) + 0 + (until (or (>= sv-128 15) (-> sv-112 terminated)) + (set! sv-128 (+ sv-128 1)) + (let ((a1-9 obj) + (v1-20 sv-112) + ) + (set! sv-136 -1) + (set! sv-144 (-> a1-9 work)) + (set! sv-148 (-> v1-20 current-poly)) + (set! sv-152 (-> v1-20 current-poly vertex-count)) + (set! sv-156 (-> a1-9 work vert0-table)) + (set! sv-160 (-> a1-9 work vert1-table)) + (set! sv-164 (- (-> v1-20 dest-pos x) (-> v1-20 current-pos x))) + (set! sv-168 (- (-> v1-20 dest-pos z) (-> v1-20 current-pos z))) + (dotimes (a2-14 (the-as int sv-152)) + (set! sv-172 (-> sv-148 vertex (-> sv-156 a2-14))) + (set! sv-176 (-> sv-148 vertex (-> sv-160 a2-14))) + (set! sv-180 (- (-> sv-172 z) (-> sv-176 z))) + (set! sv-184 (- (-> sv-176 x) (-> sv-172 x))) + (let ((f0-17 (+ (* sv-164 sv-180) (* sv-168 sv-184)))) + (when (< 0.0 f0-17) + (let ((f1-15 (+ (* sv-180 (- (-> sv-172 x) (-> v1-20 current-pos x))) + (* sv-184 (- (-> sv-172 z) (-> v1-20 current-pos z))) + ) + ) + ) + (when (< f1-15 f0-17) + (set! sv-136 a2-14) + (let ((f0-19 (fmax 0.0 (/ f1-15 f0-17)))) + (set! sv-164 (* sv-164 f0-19)) + (set! sv-168 (* sv-168 f0-19)) + ) + ) + ) + ) + ) + ) + (let ((f0-23 (+ (* sv-164 (-> v1-20 dir x)) (* sv-168 (-> v1-20 dir z))))) + (+! (-> v1-20 len) f0-23) + ) + 0 + (set! (-> v1-20 next-poly) #f) + (cond + ((= sv-136 -1) + (set! (-> v1-20 current-pos quad) (-> v1-20 dest-pos quad)) + (set! (-> v1-20 reached-dest) #t) + (set! (-> v1-20 terminated) #t) + ) + (else + (+! (-> v1-20 current-pos x) sv-164) + (+! (-> v1-20 current-pos z) sv-168) + (set! sv-188 (-> sv-148 adj-poly sv-136)) + (if (!= sv-188 255) + (set! (-> v1-20 next-poly) (-> a1-9 poly-array sv-188)) + ) + (cond + ((and (-> v1-20 next-poly) (zero? (logand (-> v1-20 next-poly pat) (-> v1-20 ignore)))) + (set! (-> v1-20 current-poly) (-> v1-20 next-poly)) + ) + (else + (set! (-> v1-20 last-edge) sv-136) + (if (-> v1-20 next-poly) + (set! (-> v1-20 hit-gap) #t) + (set! (-> v1-20 hit-boundary) #t) + ) + (set! (-> v1-20 terminated) #t) + ) + ) + ) + ) + ) + 0 + ) + (cond + ((or (-> sv-112 hit-boundary) (-> sv-112 hit-gap)) + (set! sv-192 (-> sv-112 current-poly vertex (-> sv-124 vert0-table (-> sv-112 last-edge)))) + (set! sv-196 (-> sv-112 current-poly vertex (-> sv-124 vert1-table (-> sv-112 last-edge)))) + (set! sv-200 (- (-> sv-192 z) (-> sv-196 z))) + (set! sv-204 (- (-> sv-196 x) (-> sv-192 x))) + (set! sv-208 (-> arg2 x)) + (set! sv-212 (-> arg2 z)) + (let* ((f0-35 sv-200) + (f0-37 (* f0-35 f0-35)) + (f1-27 sv-204) + (f0-39 (sqrtf (+ f0-37 (* f1-27 f1-27)))) + (f0-41 (/ 1.0 f0-39)) + ) + (set! sv-200 (* sv-200 f0-41)) + (set! sv-204 (* sv-204 f0-41)) + ) + (set! (-> arg3 found-boundary) #t) + (vector+! (-> arg3 intersection) (-> sv-112 current-pos) (-> obj bounds)) + (set! (-> arg3 boundary-normal x) sv-200) + (set! (-> arg3 boundary-normal y) 0.0) + (set! (-> arg3 boundary-normal z) sv-204) + (set! (-> arg3 poly) (-> sv-112 current-poly)) + (set! (-> arg3 edge) (-> sv-112 last-edge)) + (vector+! (-> arg3 vert-0) sv-192 (-> obj bounds)) + (vector+! (-> arg3 vert-1) sv-196 (-> obj bounds)) + (set! (-> sv-112 dest-pos quad) (-> sv-112 current-pos quad)) + (if (-> sv-112 hit-gap) + (set! (-> arg3 gap-poly) (-> sv-112 next-poly)) + ) + ) + (else + ) + ) + (vector-! arg2 (-> sv-112 current-pos) sv-116) + 0 + (label cfg-41) + 0 + (none) + ) + ) + +;; definition for method 21 of type nav-mesh +;; WARN: Return type mismatch object vs none. +;; WARN: Function (method 21 nav-mesh) has a return type of none, but the expression builder found a return statement. +(defmethod find-adjacent-bounds-one nav-mesh ((obj nav-mesh) (arg0 vector) (arg1 nav-poly) (arg2 int) (arg3 int)) + (local-vars (sv-16 nav-poly)) + (if (zero? arg3) + (set! arg2 (the-as int (mod (the-as uint (+ arg2 1)) (the-as uint (-> arg1 vertex-count))))) + ) + (set! sv-16 arg1) + (let ((s2-0 (-> sv-16 vertex arg2)) + (s3-0 sv-16) + (s1-0 100) + ) + (while (begin (label cfg-21) (nonzero? s1-0)) + (+! s1-0 -1) + (if (nonzero? arg3) + (set! arg2 + (the-as + int + (mod (the-as uint (+ (+ arg2 arg3) (the-as int (-> s3-0 vertex-count)))) (the-as uint (-> s3-0 vertex-count))) + ) + ) + ) + (let ((v1-12 (-> s3-0 adj-poly arg2))) + (cond + ((= v1-12 255) + (if (zero? arg3) + (set! arg2 (the-as int (mod (the-as uint (+ arg2 1)) (the-as uint (-> s3-0 vertex-count))))) + ) + (vector+! arg0 (-> s3-0 vertex arg2) (-> obj bounds)) + (return #f) + ) + (else + (set! s3-0 (-> obj poly-array v1-12)) + (when (= s3-0 sv-16) + (format 0 "ERROR: find-adjacent-bounds-one cur-poly = start-poly after step~%") + (return #f) + ) + (dotimes (s0-0 (the-as int (-> s3-0 vertex-count))) + (when (vector= (-> s3-0 vertex s0-0) s2-0) + (set! arg2 s0-0) + (goto cfg-21) + ) + ) + (format 0 "ERROR: find-adjacent-bounds-one couldn't match vertex~%") + (return #f) + ) + ) + ) + ) + ) + (format 0 "ERROR: find-adjacent-bounds-one took too many steps~%") + (none) + ) + +;; definition for method 20 of type nav-mesh +;; WARN: Return type mismatch int vs none. +(defmethod set-normals-from-adjacent-bounds nav-mesh ((obj nav-mesh) (arg0 clamp-travel-vector-to-mesh-return-info)) + (find-adjacent-bounds-one obj (-> arg0 vert-prev) (-> arg0 poly) (-> arg0 edge) -1) + (find-adjacent-bounds-one obj (-> arg0 vert-next) (-> arg0 poly) (-> arg0 edge) 0) + (vector-! (-> arg0 prev-normal) (-> arg0 vert-0) (-> arg0 vert-prev)) + (vector-! (-> arg0 next-normal) (-> arg0 vert-next) (-> arg0 vert-1)) + (vector-normalize! (-> arg0 prev-normal) 1.0) + (vector-normalize! (-> arg0 next-normal) 1.0) + (let ((f0-0 (-> arg0 prev-normal x))) + (set! (-> arg0 prev-normal x) (-> arg0 prev-normal z)) + (set! (-> arg0 prev-normal z) f0-0) + ) + (let ((f0-1 (-> arg0 next-normal x))) + (set! (-> arg0 next-normal x) (-> arg0 next-normal z)) + (set! (-> arg0 next-normal z) f0-1) + ) + (set! (-> arg0 prev-normal x) (- (-> arg0 prev-normal x))) + (set! (-> arg0 next-normal x) (- (-> arg0 next-normal x))) + 0 + (none) + ) + +;; definition for method 18 of type nav-mesh +;; INFO: Used lq/sq +;; WARN: Stack slot offset 156 signed mismatch +;; WARN: Stack slot offset 160 signed mismatch +;; WARN: Stack slot offset 192 signed mismatch +;; WARN: Stack slot offset 196 signed mismatch +;; WARN: Stack slot offset 192 signed mismatch +;; WARN: Stack slot offset 196 signed mismatch +;; WARN: Stack slot offset 192 signed mismatch +;; WARN: Stack slot offset 200 signed mismatch +;; WARN: Stack slot offset 196 signed mismatch +;; WARN: Stack slot offset 204 signed mismatch +;; WARN: Stack slot offset 200 signed mismatch +;; WARN: Stack slot offset 192 signed mismatch +;; WARN: Stack slot offset 204 signed mismatch +;; WARN: Stack slot offset 196 signed mismatch +;; WARN: Stack slot offset 200 signed mismatch +;; WARN: Stack slot offset 204 signed mismatch +;; WARN: Stack slot offset 156 signed mismatch +;; WARN: Stack slot offset 160 signed mismatch +;; WARN: Stack slot offset 156 signed mismatch +;; WARN: Stack slot offset 172 signed mismatch +;; WARN: Stack slot offset 160 signed mismatch +;; WARN: Stack slot offset 176 signed mismatch +;; WARN: Stack slot offset 172 signed mismatch +;; WARN: Stack slot offset 176 signed mismatch +;; WARN: Stack slot offset 156 signed mismatch +;; WARN: Stack slot offset 160 signed mismatch +;; WARN: Stack slot offset 156 signed mismatch +;; WARN: Stack slot offset 160 signed mismatch +;; WARN: Stack slot offset 192 signed mismatch +;; WARN: Stack slot offset 196 signed mismatch +;; WARN: Stack slot offset 192 signed mismatch +;; WARN: Stack slot offset 196 signed mismatch +;; WARN: Stack slot offset 192 signed mismatch +;; WARN: Stack slot offset 200 signed mismatch +;; WARN: Stack slot offset 196 signed mismatch +;; WARN: Stack slot offset 204 signed mismatch +;; WARN: Stack slot offset 200 signed mismatch +;; WARN: Stack slot offset 192 signed mismatch +;; WARN: Stack slot offset 204 signed mismatch +;; WARN: Stack slot offset 196 signed mismatch +;; WARN: Stack slot offset 200 signed mismatch +;; WARN: Stack slot offset 204 signed mismatch +;; WARN: Stack slot offset 156 signed mismatch +;; WARN: Stack slot offset 160 signed mismatch +;; WARN: Stack slot offset 156 signed mismatch +;; WARN: Stack slot offset 172 signed mismatch +;; WARN: Stack slot offset 160 signed mismatch +;; WARN: Stack slot offset 176 signed mismatch +;; WARN: Stack slot offset 172 signed mismatch +;; WARN: Stack slot offset 176 signed mismatch +;; WARN: Stack slot offset 156 signed mismatch +;; WARN: Stack slot offset 160 signed mismatch +;; WARN: Stack slot offset 156 signed mismatch +;; WARN: Stack slot offset 160 signed mismatch +;; WARN: Stack slot offset 192 signed mismatch +;; WARN: Stack slot offset 196 signed mismatch +;; WARN: Stack slot offset 192 signed mismatch +;; WARN: Stack slot offset 196 signed mismatch +;; WARN: Stack slot offset 192 signed mismatch +;; WARN: Stack slot offset 200 signed mismatch +;; WARN: Stack slot offset 196 signed mismatch +;; WARN: Stack slot offset 204 signed mismatch +;; WARN: Stack slot offset 200 signed mismatch +;; WARN: Stack slot offset 192 signed mismatch +;; WARN: Stack slot offset 204 signed mismatch +;; WARN: Stack slot offset 196 signed mismatch +;; WARN: Stack slot offset 200 signed mismatch +;; WARN: Stack slot offset 204 signed mismatch +;; WARN: Stack slot offset 156 signed mismatch +;; WARN: Stack slot offset 160 signed mismatch +;; WARN: Stack slot offset 156 signed mismatch +;; WARN: Stack slot offset 172 signed mismatch +;; WARN: Stack slot offset 160 signed mismatch +;; WARN: Stack slot offset 176 signed mismatch +;; WARN: Stack slot offset 172 signed mismatch +;; WARN: Stack slot offset 176 signed mismatch +;; WARN: Stack slot offset 156 signed mismatch +;; WARN: Stack slot offset 160 signed mismatch +;; WARN: Stack slot offset 156 signed mismatch +;; WARN: Stack slot offset 160 signed mismatch +;; WARN: Stack slot offset 156 signed mismatch +;; WARN: Stack slot offset 160 signed mismatch +;; WARN: Stack slot offset 156 signed mismatch +;; WARN: Stack slot offset 172 signed mismatch +;; WARN: Stack slot offset 160 signed mismatch +;; WARN: Stack slot offset 176 signed mismatch +;; WARN: Stack slot offset 172 signed mismatch +;; WARN: Stack slot offset 176 signed mismatch +;; WARN: Stack slot offset 156 signed mismatch +;; WARN: Stack slot offset 160 signed mismatch +;; WARN: Stack slot offset 156 signed mismatch +;; WARN: Stack slot offset 160 signed mismatch +;; WARN: Stack slot offset 192 signed mismatch +;; WARN: Stack slot offset 196 signed mismatch +;; WARN: Stack slot offset 192 signed mismatch +;; WARN: Stack slot offset 196 signed mismatch +;; WARN: Stack slot offset 192 signed mismatch +;; WARN: Stack slot offset 200 signed mismatch +;; WARN: Stack slot offset 196 signed mismatch +;; WARN: Stack slot offset 204 signed mismatch +;; WARN: Stack slot offset 200 signed mismatch +;; WARN: Stack slot offset 192 signed mismatch +;; WARN: Stack slot offset 204 signed mismatch +;; WARN: Stack slot offset 196 signed mismatch +;; WARN: Stack slot offset 200 signed mismatch +;; WARN: Stack slot offset 204 signed mismatch +;; WARN: Stack slot offset 156 signed mismatch +;; WARN: Stack slot offset 160 signed mismatch +;; WARN: Stack slot offset 156 signed mismatch +;; WARN: Stack slot offset 172 signed mismatch +;; WARN: Stack slot offset 160 signed mismatch +;; WARN: Stack slot offset 176 signed mismatch +;; WARN: Stack slot offset 172 signed mismatch +;; WARN: Stack slot offset 176 signed mismatch +;; WARN: Stack slot offset 156 signed mismatch +;; WARN: Stack slot offset 160 signed mismatch +;; WARN: Stack slot offset 156 signed mismatch +;; WARN: Stack slot offset 160 signed mismatch +;; WARN: Stack slot offset 192 signed mismatch +;; WARN: Stack slot offset 196 signed mismatch +;; WARN: Stack slot offset 192 signed mismatch +;; WARN: Stack slot offset 196 signed mismatch +;; WARN: Stack slot offset 192 signed mismatch +;; WARN: Stack slot offset 200 signed mismatch +;; WARN: Stack slot offset 196 signed mismatch +;; WARN: Stack slot offset 204 signed mismatch +;; WARN: Stack slot offset 200 signed mismatch +;; WARN: Stack slot offset 192 signed mismatch +;; WARN: Stack slot offset 204 signed mismatch +;; WARN: Stack slot offset 196 signed mismatch +;; WARN: Stack slot offset 200 signed mismatch +;; WARN: Stack slot offset 204 signed mismatch +;; WARN: Stack slot offset 156 signed mismatch +;; WARN: Stack slot offset 160 signed mismatch +;; WARN: Stack slot offset 156 signed mismatch +;; WARN: Stack slot offset 172 signed mismatch +;; WARN: Stack slot offset 160 signed mismatch +;; WARN: Stack slot offset 176 signed mismatch +;; WARN: Stack slot offset 172 signed mismatch +;; WARN: Stack slot offset 176 signed mismatch +;; WARN: Stack slot offset 156 signed mismatch +;; WARN: Stack slot offset 160 signed mismatch +;; WARN: Stack slot offset 156 signed mismatch +;; WARN: Stack slot offset 160 signed mismatch +;; WARN: Stack slot offset 192 signed mismatch +;; WARN: Stack slot offset 196 signed mismatch +;; WARN: Stack slot offset 192 signed mismatch +;; WARN: Stack slot offset 196 signed mismatch +;; WARN: Stack slot offset 192 signed mismatch +;; WARN: Stack slot offset 200 signed mismatch +;; WARN: Stack slot offset 196 signed mismatch +;; WARN: Stack slot offset 204 signed mismatch +;; WARN: Stack slot offset 200 signed mismatch +;; WARN: Stack slot offset 192 signed mismatch +;; WARN: Stack slot offset 204 signed mismatch +;; WARN: Stack slot offset 196 signed mismatch +;; WARN: Stack slot offset 200 signed mismatch +;; WARN: Stack slot offset 204 signed mismatch +;; WARN: Stack slot offset 156 signed mismatch +;; WARN: Stack slot offset 160 signed mismatch +;; WARN: Stack slot offset 156 signed mismatch +;; WARN: Stack slot offset 172 signed mismatch +;; WARN: Stack slot offset 160 signed mismatch +;; WARN: Stack slot offset 176 signed mismatch +;; WARN: Stack slot offset 172 signed mismatch +;; WARN: Stack slot offset 176 signed mismatch +;; WARN: Stack slot offset 156 signed mismatch +;; WARN: Stack slot offset 160 signed mismatch +;; WARN: Stack slot offset 156 signed mismatch +;; WARN: Stack slot offset 160 signed mismatch +;; WARN: Stack slot offset 156 signed mismatch +;; WARN: Stack slot offset 160 signed mismatch +;; WARN: Stack slot offset 156 signed mismatch +;; WARN: Stack slot offset 172 signed mismatch +;; WARN: Stack slot offset 160 signed mismatch +;; WARN: Stack slot offset 176 signed mismatch +;; WARN: Stack slot offset 172 signed mismatch +;; WARN: Stack slot offset 176 signed mismatch +;; WARN: Stack slot offset 156 signed mismatch +;; WARN: Stack slot offset 160 signed mismatch +;; WARN: Return type mismatch int vs none. +(defmethod clamp-vector-to-mesh-cross-gaps nav-mesh ((obj nav-mesh) + (arg0 vector) + (arg1 nav-poly) + (arg2 vector) + (arg3 float) + (arg4 symbol) + (arg5 clamp-travel-vector-to-mesh-return-info) + ) + (local-vars + (v1-11 symbol) + (v1-22 symbol) + (sv-96 nav-ray) + (sv-100 symbol) + (sv-104 int) + (sv-112 nav-mesh-work) + (sv-120 int) + (sv-128 int) + (sv-136 nav-mesh-work) + (sv-140 nav-poly) + (sv-144 uint8) + (sv-148 (pointer int8)) + (sv-152 (pointer int8)) + (sv-156 float) + (sv-160 float) + (sv-164 vector) + (sv-168 vector) + (sv-172 float) + (sv-176 float) + (sv-180 uint) + (sv-184 vector) + (sv-188 vector) + (sv-192 float) + (sv-196 float) + (sv-200 float) + (sv-204 float) + ) + (rlet ((acc :class vf) + (Q :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + ) + (init-vf0-vector) + (when arg5 + (set! (-> arg5 found-boundary) #f) + (set! (-> arg5 gap-poly) #f) + ) + (set! sv-96 (new 'stack-no-clear 'nav-ray)) + (set! sv-100 (the-as symbol #f)) + (set! sv-104 0) + (set! sv-112 (-> obj work)) + (set! (-> sv-96 current-poly) arg1) + (set! (-> sv-96 current-pos quad) (-> arg0 quad)) + (vector+! (-> sv-96 dest-pos) arg0 arg2) + (let* ((t6-0 obj) + (t4-2 arg1) + (v1-10 (-> sv-96 dest-pos)) + (t3-3 (-> t4-2 vertex-count)) + (t4-3 (-> t4-2 vertex)) + (t5-1 (-> t6-0 work vert0-table)) + (t6-2 (-> t6-0 work vert1-table)) + ) + (dotimes (t7-0 (the-as int t3-3)) + (let* ((t8-3 (-> t4-3 (-> t5-1 t7-0))) + (t9-3 (-> t4-3 (-> t6-2 t7-0))) + (f0-1 (- (-> t8-3 z) (-> t9-3 z))) + (f1-2 (- (-> t9-3 x) (-> t8-3 x))) + (f2-2 (- (-> v1-10 x) (-> t8-3 x))) + (f3-2 (- (-> v1-10 z) (-> t8-3 z))) + (f0-3 (+ (* f2-2 f0-1) (* f3-2 f1-2))) + ) + (when (< 0.0 f0-3) + (set! v1-11 #f) + (goto cfg-9) + ) + ) + ) + ) + (set! v1-11 #t) + (label cfg-9) + (b! v1-11 cfg-62 :delay (nop!)) + (until sv-100 + (set! sv-120 0) + (let ((v1-15 sv-96)) + (vector-! (-> v1-15 dir) (-> v1-15 dest-pos) (-> v1-15 current-pos)) + (set! (-> v1-15 dir y) 0.0) + (let ((t3-5 (-> v1-15 dir))) + (let ((f0-5 1.0)) + (.lvf vf1 (&-> t3-5 quad)) + (.mul.vf vf2 vf1 vf1 :mask #b111) + (let ((t4-6 f0-5)) + (.mov vf3 t4-6) + ) + ) + (.mul.x.vf acc vf0 vf2 :mask #b1000) + (.add.mul.y.vf acc vf0 vf2 acc :mask #b1000) + (.add.mul.z.vf vf2 vf0 vf2 acc :mask #b1000) + (.isqrt.vf Q vf3 vf2 :fsf #b0 :ftf #b11) + (.wait.vf) + (.mul.vf vf1 vf1 Q :mask #b111) + (.nop.vf) + (.nop.vf) + (.nop.vf) + (.svf (&-> t3-5 quad) vf1) + ) + (set! (-> v1-15 next-poly) #f) + (set! (-> v1-15 len) 0.0) + (set! (-> v1-15 last-edge) -1) + (set! (-> v1-15 terminated) #f) + (set! (-> v1-15 reached-dest) #f) + (set! (-> v1-15 hit-boundary) #f) + (set! (-> v1-15 hit-gap) #f) + (set! (-> v1-15 ignore) (the-as uint 3)) + ) + 0 + (until v1-22 + (set! sv-120 (+ sv-120 1)) + (let ((t3-8 obj) + (v1-19 sv-96) + ) + (set! sv-128 -1) + (set! sv-136 (-> t3-8 work)) + (set! sv-140 (-> v1-19 current-poly)) + (set! sv-144 (-> v1-19 current-poly vertex-count)) + (set! sv-148 (-> t3-8 work vert0-table)) + (set! sv-152 (-> t3-8 work vert1-table)) + (set! sv-156 (- (-> v1-19 dest-pos x) (-> v1-19 current-pos x))) + (set! sv-160 (- (-> v1-19 dest-pos z) (-> v1-19 current-pos z))) + (dotimes (t4-16 (the-as int sv-144)) + (set! sv-164 (-> sv-140 vertex (-> sv-148 t4-16))) + (set! sv-168 (-> sv-140 vertex (-> sv-152 t4-16))) + (set! sv-172 (- (-> sv-164 z) (-> sv-168 z))) + (set! sv-176 (- (-> sv-168 x) (-> sv-164 x))) + (let ((f0-17 (+ (* sv-156 sv-172) (* sv-160 sv-176)))) + (when (< 0.0 f0-17) + (let ((f1-15 (+ (* sv-172 (- (-> sv-164 x) (-> v1-19 current-pos x))) + (* sv-176 (- (-> sv-164 z) (-> v1-19 current-pos z))) + ) + ) + ) + (when (< f1-15 f0-17) + (set! sv-128 t4-16) + (let ((f0-19 (fmax 0.0 (/ f1-15 f0-17)))) + (set! sv-156 (* sv-156 f0-19)) + (set! sv-160 (* sv-160 f0-19)) + ) + ) + ) + ) + ) + ) + (let ((f0-23 (+ (* sv-156 (-> v1-19 dir x)) (* sv-160 (-> v1-19 dir z))))) + (+! (-> v1-19 len) f0-23) + ) + 0 + (set! (-> v1-19 next-poly) #f) + (cond + ((= sv-128 -1) + (set! (-> v1-19 current-pos quad) (-> v1-19 dest-pos quad)) + (set! (-> v1-19 reached-dest) #t) + (set! (-> v1-19 terminated) #t) + ) + (else + (+! (-> v1-19 current-pos x) sv-156) + (+! (-> v1-19 current-pos z) sv-160) + (set! sv-180 (-> sv-140 adj-poly sv-128)) + (if (!= sv-180 255) + (set! (-> v1-19 next-poly) (-> t3-8 poly-array sv-180)) + ) + (cond + ((and (-> v1-19 next-poly) (zero? (logand (-> v1-19 next-poly pat) (-> v1-19 ignore)))) + (set! (-> v1-19 current-poly) (-> v1-19 next-poly)) + ) + (else + (set! (-> v1-19 last-edge) sv-128) + (if (-> v1-19 next-poly) + (set! (-> v1-19 hit-gap) #t) + (set! (-> v1-19 hit-boundary) #t) + ) + (set! (-> v1-19 terminated) #t) + ) + ) + ) + ) + ) + 0 + (set! v1-22 (or (>= sv-120 15) (or (>= (-> sv-96 len) (fmax 20480.0 arg3)) (-> sv-96 terminated)))) + ) + (cond + ((and (-> sv-96 hit-boundary) (and (< (-> sv-96 len) arg3) (!= (-> sv-96 last-edge) -1) (< sv-104 1))) + (set! sv-104 (+ sv-104 1)) + (set! sv-184 (-> arg1 vertex (-> sv-112 vert0-table (-> sv-96 last-edge)))) + (set! sv-188 (-> arg1 vertex (-> sv-112 vert1-table (-> sv-96 last-edge)))) + (set! sv-192 (- (-> sv-184 z) (-> sv-188 z))) + (set! sv-196 (- (-> sv-188 x) (-> sv-184 x))) + (set! sv-200 (-> arg2 x)) + (set! sv-204 (-> arg2 z)) + (let* ((f0-37 sv-192) + (f0-39 (* f0-37 f0-37)) + (f1-30 sv-196) + (f0-41 (sqrtf (+ f0-39 (* f1-30 f1-30)))) + (f0-43 (/ 1.0 f0-41)) + ) + (set! sv-192 (* sv-192 f0-43)) + (set! sv-196 (* sv-196 f0-43)) + ) + (when arg5 + (set! (-> arg5 found-boundary) #t) + (vector+! (-> arg5 intersection) (-> sv-96 current-pos) (-> obj bounds)) + (set! (-> arg5 boundary-normal x) sv-192) + (set! (-> arg5 boundary-normal y) 0.0) + (set! (-> arg5 boundary-normal z) sv-196) + (set! (-> arg5 poly) (-> sv-96 current-poly)) + (set! (-> arg5 edge) (-> sv-96 last-edge)) + (vector+! (-> arg5 vert-0) sv-184 (-> obj bounds)) + (vector+! (-> arg5 vert-1) sv-188 (-> obj bounds)) + ) + (set! (-> sv-96 dest-pos quad) (-> sv-96 current-pos quad)) + (cond + (arg4 + (let ((f0-49 (* 1.01 (+ (* sv-192 sv-200) (* sv-196 sv-204))))) + (set! sv-200 (- sv-200 (* sv-192 f0-49))) + (set! sv-204 (- sv-204 (* sv-196 f0-49))) + ) + (+! (-> sv-96 dest-pos x) sv-200) + (+! (-> sv-96 dest-pos z) sv-204) + ) + (else + (set! sv-100 #t) + ) + ) + ) + ((-> sv-96 hit-gap) + (if arg5 + (set! (-> arg5 gap-poly) (-> sv-96 next-poly)) + ) + (set! sv-100 #t) + ) + (else + (set! sv-100 #t) + ) + ) + ) + (vector-! arg2 (-> sv-96 current-pos) arg0) + 0 + (label cfg-62) + 0 + (none) + ) + ) + +;; definition for method 22 of type nav-control +(defmethod find-first-sphere-and-update-avoid-params nav-control ((obj nav-control) (arg0 vector) (arg1 nav-avoid-spheres-params)) + (rlet ((acc :class vf) + (Q :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + ) + (init-vf0-vector) + (let ((s2-1 (vector-! (new 'stack-no-clear 'vector) (-> obj root-nav-sphere) (-> obj state mesh bounds))) + (f30-0 -1.0) + ) + (let ((s3-0 -1)) + (countdown (s1-0 (-> obj sphere-count)) + (let* ((s0-0 (-> obj sphere-array s1-0)) + (f0-2 (ray-circle-intersect s2-1 arg0 s0-0 (+ -409.6 (-> s0-0 r)))) + ) + (when (>= f0-2 0.0) + (let ((v1-5 (new 'stack-no-clear 'vector))) + (vector-! v1-5 (the-as vector s0-0) s2-1) + (when (>= (vector-dot v1-5 arg0) 0.0) + (when (or (< f30-0 0.0) (< f0-2 f30-0)) + (set! f30-0 f0-2) + (set! s3-0 s1-0) + ) + ) + ) + ) + ) + ) + (when arg1 + (set! (-> arg1 current-pos x) f30-0) + (when (>= f30-0 0.0) + (vector+float*! (-> arg1 travel) (-> obj root-nav-sphere) arg0 f30-0) + (let ((a0-9 (-> obj sphere-array s3-0)) + (v1-19 (new 'stack-no-clear 'vector)) + ) + (vector+! v1-19 (the-as vector a0-9) (-> obj state mesh bounds)) + (vector-! (-> arg1 pref-dir) (-> arg1 travel) v1-19) + ) + (set! (-> arg1 pref-dir w) 1.0) + (let ((v1-21 (-> arg1 pref-dir))) + (let ((f0-6 1.0)) + (.lvf vf1 (&-> v1-21 quad)) + (.mul.vf vf2 vf1 vf1 :mask #b111) + (let ((a0-12 f0-6)) + (.mov vf3 a0-12) + ) + ) + (.mul.x.vf acc vf0 vf2 :mask #b1000) + (.add.mul.y.vf acc vf0 vf2 acc :mask #b1000) + (.add.mul.z.vf vf2 vf0 vf2 acc :mask #b1000) + (.isqrt.vf Q vf3 vf2 :fsf #b0 :ftf #b11) + (.wait.vf) + (.mul.vf vf1 vf1 Q :mask #b111) + (.nop.vf) + (.nop.vf) + (.nop.vf) + (.svf (&-> v1-21 quad) vf1) + ) + ) + ) + ) + f30-0 + ) + ) + ) + +;; definition for method 24 of type nav-control +(defmethod add-root-sphere-to-hash! nav-control ((obj nav-control) (arg0 vector) (arg1 int)) + "Add our root sphere to the hash (if enabled with output-sphere-hash flag) at the given location." + (if (logtest? (-> obj flags) (nav-control-flag output-sphere-hash)) + (add-sphere-with-mask-and-id + (-> obj state mesh sphere-hash) + arg0 + (logand arg1 255) + (the-as int (-> obj root-sphere-id)) + ) + ) + (none) + ) + +;; definition for method 47 of type nav-state +;; WARN: Return type mismatch int vs none. +(defmethod reset! nav-state ((obj nav-state) (arg0 nav-control)) + (set! (-> obj nav) arg0) + (set! (-> obj flags) (nav-state-flag)) + (set! (-> obj current-poly) #f) + (set! (-> obj next-poly) #f) + (set! (-> obj target-poly) #f) + (set! (-> obj user-poly) #f) + 0 + (none) + ) + +;; definition for method 7 of type nav-state +(defmethod relocate nav-state ((obj nav-state) (arg0 int)) + (break!) + (&+! (-> obj nav) arg0) + obj + ) + +;; definition for method 12 of type nav-state +;; INFO: Used lq/sq +(defmethod get-velocity nav-state ((obj nav-state) (arg0 vector)) + (set! (-> arg0 quad) (-> obj velocity quad)) + arg0 + ) + +;; definition for method 14 of type nav-state +;; INFO: Used lq/sq +(defmethod get-heading nav-state ((obj nav-state) (arg0 vector)) + (set! (-> arg0 quad) (-> obj heading quad)) + arg0 + ) + +;; definition for method 15 of type nav-state +;; INFO: Used lq/sq +(defmethod get-target-post nav-state ((obj nav-state) (arg0 vector)) + (set! (-> arg0 quad) (-> obj target-post quad)) + arg0 + ) + +;; definition for method 19 of type nav-state +(defmethod get-current-poly nav-state ((obj nav-state)) + "@returns `current-poly`" + (-> obj current-poly) + ) + +;; definition for method 16 of type nav-state +(defmethod get-speed nav-state ((obj nav-state)) + "@returns `speed`" + (-> obj speed) + ) + +;; definition for method 17 of type nav-state +(defmethod get-rotation-rate nav-state ((obj nav-state)) + "@returns `rotation-rate`" + (-> obj rotation-rate) + ) + +;; definition for method 13 of type nav-state +;; INFO: Used lq/sq +(defmethod get-travel nav-state ((obj nav-state) (arg0 vector)) + (set! (-> arg0 quad) (-> obj travel quad)) + arg0 + ) + +;; definition for method 44 of type nav-state +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod set-velocity! nav-state ((obj nav-state) (velocity vector)) + (set! (-> obj velocity quad) (-> velocity quad)) + 0 + (none) + ) + +;; definition for method 45 of type nav-state +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod set-heading! nav-state ((obj nav-state) (arg0 vector)) + (set! (-> obj heading quad) (-> arg0 quad)) + 0 + (none) + ) + +;; definition for method 46 of type nav-state +;; WARN: Return type mismatch int vs none. +(defmethod set-speed! nav-state ((obj nav-state) (arg0 meters)) + (set! (-> obj speed) arg0) + 0 + (none) + ) + +;; definition for method 42 of type nav-state +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod set-target-post! nav-state ((obj nav-state) (arg0 vector)) + (logclear! (-> obj flags) (nav-state-flag directional-mode)) + (logior! (-> obj flags) (nav-state-flag target-poly-dirty)) + (set! (-> obj target-post quad) (-> arg0 quad)) + 0 + (none) + ) + +;; definition for method 43 of type nav-state +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod set-travel! nav-state ((obj nav-state) (arg0 vector)) + (logior! (-> obj flags) (nav-state-flag directional-mode)) + (set! (-> obj travel quad) (-> arg0 quad)) + 0 + (none) + ) + +;; definition for method 20 of type nav-state +;; WARN: Return type mismatch int vs none. +(defmethod copy-nav-state! nav-state ((obj nav-state) (arg0 (pointer nav-state))) + "Copies the [[nav-state]] the given pointer points to into the current object" + (mem-copy! (the-as pointer obj) arg0 176) + 0 + (none) + ) + +;; definition for method 10 of type nav-state +;; WARN: Return type mismatch int vs none. +(defmethod nav-state-method-10 nav-state ((obj nav-state)) + "Virtual/Stub" + 0 + (none) + ) + +;; definition for method 9 of type nav-state +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod debug-draw nav-state ((obj nav-state)) + (let ((s5-0 (-> obj mesh))) + (if (-> obj next-poly) + (debug-draw-poly s5-0 (-> obj next-poly) *color-cyan*) + ) + (if (-> obj target-poly) + (debug-draw-poly s5-0 (-> obj target-poly) *color-yellow*) + ) + (if (-> obj current-poly) + (debug-draw-poly s5-0 (-> obj current-poly) *color-red*) + ) + ) + (add-debug-x #t (bucket-id debug-no-zbuf1) (-> obj target-post) *color-yellow*) + (add-debug-vector + #t + (bucket-id debug-no-zbuf1) + (-> obj current-pos) + (-> obj travel) + (meters 0.00024414062) + *color-white* + ) + (let ((s5-1 (new 'stack-no-clear 'vector))) + 0.0 + (-> obj mesh work debug) + (set! (-> s5-1 quad) (-> obj current-pos quad)) + (let ((f30-0 (-> s5-1 y))) + (set! (-> s5-1 y) (+ 2048.0 f30-0)) + (add-debug-vector #t (bucket-id debug-no-zbuf1) s5-1 (-> obj heading) (meters 1) *color-yellow*) + (set! (-> s5-1 y) (+ 4096.0 f30-0)) + ) + ) + 0 + (add-debug-x + #t + (bucket-id debug-no-zbuf1) + (vector+! (new 'stack-no-clear 'vector) (-> obj current-pos) (-> obj travel)) + *color-white* + ) + 0 + (none) + ) + +;; definition for method 38 of type nav-state +;; WARN: Return type mismatch int vs none. +(defmethod set-current-poly! nav-state ((obj nav-state) (arg0 nav-poly)) + (set! (-> obj current-poly) arg0) + 0 + (none) + ) + +;; definition for method 41 of type nav-state +(defmethod clamp-vector-to-mesh-cross-gaps nav-state ((obj nav-state) (arg0 vector)) + (when (-> obj current-poly) + (clamp-vector-to-mesh-cross-gaps + (-> obj nav) + (-> obj current-pos) + (-> obj current-poly) + arg0 + 204.8 + #f + (the-as clamp-travel-vector-to-mesh-return-info #f) + ) + #t + ) + ) + +;; definition for method 40 of type nav-state +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod do-navigation-to-destination nav-state ((obj nav-state) (arg0 vector)) + (local-vars (v1-15 symbol)) + (rlet ((acc :class vf) + (Q :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + ) + (init-vf0-vector) + (cond + ((-> obj current-poly) + (let ((s3-0 (-> obj mesh)) + (s4-0 (new 'stack-no-clear 'nav-ray)) + ) + (let ((s2-0 0)) + (set! (-> s4-0 current-poly) (-> obj current-poly)) + (vector-! (-> s4-0 current-pos) (-> obj current-pos) (-> s3-0 bounds)) + (vector-! (-> s4-0 dest-pos) arg0 (-> s3-0 bounds)) + (b! (not (point-in-poly? s3-0 (-> obj current-poly) (-> s4-0 dest-pos))) cfg-3 :delay (empty-form)) + (logior! (-> obj flags) (nav-state-flag in-mesh)) + (set! (-> obj current-pos quad) (-> arg0 quad)) + (b! #t cfg-17 :delay (nop!)) + (label cfg-3) + (let ((v1-10 s4-0)) + (vector-! (-> v1-10 dir) (-> v1-10 dest-pos) (-> v1-10 current-pos)) + (set! (-> v1-10 dir y) 0.0) + (let ((a0-6 (-> v1-10 dir))) + (let ((f0-1 1.0)) + (.lvf vf1 (&-> a0-6 quad)) + (.mul.vf vf2 vf1 vf1 :mask #b111) + (let ((a1-8 f0-1)) + (.mov vf3 a1-8) + ) + ) + (.mul.x.vf acc vf0 vf2 :mask #b1000) + (.add.mul.y.vf acc vf0 vf2 acc :mask #b1000) + (.add.mul.z.vf vf2 vf0 vf2 acc :mask #b1000) + (.isqrt.vf Q vf3 vf2 :fsf #b0 :ftf #b11) + (.wait.vf) + (.mul.vf vf1 vf1 Q :mask #b111) + (.nop.vf) + (.nop.vf) + (.nop.vf) + (.svf (&-> a0-6 quad) vf1) + ) + (set! (-> v1-10 next-poly) #f) + (set! (-> v1-10 len) 0.0) + (set! (-> v1-10 last-edge) -1) + (set! (-> v1-10 terminated) #f) + (set! (-> v1-10 reached-dest) #f) + (set! (-> v1-10 hit-boundary) #f) + (set! (-> v1-10 hit-gap) #f) + (set! (-> v1-10 ignore) (the-as uint 3)) + ) + 0 + (set! (-> s4-0 ignore) (the-as uint 1)) + (until v1-15 + (+! s2-0 1) + (move-along-nav-ray! s3-0 s4-0) + (set! v1-15 (or (>= s2-0 15) (-> s4-0 terminated))) + ) + ) + (set! (-> obj current-poly) (-> s4-0 current-poly)) + (when (-> s4-0 reached-dest) + (if (not (point-in-poly? s3-0 (-> obj current-poly) (-> s4-0 dest-pos))) + (set! (-> s4-0 reached-dest) #f) + ) + ) + (cond + ((-> s4-0 reached-dest) + (logior! (-> obj flags) (nav-state-flag in-mesh)) + (set! (-> obj current-pos quad) (-> arg0 quad)) + ) + (else + (logclear! (-> obj flags) (nav-state-flag in-mesh)) + (set! (-> obj current-pos quad) (-> arg0 quad)) + (let ((s4-1 (new 'stack 'nav-find-poly-parms))) + (vector-! (-> s4-1 point) arg0 (-> obj mesh bounds)) + (set! (-> s4-1 y-threshold) (-> obj nav nearest-y-threshold)) + (set! (-> s4-1 ignore) (the-as uint 1)) + (find-nearest-poly-to-point-local (-> obj mesh) s4-1) + (set! (-> obj current-poly) (-> s4-1 poly)) + ) + 0 + ) + ) + ) + ) + (else + (set! (-> obj current-pos quad) (-> arg0 quad)) + (let ((s4-2 (new 'stack 'nav-find-poly-parms))) + (vector-! (-> s4-2 point) arg0 (-> obj mesh bounds)) + (set! (-> s4-2 y-threshold) (-> obj nav nearest-y-threshold)) + (set! (-> s4-2 ignore) (the-as uint 1)) + (find-nearest-poly-to-point-local (-> obj mesh) s4-2) + (set! (-> obj current-poly) (-> s4-2 poly)) + (logclear! (-> obj flags) (nav-state-flag in-mesh)) + (if (-> s4-2 point-inside?) + (logior! (-> obj flags) (nav-state-flag in-mesh)) + ) + ) + ) + ) + (label cfg-17) + 0 + (none) + ) + ) + +;; definition for method 18 of type nav-state +(defmethod try-projecting-to-current-poly nav-state ((obj nav-state) (arg0 vector) (arg1 object) (arg2 vector)) + (cond + ((-> obj current-poly) + (let ((s5-0 (-> obj nav)) + (v1-1 (-> obj current-poly)) + (gp-0 arg0) + ) + (let ((t1-0 arg1) + (a1-1 arg2) + ) + (project-point-onto-plane-of-poly-local + (-> s5-0 state mesh) + v1-1 + gp-0 + (the-as vector t1-0) + (vector-! (new 'stack-no-clear 'vector) a1-1 (-> s5-0 state mesh bounds)) + ) + ) + (vector+! gp-0 gp-0 (-> s5-0 state mesh bounds)) + ) + 0 + #t + ) + (else + #f + ) + ) + ) + +;; definition for method 20 of type nav-control +;; WARN: Return type mismatch int vs none. +(defmethod clamp-vector-to-mesh-cross-gaps nav-control ((obj nav-control) + (arg0 vector) + (arg1 nav-poly) + (arg2 vector) + (arg3 float) + (arg4 symbol) + (arg5 clamp-travel-vector-to-mesh-return-info) + ) + (let ((v1-0 (new 'stack-no-clear 'vector))) + (vector-! v1-0 arg0 (-> obj state mesh bounds)) + (clamp-vector-to-mesh-cross-gaps (-> obj state mesh) v1-0 arg1 arg2 arg3 arg4 arg5) + ) + 0 + (none) + ) + +;; definition for method 12 of type nav-control +(defmethod cloest-point-on-mesh nav-control ((obj nav-control) (arg0 vector) (arg1 vector) (arg2 nav-poly)) + (local-vars (sv-16 vector)) + (set! sv-16 arg0) + (let ((gp-0 (new 'stack-no-clear 'nav-find-poly-parms))) + (set! (-> gp-0 poly) arg2) + (vector-! (-> gp-0 point) arg1 (-> obj state mesh bounds)) + (when (or (not (-> gp-0 poly)) (not (point-in-poly? (-> obj state mesh) (-> gp-0 poly) (-> gp-0 point)))) + (set! (-> gp-0 y-threshold) (-> obj nearest-y-threshold)) + (set! (-> gp-0 ignore) (the-as uint 3)) + (find-nearest-poly-to-point-local (-> obj state mesh) gp-0) + (when (-> gp-0 poly) + (project-point-into-poly-2d (-> obj state mesh) (-> gp-0 poly) sv-16 (-> gp-0 point)) + (vector+! sv-16 sv-16 (-> obj state mesh bounds)) + ) + ) + (-> gp-0 poly) + ) + ) + +;; definition for function vector-rotate-y-sincos! +(defun vector-rotate-y-sincos! ((arg0 vector) (arg1 vector) (arg2 float) (arg3 float)) + (let ((f0-0 (-> arg1 x)) + (f1-0 (-> arg1 z)) + ) + (set! (-> arg0 x) (+ (* arg3 f0-0) (* arg2 f1-0))) + (set! (-> arg0 y) (-> arg1 y)) + (set! (-> arg0 z) (- (* arg3 f1-0) (* arg2 f0-0))) + ) + ) + +;; definition for method 39 of type nav-state +;; INFO: function output is handled by mips2c +(defmethod-mips2c "(method 39 nav-state)" 39 nav-state) + +;; definition for method 50 of type nav-state +;; WARN: Return type mismatch int vs none. +(defmethod nav-state-method-50 nav-state ((obj nav-state)) + "Virtual/Stub" + 0 + (none) + ) + +;; definition for function test-xz-point-on-line-segment? +(defun test-xz-point-on-line-segment? ((arg0 vector) (arg1 vector) (arg2 vector) (arg3 float)) + (local-vars (v1-2 float) (v1-4 float)) + (rlet ((vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + ) + (let* ((f0-0 arg3) + (f0-2 (* f0-0 f0-0)) + ) + (let ((v1-1 arg0) + (t0-0 arg1) + ) + (.lvf vf2 (&-> v1-1 quad)) + (.lvf vf3 (&-> t0-0 quad)) + ) + (.sub.vf vf1 vf3 vf2) + (.mul.vf vf1 vf1 vf1) + (.add.z.vf vf1 vf1 vf1 :mask #b1) + (.mov v1-2 vf1) + (let ((f1-0 v1-2)) + (let ((v1-3 arg0) + (t0-1 arg2) + ) + (.lvf vf2 (&-> v1-3 quad)) + (.lvf vf3 (&-> t0-1 quad)) + ) + (.sub.vf vf1 vf3 vf2) + (.mul.vf vf1 vf1 vf1) + (.add.z.vf vf1 vf1 vf1 :mask #b1) + (.mov v1-4 vf1) + (let ((v0-0 (>= f0-2 (fmin f1-0 v1-4)))) + (when (not v0-0) + (let* ((f0-4 (- (-> arg2 x) (-> arg1 x))) + (f1-4 (- (-> arg2 z) (-> arg1 z))) + (f2-2 f0-4) + (f2-4 (* f2-2 f2-2)) + (f3-0 f1-4) + (f2-6 (sqrtf (+ f2-4 (* f3-0 f3-0)))) + (f3-3 f2-6) + (f3-5 (/ 1.0 f3-3)) + (f5-0 (* f3-5 (- f1-4))) + (f6-0 (* f3-5 f0-4)) + (f3-7 (- (-> arg0 x) (-> arg1 x))) + (f4-4 (- (-> arg0 z) (-> arg1 z))) + ) + (when (>= arg3 (fabs (+ (* f3-7 f5-0) (* f4-4 f6-0)))) + (let ((f0-6 (+ (* f3-7 f0-4) (* f4-4 f1-4)))) + (set! v0-0 (and (>= f0-6 0.0) (>= (* f2-6 f2-6) f0-6))) + ) + ) + ) + ) + v0-0 + ) + ) + ) + ) + ) + +;; definition for method 51 of type nav-state +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod navigate-using-route-portals nav-state ((obj nav-state)) + (local-vars + (v1-117 float) + (sv-112 vector) + (sv-116 nav-route-portal) + (sv-120 (inline-array vector)) + (sv-124 symbol) + ) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (set! (-> obj virtual-current-poly) (-> obj current-poly)) + (set! sv-112 (new 'stack-no-clear 'vector)) + (set! sv-116 (new 'stack-no-clear 'nav-route-portal)) + (set! sv-120 (new 'stack-no-clear 'inline-array 'vector 2)) + (set! sv-124 (the-as symbol #f)) + (vector-! (-> obj current-pos-local) (-> obj current-pos) (-> obj mesh bounds)) + (set! (-> obj virtual-current-pos-local quad) (-> obj current-pos-local quad)) + (set! (-> sv-116 next-poly) #f) + (when (not (logtest? (-> obj flags) (nav-state-flag directional-mode))) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (let ((s4-0 (new 'stack-no-clear 'nav-find-poly-parms))) + (vector-! s5-0 (-> obj target-post) (-> obj mesh bounds)) + (when (or (logtest? (-> obj flags) (nav-state-flag target-poly-dirty)) (not (-> obj target-poly))) + (set! (-> s4-0 point quad) (-> s5-0 quad)) + (set! (-> s4-0 y-threshold) (-> obj nav nearest-y-threshold)) + (set! (-> s4-0 ignore) (the-as uint 3)) + (find-nearest-poly-to-point-local (-> obj mesh) s4-0) + (set! (-> obj target-poly) (-> s4-0 poly)) + (if (not (-> obj target-poly)) + (set! (-> obj target-poly) (-> obj current-poly)) + ) + (logclear! (-> obj flags) (nav-state-flag target-poly-dirty)) + ) + ) + (project-point-into-poly-2d (-> obj mesh) (-> obj target-poly) sv-112 s5-0) + ) + (set! (-> sv-112 y) (-> obj current-pos-local y)) + (vector-! (-> obj travel) sv-112 (-> obj current-pos-local)) + (set! (-> obj travel y) 0.0) + (let* ((v1-32 (-> obj travel)) + (f0-6 (+ (* (-> v1-32 x) (-> v1-32 x)) (* (-> v1-32 z) (-> v1-32 z)))) + (f1-3 4096.0) + ) + (if (< f0-6 (* f1-3 f1-3)) + (logior! (-> obj flags) (nav-state-flag at-target)) + ) + ) + (get-route-portal (-> obj mesh) (-> obj current-poly) (-> obj target-poly) sv-116) + ) + (cond + ((not (-> sv-116 next-poly)) + (set! (-> obj next-poly) #f) + ) + (else + (set! (-> obj next-poly) (-> sv-116 next-poly)) + (set! (-> sv-120 0 quad) (-> sv-116 vertex 0 quad)) + (set! (-> sv-120 1 quad) (-> sv-116 vertex 1 quad)) + (set! sv-124 #t) + (while (and sv-124 (-> sv-116 next-poly) (test-xz-point-on-line-segment? + (-> obj current-pos-local) + (the-as vector (-> sv-116 vertex)) + (-> sv-116 vertex 1) + 409.59998 + ) + ) + (when #t + #t + (vector-segment-distance-point! + (-> obj current-pos-local) + (the-as vector (-> sv-116 vertex)) + (-> sv-116 vertex 1) + (-> obj virtual-current-pos-local) + ) + (vector-! (-> obj travel) sv-112 (-> obj virtual-current-pos-local)) + (set! (-> obj travel y) 0.0) + 0 + ) + (set! (-> obj virtual-current-poly) (-> sv-116 next-poly)) + (cond + ((get-route-portal (-> obj mesh) (-> sv-116 next-poly) (-> obj target-poly) sv-116) + (set! (-> obj next-poly) (-> sv-116 next-poly)) + (set! (-> sv-120 0 quad) (-> sv-116 vertex 0 quad)) + (set! (-> sv-120 1 quad) (-> sv-116 vertex 1 quad)) + 0 + ) + (else + (set! (-> obj next-poly) #f) + (set! sv-124 (the-as symbol #f)) + ) + ) + ) + ) + ) + (when sv-124 + (let ((s5-1 (new 'stack-no-clear 'matrix))) + (vector-! (the-as vector (-> s5-1 vector)) (-> sv-120 1) (-> sv-120 0)) + (vector-normalize! (the-as vector (-> s5-1 vector)) 409.6) + (vector+! (-> sv-120 0) (-> sv-120 0) (the-as vector (-> s5-1 vector))) + (vector-! (-> sv-120 1) (-> sv-120 1) (the-as vector (-> s5-1 vector))) + ) + (when (not (ray-ccw-line-segment-intersection? + (-> obj virtual-current-pos-local) + (-> obj travel) + (-> sv-120 0) + (-> sv-120 1) + ) + ) + (let ((s5-2 -1)) + (let* ((f0-8 (cos 8192.0)) + (f0-10 (* f0-8 f0-8)) + (v1-93 (new 'stack-no-clear 'vector)) + (a0-39 (-> obj travel)) + (f1-9 (+ (* (-> a0-39 x) (-> a0-39 x)) (* (-> a0-39 z) (-> a0-39 z)))) + ) + (countdown (a0-41 2) + (vector-! v1-93 (-> sv-120 a0-41) (-> obj virtual-current-pos-local)) + (let ((f2-5 (vector-dot (-> obj travel) v1-93))) + (when (< 0.0 f2-5) + (let* ((f2-7 (* f2-5 f2-5)) + (a1-26 v1-93) + (f2-8 (/ f2-7 (* f1-9 (+ (* (-> a1-26 x) (-> a1-26 x)) (* (-> a1-26 z) (-> a1-26 z)))))) + ) + (when (< f0-10 f2-8) + (set! f0-10 f2-8) + (set! s5-2 a0-41) + ) + ) + ) + ) + ) + ) + (when (= s5-2 -1) + (let ((f30-0 (the-as float #x7f800000)) + (s3-0 (new 'stack-no-clear 'nav-route-portal)) + (s4-1 (new 'stack-no-clear 'vector)) + ) + (get-route-portal (-> obj mesh) (-> sv-116 next-poly) (-> obj target-poly) s3-0) + (cond + ((-> s3-0 next-poly) + (vector+! s4-1 (the-as vector (-> s3-0 vertex)) (the-as vector (-> s3-0 vertex 1))) + (vector-float*! s4-1 s4-1 0.5) + ) + (else + (set! (-> s4-1 quad) (-> sv-112 quad)) + ) + ) + (countdown (s3-1 2) + (let* ((s2-0 (-> sv-120 s3-1)) + (f0-13 (+ (vector-vector-xz-distance-squared (-> obj virtual-current-pos-local) s2-0) + (vector-vector-xz-distance-squared s4-1 s2-0) + ) + ) + ) + (when (< f0-13 f30-0) + (set! f30-0 f0-13) + (set! s5-2 s3-1) + ) + ) + ) + ) + ) + (vector-! (-> obj travel) (-> sv-120 s5-2) (-> obj virtual-current-pos-local)) + ) + (set! (-> obj travel y) 0.0) + ) + ) + (.lvf vf1 (&-> (-> obj travel) quad)) + (.add.w.vf vf2 vf0 vf0 :mask #b1) + (.mul.vf vf1 vf1 vf1) + (.mul.x.vf acc vf2 vf1 :mask #b1) + (.add.mul.y.vf acc vf2 vf1 acc :mask #b1) + (.add.mul.z.vf vf1 vf2 vf1 acc :mask #b1) + (.mov v1-117 vf1) + (let ((f0-15 v1-117) + (f1-10 (-> obj nav nav-cull-radius)) + ) + (if (< (* f1-10 f1-10) f0-15) + (vector-float*! (-> obj travel) (-> obj travel) (/ (-> obj nav nav-cull-radius) (sqrtf f0-15))) + ) + ) + 0 + (none) + ) + ) + +;; definition for method 49 of type nav-state +;; INFO: Used lq/sq +;; WARN: Stack slot offset 124 signed mismatch +;; WARN: Stack slot offset 128 signed mismatch +;; WARN: Stack slot offset 124 signed mismatch +;; WARN: Stack slot offset 128 signed mismatch +;; WARN: Stack slot offset 124 signed mismatch +;; WARN: Stack slot offset 140 signed mismatch +;; WARN: Stack slot offset 128 signed mismatch +;; WARN: Stack slot offset 144 signed mismatch +;; WARN: Stack slot offset 140 signed mismatch +;; WARN: Stack slot offset 144 signed mismatch +;; WARN: Stack slot offset 124 signed mismatch +;; WARN: Stack slot offset 128 signed mismatch +;; WARN: Stack slot offset 124 signed mismatch +;; WARN: Stack slot offset 128 signed mismatch +;; WARN: Stack slot offset 124 signed mismatch +;; WARN: Stack slot offset 128 signed mismatch +;; WARN: Stack slot offset 124 signed mismatch +;; WARN: Stack slot offset 140 signed mismatch +;; WARN: Stack slot offset 128 signed mismatch +;; WARN: Stack slot offset 144 signed mismatch +;; WARN: Stack slot offset 140 signed mismatch +;; WARN: Stack slot offset 144 signed mismatch +;; WARN: Stack slot offset 124 signed mismatch +;; WARN: Stack slot offset 128 signed mismatch +;; WARN: Stack slot offset 124 signed mismatch +;; WARN: Stack slot offset 128 signed mismatch +;; WARN: Stack slot offset 124 signed mismatch +;; WARN: Stack slot offset 128 signed mismatch +;; WARN: Stack slot offset 124 signed mismatch +;; WARN: Stack slot offset 140 signed mismatch +;; WARN: Stack slot offset 128 signed mismatch +;; WARN: Stack slot offset 144 signed mismatch +;; WARN: Stack slot offset 140 signed mismatch +;; WARN: Stack slot offset 144 signed mismatch +;; WARN: Stack slot offset 124 signed mismatch +;; WARN: Stack slot offset 128 signed mismatch +;; WARN: Stack slot offset 124 signed mismatch +;; WARN: Stack slot offset 128 signed mismatch +;; WARN: Stack slot offset 124 signed mismatch +;; WARN: Stack slot offset 128 signed mismatch +;; WARN: Stack slot offset 124 signed mismatch +;; WARN: Stack slot offset 140 signed mismatch +;; WARN: Stack slot offset 128 signed mismatch +;; WARN: Stack slot offset 144 signed mismatch +;; WARN: Stack slot offset 140 signed mismatch +;; WARN: Stack slot offset 144 signed mismatch +;; WARN: Stack slot offset 124 signed mismatch +;; WARN: Stack slot offset 128 signed mismatch +;; WARN: Stack slot offset 124 signed mismatch +;; WARN: Stack slot offset 128 signed mismatch +;; WARN: Stack slot offset 124 signed mismatch +;; WARN: Stack slot offset 128 signed mismatch +;; WARN: Stack slot offset 124 signed mismatch +;; WARN: Stack slot offset 140 signed mismatch +;; WARN: Stack slot offset 128 signed mismatch +;; WARN: Stack slot offset 144 signed mismatch +;; WARN: Stack slot offset 140 signed mismatch +;; WARN: Stack slot offset 144 signed mismatch +;; WARN: Stack slot offset 124 signed mismatch +;; WARN: Stack slot offset 128 signed mismatch +;; WARN: Stack slot offset 124 signed mismatch +;; WARN: Stack slot offset 128 signed mismatch +;; WARN: Stack slot offset 124 signed mismatch +;; WARN: Stack slot offset 128 signed mismatch +;; WARN: Stack slot offset 124 signed mismatch +;; WARN: Stack slot offset 140 signed mismatch +;; WARN: Stack slot offset 128 signed mismatch +;; WARN: Stack slot offset 144 signed mismatch +;; WARN: Stack slot offset 140 signed mismatch +;; WARN: Stack slot offset 144 signed mismatch +;; WARN: Stack slot offset 124 signed mismatch +;; WARN: Stack slot offset 128 signed mismatch +;; WARN: Stack slot offset 124 signed mismatch +;; WARN: Stack slot offset 128 signed mismatch +;; WARN: Stack slot offset 124 signed mismatch +;; WARN: Stack slot offset 128 signed mismatch +;; WARN: Stack slot offset 124 signed mismatch +;; WARN: Stack slot offset 140 signed mismatch +;; WARN: Stack slot offset 128 signed mismatch +;; WARN: Stack slot offset 144 signed mismatch +;; WARN: Stack slot offset 140 signed mismatch +;; WARN: Stack slot offset 144 signed mismatch +;; WARN: Stack slot offset 124 signed mismatch +;; WARN: Stack slot offset 128 signed mismatch +;; WARN: Stack slot offset 124 signed mismatch +;; WARN: Stack slot offset 128 signed mismatch +;; WARN: Stack slot offset 124 signed mismatch +;; WARN: Stack slot offset 128 signed mismatch +;; WARN: Stack slot offset 124 signed mismatch +;; WARN: Stack slot offset 140 signed mismatch +;; WARN: Stack slot offset 128 signed mismatch +;; WARN: Stack slot offset 144 signed mismatch +;; WARN: Stack slot offset 140 signed mismatch +;; WARN: Stack slot offset 144 signed mismatch +;; WARN: Stack slot offset 124 signed mismatch +;; WARN: Stack slot offset 128 signed mismatch +;; WARN: Return type mismatch int vs none. +(defmethod navigate-using-best-dir-use-existing-avoid-spheres nav-state ((obj nav-state) (arg0 nav-avoid-spheres-params)) + (local-vars + (sv-96 int) + (sv-104 nav-mesh-work) + (sv-108 nav-poly) + (sv-112 uint8) + (sv-116 (pointer int8)) + (sv-120 (pointer int8)) + (sv-124 float) + (sv-128 float) + (sv-132 vector) + (sv-136 vector) + (sv-140 float) + (sv-144 float) + (sv-148 uint) + ) + (rlet ((acc :class vf) + (Q :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + ) + (init-vf0-vector) + (when (-> arg0 avoiding-sphere?) + (logior! (-> obj flags) (nav-state-flag avoiding-sphere)) + (let ((f0-0 (-> arg0 closest-sphere-dist2)) + (f1-0 512.0) + ) + (if (< f0-0 (* f1-0 f1-0)) + (logior! (-> obj flags) (nav-state-flag touching-sphere)) + ) + ) + (set! (-> obj travel quad) (-> arg0 out-travel 0 quad)) + (let ((v1-10 (new 'stack-no-clear 'nav-ray))) + (set! (-> v1-10 current-pos quad) (-> obj virtual-current-pos-local quad)) + (set! (-> v1-10 current-poly) (-> obj virtual-current-poly)) + (vector+! (-> v1-10 dest-pos) (-> obj virtual-current-pos-local) (-> obj travel)) + (let ((a2-5 0)) + (let ((a3-3 v1-10)) + (vector-! (-> a3-3 dir) (-> a3-3 dest-pos) (-> a3-3 current-pos)) + (set! (-> a3-3 dir y) 0.0) + (let ((t0-3 (-> a3-3 dir))) + (let ((f0-2 1.0)) + (.lvf vf1 (&-> t0-3 quad)) + (.mul.vf vf2 vf1 vf1 :mask #b111) + (let ((t1-2 f0-2)) + (.mov vf3 t1-2) + ) + ) + (.mul.x.vf acc vf0 vf2 :mask #b1000) + (.add.mul.y.vf acc vf0 vf2 acc :mask #b1000) + (.add.mul.z.vf vf2 vf0 vf2 acc :mask #b1000) + (.isqrt.vf Q vf3 vf2 :fsf #b0 :ftf #b11) + (.wait.vf) + (.mul.vf vf1 vf1 Q :mask #b111) + (.nop.vf) + (.nop.vf) + (.nop.vf) + (.svf (&-> t0-3 quad) vf1) + ) + (set! (-> a3-3 next-poly) #f) + (set! (-> a3-3 len) 0.0) + (set! (-> a3-3 last-edge) -1) + (set! (-> a3-3 terminated) #f) + (set! (-> a3-3 reached-dest) #f) + (set! (-> a3-3 hit-boundary) #f) + (set! (-> a3-3 hit-gap) #f) + (set! (-> a3-3 ignore) (the-as uint 3)) + ) + 0 + (until (or (>= a2-5 15) (-> v1-10 terminated)) + (+! a2-5 1) + (let ((t0-6 (-> obj mesh)) + (a3-5 v1-10) + ) + (set! sv-96 -1) + (set! sv-104 (-> t0-6 work)) + (set! sv-108 (-> a3-5 current-poly)) + (set! sv-112 (-> a3-5 current-poly vertex-count)) + (set! sv-116 (-> t0-6 work vert0-table)) + (set! sv-120 (-> t0-6 work vert1-table)) + (set! sv-124 (- (-> a3-5 dest-pos x) (-> a3-5 current-pos x))) + (set! sv-128 (- (-> a3-5 dest-pos z) (-> a3-5 current-pos z))) + (dotimes (t1-12 (the-as int sv-112)) + (set! sv-132 (-> sv-108 vertex (-> sv-116 t1-12))) + (set! sv-136 (-> sv-108 vertex (-> sv-120 t1-12))) + (set! sv-140 (- (-> sv-132 z) (-> sv-136 z))) + (set! sv-144 (- (-> sv-136 x) (-> sv-132 x))) + (let ((f0-14 (+ (* sv-124 sv-140) (* sv-128 sv-144)))) + (when (< 0.0 f0-14) + (let ((f1-13 + (+ (* sv-140 (- (-> sv-132 x) (-> a3-5 current-pos x))) (* sv-144 (- (-> sv-132 z) (-> a3-5 current-pos z)))) + ) + ) + (when (< f1-13 f0-14) + (set! sv-96 t1-12) + (let ((f0-16 (fmax 0.0 (/ f1-13 f0-14)))) + (set! sv-124 (* sv-124 f0-16)) + (set! sv-128 (* sv-128 f0-16)) + ) + ) + ) + ) + ) + ) + (let ((f0-20 (+ (* sv-124 (-> a3-5 dir x)) (* sv-128 (-> a3-5 dir z))))) + (+! (-> a3-5 len) f0-20) + ) + 0 + (set! (-> a3-5 next-poly) #f) + (cond + ((= sv-96 -1) + (set! (-> a3-5 current-pos quad) (-> a3-5 dest-pos quad)) + (set! (-> a3-5 reached-dest) #t) + (set! (-> a3-5 terminated) #t) + ) + (else + (+! (-> a3-5 current-pos x) sv-124) + (+! (-> a3-5 current-pos z) sv-128) + (set! sv-148 (-> sv-108 adj-poly sv-96)) + (if (!= sv-148 255) + (set! (-> a3-5 next-poly) (-> t0-6 poly-array sv-148)) + ) + (cond + ((and (-> a3-5 next-poly) (zero? (logand (-> a3-5 next-poly pat) (-> a3-5 ignore)))) + (set! (-> a3-5 current-poly) (-> a3-5 next-poly)) + ) + (else + (set! (-> a3-5 last-edge) sv-96) + (if (-> a3-5 next-poly) + (set! (-> a3-5 hit-gap) #t) + (set! (-> a3-5 hit-boundary) #t) + ) + (set! (-> a3-5 terminated) #t) + ) + ) + ) + ) + ) + 0 + ) + ) + (cond + ((or (-> v1-10 reached-dest) (-> v1-10 hit-gap) (>= (-> v1-10 len) 4096.0)) + (set! (-> obj travel quad) (-> arg0 out-travel 0 quad)) + ) + (else + (set! (-> obj travel quad) (-> arg0 out-travel 1 quad)) + (logior! (-> obj flags) (nav-state-flag trapped-by-sphere)) + ) + ) + ) + ) + 0 + (none) + ) + ) + +;; definition for method 52 of type nav-state +;; INFO: Used lq/sq +;; WARN: Stack slot offset 220 signed mismatch +;; WARN: Stack slot offset 224 signed mismatch +;; WARN: Stack slot offset 220 signed mismatch +;; WARN: Stack slot offset 224 signed mismatch +;; WARN: Stack slot offset 220 signed mismatch +;; WARN: Stack slot offset 236 signed mismatch +;; WARN: Stack slot offset 224 signed mismatch +;; WARN: Stack slot offset 240 signed mismatch +;; WARN: Stack slot offset 236 signed mismatch +;; WARN: Stack slot offset 240 signed mismatch +;; WARN: Stack slot offset 220 signed mismatch +;; WARN: Stack slot offset 224 signed mismatch +;; WARN: Stack slot offset 220 signed mismatch +;; WARN: Stack slot offset 224 signed mismatch +;; WARN: Stack slot offset 220 signed mismatch +;; WARN: Stack slot offset 224 signed mismatch +;; WARN: Stack slot offset 220 signed mismatch +;; WARN: Stack slot offset 236 signed mismatch +;; WARN: Stack slot offset 224 signed mismatch +;; WARN: Stack slot offset 240 signed mismatch +;; WARN: Stack slot offset 236 signed mismatch +;; WARN: Stack slot offset 240 signed mismatch +;; WARN: Stack slot offset 220 signed mismatch +;; WARN: Stack slot offset 224 signed mismatch +;; WARN: Stack slot offset 220 signed mismatch +;; WARN: Stack slot offset 224 signed mismatch +;; WARN: Stack slot offset 220 signed mismatch +;; WARN: Stack slot offset 224 signed mismatch +;; WARN: Stack slot offset 220 signed mismatch +;; WARN: Stack slot offset 236 signed mismatch +;; WARN: Stack slot offset 224 signed mismatch +;; WARN: Stack slot offset 240 signed mismatch +;; WARN: Stack slot offset 236 signed mismatch +;; WARN: Stack slot offset 240 signed mismatch +;; WARN: Stack slot offset 220 signed mismatch +;; WARN: Stack slot offset 224 signed mismatch +;; WARN: Stack slot offset 220 signed mismatch +;; WARN: Stack slot offset 224 signed mismatch +;; WARN: Stack slot offset 220 signed mismatch +;; WARN: Stack slot offset 224 signed mismatch +;; WARN: Stack slot offset 220 signed mismatch +;; WARN: Stack slot offset 236 signed mismatch +;; WARN: Stack slot offset 224 signed mismatch +;; WARN: Stack slot offset 240 signed mismatch +;; WARN: Stack slot offset 236 signed mismatch +;; WARN: Stack slot offset 240 signed mismatch +;; WARN: Stack slot offset 220 signed mismatch +;; WARN: Stack slot offset 224 signed mismatch +;; WARN: Stack slot offset 220 signed mismatch +;; WARN: Stack slot offset 224 signed mismatch +;; WARN: Stack slot offset 220 signed mismatch +;; WARN: Stack slot offset 224 signed mismatch +;; WARN: Stack slot offset 220 signed mismatch +;; WARN: Stack slot offset 236 signed mismatch +;; WARN: Stack slot offset 224 signed mismatch +;; WARN: Stack slot offset 240 signed mismatch +;; WARN: Stack slot offset 236 signed mismatch +;; WARN: Stack slot offset 240 signed mismatch +;; WARN: Stack slot offset 220 signed mismatch +;; WARN: Stack slot offset 224 signed mismatch +;; WARN: Stack slot offset 220 signed mismatch +;; WARN: Stack slot offset 224 signed mismatch +;; WARN: Stack slot offset 220 signed mismatch +;; WARN: Stack slot offset 224 signed mismatch +;; WARN: Stack slot offset 220 signed mismatch +;; WARN: Stack slot offset 236 signed mismatch +;; WARN: Stack slot offset 224 signed mismatch +;; WARN: Stack slot offset 240 signed mismatch +;; WARN: Stack slot offset 236 signed mismatch +;; WARN: Stack slot offset 240 signed mismatch +;; WARN: Stack slot offset 220 signed mismatch +;; WARN: Stack slot offset 224 signed mismatch +;; WARN: Stack slot offset 220 signed mismatch +;; WARN: Stack slot offset 224 signed mismatch +;; WARN: Stack slot offset 220 signed mismatch +;; WARN: Stack slot offset 224 signed mismatch +;; WARN: Stack slot offset 220 signed mismatch +;; WARN: Stack slot offset 236 signed mismatch +;; WARN: Stack slot offset 224 signed mismatch +;; WARN: Stack slot offset 240 signed mismatch +;; WARN: Stack slot offset 236 signed mismatch +;; WARN: Stack slot offset 240 signed mismatch +;; WARN: Stack slot offset 220 signed mismatch +;; WARN: Stack slot offset 224 signed mismatch +;; WARN: Stack slot offset 220 signed mismatch +;; WARN: Stack slot offset 224 signed mismatch +;; WARN: Stack slot offset 220 signed mismatch +;; WARN: Stack slot offset 224 signed mismatch +;; WARN: Stack slot offset 220 signed mismatch +;; WARN: Stack slot offset 236 signed mismatch +;; WARN: Stack slot offset 224 signed mismatch +;; WARN: Stack slot offset 240 signed mismatch +;; WARN: Stack slot offset 236 signed mismatch +;; WARN: Stack slot offset 240 signed mismatch +;; WARN: Stack slot offset 220 signed mismatch +;; WARN: Stack slot offset 224 signed mismatch +;; WARN: Return type mismatch int vs none. +(defmethod navigate-using-best-dir-recompute-avoid-spheres-1 nav-state ((obj nav-state)) + (local-vars + (sv-192 int) + (sv-200 nav-mesh-work) + (sv-204 nav-poly) + (sv-208 uint8) + (sv-212 (pointer int8)) + (sv-216 (pointer int8)) + (sv-220 float) + (sv-224 float) + (sv-228 vector) + (sv-232 vector) + (sv-236 float) + (sv-240 float) + (sv-244 uint) + ) + (rlet ((acc :class vf) + (Q :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + ) + (init-vf0-vector) + (let ((s5-0 (new 'stack-no-clear 'nav-avoid-spheres-params))) + (set! (-> s5-0 current-pos quad) (-> obj virtual-current-pos-local quad)) + (set! (-> s5-0 travel quad) (-> obj travel quad)) + (set! (-> s5-0 pref-dir quad) (-> (if (logtest? (-> obj flags) (nav-state-flag trapped-by-sphere)) + (-> obj heading) + (-> obj travel) + ) + quad + ) + ) + (avoid-spheres-1! (-> obj nav) s5-0) + (when (-> s5-0 avoiding-sphere?) + (logior! (-> obj flags) (nav-state-flag avoiding-sphere)) + (let ((f0-0 (-> s5-0 closest-sphere-dist2)) + (f1-0 512.0) + ) + (if (< f0-0 (* f1-0 f1-0)) + (logior! (-> obj flags) (nav-state-flag touching-sphere)) + ) + ) + (set! (-> obj travel quad) (-> s5-0 out-travel 0 quad)) + (let ((v1-15 (new 'stack-no-clear 'nav-ray))) + (set! (-> v1-15 current-pos quad) (-> obj virtual-current-pos-local quad)) + (set! (-> v1-15 current-poly) (-> obj virtual-current-poly)) + (vector+! (-> v1-15 dest-pos) (-> obj virtual-current-pos-local) (-> obj travel)) + (let ((a0-15 0)) + (let ((a1-4 v1-15)) + (vector-! (-> a1-4 dir) (-> a1-4 dest-pos) (-> a1-4 current-pos)) + (set! (-> a1-4 dir y) 0.0) + (let ((a2-3 (-> a1-4 dir))) + (let ((f0-2 1.0)) + (.lvf vf1 (&-> a2-3 quad)) + (.mul.vf vf2 vf1 vf1 :mask #b111) + (let ((a3-2 f0-2)) + (.mov vf3 a3-2) + ) + ) + (.mul.x.vf acc vf0 vf2 :mask #b1000) + (.add.mul.y.vf acc vf0 vf2 acc :mask #b1000) + (.add.mul.z.vf vf2 vf0 vf2 acc :mask #b1000) + (.isqrt.vf Q vf3 vf2 :fsf #b0 :ftf #b11) + (.wait.vf) + (.mul.vf vf1 vf1 Q :mask #b111) + (.nop.vf) + (.nop.vf) + (.nop.vf) + (.svf (&-> a2-3 quad) vf1) + ) + (set! (-> a1-4 next-poly) #f) + (set! (-> a1-4 len) 0.0) + (set! (-> a1-4 last-edge) -1) + (set! (-> a1-4 terminated) #f) + (set! (-> a1-4 reached-dest) #f) + (set! (-> a1-4 hit-boundary) #f) + (set! (-> a1-4 hit-gap) #f) + (set! (-> a1-4 ignore) (the-as uint 3)) + ) + 0 + (until (or (>= a0-15 15) (-> v1-15 terminated)) + (+! a0-15 1) + (let ((a2-6 (-> obj mesh)) + (a1-6 v1-15) + ) + (set! sv-192 -1) + (set! sv-200 (-> a2-6 work)) + (set! sv-204 (-> a1-6 current-poly)) + (set! sv-208 (-> a1-6 current-poly vertex-count)) + (set! sv-212 (-> a2-6 work vert0-table)) + (set! sv-216 (-> a2-6 work vert1-table)) + (set! sv-220 (- (-> a1-6 dest-pos x) (-> a1-6 current-pos x))) + (set! sv-224 (- (-> a1-6 dest-pos z) (-> a1-6 current-pos z))) + (dotimes (a3-12 (the-as int sv-208)) + (set! sv-228 (-> sv-204 vertex (-> sv-212 a3-12))) + (set! sv-232 (-> sv-204 vertex (-> sv-216 a3-12))) + (set! sv-236 (- (-> sv-228 z) (-> sv-232 z))) + (set! sv-240 (- (-> sv-232 x) (-> sv-228 x))) + (let ((f0-14 (+ (* sv-220 sv-236) (* sv-224 sv-240)))) + (when (< 0.0 f0-14) + (let ((f1-13 + (+ (* sv-236 (- (-> sv-228 x) (-> a1-6 current-pos x))) (* sv-240 (- (-> sv-228 z) (-> a1-6 current-pos z)))) + ) + ) + (when (< f1-13 f0-14) + (set! sv-192 a3-12) + (let ((f0-16 (fmax 0.0 (/ f1-13 f0-14)))) + (set! sv-220 (* sv-220 f0-16)) + (set! sv-224 (* sv-224 f0-16)) + ) + ) + ) + ) + ) + ) + (let ((f0-20 (+ (* sv-220 (-> a1-6 dir x)) (* sv-224 (-> a1-6 dir z))))) + (+! (-> a1-6 len) f0-20) + ) + 0 + (set! (-> a1-6 next-poly) #f) + (cond + ((= sv-192 -1) + (set! (-> a1-6 current-pos quad) (-> a1-6 dest-pos quad)) + (set! (-> a1-6 reached-dest) #t) + (set! (-> a1-6 terminated) #t) + ) + (else + (+! (-> a1-6 current-pos x) sv-220) + (+! (-> a1-6 current-pos z) sv-224) + (set! sv-244 (-> sv-204 adj-poly sv-192)) + (if (!= sv-244 255) + (set! (-> a1-6 next-poly) (-> a2-6 poly-array sv-244)) + ) + (cond + ((and (-> a1-6 next-poly) (zero? (logand (-> a1-6 next-poly pat) (-> a1-6 ignore)))) + (set! (-> a1-6 current-poly) (-> a1-6 next-poly)) + ) + (else + (set! (-> a1-6 last-edge) sv-192) + (if (-> a1-6 next-poly) + (set! (-> a1-6 hit-gap) #t) + (set! (-> a1-6 hit-boundary) #t) + ) + (set! (-> a1-6 terminated) #t) + ) + ) + ) + ) + ) + 0 + ) + ) + (cond + ((or (-> v1-15 reached-dest) (-> v1-15 hit-gap) (>= (-> v1-15 len) 4096.0)) + (set! (-> obj travel quad) (-> s5-0 out-travel 0 quad)) + ) + (else + (set! (-> obj travel quad) (-> s5-0 out-travel 1 quad)) + (logior! (-> obj flags) (nav-state-flag trapped-by-sphere)) + ) + ) + ) + ) + ) + 0 + 0 + (none) + ) + ) + +;; definition for method 53 of type nav-state +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod navigate-within-poly nav-state ((obj nav-state)) + (rlet ((acc :class vf) + (Q :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + ) + (init-vf0-vector) + (set! (-> obj target-dir quad) (-> obj travel quad)) + (let ((v1-1 (-> obj target-dir))) + (let ((f0-0 1.0)) + (.lvf vf1 (&-> v1-1 quad)) + (.mul.vf vf2 vf1 vf1 :mask #b111) + (let ((a0-4 f0-0)) + (.mov vf3 a0-4) + ) + ) + (.mul.x.vf acc vf0 vf2 :mask #b1000) + (.add.mul.y.vf acc vf0 vf2 acc :mask #b1000) + (.add.mul.z.vf vf2 vf0 vf2 acc :mask #b1000) + (.isqrt.vf Q vf3 vf2 :fsf #b0 :ftf #b11) + (.wait.vf) + (.mul.vf vf1 vf1 Q :mask #b111) + (.nop.vf) + (.nop.vf) + (.nop.vf) + (.svf (&-> v1-1 quad) vf1) + ) + (cond + ((logtest? (-> obj nav flags) (nav-control-flag limit-rotation-rate)) + (let ((s5-0 (nav-state-method-39 obj))) + (let* ((f0-1 40.96) + (f0-3 (* f0-1 f0-1)) + (v1-8 (-> obj travel)) + ) + (when (< f0-3 (+ (* (-> v1-8 x) (-> v1-8 x)) (* (-> v1-8 z) (-> v1-8 z)))) + (set! (-> obj heading quad) (-> obj travel quad)) + (set! (-> obj heading y) 0.0) + (let ((v1-12 (-> obj heading))) + (let ((f0-5 1.0)) + (.lvf vf1 (&-> v1-12 quad)) + (.mul.vf vf2 vf1 vf1 :mask #b111) + (let ((a0-9 f0-5)) + (.mov vf3 a0-9) + ) + ) + (.mul.x.vf acc vf0 vf2 :mask #b1000) + (.add.mul.y.vf acc vf0 vf2 acc :mask #b1000) + (.add.mul.z.vf vf2 vf0 vf2 acc :mask #b1000) + (.isqrt.vf Q vf3 vf2 :fsf #b0 :ftf #b11) + (.wait.vf) + (.mul.vf vf1 vf1 Q :mask #b111) + (.nop.vf) + (.nop.vf) + (.nop.vf) + (.svf (&-> v1-12 quad) vf1) + ) + ) + ) + (let ((f0-6 + (find-first-sphere-and-update-avoid-params (-> obj nav) (-> obj travel) (the-as nav-avoid-spheres-params #f)) + ) + ) + (when (>= f0-6 0.0) + (vector-float*! (-> obj travel) (-> obj travel) f0-6) + (let ((f0-7 (* f0-6 (-> obj nav nav-cull-radius)))) + (if (and (not s5-0) (>= 40.96 f0-7)) + (logior! (-> obj flags) (nav-state-flag blocked)) + ) + ) + ) + ) + ) + ) + (else + (let* ((f0-8 40.96) + (f0-10 (* f0-8 f0-8)) + (v1-26 (-> obj travel)) + ) + (when (< f0-10 (+ (* (-> v1-26 x) (-> v1-26 x)) (* (-> v1-26 z) (-> v1-26 z)))) + (set! (-> obj heading quad) (-> obj travel quad)) + (set! (-> obj heading y) 0.0) + (let ((v1-30 (-> obj heading))) + (let ((f0-12 1.0)) + (.lvf vf1 (&-> v1-30 quad)) + (.mul.vf vf2 vf1 vf1 :mask #b111) + (let ((a0-15 f0-12)) + (.mov vf3 a0-15) + ) + ) + (.mul.x.vf acc vf0 vf2 :mask #b1000) + (.add.mul.y.vf acc vf0 vf2 acc :mask #b1000) + (.add.mul.z.vf vf2 vf0 vf2 acc :mask #b1000) + (.isqrt.vf Q vf3 vf2 :fsf #b0 :ftf #b11) + (.wait.vf) + (.mul.vf vf1 vf1 Q :mask #b111) + (.nop.vf) + (.nop.vf) + (.nop.vf) + (.svf (&-> v1-30 quad) vf1) + ) + ) + ) + ) + ) + (if (not (logtest? (-> obj flags) (nav-state-flag touching-sphere))) + (logclear! (-> obj flags) (nav-state-flag trapped-by-sphere)) + ) + 0 + (none) + ) + ) + +;; definition for method 54 of type nav-state +;; WARN: Return type mismatch int vs none. +(defmethod clamp-travel-vector nav-state ((obj nav-state)) + (let ((s5-0 (new 'stack-no-clear 'clamp-travel-vector-to-mesh-return-info))) + (clamp-vector-to-mesh-cross-gaps + (-> obj mesh) + (-> obj virtual-current-pos-local) + (-> obj virtual-current-poly) + (-> obj travel) + (-> obj mesh work nav-poly-min-dist) + (not (or (logtest? (-> obj nav flags) (nav-control-flag no-redirect-in-clamp)) + (logtest? (-> obj nav flags) (nav-control-flag limit-rotation-rate)) + ) + ) + s5-0 + ) + (when (-> s5-0 gap-poly) + (set! (-> obj next-poly) (-> s5-0 gap-poly)) + (let* ((v1-12 (-> obj travel)) + (f0-4 (+ (* (-> v1-12 x) (-> v1-12 x)) (* (-> v1-12 z) (-> v1-12 z)))) + (f1-3 1024.0) + ) + (if (< f0-4 (* f1-3 f1-3)) + (logior! (-> obj flags) (nav-state-flag at-gap)) + ) + ) + ) + ) + (let ((v1-19 (new 'stack-no-clear 'vector))) + (vector-! v1-19 (-> obj virtual-current-pos-local) (-> obj current-pos-local)) + (vector+! (-> obj travel) (-> obj travel) v1-19) + ) + (set! (-> obj travel y) 0.0) + 0 + (none) + ) + +;; definition for method 11 of type nav-state +;; INFO: Used lq/sq +;; WARN: Stack slot offset 56 signed mismatch +;; WARN: Stack slot offset 56 signed mismatch +;; WARN: Stack slot offset 56 signed mismatch +;; WARN: Stack slot offset 56 signed mismatch +(defmethod plan-over-pat1-polys-using-route nav-state ((obj nav-state) (arg0 nav-gap-info)) + (local-vars (sv-48 vector) (sv-52 vector) (sv-56 float)) + (let ((a1-1 (-> obj next-poly))) + (when (logtest? (the-as int (-> a1-1 pat)) 1) + (while (and a1-1 (logtest? (the-as int (-> a1-1 pat)) 1)) + (set! a1-1 (lookup-poly-on-route-to-target (-> obj mesh) a1-1 (-> obj target-poly))) + ) + (when (and a1-1 (!= a1-1 (-> obj current-poly))) + (set! (-> arg0 poly) a1-1) + (-> obj mesh) + (let ((s3-0 (-> arg0 poly)) + (s4-0 (-> arg0 dest)) + ) + (let ((s2-0 (-> obj current-pos-local))) + (set! sv-48 (new 'stack-no-clear 'vector)) + (set! sv-52 (new 'stack-no-clear 'vector)) + (set! sv-56 10000000000000000000000000000000000000.0) + (let* ((s1-0 (-> s3-0 vertex-count)) + (v1-13 (the-as int (+ s1-0 -1))) + ) + (dotimes (s0-0 (the-as int s1-0)) + (let ((f0-1 (vector-segment-distance-point! s2-0 (-> s3-0 vertex v1-13) (-> s3-0 vertex s0-0) sv-48))) + (when (< f0-1 sv-56) + (set! sv-56 f0-1) + (set! (-> sv-52 quad) (-> sv-48 quad)) + ) + ) + (set! v1-13 s0-0) + ) + ) + ) + (set! (-> s4-0 quad) (-> sv-52 quad)) + ) + (vector+! (-> arg0 dest) (-> arg0 dest) (-> obj mesh bounds)) + #t + ) + ) + ) + ) + +;; definition for method 24 of type nav-state +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod turn-and-navigate-to-destination nav-state ((obj nav-state)) + (rlet ((acc :class vf) + (Q :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + ) + (init-vf0-vector) + (set! (-> obj rotation-rate) (-> obj nav max-rotation-rate)) + (if (< 0.0 (-> obj speed)) + (set! (-> obj rotation-rate) + (fmin + (-> obj rotation-rate) + (* (/ (-> obj nav turning-acceleration) (-> obj speed)) (-> obj mesh work rad-to-deg)) + ) + ) + ) + (when (logtest? (-> obj nav flags) (nav-control-flag update-heading-from-facing)) + (vector-z-quaternion! (-> obj heading) (-> obj nav shape quat)) + (set! (-> obj heading y) 0.0) + (let ((v1-12 (-> obj heading))) + (let ((f0-5 1.0)) + (.lvf vf1 (&-> v1-12 quad)) + (.mul.vf vf2 vf1 vf1 :mask #b111) + (let ((a0-3 f0-5)) + (.mov vf3 a0-3) + ) + ) + (.mul.x.vf acc vf0 vf2 :mask #b1000) + (.add.mul.y.vf acc vf0 vf2 acc :mask #b1000) + (.add.mul.z.vf vf2 vf0 vf2 acc :mask #b1000) + (.isqrt.vf Q vf3 vf2 :fsf #b0 :ftf #b11) + (.wait.vf) + (.mul.vf vf1 vf1 Q :mask #b111) + (.nop.vf) + (.nop.vf) + (.nop.vf) + (.svf (&-> v1-12 quad) vf1) + ) + ) + (let ((a1-1 (new 'stack-no-clear 'vector))) + (set! (-> a1-1 quad) (-> obj nav shape trans quad)) + (if (or (not (-> obj current-poly)) + (!= (-> obj current-pos x) (-> a1-1 x)) + (!= (-> obj current-pos z) (-> a1-1 z)) + ) + (do-navigation-to-destination obj a1-1) + ) + ) + (logclear! + (-> obj flags) + (nav-state-flag blocked in-target-poly at-target avoiding-sphere touching-sphere at-gap) + ) + 0 + (none) + ) + ) + +;; definition for method 25 of type nav-state +;; WARN: Return type mismatch int vs none. +(defmethod navigate-using-route-portals-wrapper nav-state ((obj nav-state)) + (navigate-using-route-portals obj) + 0 + (none) + ) + +;; definition for method 26 of type nav-state +;; WARN: Return type mismatch int vs none. +(defmethod navigate-using-best-dir-recompute-avoid-spheres-1-wrapper nav-state ((obj nav-state)) + (navigate-using-best-dir-recompute-avoid-spheres-1 obj) + 0 + (none) + ) + +;; definition for method 27 of type nav-state +;; WARN: Return type mismatch int vs none. +(defmethod navigate-within-poly-wrapper nav-state ((obj nav-state)) + (navigate-within-poly obj) + 0 + (none) + ) + +;; definition for method 28 of type nav-state +;; WARN: Stack slot offset 192 signed mismatch +;; WARN: Stack slot offset 192 signed mismatch +;; WARN: Stack slot offset 200 signed mismatch +;; WARN: Stack slot offset 196 signed mismatch +;; WARN: Stack slot offset 196 signed mismatch +;; WARN: Stack slot offset 204 signed mismatch +;; WARN: Stack slot offset 204 signed mismatch +;; WARN: Stack slot offset 192 signed mismatch +;; WARN: Stack slot offset 192 signed mismatch +;; WARN: Stack slot offset 200 signed mismatch +;; WARN: Stack slot offset 196 signed mismatch +;; WARN: Stack slot offset 196 signed mismatch +;; WARN: Stack slot offset 192 signed mismatch +;; WARN: Stack slot offset 192 signed mismatch +;; WARN: Stack slot offset 200 signed mismatch +;; WARN: Stack slot offset 196 signed mismatch +;; WARN: Stack slot offset 196 signed mismatch +;; WARN: Stack slot offset 204 signed mismatch +;; WARN: Stack slot offset 204 signed mismatch +;; WARN: Stack slot offset 192 signed mismatch +;; WARN: Stack slot offset 192 signed mismatch +;; WARN: Stack slot offset 200 signed mismatch +;; WARN: Stack slot offset 196 signed mismatch +;; WARN: Stack slot offset 196 signed mismatch +;; WARN: Stack slot offset 204 signed mismatch +;; WARN: Stack slot offset 204 signed mismatch +;; WARN: Return type mismatch int vs none. +(defmethod compute-travel-speed nav-state ((obj nav-state)) + (local-vars (sv-192 float) (sv-196 float) (sv-200 float) (sv-204 float) (sv-224 vector)) + (let ((s5-0 obj)) + (let ((s4-0 (new 'stack-no-clear 'clamp-travel-vector-to-mesh-return-info))) + (clamp-vector-to-mesh-cross-gaps + (-> s5-0 mesh) + (-> s5-0 virtual-current-pos-local) + (-> s5-0 virtual-current-poly) + (-> s5-0 travel) + (-> s5-0 mesh work nav-poly-min-dist) + (not (or (logtest? (-> s5-0 nav flags) (nav-control-flag no-redirect-in-clamp)) + (logtest? (-> s5-0 nav flags) (nav-control-flag limit-rotation-rate)) + ) + ) + s4-0 + ) + (when (-> s4-0 gap-poly) + (set! (-> s5-0 next-poly) (-> s4-0 gap-poly)) + (let* ((v1-12 (-> s5-0 travel)) + (f0-4 (+ (* (-> v1-12 x) (-> v1-12 x)) (* (-> v1-12 z) (-> v1-12 z)))) + (f1-3 1024.0) + ) + (if (< f0-4 (* f1-3 f1-3)) + (logior! (-> s5-0 flags) (nav-state-flag at-gap)) + ) + ) + ) + ) + (let ((v1-19 (new 'stack-no-clear 'vector))) + (vector-! v1-19 (-> s5-0 virtual-current-pos-local) (-> s5-0 current-pos-local)) + (vector+! (-> s5-0 travel) (-> s5-0 travel) v1-19) + ) + (set! (-> s5-0 travel y) 0.0) + ) + 0 + (cond + ((logtest? (-> obj nav flags) (nav-control-flag use-momentum)) + (set! sv-192 (-> obj nav target-speed)) + (if (not (logtest? (-> obj nav flags) (nav-control-flag momentum-ignore-heading))) + (set! sv-192 (* sv-192 (fmax 0.0 (vector-dot (-> obj heading) (-> obj target-dir))))) + ) + (set! sv-196 (- sv-192 (-> obj speed))) + (set! sv-200 (* (-> obj nav sec-per-frame) (-> obj nav acceleration))) + (set! sv-204 (fmin sv-200 (fabs sv-196))) + (if (< sv-196 0.0) + (set! (-> obj speed) (- (-> obj speed) sv-204)) + (+! (-> obj speed) sv-204) + ) + ) + (else + (set! (-> obj speed) (-> obj nav target-speed)) + ) + ) + (let* ((f0-22 (/ (vector-length (-> obj travel)) (-> obj nav sec-per-frame))) + (f1-18 (fmin (* (-> obj nav speed-scale) (-> obj speed)) f0-22)) + ) + (set! sv-224 (new 'stack-no-clear 'vector)) + (when (< f0-22 (-> obj speed)) + (set! (-> obj prev-speed) (-> obj speed)) + (set! (-> obj speed) (/ f0-22 (-> obj nav speed-scale))) + ) + (vector-normalize-copy! sv-224 (-> obj travel) f1-18) + ) + (set! (-> obj velocity x) (-> sv-224 x)) + (set! (-> obj velocity z) (-> sv-224 z)) + 0 + (none) + ) + +;; definition for method 34 of type nav-state +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod navigate-v1! nav-state ((obj nav-state)) + (rlet ((acc :class vf) + (Q :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + ) + (init-vf0-vector) + (let ((s5-0 obj)) + (set! (-> s5-0 rotation-rate) (-> s5-0 nav max-rotation-rate)) + (if (< 0.0 (-> s5-0 speed)) + (set! (-> s5-0 rotation-rate) + (fmin + (-> s5-0 rotation-rate) + (* (/ (-> s5-0 nav turning-acceleration) (-> s5-0 speed)) (-> s5-0 mesh work rad-to-deg)) + ) + ) + ) + (when (logtest? (-> s5-0 nav flags) (nav-control-flag update-heading-from-facing)) + (vector-z-quaternion! (-> s5-0 heading) (-> s5-0 nav shape quat)) + (set! (-> s5-0 heading y) 0.0) + (let ((v1-12 (-> s5-0 heading))) + (let ((f0-5 1.0)) + (.lvf vf1 (&-> v1-12 quad)) + (.mul.vf vf2 vf1 vf1 :mask #b111) + (let ((a0-3 f0-5)) + (.mov vf3 a0-3) + ) + ) + (.mul.x.vf acc vf0 vf2 :mask #b1000) + (.add.mul.y.vf acc vf0 vf2 acc :mask #b1000) + (.add.mul.z.vf vf2 vf0 vf2 acc :mask #b1000) + (.isqrt.vf Q vf3 vf2 :fsf #b0 :ftf #b11) + (.wait.vf) + (.mul.vf vf1 vf1 Q :mask #b111) + (.nop.vf) + (.nop.vf) + (.nop.vf) + (.svf (&-> v1-12 quad) vf1) + ) + ) + (let ((a1-1 (new 'stack-no-clear 'vector))) + (set! (-> a1-1 quad) (-> s5-0 nav shape trans quad)) + (if (or (not (-> s5-0 current-poly)) + (!= (-> s5-0 current-pos x) (-> a1-1 x)) + (!= (-> s5-0 current-pos z) (-> a1-1 z)) + ) + (do-navigation-to-destination s5-0 a1-1) + ) + ) + (logclear! + (-> s5-0 flags) + (nav-state-flag blocked in-target-poly at-target avoiding-sphere touching-sphere at-gap) + ) + ) + 0 + (navigate-using-route-portals obj) + 0 + (let* ((v1-26 (-> obj nav)) + (a0-13 (-> v1-26 state mesh sphere-hash sphere-array)) + (a1-2 (-> v1-26 sphere-id-array)) + (a2-1 (-> v1-26 state mesh bounds)) + (a3-0 (-> v1-26 root-nav-sphere)) + (t0-0 (-> v1-26 sphere-count)) + ) + (dotimes (t1-0 t0-0) + (let ((t3-0 (-> a0-13 (-> a1-2 t1-0))) + (t2-4 (-> v1-26 sphere-array t1-0)) + ) + (vector-! (the-as vector t2-4) (the-as vector t3-0) a2-1) + (set! (-> t2-4 r) (+ (-> t3-0 r) (-> a3-0 w))) + ) + ) + ) + 0 + (navigate-using-best-dir-recompute-avoid-spheres-1 obj) + 0 + (navigate-within-poly obj) + 0 + (compute-travel-speed obj) + 0 + (none) + ) + ) + +;; definition for method 35 of type nav-state +;; WARN: Return type mismatch int vs none. +(defmethod reset-target! nav-state ((obj nav-state)) + (vector-reset! (-> obj target-dir)) + 0 + (none) + ) + +;; definition for method 36 of type nav-state +;; WARN: Return type mismatch int vs none. +(defmethod add-offset-to-target! nav-state ((obj nav-state) (arg0 vector)) + (vector+! (-> obj target-dir) (-> obj target-dir) arg0) + 0 + (none) + ) + +;; definition for method 29 of type nav-state +;; WARN: Return type mismatch int vs none. +(defmethod nav-state-method-29 nav-state ((obj nav-state)) + 0 + (none) + ) + +;; definition for method 30 of type nav-state +;; WARN: Return type mismatch int vs none. +(defmethod nav-state-method-30 nav-state ((obj nav-state)) + 0 + (none) + ) + +;; definition for method 31 of type nav-state +;; INFO: Used lq/sq +;; WARN: Stack slot offset 220 signed mismatch +;; WARN: Stack slot offset 224 signed mismatch +;; WARN: Stack slot offset 220 signed mismatch +;; WARN: Stack slot offset 224 signed mismatch +;; WARN: Stack slot offset 220 signed mismatch +;; WARN: Stack slot offset 236 signed mismatch +;; WARN: Stack slot offset 224 signed mismatch +;; WARN: Stack slot offset 240 signed mismatch +;; WARN: Stack slot offset 236 signed mismatch +;; WARN: Stack slot offset 240 signed mismatch +;; WARN: Stack slot offset 220 signed mismatch +;; WARN: Stack slot offset 224 signed mismatch +;; WARN: Stack slot offset 220 signed mismatch +;; WARN: Stack slot offset 224 signed mismatch +;; WARN: Stack slot offset 220 signed mismatch +;; WARN: Stack slot offset 224 signed mismatch +;; WARN: Stack slot offset 220 signed mismatch +;; WARN: Stack slot offset 236 signed mismatch +;; WARN: Stack slot offset 224 signed mismatch +;; WARN: Stack slot offset 240 signed mismatch +;; WARN: Stack slot offset 236 signed mismatch +;; WARN: Stack slot offset 240 signed mismatch +;; WARN: Stack slot offset 220 signed mismatch +;; WARN: Stack slot offset 224 signed mismatch +;; WARN: Stack slot offset 220 signed mismatch +;; WARN: Stack slot offset 224 signed mismatch +;; WARN: Stack slot offset 220 signed mismatch +;; WARN: Stack slot offset 224 signed mismatch +;; WARN: Stack slot offset 220 signed mismatch +;; WARN: Stack slot offset 236 signed mismatch +;; WARN: Stack slot offset 224 signed mismatch +;; WARN: Stack slot offset 240 signed mismatch +;; WARN: Stack slot offset 236 signed mismatch +;; WARN: Stack slot offset 240 signed mismatch +;; WARN: Stack slot offset 220 signed mismatch +;; WARN: Stack slot offset 224 signed mismatch +;; WARN: Stack slot offset 220 signed mismatch +;; WARN: Stack slot offset 224 signed mismatch +;; WARN: Stack slot offset 220 signed mismatch +;; WARN: Stack slot offset 224 signed mismatch +;; WARN: Stack slot offset 220 signed mismatch +;; WARN: Stack slot offset 236 signed mismatch +;; WARN: Stack slot offset 224 signed mismatch +;; WARN: Stack slot offset 240 signed mismatch +;; WARN: Stack slot offset 236 signed mismatch +;; WARN: Stack slot offset 240 signed mismatch +;; WARN: Stack slot offset 220 signed mismatch +;; WARN: Stack slot offset 224 signed mismatch +;; WARN: Stack slot offset 220 signed mismatch +;; WARN: Stack slot offset 224 signed mismatch +;; WARN: Stack slot offset 220 signed mismatch +;; WARN: Stack slot offset 224 signed mismatch +;; WARN: Stack slot offset 220 signed mismatch +;; WARN: Stack slot offset 236 signed mismatch +;; WARN: Stack slot offset 224 signed mismatch +;; WARN: Stack slot offset 240 signed mismatch +;; WARN: Stack slot offset 236 signed mismatch +;; WARN: Stack slot offset 240 signed mismatch +;; WARN: Stack slot offset 220 signed mismatch +;; WARN: Stack slot offset 224 signed mismatch +;; WARN: Stack slot offset 220 signed mismatch +;; WARN: Stack slot offset 224 signed mismatch +;; WARN: Stack slot offset 220 signed mismatch +;; WARN: Stack slot offset 224 signed mismatch +;; WARN: Stack slot offset 220 signed mismatch +;; WARN: Stack slot offset 236 signed mismatch +;; WARN: Stack slot offset 224 signed mismatch +;; WARN: Stack slot offset 240 signed mismatch +;; WARN: Stack slot offset 236 signed mismatch +;; WARN: Stack slot offset 240 signed mismatch +;; WARN: Stack slot offset 220 signed mismatch +;; WARN: Stack slot offset 224 signed mismatch +;; WARN: Stack slot offset 220 signed mismatch +;; WARN: Stack slot offset 224 signed mismatch +;; WARN: Stack slot offset 220 signed mismatch +;; WARN: Stack slot offset 224 signed mismatch +;; WARN: Stack slot offset 220 signed mismatch +;; WARN: Stack slot offset 236 signed mismatch +;; WARN: Stack slot offset 224 signed mismatch +;; WARN: Stack slot offset 240 signed mismatch +;; WARN: Stack slot offset 236 signed mismatch +;; WARN: Stack slot offset 240 signed mismatch +;; WARN: Stack slot offset 220 signed mismatch +;; WARN: Stack slot offset 224 signed mismatch +;; WARN: Stack slot offset 220 signed mismatch +;; WARN: Stack slot offset 224 signed mismatch +;; WARN: Stack slot offset 220 signed mismatch +;; WARN: Stack slot offset 224 signed mismatch +;; WARN: Stack slot offset 220 signed mismatch +;; WARN: Stack slot offset 236 signed mismatch +;; WARN: Stack slot offset 224 signed mismatch +;; WARN: Stack slot offset 240 signed mismatch +;; WARN: Stack slot offset 236 signed mismatch +;; WARN: Stack slot offset 240 signed mismatch +;; WARN: Stack slot offset 220 signed mismatch +;; WARN: Stack slot offset 224 signed mismatch +;; WARN: Return type mismatch int vs none. +(defmethod navigate-using-best-dir-recompute-avoid-spheres-2 nav-state ((obj nav-state)) + (local-vars + (sv-192 int) + (sv-200 nav-mesh-work) + (sv-204 nav-poly) + (sv-208 uint8) + (sv-212 (pointer int8)) + (sv-216 (pointer int8)) + (sv-220 float) + (sv-224 float) + (sv-228 vector) + (sv-232 vector) + (sv-236 float) + (sv-240 float) + (sv-244 uint) + ) + (rlet ((acc :class vf) + (Q :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + ) + (init-vf0-vector) + (let ((s5-0 (new 'stack-no-clear 'nav-avoid-spheres-params))) + (set! (-> s5-0 current-pos quad) (-> obj virtual-current-pos-local quad)) + (set! (-> s5-0 travel quad) (-> obj travel quad)) + (set! (-> s5-0 pref-dir quad) (-> (if (logtest? (-> obj flags) (nav-state-flag trapped-by-sphere)) + (-> obj heading) + (-> obj travel) + ) + quad + ) + ) + (avoid-spheres-2! (-> obj nav) s5-0) + (let ((v1-5 obj)) + (when (-> s5-0 avoiding-sphere?) + (logior! (-> v1-5 flags) (nav-state-flag avoiding-sphere)) + (let ((f0-0 (-> s5-0 closest-sphere-dist2)) + (f1-0 512.0) + ) + (if (< f0-0 (* f1-0 f1-0)) + (logior! (-> v1-5 flags) (nav-state-flag touching-sphere)) + ) + ) + (set! (-> v1-5 travel quad) (-> s5-0 out-travel 0 quad)) + (let ((a0-20 (new 'stack-no-clear 'nav-ray))) + (set! (-> a0-20 current-pos quad) (-> v1-5 virtual-current-pos-local quad)) + (set! (-> a0-20 current-poly) (-> v1-5 virtual-current-poly)) + (vector+! (-> a0-20 dest-pos) (-> v1-5 virtual-current-pos-local) (-> v1-5 travel)) + (let ((a1-6 0)) + (let ((a2-3 a0-20)) + (vector-! (-> a2-3 dir) (-> a2-3 dest-pos) (-> a2-3 current-pos)) + (set! (-> a2-3 dir y) 0.0) + (let ((a3-3 (-> a2-3 dir))) + (let ((f0-2 1.0)) + (.lvf vf1 (&-> a3-3 quad)) + (.mul.vf vf2 vf1 vf1 :mask #b111) + (let ((t0-2 f0-2)) + (.mov vf3 t0-2) + ) + ) + (.mul.x.vf acc vf0 vf2 :mask #b1000) + (.add.mul.y.vf acc vf0 vf2 acc :mask #b1000) + (.add.mul.z.vf vf2 vf0 vf2 acc :mask #b1000) + (.isqrt.vf Q vf3 vf2 :fsf #b0 :ftf #b11) + (.wait.vf) + (.mul.vf vf1 vf1 Q :mask #b111) + (.nop.vf) + (.nop.vf) + (.nop.vf) + (.svf (&-> a3-3 quad) vf1) + ) + (set! (-> a2-3 next-poly) #f) + (set! (-> a2-3 len) 0.0) + (set! (-> a2-3 last-edge) -1) + (set! (-> a2-3 terminated) #f) + (set! (-> a2-3 reached-dest) #f) + (set! (-> a2-3 hit-boundary) #f) + (set! (-> a2-3 hit-gap) #f) + (set! (-> a2-3 ignore) (the-as uint 3)) + ) + 0 + (until (or (>= a1-6 15) (-> a0-20 terminated)) + (+! a1-6 1) + (let ((a3-6 (-> v1-5 mesh)) + (a2-5 a0-20) + ) + (set! sv-192 -1) + (set! sv-200 (-> a3-6 work)) + (set! sv-204 (-> a2-5 current-poly)) + (set! sv-208 (-> a2-5 current-poly vertex-count)) + (set! sv-212 (-> a3-6 work vert0-table)) + (set! sv-216 (-> a3-6 work vert1-table)) + (set! sv-220 (- (-> a2-5 dest-pos x) (-> a2-5 current-pos x))) + (set! sv-224 (- (-> a2-5 dest-pos z) (-> a2-5 current-pos z))) + (dotimes (t0-12 (the-as int sv-208)) + (set! sv-228 (-> sv-204 vertex (-> sv-212 t0-12))) + (set! sv-232 (-> sv-204 vertex (-> sv-216 t0-12))) + (set! sv-236 (- (-> sv-228 z) (-> sv-232 z))) + (set! sv-240 (- (-> sv-232 x) (-> sv-228 x))) + (let ((f0-14 (+ (* sv-220 sv-236) (* sv-224 sv-240)))) + (when (< 0.0 f0-14) + (let ((f1-13 + (+ (* sv-236 (- (-> sv-228 x) (-> a2-5 current-pos x))) (* sv-240 (- (-> sv-228 z) (-> a2-5 current-pos z)))) + ) + ) + (when (< f1-13 f0-14) + (set! sv-192 t0-12) + (let ((f0-16 (fmax 0.0 (/ f1-13 f0-14)))) + (set! sv-220 (* sv-220 f0-16)) + (set! sv-224 (* sv-224 f0-16)) + ) + ) + ) + ) + ) + ) + (let ((f0-20 (+ (* sv-220 (-> a2-5 dir x)) (* sv-224 (-> a2-5 dir z))))) + (+! (-> a2-5 len) f0-20) + ) + 0 + (set! (-> a2-5 next-poly) #f) + (cond + ((= sv-192 -1) + (set! (-> a2-5 current-pos quad) (-> a2-5 dest-pos quad)) + (set! (-> a2-5 reached-dest) #t) + (set! (-> a2-5 terminated) #t) + ) + (else + (+! (-> a2-5 current-pos x) sv-220) + (+! (-> a2-5 current-pos z) sv-224) + (set! sv-244 (-> sv-204 adj-poly sv-192)) + (if (!= sv-244 255) + (set! (-> a2-5 next-poly) (-> a3-6 poly-array sv-244)) + ) + (cond + ((and (-> a2-5 next-poly) (zero? (logand (-> a2-5 next-poly pat) (-> a2-5 ignore)))) + (set! (-> a2-5 current-poly) (-> a2-5 next-poly)) + ) + (else + (set! (-> a2-5 last-edge) sv-192) + (if (-> a2-5 next-poly) + (set! (-> a2-5 hit-gap) #t) + (set! (-> a2-5 hit-boundary) #t) + ) + (set! (-> a2-5 terminated) #t) + ) + ) + ) + ) + ) + 0 + ) + ) + (cond + ((or (-> a0-20 reached-dest) (-> a0-20 hit-gap) (>= (-> a0-20 len) 4096.0)) + (set! (-> v1-5 travel quad) (-> s5-0 out-travel 0 quad)) + ) + (else + (set! (-> v1-5 travel quad) (-> s5-0 out-travel 1 quad)) + (logior! (-> v1-5 flags) (nav-state-flag trapped-by-sphere)) + ) + ) + ) + ) + ) + ) + 0 + (if (not (logtest? (-> obj flags) (nav-state-flag touching-sphere))) + (logclear! (-> obj flags) (nav-state-flag trapped-by-sphere)) + ) + 0 + (none) + ) + ) + +;; definition for method 32 of type nav-state +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod update-travel-dir-from-spheres nav-state ((obj nav-state)) + (local-vars (v1-11 float) (v1-25 float)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (let ((s5-0 (new 'stack-no-clear 'nav-control-cfs-work))) + (vector-reset! (-> s5-0 in-dir)) + (set! (-> s5-0 best-dir 0 quad) (-> obj travel quad)) + (set! (-> s5-0 best-dir 0 y) 0.0) + (vector-normalize! (the-as vector (-> s5-0 best-dir)) (-> obj nav target-speed)) + (vector-! (-> s5-0 right-dir) (the-as vector (-> s5-0 best-dir)) (-> obj velocity)) + (vector-float*! (-> s5-0 right-dir) (-> s5-0 right-dir) 4.0) + (vector+! (-> s5-0 in-dir) (-> s5-0 in-dir) (-> s5-0 right-dir)) + (dotimes (s4-0 (-> obj nav sphere-count)) + (let ((s3-0 (-> obj nav sphere-array s4-0))) + (vector-! (-> s5-0 right-dir) (-> obj current-pos-local) (the-as vector s3-0)) + (.lvf vf1 (&-> (-> s5-0 right-dir) quad)) + (.add.w.vf vf2 vf0 vf0 :mask #b1) + (.mul.vf vf1 vf1 vf1) + (.mul.x.vf acc vf2 vf1 :mask #b1) + (.add.mul.y.vf acc vf2 vf1 acc :mask #b1) + (.add.mul.z.vf vf1 vf2 vf1 acc :mask #b1) + (.mov v1-11 vf1) + (let ((f30-0 v1-11)) + (vector-normalize! (-> s5-0 right-dir) 2.0) + (let* ((f0-4 (+ (-> obj nav root-nav-sphere w) (-> s3-0 r))) + (f1-1 (* f0-4 f0-4)) + (f0-7 (fmax 0.0 (/ (- f1-1 f30-0) f1-1))) + ) + (vector-float*! (-> s5-0 right-dir) (-> s5-0 right-dir) (* 81920.0 f0-7)) + ) + ) + ) + (vector+! (-> s5-0 in-dir) (-> s5-0 in-dir) (-> s5-0 right-dir)) + ) + (vector+! (-> obj target-dir) (-> obj target-dir) (-> s5-0 in-dir)) + ) + (set! (-> obj target-dir y) 0.0) + (vector+float*! (-> obj velocity) (-> obj velocity) (-> obj target-dir) (-> obj nav sec-per-frame)) + (.lvf vf1 (&-> (-> obj velocity) quad)) + (.add.w.vf vf2 vf0 vf0 :mask #b1) + (.mul.vf vf1 vf1 vf1) + (.mul.x.vf acc vf2 vf1 :mask #b1) + (.add.mul.y.vf acc vf2 vf1 acc :mask #b1) + (.add.mul.z.vf vf1 vf2 vf1 acc :mask #b1) + (.mov v1-25 vf1) + (let ((f0-11 v1-25) + (f1-4 (-> obj nav target-speed)) + ) + (if (< (* f1-4 f1-4) f0-11) + (vector-float*! (-> obj velocity) (-> obj velocity) (/ (-> obj nav target-speed) (sqrtf f0-11))) + ) + ) + (vector-float*! (-> obj travel) (-> obj velocity) (-> obj nav sec-per-frame)) + 0 + (none) + ) + ) + +;; definition for method 33 of type nav-state +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod compute-speed-simple nav-state ((obj nav-state)) + (rlet ((acc :class vf) + (Q :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + ) + (init-vf0-vector) + (let ((s5-0 (new 'stack-no-clear 'clamp-travel-vector-to-mesh-return-info))) + (clamp-vector-to-mesh-cross-gaps + (-> obj mesh) + (-> obj virtual-current-pos-local) + (-> obj virtual-current-poly) + (-> obj travel) + (-> obj mesh work nav-poly-min-dist) + #t + s5-0 + ) + (if (-> s5-0 gap-poly) + (set! (-> obj next-poly) (-> s5-0 gap-poly)) + ) + ) + (let* ((f0-1 40.96) + (f0-3 (* f0-1 f0-1)) + (v1-9 (-> obj travel)) + ) + (when (< f0-3 (+ (* (-> v1-9 x) (-> v1-9 x)) (* (-> v1-9 z) (-> v1-9 z)))) + (set! (-> obj heading quad) (-> obj travel quad)) + (set! (-> obj heading y) 0.0) + (let ((v1-13 (-> obj heading))) + (let ((f0-5 1.0)) + (.lvf vf1 (&-> v1-13 quad)) + (.mul.vf vf2 vf1 vf1 :mask #b111) + (let ((a0-5 f0-5)) + (.mov vf3 a0-5) + ) + ) + (.mul.x.vf acc vf0 vf2 :mask #b1000) + (.add.mul.y.vf acc vf0 vf2 acc :mask #b1000) + (.add.mul.z.vf vf2 vf0 vf2 acc :mask #b1000) + (.isqrt.vf Q vf3 vf2 :fsf #b0 :ftf #b11) + (.wait.vf) + (.mul.vf vf1 vf1 Q :mask #b111) + (.nop.vf) + (.nop.vf) + (.nop.vf) + (.svf (&-> v1-13 quad) vf1) + ) + ) + ) + (vector-float*! (-> obj velocity) (-> obj travel) (/ 1.0 (-> obj nav sec-per-frame))) + (set! (-> obj speed) (vector-length (-> obj velocity))) + (vector-reset! (-> obj target-dir)) + 0 + (none) + ) + ) + +;; definition for method 37 of type nav-state +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod navigate-v2! nav-state ((obj nav-state)) + (rlet ((acc :class vf) + (Q :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + ) + (init-vf0-vector) + (let ((s5-0 obj)) + (set! (-> s5-0 rotation-rate) (-> s5-0 nav max-rotation-rate)) + (if (< 0.0 (-> s5-0 speed)) + (set! (-> s5-0 rotation-rate) + (fmin + (-> s5-0 rotation-rate) + (* (/ (-> s5-0 nav turning-acceleration) (-> s5-0 speed)) (-> s5-0 mesh work rad-to-deg)) + ) + ) + ) + (when (logtest? (-> s5-0 nav flags) (nav-control-flag update-heading-from-facing)) + (vector-z-quaternion! (-> s5-0 heading) (-> s5-0 nav shape quat)) + (set! (-> s5-0 heading y) 0.0) + (let ((v1-12 (-> s5-0 heading))) + (let ((f0-5 1.0)) + (.lvf vf1 (&-> v1-12 quad)) + (.mul.vf vf2 vf1 vf1 :mask #b111) + (let ((a0-3 f0-5)) + (.mov vf3 a0-3) + ) + ) + (.mul.x.vf acc vf0 vf2 :mask #b1000) + (.add.mul.y.vf acc vf0 vf2 acc :mask #b1000) + (.add.mul.z.vf vf2 vf0 vf2 acc :mask #b1000) + (.isqrt.vf Q vf3 vf2 :fsf #b0 :ftf #b11) + (.wait.vf) + (.mul.vf vf1 vf1 Q :mask #b111) + (.nop.vf) + (.nop.vf) + (.nop.vf) + (.svf (&-> v1-12 quad) vf1) + ) + ) + (let ((a1-1 (new 'stack-no-clear 'vector))) + (set! (-> a1-1 quad) (-> s5-0 nav shape trans quad)) + (if (or (not (-> s5-0 current-poly)) + (!= (-> s5-0 current-pos x) (-> a1-1 x)) + (!= (-> s5-0 current-pos z) (-> a1-1 z)) + ) + (do-navigation-to-destination s5-0 a1-1) + ) + ) + (logclear! + (-> s5-0 flags) + (nav-state-flag blocked in-target-poly at-target avoiding-sphere touching-sphere at-gap) + ) + ) + 0 + (navigate-using-route-portals obj) + 0 + (let* ((v1-26 (-> obj nav)) + (a0-13 (-> v1-26 state mesh sphere-hash sphere-array)) + (a1-2 (-> v1-26 sphere-id-array)) + (a2-1 (-> v1-26 state mesh bounds)) + (a3-0 (-> v1-26 root-nav-sphere)) + (t0-0 (-> v1-26 sphere-count)) + ) + (dotimes (t1-0 t0-0) + (let ((t3-0 (-> a0-13 (-> a1-2 t1-0))) + (t2-4 (-> v1-26 sphere-array t1-0)) + ) + (vector-! (the-as vector t2-4) (the-as vector t3-0) a2-1) + (set! (-> t2-4 r) (+ (-> t3-0 r) (-> a3-0 w))) + ) + ) + ) + 0 + (navigate-using-best-dir-recompute-avoid-spheres-2 obj) + (update-travel-dir-from-spheres obj) + (compute-speed-simple obj) + 0 + (none) + ) + ) + + + + diff --git a/goal_src/jak2/engine/nav/nav-mesh-h.gc b/goal_src/jak2/engine/nav/nav-mesh-h.gc index d88d231fb5..f4d61c01ea 100644 --- a/goal_src/jak2/engine/nav/nav-mesh-h.gc +++ b/goal_src/jak2/engine/nav/nav-mesh-h.gc @@ -14,8 +14,8 @@ (declare-type grid-hash basic) (declare-type sphere-hash grid-hash) -(define-extern nav-mesh-connect-from-ent (function entity-nav-mesh none)) -(define-extern find-nearest-nav-mesh (function vector int nav-mesh)) +(define-extern nav-mesh-connect-from-ent (function process-drawable symbol)) +(define-extern find-nearest-nav-mesh (function vector float nav-mesh)) ;; DECOMP BEGINS @@ -171,7 +171,7 @@ (deftype clamp-travel-vector-to-mesh-return-info (structure) - ((found-boundary basic :offset-assert 0) + ((found-boundary symbol :offset-assert 0) (intersection vector :inline :offset-assert 16) (boundary-normal vector :inline :offset-assert 32) (prev-normal vector :inline :offset-assert 48) @@ -221,44 +221,44 @@ :size-assert #x70 :flag-assert #x2f00000070 (:methods - (nav-mesh-method-9 (_type_) none 9) + (debug-draw (_type_) none 9) (nav-mesh-method-10 (_type_ vector vector nav-poly) nav-poly 10) - (nav-mesh-method-11 (_type_ nav-poly vector) vector 11) - (nav-mesh-method-12 (_type_ nav-poly vector) none 12) - (nav-mesh-method-13 (_type_ nav-poly nav-poly) nav-poly 13) + (poly-centroid (_type_ nav-poly vector) vector 11) + (poly-centroid-local (_type_ nav-poly vector) vector 12) + (lookup-poly-on-route-to-target (_type_ nav-poly nav-poly) nav-poly 13) (get-route-portal (_type_ nav-poly nav-poly nav-route-portal) (inline-array nav-vertex) 14) (initialize-mesh! (_type_) none 15) (move-along-nav-ray! (_type_ nav-ray) none 16) (try-move-along-ray (_type_ nav-poly vector vector float) meters 17) - (nav-mesh-method-18 (_type_ vector nav-poly vector float symbol clamp-travel-vector-to-mesh-return-info) none 18) - (nav-mesh-method-19 (_type_) none 19) - (nav-mesh-method-20 (_type_ clamp-travel-vector-to-mesh-return-info) none 20) + (clamp-vector-to-mesh-cross-gaps (_type_ vector nav-poly vector float symbol clamp-travel-vector-to-mesh-return-info) none 18) + (clamp-vector-to-mesh-no-gaps (_type_ vector nav-poly vector clamp-travel-vector-to-mesh-return-info) none 19) + (set-normals-from-adjacent-bounds (_type_ clamp-travel-vector-to-mesh-return-info) none 20) (find-adjacent-bounds-one (_type_ vector nav-poly int int) none 21) - (nav-mesh-method-22 (_type_ vector vector) none 22) - (nav-mesh-method-23 (_type_ entity-nav-mesh) none 23) - (nav-mesh-method-24 (_type_) none 24) - (nav-mesh-method-25 (_type_) none 25) - (nav-mesh-method-26 (_type_) none 26) + (compute-bounding-box-from-vertices (_type_ vector vector) none 22) + (init-from-entity (_type_ entity-nav-mesh) none 23) + (handle-birth (_type_) none 24) + (handle-kill (_type_) none 25) + (update-navigation (_type_) none 26) (new-nav-control (_type_ process-drawable int) nav-control 27) - (nav-mesh-method-28 (_type_ object) none 28) - (nav-mesh-method-29 (_type_ process-drawable symbol) nav-control 29) - (nav-mesh-method-30 (_type_ process-drawable) none 30) - (change-to (_type_ process-drawable) none 31) - (nav-mesh-method-32 (_type_ uint32) none 32) - (nav-mesh-method-33 (_type_ uint32) symbol 33) - (nav-mesh-method-34 (_type_ object vector float) none 34) - (nav-mesh-method-35 () none 35) - (nav-mesh-method-36 (_type_ nav-poly rgba) none 36) + (remove-nav-control (_type_ nav-control) none 28) + (add-process-drawable-to-navmesh (_type_ process-drawable symbol) none 29) + (remove-process-drawable (_type_ process-drawable) none 30) + (change-to (_type_ process-drawable symbol) none 31) + (link-by-id (_type_ uint) symbol 32) + (unlink-by-id (_type_ uint) symbol 33) + (nav-mesh-method-34 (_type_ vector vector float) float 34) + (nav-mesh-method-35 (_type_ vector vector float) none 35) + (debug-draw-poly (_type_ nav-poly rgba) none 36) (point-in-poly? (_type_ nav-poly vector) symbol 37) - (nav-mesh-method-38 (_type_ nav-poly vector vector vector object) vector 38) + (nav-mesh-method-38 (_type_ nav-poly vector vector vector (pointer nav-poly)) vector 38) (closest-point-on-boundary (_type_ nav-poly vector vector) none 39) - (nav-mesh-method-40 (_type_ nav-poly vector object vector) none 40) + (project-point-onto-plane-of-poly-local (_type_ nav-poly vector vector vector) none 40) (project-point-into-poly-2d (_type_ nav-poly vector vector) none 41) - (nav-mesh-method-42 (_type_ nav-find-poly-parms) nav-poly 42) - (nav-mesh-method-43 (_type_ nav-find-poly-parms) none 43) - (nav-mesh-method-44 (_type_ vector float float) symbol 44) - (nav-mesh-method-45 (_type_ entity-perm) none 45) - (nav-mesh-method-46 (_type_ object) none 46) + (find-poly-containing-point-local (_type_ nav-find-poly-parms) nav-poly 42) + (find-nearest-poly-to-point-local (_type_ nav-find-poly-parms) nav-find-poly-parms 43) + (is-in-mesh-local? (_type_ vector float float) symbol 44) + (link-to-other-mesh (_type_ nav-mesh-link) symbol 45) + (unlink-mesh (_type_ nav-mesh-link) none 46) ) ) diff --git a/goal_src/jak2/engine/nav/nav-mesh.gc b/goal_src/jak2/engine/nav/nav-mesh.gc index bf2a34bbd5..0b84447cfc 100644 --- a/goal_src/jak2/engine/nav/nav-mesh.gc +++ b/goal_src/jak2/engine/nav/nav-mesh.gc @@ -7,6 +7,2847 @@ ;; DECOMP BEGINS -(defun nav-mesh-connect-from-ent ((arg0 entity-nav-mesh)) + +(rlet ((vf0 :class vf) (vf4 :class vf) (vf5 :class vf) (vf6 :class vf)) +(init-vf0-vector) + +;; definition for symbol *debug-nav-control-output*, type symbol +(define *debug-nav-control-output* #f) + +;; definition for symbol *debug-nav-control*, type symbol +(define *debug-nav-control* #f) + +;; definition for symbol *debug-nav-mesh-output*, type symbol +(define *debug-nav-mesh-output* #f) + +;; definition for symbol *debug-nav-ray*, type nav-ray +(define *debug-nav-ray* (the-as nav-ray #f)) + +;; definition for symbol *debug-ray-offset*, type vector +(define *debug-ray-offset* (new 'static 'vector)) + +;; definition for symbol *debug-offset*, type vector +(define *debug-offset* (new 'static 'vector :y 4096.0 :w 1.0)) + +;; definition for symbol *nav-mesh-work*, type nav-mesh-work +(define *nav-mesh-work* (new 'static 'nav-mesh-work + :vert0-table (new 'static 'array int8 4 0 1 2 3) + :vert1-table (new 'static 'array int8 4 1 2 3 0) + :edge-mask-table (new 'static 'array uint8 3 #x1 #x2 #x4) + :deg-to-rad 0.000095873795 + :rad-to-deg 10430.379 + :nav-poly-min-dist 204.8 + :nav-poly-epsilon 40.96 + :debug (new 'static 'nav-mesh-work-debug) + :work-struct-in-scratch 1 + :mesh-struct-in-scratch 1 + :polys-in-scratch 1 + ) + ) + +;; definition for symbol *default-nav-mesh*, type nav-mesh +(define *default-nav-mesh* (new 'static 'nav-mesh + :poly-array (new 'static 'inline-array nav-poly 1 + (new 'static 'nav-poly + :vertex (new 'static 'inline-array vector 4 + (new 'static 'vector :w -175458100000000000000000000000000000000.0) + (new 'static 'vector :w (the-as float #xffffffff)) + (new 'static 'vector) + (new 'static 'vector) + ) + ) + ) + :poly-count #x1 + :max-nav-control-count #x80 + :nav-control-array (new 'static 'inline-array nav-control 128 + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + ) + ) + ) + +;; failed to figure out what this is: +(kmemopen global "nav-mesh") + +;; failed to figure out what this is: +(let ((gp-0 *default-nav-mesh*)) + (set! (-> gp-0 work) *nav-mesh-work*) + (if (zero? (-> gp-0 user-list)) + (set! (-> gp-0 user-list) (new 'global 'engine 'nav-engine 128 connection)) + ) + (when (zero? (-> gp-0 poly-hash)) + (set! (-> gp-0 poly-hash) (new 'global 'grid-hash 16)) + (let ((v1-12 (new 'static 'inline-array vector 2 (new 'static 'vector) (new 'static 'vector)))) + (vector-reset! (-> v1-12 0)) + (vector-reset! (-> v1-12 1)) + (let ((a1-3 (-> v1-12 0))) + (let ((a0-5 (-> v1-12 0))) + (let ((a2-3 -4096.0)) + (.mov vf6 a2-3) + ) + (.lvf vf4 (&-> a0-5 quad)) + ) + (.add.x.vf vf5 vf0 vf0 :mask #b1000) + (.add.x.vf vf5 vf4 vf6 :mask #b111) + (.svf (&-> a1-3 quad) vf5) + ) + (let ((a1-4 (-> v1-12 1))) + (let ((a0-6 (-> v1-12 1))) + (let ((a2-5 4096.0)) + (.mov vf6 a2-5) + ) + (.lvf vf4 (&-> a0-6 quad)) + ) + (.add.x.vf vf5 vf0 vf0 :mask #b1000) + (.add.x.vf vf5 vf4 vf6 :mask #b111) + (.svf (&-> a1-4 quad) vf5) + ) + (update-grid-for-objects-in-box + (-> gp-0 poly-hash) + (the-as int (-> gp-0 poly-count)) + (-> v1-12 0) + (-> v1-12 1) + ) + ) + ) + ) + +;; failed to figure out what this is: +(kmemclose) + +;; definition for function nav-mesh-connect-from-ent +(defun nav-mesh-connect-from-ent ((arg0 process-drawable)) + "Connect this process to the nav-mesh associate with the entity that spawned the process" + (let ((s5-0 (nav-mesh-from-res-tag (-> arg0 entity) 'nav-mesh-actor 0))) + (cond + (s5-0 + (if (zero? (-> s5-0 user-list)) + (format 0 "nav-mesh-connect-from-ent: nav mesh not initialized!~%") + ) + (if (add-connection (-> s5-0 user-list) arg0 nothing arg0 #f (-> arg0 root)) + #t + ) + ) + (else + (if (-> arg0 entity) + (logior! (-> arg0 entity extra perm status) (entity-perm-status bit-1)) + ) + #f + ) + ) + ) + ) + +;; definition (debug) for function connection-validate +;; WARN: Return type mismatch int vs none. +(defun-debug connection-validate ((arg0 connection)) + (when (zero? arg0) + (break!) + 0 + ) + (when (zero? (-> arg0 next1)) + (break!) + 0 + ) + (when (zero? (-> arg0 prev1)) + (break!) + 0 + ) + (when (-> arg0 next1) + (when (!= arg0 (-> arg0 next1 prev1)) + (break!) + 0 + ) + ) + (when (-> arg0 prev1) + (when (!= arg0 (-> arg0 prev1 next1)) + (break!) + 0 + ) + ) + 0 (none) ) + +;; definition (debug) for function connection-list-validate +(defun-debug connection-list-validate ((arg0 (inline-array connection))) + (let ((gp-0 (the-as object (&-> arg0 3 prev1)))) + (while gp-0 + (connection-validate (the-as connection gp-0)) + (set! gp-0 (-> (the-as connection gp-0) next1)) + ) + ) + #f + ) + +;; definition (debug) for function nav-control-validate +;; WARN: Return type mismatch int vs none. +(defun-debug nav-control-validate ((arg0 process-drawable)) + (let ((s5-0 (the-as object (-> arg0 nav)))) + (when (and (-> arg0 nav) (!= arg0 (-> arg0 nav process))) + (format 0 "process pointing to wrong nav-control!~%") + (break!) + 0 + ) + (let ((s4-0 (-> arg0 nav state mesh))) + (when (or (not s4-0) (zero? s4-0)) + (format 0 "nav control has invalid mesh~%") + (break!) + 0 + ) + (let ((v1-12 (- (the-as int s5-0) (the-as uint (the-as int (-> s4-0 nav-control-array 0)))))) + (when (or (< (the-as uint v1-12) 0) + (< (the-as uint (* (the-as uint 288) (-> s4-0 nav-control-count))) (the-as uint v1-12)) + ) + (format 0 "nav control (~,,8x) is not in the mesh's nav-control-array!~%" (the-as nav-control s5-0)) + (inspect s4-0) + (break!) + 0 + ) + ) + ) + ) + (connection-list-validate (the-as (inline-array connection) arg0)) + 0 + (none) + ) + +;; definition (debug) for function debug-validate-nav-poly +;; WARN: Return type mismatch int vs none. +(defun-debug debug-validate-nav-poly ((arg0 nav-mesh-link) (arg1 nav-poly)) + (set! (-> *nav-mesh-work* poly1) (-> *nav-mesh-work* poly0)) + (set! (-> *nav-mesh-work* poly0) arg1) + (when arg1 + (let ((a2-1 arg1) + (a3-0 (+ (-> arg0 dest-mesh-id) 0)) + (t0-0 (+ (-> arg0 dest-mesh-id) (* (+ (-> arg0 src-switch-poly-id) -1) 64))) + ) + (when (or (< (the-as uint a2-1) a3-0) (< t0-0 (the-as uint a2-1))) + (format 0 "validate-nav-poly: bad poly pointer ~x range ~x ~x~%" a2-1 a3-0 t0-0) + (break!) + 0 + ) + ) + ) + 0 + (none) + ) + +;; definition for method 27 of type entity-nav-mesh +;; WARN: Return type mismatch int vs none. +(defmethod initialize-nav-mesh! entity-nav-mesh ((obj entity-nav-mesh)) + "Initialize the nav-mesh in this entity." + (let ((v1-0 (-> obj nav-mesh))) + (if (nonzero? v1-0) + (init-from-entity v1-0 obj) + ) + ) + 0 + (none) + ) + +;; definition for method 22 of type entity-nav-mesh +(defmethod birth! entity-nav-mesh ((obj entity-nav-mesh)) + (let ((a0-1 (-> obj nav-mesh))) + (if (nonzero? a0-1) + (handle-birth a0-1) + ) + ) + obj + ) + +;; definition for method 23 of type entity-nav-mesh +(defmethod kill! entity-nav-mesh ((obj entity-nav-mesh)) + (if (-> obj nav-mesh) + (handle-kill (-> obj nav-mesh)) + ) + obj + ) + +;; definition for method 28 of type entity-nav-mesh +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod debug-draw entity-nav-mesh ((obj entity-nav-mesh)) + (add-debug-x + #t + (bucket-id debug-no-zbuf1) + (-> obj nav-mesh bounds) + (new 'static 'rgba :r #x80 :g #xff :b #x80 :a #x80) + ) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (set! (-> s5-0 quad) (-> obj nav-mesh bounds quad)) + (let ((a0-6 (new 'stack 'random-generator))) + (set! (-> a0-6 seed) (-> obj aid)) + (let* ((v1-4 (rand-uint31-gen a0-6)) + (f30-0 (* 182.04445 (the float (logand v1-4 #xffff)))) + ) + (+! (-> s5-0 x) (* 4096.0 (cos f30-0))) + (+! (-> s5-0 z) (* 4096.0 (sin f30-0))) + ) + ) + (add-debug-text-3d + #t + (bucket-id debug-no-zbuf1) + (res-lump-struct obj 'name string) + s5-0 + (font-color #dadada) + (new 'static 'vector2h :data (new 'static 'array int16 2 0 8)) + ) + (let ((s4-1 add-debug-text-3d) + (s3-1 #t) + (s2-1 318) + ) + (format (clear *temp-string*) "aid ~D" (-> obj aid)) + (s4-1 + s3-1 + (the-as bucket-id s2-1) + *temp-string* + s5-0 + (font-color #dadada) + (new 'static 'vector2h :data (new 'static 'array int16 2 0 16)) + ) + ) + ) + (debug-draw (-> obj nav-mesh)) + 0 + (none) + ) + +;; definition for method 31 of type entity-actor +;; INFO: Used lq/sq +(defmethod get-simple-travel-vector entity-actor ((obj entity-actor) (arg0 vector) (arg1 vector) (arg2 vector) (arg3 object) (arg4 float)) + (local-vars (at-0 int) (at-1 int)) + (with-pp + (rlet ((vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (let ((gp-0 (nav-mesh-from-res-tag obj 'nav-mesh-actor 0))) + (cond + (gp-0 + (let ((v1-0 arg0)) + (.lvf vf1 (&-> arg2 quad)) + (let ((f0-0 (-> pp clock seconds-per-frame))) + (.mov at-0 f0-0) + ) + (.mov vf2 at-0) + (.mov.vf vf1 vf0 :mask #b1000) + (.mul.x.vf vf1 vf1 vf2 :mask #b111) + (.svf (&-> v1-0 quad) vf1) + ) + (let ((s3-1 (new 'stack-no-clear 'nav-find-poly-parms))) + (vector-! (-> s3-1 point) arg1 (-> gp-0 bounds)) + (set! (-> s3-1 y-threshold) 40960.0) + (set! (-> s3-1 ignore) (the-as uint 3)) + (let ((a2-2 (find-poly-containing-point-local gp-0 s3-1))) + (cond + (a2-2 + (clamp-vector-to-mesh-cross-gaps + gp-0 + (-> s3-1 point) + a2-2 + arg0 + 2048.0 + #f + (the-as clamp-travel-vector-to-mesh-return-info #f) + ) + (let ((v1-7 arg0)) + (.lvf vf1 (&-> arg0 quad)) + (let ((f0-2 (-> pp clock frames-per-second))) + (.mov at-1 f0-2) + ) + (.mov vf2 at-1) + (.mov.vf vf1 vf0 :mask #b1000) + (.mul.x.vf vf1 vf1 vf2 :mask #b111) + (.svf (&-> v1-7 quad) vf1) + ) + ) + (else + (set! (-> arg0 x) (* (-> arg0 x) (- arg4))) + (set! (-> arg0 y) (* (-> arg0 y) (-> pp clock frames-per-second))) + (set! (-> arg0 z) (* (-> arg0 z) (- arg4))) + ) + ) + ) + ) + gp-0 + ) + (else + (set! (-> arg0 quad) (-> arg2 quad)) + (the-as nav-mesh #f) + ) + ) + ) + ) + ) + ) + +;; definition for method 32 of type entity-actor +;; INFO: Used lq/sq +(defmethod project-point-to-nav-mesh entity-actor ((obj entity-actor) (arg0 vector) (arg1 vector) (arg2 nav-poly) (arg3 float)) + (local-vars (sv-16 vector)) + (let ((gp-0 (nav-mesh-from-res-tag obj 'nav-mesh-actor 0))) + (cond + (gp-0 + (set! sv-16 arg0) + (let ((s5-1 (new 'stack-no-clear 'nav-find-poly-parms))) + (set! (-> s5-1 poly) arg2) + (vector-! (-> s5-1 point) arg1 (-> gp-0 bounds)) + (when (or (not (-> s5-1 poly)) (not (point-in-poly? gp-0 (-> s5-1 poly) (-> s5-1 point)))) + (set! (-> s5-1 y-threshold) arg3) + (set! (-> s5-1 ignore) (the-as uint 3)) + (find-nearest-poly-to-point-local gp-0 s5-1) + (when (-> s5-1 poly) + (project-point-into-poly-2d gp-0 (-> s5-1 poly) sv-16 (-> s5-1 point)) + (vector+! sv-16 sv-16 (-> gp-0 bounds)) + ) + ) + (-> s5-1 poly) + ) + ) + (else + (set! (-> arg0 quad) (-> arg1 quad)) + (the-as nav-poly #f) + ) + ) + ) + ) + +;; definition for method 4 of type nav-mesh +;; WARN: Return type mismatch uint vs int. +(defmethod length nav-mesh ((obj nav-mesh)) + (the-as int (-> obj poly-count)) + ) + +;; definition for method 36 of type nav-mesh +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod debug-draw-poly nav-mesh ((obj nav-mesh) (arg0 nav-poly) (arg1 rgba)) + (let ((gp-0 (new 'stack-no-clear 'inline-array 'vector 3))) + (set! (-> gp-0 0 quad) (-> obj bounds quad)) + (if (logtest? (the-as int (-> arg0 pat)) 7) + (set! (-> gp-0 0 y) (+ 409.6 (-> gp-0 0 y))) + ) + (let ((v1-7 (the-as int (+ (-> arg0 vertex-count) -1)))) + (dotimes (s2-0 (the-as int (-> arg0 vertex-count))) + (add-debug-line + #t + (bucket-id debug-no-zbuf1) + (vector+! (-> gp-0 1) (-> gp-0 0) (-> arg0 vertex s2-0)) + (vector+! (-> gp-0 2) (-> gp-0 0) (-> arg0 vertex v1-7)) + arg1 + #f + (the-as rgba -1) + ) + (set! v1-7 s2-0) + ) + ) + (when (and (logtest? (the-as int (-> arg0 pat)) 4) (< (the-as uint (-> arg0 link)) (-> obj link-count))) + (poly-centroid obj arg0 (-> gp-0 1)) + (let ((s5-1 (-> obj link-array (-> arg0 link)))) + (add-debug-x #t (bucket-id debug-no-zbuf1) (-> gp-0 1) *color-magenta*) + (let ((s4-1 add-debug-text-3d) + (s3-1 #t) + (s2-1 318) + ) + (format (clear *temp-string*) "link ~D" (-> s5-1 id)) + (s4-1 + s3-1 + (the-as bucket-id s2-1) + *temp-string* + (-> gp-0 1) + (font-color magenta-#f87df8) + (new 'static 'vector2h :data (new 'static 'array int16 2 0 8)) + ) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 27 of type nav-mesh +(defmethod new-nav-control nav-mesh ((obj nav-mesh) (arg0 process-drawable) (arg1 int)) + (let ((gp-0 (the-as nav-control #f))) + (dotimes (v1-0 (the-as int (-> obj nav-control-count))) + (let ((a1-2 (-> obj nav-control-array v1-0))) + (b! (-> a1-2 process) cfg-3 :delay (empty-form)) + (set! gp-0 a1-2) + ) + (set! (-> gp-0 process) (the-as process 0)) + (set! (-> gp-0 state mesh) obj) + (b! #t cfg-8 :delay (nop!)) + (label cfg-3) + ) + (let ((v1-3 (-> obj nav-control-count))) + (cond + ((< v1-3 (-> obj max-nav-control-count)) + (+! (-> obj nav-control-count) 1) + (set! gp-0 (-> obj nav-control-array v1-3)) + (set! (-> gp-0 state mesh) obj) + ) + (else + (format + 0 + "nav-mesh::new-nav-control: too many users for nav-mesh ~s~%" + (res-lump-struct (-> obj entity) 'name structure) + ) + ) + ) + ) + (label cfg-8) + gp-0 + ) + ) + +;; definition for method 28 of type nav-mesh +;; WARN: Return type mismatch int vs none. +(defmethod remove-nav-control nav-mesh ((obj nav-mesh) (arg0 nav-control)) + (set! (-> arg0 process) #f) + (let ((v1-1 (+ (-> obj nav-control-count) -1))) + (while (and (>= v1-1 0) (not (-> obj nav-control-array v1-1 process))) + (+! v1-1 -1) + ) + (set! (-> obj nav-control-count) (+ v1-1 1)) + ) + 0 + (none) + ) + +;; definition for method 29 of type nav-mesh +;; WARN: Return type mismatch int vs none. +(defmethod add-process-drawable-to-navmesh nav-mesh ((obj nav-mesh) (arg0 process-drawable) (arg1 symbol)) + (if arg1 + (change-to obj arg0 arg1) + (add-connection (-> obj user-list) arg0 nothing arg0 #f (-> arg0 root)) + ) + 0 + (none) + ) + +;; definition for method 30 of type nav-mesh +;; WARN: Return type mismatch int vs none. +(defmethod remove-process-drawable nav-mesh ((obj nav-mesh) (arg0 process-drawable)) + (remove-from-process (-> obj user-list) arg0) + (let ((a1-2 (-> arg0 nav))) + (when (nonzero? a1-2) + (remove-nav-control obj a1-2) + (set! (-> arg0 nav) #f) + ) + ) + 0 + (none) + ) + +;; definition for method 31 of type nav-mesh +;; WARN: Return type mismatch int vs none. +(defmethod change-to nav-mesh ((obj nav-mesh) (arg0 process-drawable) (arg1 symbol)) + (local-vars (v1-5 symbol)) + (let ((gp-0 arg0)) + (b! (nonzero? (-> obj user-list)) cfg-2 :delay (empty-form)) + (go process-drawable-art-error "nav mesh not initialized") + (b! #t cfg-18 :delay (nop!)) + (label cfg-2) + (let ((s3-0 (-> gp-0 nav))) + (b! (nonzero? s3-0) cfg-4 :delay (empty-form)) + (set! s3-0 (the-as nav-control #f)) + (label cfg-4) + (b! (not s3-0) cfg-7 :likely-delay (set! v1-5 #t)) + (set! v1-5 (!= obj (-> s3-0 state mesh))) + (label cfg-7) + (b! (not v1-5) cfg-18 :delay (empty-form)) + (let ((s4-0 (new-nav-control obj arg0 (the-as int arg1)))) + (b! s4-0 cfg-12 :delay (empty-form)) + (b! (not *debug-segment*) cfg-11 :delay (empty-form)) + (format 0 "ERROR: nav-mesh::change-to: unable to allocate nav-mesh for ~s~%" gp-0) + (label cfg-11) + (b! #t cfg-18 :delay (nop!)) + (label cfg-12) + (cond + (s3-0 + (quad-copy! (the-as pointer s4-0) (the-as pointer s3-0) 18) + (set! (-> s4-0 state mesh) obj) + (set! (-> s4-0 state nav) s4-0) + (set! (-> s4-0 state current-poly) #f) + (set! (-> s4-0 state virtual-current-poly) #f) + (set! (-> s4-0 state next-poly) #f) + (set! (-> s4-0 state user-poly) #f) + (set! (-> s4-0 state target-poly) #f) + (let ((s2-0 (-> s3-0 state mesh))) + (remove-nav-control s2-0 s3-0) + (remove-from-process (-> s2-0 user-list) gp-0) + ) + ) + (else + (init! s4-0 (the-as collide-shape (-> gp-0 root))) + ) + ) + (set-nearest-y-thres! s4-0 (-> obj nearest-y-threshold)) + (set! (-> gp-0 nav) s4-0) + ) + ) + (add-connection (-> obj user-list) gp-0 nothing gp-0 #t (-> gp-0 root)) + (send-event gp-0 'nav-mesh-new :from gp-0) + ) + (label cfg-18) + 0 + (none) + ) + +;; definition for method 45 of type nav-mesh +(defmethod link-to-other-mesh nav-mesh ((obj nav-mesh) (arg0 nav-mesh-link)) + (when (not (-> arg0 dest-mesh)) + (let* ((s4-0 (entity-nav-mesh-by-aid (the-as actor-id (-> arg0 dest-mesh-id)))) + (v1-1 (if (type? s4-0 entity-nav-mesh) + s4-0 + ) + ) + ) + (when v1-1 + (let ((a0-3 (-> v1-1 nav-mesh)) + (v1-2 (the-as structure #f)) + ) + (dotimes (a1-2 (the-as int (-> a0-3 link-count))) + (let ((a2-1 (-> a0-3 link-array a1-2))) + (let ((a3-1 (-> arg0 id))) + (b! (!= (-> a2-1 id) a3-1) cfg-7 :delay (empty-form)) + ) + (set! v1-2 a2-1) + ) + (b! #t cfg-10 :delay (nop!)) + (label cfg-7) + ) + (label cfg-10) + (when (the-as nav-mesh-link v1-2) + (set! (-> arg0 dest-mesh) a0-3) + (set! (-> (the-as nav-mesh v1-2) route) (the-as (pointer nav-poly) obj)) + (set! (-> arg0 dest-link-poly-id) (-> (the-as nav-mesh v1-2) poly-count)) + (set! (-> arg0 dest-switch-poly-id) (-> (the-as nav-mesh v1-2) static-sphere-count)) + (set! (-> (the-as nav-mesh v1-2) nav-control-count) (-> arg0 src-switch-poly-id)) + (set! (-> (the-as nav-mesh v1-2) max-nav-control-count) (-> arg0 src-link-poly-id)) + #t + ) + ) + ) + ) + ) + ) + +;; definition for method 46 of type nav-mesh +;; WARN: Return type mismatch int vs none. +(defmethod unlink-mesh nav-mesh ((obj nav-mesh) (arg0 nav-mesh-link)) + (let ((a0-1 (-> arg0 dest-mesh))) + (when a0-1 + (let ((v1-0 (the-as nav-mesh-link #f))) + (dotimes (a2-1 (the-as int (-> a0-1 link-count))) + (let ((a3-1 (-> a0-1 link-array a2-1))) + (let ((t0-1 (-> arg0 id))) + (b! (!= (-> a3-1 id) t0-1) cfg-4 :delay (empty-form)) + ) + (set! v1-0 a3-1) + ) + (b! #t cfg-7 :delay (nop!)) + (label cfg-4) + ) + (label cfg-7) + (when v1-0 + (set! (-> arg0 dest-mesh) #f) + (set! (-> v1-0 dest-mesh) #f) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 32 of type nav-mesh +(defmethod link-by-id nav-mesh ((obj nav-mesh) (arg0 uint)) + "arg1 is a [[nav-mesh-link]] `id`" + (let ((v1-0 (the-as nav-mesh-link #f))) + (dotimes (a2-0 (the-as int (-> obj link-count))) + (let ((a3-1 (-> obj link-array a2-0))) + (b! (!= (-> a3-1 id) arg0) cfg-3 :delay (empty-form)) + (set! v1-0 a3-1) + ) + (b! #t cfg-6 :delay (nop!)) + (label cfg-3) + ) + (label cfg-6) + (if v1-0 + (link-to-other-mesh obj v1-0) + ) + ) + ) + +;; definition for method 33 of type nav-mesh +(defmethod unlink-by-id nav-mesh ((obj nav-mesh) (arg0 uint)) + "arg1 is a [[nav-mesh-link]] `id`" + (let ((v1-0 (the-as nav-mesh-link #f))) + (dotimes (a2-0 (the-as int (-> obj link-count))) + (let ((a3-1 (-> obj link-array a2-0))) + (b! (!= (-> a3-1 id) arg0) cfg-3 :delay (empty-form)) + (set! v1-0 a3-1) + ) + (b! #t cfg-6 :delay (nop!)) + (label cfg-3) + ) + (label cfg-6) + (when v1-0 + (unlink-mesh obj v1-0) + #t + ) + ) + ) + +;; definition for method 23 of type nav-mesh +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod init-from-entity nav-mesh ((obj nav-mesh) (arg0 entity-nav-mesh)) + "Initialize this mesh from an entity." + (local-vars (sv-16 res-tag)) + (set! (-> obj entity) arg0) + (set! (-> obj work) *nav-mesh-work*) + (set! sv-16 (new 'static 'res-tag)) + (let ((v1-2 (res-lump-data arg0 'nav-mesh-sphere pointer :tag-ptr (& sv-16)))) + (when v1-2 + (set! (-> obj static-sphere-count) (-> sv-16 elt-count)) + (set! (-> obj static-sphere) (the-as (inline-array sphere) v1-2)) + ) + ) + (set! (-> obj nearest-y-threshold) (res-lump-float arg0 'nearest-y-threshold :default 40960.0)) + (set! (-> obj flags) (nav-mesh-flag)) + (set! (-> obj water-max-height) (res-lump-float arg0 'water-max-height :default 8192.0)) + (let ((s5-1 (res-lump-value arg0 'nav-max-users uint128 :default (the-as uint128 64) :time -1000000000.0))) + (set! (-> obj user-list) (new 'loading-level 'engine 'nav-engine (the-as int s5-1) connection)) + (set! (-> obj nav-control-array) + (the-as (inline-array nav-control) (malloc 'loading-level (* 288 (the-as int s5-1)))) + ) + (set! (-> obj nav-control-count) (the-as uint 0)) + (set! (-> obj max-nav-control-count) (the-as uint s5-1)) + (set! (-> obj sphere-hash) + (new 'loading-level 'sphere-hash 4096 (the-as int (+ s5-1 (-> obj static-sphere-count)))) + ) + ) + (if (nonzero? (-> obj poly-hash)) + (set! (-> obj poly-hash work) *grid-hash-work*) + ) + (initialize-mesh! obj) + 0 + (none) + ) + +;; definition for method 24 of type nav-mesh +;; WARN: Return type mismatch int vs none. +(defmethod handle-birth nav-mesh ((obj nav-mesh)) + "Handle the parent nav-mesh-entity birth." + (dotimes (s5-0 (the-as int (-> obj link-count))) + (let ((a1-0 (-> obj link-array s5-0))) + (if (not (-> a1-0 dest-mesh)) + (link-to-other-mesh obj a1-0) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 25 of type nav-mesh +;; WARN: Return type mismatch int vs none. +(defmethod handle-kill nav-mesh ((obj nav-mesh)) + "Handle the parent nav-mesh-entity kill." + (when (nonzero? (-> obj user-list)) + (countdown (s5-0 (-> obj nav-control-count)) + (let* ((v1-3 (-> obj nav-control-array s5-0)) + (s4-0 (-> v1-3 process)) + ) + (when s4-0 + (if (not (send-event (-> v1-3 process) 'nav-mesh-kill)) + (format 0 "ERROR: object ~A did not accept nav-mesh kill~%" s4-0) + ) + ) + ) + ) + (remove-all (-> obj user-list)) + (dotimes (s5-1 (the-as int (-> obj link-count))) + (let ((a1-2 (-> obj link-array s5-1))) + (if (-> a1-2 dest-mesh) + (unlink-mesh obj a1-2) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition of type nav-engine-spr-buffer +(deftype nav-engine-spr-buffer (structure) + ((mem-addr (pointer nav-mesh) :offset-assert 0) + (mem-nav uint32 :offset 0) + (spr-addr (inline-array nav-control) :offset-assert 4) + (spr-nav uint32 :offset 4) + (q-size uint32 :offset-assert 8) + (i-nav uint8 :offset-assert 12) + (done int8 :offset-assert 13) + (nav-count int8 :offset-assert 14) + (i-pass int8 :offset-assert 15) + ) + :pack-me + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + +;; definition for method 3 of type nav-engine-spr-buffer +(defmethod inspect nav-engine-spr-buffer ((obj nav-engine-spr-buffer)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'nav-engine-spr-buffer) + (format #t "~1Tmem-addr: ~D~%" (-> obj mem-addr)) + (format #t "~1Tmem-nav: #x~X~%" (-> obj mem-addr)) + (format #t "~1Tspr-addr: ~D~%" (-> obj spr-addr)) + (format #t "~1Tspr-nav: #x~X~%" (-> obj spr-addr)) + (format #t "~1Tq-size: ~D~%" (-> obj q-size)) + (format #t "~1Ti-nav: ~D~%" (-> obj i-nav)) + (format #t "~1Tdone: ~D~%" (-> obj done)) + (format #t "~1Tnav-count: ~D~%" (-> obj nav-count)) + (format #t "~1Ti-pass: ~D~%" (-> obj i-pass)) + (label cfg-4) + obj + ) + +;; definition of type nav-engine +(deftype nav-engine (structure) + ((spr-addr uint32 :offset-assert 0) + (nav-work-addr uint32 :offset-assert 4) + (nav-mesh-addr nav-mesh :offset-assert 8) + (poly-array-addr uint32 :offset-assert 12) + (hash-sphere-addr uint32 :offset-assert 16) + (hash-buckets-addr uint32 :offset-assert 20) + (buf-nav-control-count int8 :offset-assert 24) + (max-pass-count int8 :offset-assert 25) + (output-sphere-hash uint8 :offset-assert 26) + (work-buf-array nav-engine-spr-buffer 3 :inline :offset-assert 28) + (spr-work nav-mesh-work :offset 4) + (mem-work nav-mesh-work :offset-assert 76) + (spr-mesh nav-mesh :offset 8) + (mem-mesh nav-mesh :offset-assert 80) + (spr-poly-array uint32 :offset 12) + (mem-poly-array (inline-array nav-poly) :offset-assert 84) + (hash-sphere-list uint32 :offset 16) + (hash-buckets uint32 :offset 20) + (to-spr-wait uint32 :offset-assert 88) + (from-spr-wait uint32 :offset-assert 92) + ) + :method-count-assert 22 + :size-assert #x60 + :flag-assert #x1600000060 + (:methods + (inc-spr-addr! (_type_ uint) uint 9) + (lay-out-spad-memory (_type_ nav-mesh) none 10) + (set-up-mem-work (_type_) none 11) + (add-spheres-from-mesh-user-list (_type_ sphere-hash nav-mesh) none 12) + (add-all-spheres (_type_) none 13) + (do-sphere-lookups (_type_) none 14) + (update-nav-controls-pipelined-in-spr (_type_) none 15) + (update-nav-controls-in-spr (_type_) none 16) + (upload-nav-to-spr (_type_ nav-engine-spr-buffer) none 17) + (download-nav-from-spr (_type_ nav-engine-spr-buffer) none 18) + (do-callbacks (_type_ nav-engine-spr-buffer) none 19) + (reloc-ptrs-to-spad (_type_ nav-engine-spr-buffer) none 20) + (reloc-ptrs-to-mem (_type_ nav-engine-spr-buffer) none 21) + ) + ) + +;; definition for method 3 of type nav-engine +(defmethod inspect nav-engine ((obj nav-engine)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'nav-engine) + (format #t "~1Tspr-addr: ~D~%" (-> obj spr-addr)) + (format #t "~1Tnav-work-addr: ~D~%" (-> obj nav-work-addr)) + (format #t "~1Tnav-mesh-addr: ~D~%" (-> obj nav-mesh-addr)) + (format #t "~1Tpoly-array-addr: ~D~%" (-> obj poly-array-addr)) + (format #t "~1Thash-sphere-addr: ~D~%" (-> obj hash-sphere-addr)) + (format #t "~1Thash-buckets-addr: ~D~%" (-> obj hash-buckets-addr)) + (format #t "~1Tbuf-nav-control-count: ~D~%" (-> obj buf-nav-control-count)) + (format #t "~1Tmax-pass-count: ~D~%" (-> obj max-pass-count)) + (format #t "~1Toutput-sphere-hash: ~D~%" (-> obj output-sphere-hash)) + (format #t "~1Twork-buf-array[3] @ #x~X~%" (-> obj work-buf-array)) + (format #t "~1Tspr-work: #~%" (-> obj nav-work-addr)) + (format #t "~1Tmem-work: #~%" (-> obj mem-work)) + (format #t "~1Tspr-mesh: ~A~%" (-> obj nav-mesh-addr)) + (format #t "~1Tmem-mesh: ~A~%" (-> obj mem-mesh)) + (format #t "~1Tspr-poly-array: #x~X~%" (-> obj poly-array-addr)) + (format #t "~1Tmem-poly-array: #x~X~%" (-> obj mem-poly-array)) + (format #t "~1Thash-sphere-list: #x~X~%" (-> obj hash-sphere-addr)) + (format #t "~1Thash-buckets: #x~X~%" (-> obj hash-buckets-addr)) + (format #t "~1Tto-spr-wait: ~D~%" (-> obj to-spr-wait)) + (format #t "~1Tfrom-spr-wait: ~D~%" (-> obj from-spr-wait)) + (label cfg-4) + obj + ) + +;; definition for method 9 of type nav-engine +(defmethod inc-spr-addr! nav-engine ((obj nav-engine) (arg0 uint)) + "Adds the given integer to `spr-addr` and returns it" + (let ((v0-0 (-> obj spr-addr))) + (+! (-> obj spr-addr) arg0) + v0-0 + ) + ) + +;; definition for method 10 of type nav-engine +;; WARN: Return type mismatch int vs none. +(defmethod lay-out-spad-memory nav-engine ((obj nav-engine) (arg0 nav-mesh)) + (let ((s5-0 0)) + (set! (-> obj spr-addr) (the-as uint #x70000060)) + (let* ((v1-1 obj) + (a1-1 320) + (a0-1 (-> v1-1 spr-addr)) + ) + (+! (-> v1-1 spr-addr) a1-1) + (set! (-> obj nav-work-addr) a0-1) + ) + (let* ((v1-2 obj) + (a1-3 112) + (a0-2 (-> v1-2 spr-addr)) + ) + (+! (-> v1-2 spr-addr) a1-3) + (set! (-> obj nav-mesh-addr) (the-as nav-mesh a0-2)) + ) + (if (and (= (-> *nav-mesh-work* polys-in-scratch) 1) (< (-> arg0 poly-count) (the-as uint 64))) + (set! s5-0 (the-as int (-> arg0 poly-count))) + ) + (let* ((v1-10 obj) + (a1-5 (* s5-0 64)) + (a0-4 (-> v1-10 spr-addr)) + ) + (+! (-> v1-10 spr-addr) a1-5) + (set! (-> obj poly-array-addr) a0-4) + ) + (let* ((v1-11 obj) + (a1-7 (* (-> arg0 sphere-hash max-object-count) 16)) + (a0-7 (-> v1-11 spr-addr)) + ) + (+! (-> v1-11 spr-addr) a1-7) + (set! (-> obj hash-sphere-addr) a0-7) + ) + (let* ((v1-12 obj) + (a1-9 0) + (a0-8 (-> v1-12 spr-addr)) + ) + (+! (-> v1-12 spr-addr) a1-9) + (set! (-> obj hash-buckets-addr) a0-8) + ) + (set! (-> obj buf-nav-control-count) 7) + (dotimes (v1-14 3) + (let ((a0-11 (-> obj work-buf-array v1-14))) + (let* ((a1-11 obj) + (a3-0 2048) + (a2-5 (-> a1-11 spr-addr)) + ) + (+! (-> a1-11 spr-addr) a3-0) + (set! (-> a0-11 spr-addr) (the-as (inline-array nav-control) a2-5)) + ) + (set! (-> a0-11 mem-addr) (the-as (pointer nav-mesh) 0)) + (set! (-> a0-11 q-size) (the-as uint 0)) + (set! (-> a0-11 nav-count) 0) + (set! (-> a0-11 i-pass) -1) + ) + ) + (set! (-> obj output-sphere-hash) (the-as uint 0)) + (set! (-> obj mem-mesh) arg0) + (cond + ((= (-> *nav-mesh-work* mesh-struct-in-scratch) 1) + (set! (-> obj nav-mesh-addr) (the-as nav-mesh (&-> (-> obj nav-mesh-addr) poly-array))) + (mem-copy! (&-> (-> obj nav-mesh-addr) type) (&-> arg0 type) 112) + ) + (else + (set! (-> obj nav-mesh-addr) arg0) + ) + ) + (set! (-> obj mem-work) (-> arg0 work)) + (if (= (-> *nav-mesh-work* work-struct-in-scratch) 1) + (quad-copy! (the-as pointer (-> obj nav-work-addr)) (the-as pointer (-> obj mem-work)) 20) + (set! (-> obj nav-work-addr) (the-as uint (-> arg0 work))) + ) + (set! (-> obj nav-mesh-addr work) (the-as nav-mesh-work (-> obj nav-work-addr))) + (set! (-> obj mem-poly-array) (-> arg0 poly-array)) + (when (> s5-0 0) + (quad-copy! (the-as pointer (-> obj poly-array-addr)) (the-as pointer (-> obj mem-poly-array)) (* s5-0 4)) + (set! (-> obj nav-mesh-addr poly-array) (the-as (inline-array nav-poly) (-> obj poly-array-addr))) + ) + ) + 0 + (none) + ) + +;; definition for method 11 of type nav-engine +;; WARN: Return type mismatch int vs none. +(defmethod set-up-mem-work nav-engine ((obj nav-engine)) + (let ((v1-0 (-> obj mem-mesh))) + (set! (-> v1-0 poly-array) (-> obj mem-poly-array)) + (set! (-> v1-0 work) (-> obj mem-work)) + ) + 0 + (none) + ) + +;; definition for method 12 of type nav-engine +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod add-spheres-from-mesh-user-list nav-engine ((obj nav-engine) (arg0 sphere-hash) (arg1 nav-mesh)) + (countdown (s3-0 (-> arg1 static-sphere-count)) + (add-a-sphere-with-flag arg0 (-> arg1 static-sphere s3-0) 64) + ) + (let* ((s4-1 (-> arg1 user-list)) + (v1-6 (-> s4-1 alive-list next0)) + (s3-1 (-> (the-as connection v1-6) next0)) + ) + (while (!= v1-6 (-> s4-1 alive-list-end)) + (let ((a0-4 (-> (the-as connection v1-6) param1)) + (s2-0 (the-as object (-> (the-as connection v1-6) param3))) + ) + (cond + ((-> (the-as connection v1-6) param2) + (let ((s1-0 (-> (the-as process-focusable a0-4) nav))) + (set! (-> s1-0 sec-per-frame) (-> (the-as process-focusable a0-4) clock seconds-per-frame)) + (set! (-> s1-0 root-nav-sphere quad) (-> (the-as collide-shape s2-0) trans quad)) + (set! (-> s1-0 root-nav-sphere w) (-> (the-as collide-shape s2-0) nav-radius)) + (if (logtest? (-> s1-0 flags) (nav-control-flag output-sphere-hash)) + (set! (-> obj output-sphere-hash) (the-as uint 1)) + ) + (if (logtest? (-> (the-as collide-shape s2-0) nav-flags) (nav-flags has-root-sphere)) + (set! (-> s1-0 root-sphere-id) + (the-as uint (add-a-sphere-with-flag + arg0 + (-> s1-0 root-nav-sphere) + (the-as int (-> (the-as collide-shape s2-0) backup-collide-as)) + ) + ) + ) + ) + (if (logtest? (-> (the-as collide-shape s2-0) nav-flags) (nav-flags has-extra-sphere)) + (add-a-sphere-with-flag + arg0 + (-> s1-0 extra-nav-sphere) + (the-as int (-> (the-as collide-shape s2-0) backup-collide-as)) + ) + ) + ) + ) + (else + (when (logtest? (-> (the-as collide-shape s2-0) nav-flags) (nav-flags has-root-sphere)) + (let ((a1-5 (new 'stack-no-clear 'vector))) + (set! (-> a1-5 quad) (-> (the-as collide-shape s2-0) trans quad)) + (set! (-> a1-5 w) (-> (the-as collide-shape s2-0) nav-radius)) + (add-a-sphere-with-flag arg0 a1-5 (the-as int (-> (the-as collide-shape s2-0) backup-collide-as))) + ) + ) + ) + ) + (when (logtest? (-> (the-as collide-shape s2-0) nav-flags) (nav-flags has-child-spheres)) + (let ((s2-1 (-> (the-as collide-shape s2-0) root-prim)) + (s1-1 1) + ) + (when (= (-> s2-1 prim-core prim-type) (prim-type group)) + (let ((v1-35 s2-1)) + (set! s2-1 (-> (the-as collide-shape-prim-group v1-35) child 0)) + (set! s1-1 (the-as int (-> v1-35 specific 0))) + ) + ) + (while (nonzero? s1-1) + (+! s1-1 -1) + (when (and (logtest? (collide-action nav-sphere) (-> s2-1 prim-core action)) + (= (-> s2-1 prim-core prim-type) (prim-type sphere)) + ) + (let ((a1-6 (new 'stack-no-clear 'vector))) + (set! (-> a1-6 quad) (-> s2-1 prim-core world-sphere quad)) + (set! (-> a1-6 w) (-> (the-as collide-shape-prim-sphere s2-1) nav-radius)) + (add-a-sphere-with-flag arg0 a1-6 (the-as int (-> s2-1 prim-core collide-as))) + ) + ) + (&+! s2-1 80) + ) + ) + ) + ) + (set! v1-6 s3-1) + (set! s3-1 (-> s3-1 next0)) + ) + ) + 0 + (none) + ) + +;; definition for method 13 of type nav-engine +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod add-all-spheres nav-engine ((obj nav-engine)) + (let ((s4-0 (-> obj nav-mesh-addr)) + (gp-0 (-> obj nav-mesh-addr sphere-hash)) + ) + (clear-objects! gp-0) + (set! (-> gp-0 bucket-array) (the-as (pointer grid-hash-word) (-> obj hash-buckets-addr))) + (set! (-> gp-0 sphere-array) (the-as (inline-array sphere) (-> obj hash-sphere-addr))) + (when *target* + (let ((a1-0 (new 'stack-no-clear 'nav-vertex))) + (let ((v1-8 (-> *target* control))) + (set! (-> a1-0 quad) (-> v1-8 trans quad)) + (set! (-> a1-0 w) (-> v1-8 nav-radius)) + ) + (add-a-sphere-with-flag gp-0 a1-0 2) + ) + ) + (add-spheres-from-mesh-user-list obj gp-0 s4-0) + (let ((s3-0 (the-as nav-mesh (-> s4-0 next-nav-mesh)))) + (while (and s3-0 (nonzero? s3-0)) + (add-spheres-from-mesh-user-list obj gp-0 s3-0) + (set! s3-0 (the-as nav-mesh (-> s3-0 next-nav-mesh))) + ) + ) + (let ((s4-1 (the-as nav-mesh (-> s4-0 prev-nav-mesh)))) + (while (and s4-1 (nonzero? s4-1)) + (add-spheres-from-mesh-user-list obj gp-0 s4-1) + (set! s4-1 (the-as nav-mesh (-> s4-1 prev-nav-mesh))) + ) + ) + (update-from-spheres gp-0) + ) + 0 + (none) + ) + +;; definition for method 14 of type nav-engine +;; WARN: Return type mismatch int vs none. +(defmethod do-sphere-lookups nav-engine ((obj nav-engine)) + (let ((s5-0 (-> obj nav-mesh-addr))) + (dotimes (s4-0 (the-as int (-> s5-0 nav-control-count))) + (let ((a0-3 (-> s5-0 nav-control-array s4-0))) + (when (-> a0-3 process) + (set! (-> a0-3 sphere-count) 0) + (set! (-> a0-3 state mesh) (-> obj nav-mesh-addr)) + (set! (-> obj mem-work nav) (the-as basic a0-3)) + (find-sphere-ids-from-sphere-hash a0-3 #f) + (set! (-> obj mem-work nav) #f) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition for function nav-dma-send-to-spr-no-flush +;; INFO: function output is handled by mips2c +(def-mips2c nav-dma-send-to-spr-no-flush (function pointer pointer int none)) + +;; definition for function nav-dma-send-from-spr-no-flush +;; INFO: function output is handled by mips2c +(def-mips2c nav-dma-send-from-spr-no-flush (function pointer pointer int none)) + +;; definition for function inc-mod3 +(defun inc-mod3 ((arg0 int)) + "Increments and returns the provided [[int]], if the value exceeds `2`, wrap back to `0`" + (local-vars (v0-1 int) (v1-1 int)) + (let ((v0-0 (+ arg0 1))) + (let ((v1-0 2)) + (set-on-less-than v1-1 v1-0 v0-0) + ) + (move-if-not-zero v0-1 0 v1-1 v0-0) + ) + v0-1 + ) + +;; definition for function nav-state-patch-pointers +;; INFO: function output is handled by mips2c +(def-mips2c nav-state-patch-pointers (function nav-state int none)) + +;; definition for method 17 of type nav-engine +;; INFO: function output is handled by mips2c +(defmethod-mips2c "(method 17 nav-engine)" 17 nav-engine) + +;; definition for method 18 of type nav-engine +;; INFO: function output is handled by mips2c +(defmethod-mips2c "(method 18 nav-engine)" 18 nav-engine) + +;; definition for method 19 of type nav-engine +;; WARN: Return type mismatch int vs none. +(defmethod do-callbacks nav-engine ((obj nav-engine) (arg0 nav-engine-spr-buffer)) + (local-vars (sv-16 nav-callback-info)) + (with-pp + (dotimes (s4-0 (-> arg0 nav-count)) + (let* ((a1-1 (-> arg0 spr-addr s4-0)) + (a0-3 (-> a1-1 process)) + ) + (set! sv-16 (-> a1-1 callback-info)) + (when a0-3 + (set! (-> a1-1 state nav) a1-1) + (when (and (logtest? (-> a1-1 flags) (nav-control-flag kernel-run)) sv-16) + (let ((s3-0 pp)) + (set! pp a0-3) + (set! (-> obj mem-mesh work nav) (the-as basic a1-1)) + (let ((v1-10 (-> sv-16 callback-count))) + (set! (-> obj max-pass-count) (max (-> obj max-pass-count) v1-10)) + (if (< (-> arg0 i-pass) v1-10) + ((-> sv-16 callback-array (-> arg0 i-pass)) a0-3 a1-1) + ) + ) + (set! pp s3-0) + ) + (set! (-> obj mem-mesh work nav) #f) + ) + ) + ) + ) + 0 + (none) + ) + ) + +;; definition for method 20 of type nav-engine +;; INFO: function output is handled by mips2c +(defmethod-mips2c "(method 20 nav-engine)" 20 nav-engine) + +;; definition for method 21 of type nav-engine +;; INFO: function output is handled by mips2c +(defmethod-mips2c "(method 21 nav-engine)" 21 nav-engine) + +;; definition for method 15 of type nav-engine +;; WARN: Return type mismatch int vs none. +(defmethod update-nav-controls-pipelined-in-spr nav-engine ((obj nav-engine)) + (local-vars + (v1-33 int) + (v1-45 int) + (v1-66 int) + (a0-14 int) + (a0-19 int) + (a0-26 int) + (sv-16 symbol) + (sv-24 int) + (sv-32 int) + (sv-40 uint) + (sv-44 (inline-array nav-control)) + (sv-48 nav-engine-spr-buffer) + ) + (flush-cache 0) + (set! (-> obj max-pass-count) 3) + (set! sv-16 (the-as symbol #f)) + (set! sv-24 0) + (set! sv-32 0) + (set! sv-40 (-> obj nav-mesh-addr nav-control-count)) + (set! sv-44 (-> obj nav-mesh-addr nav-control-array)) + (let ((s5-0 2) + (s3-0 1) + (s4-0 0) + ) + (while (not sv-16) + (let ((s2-0 (-> obj work-buf-array s5-0))) + (set! (-> s2-0 i-nav) (the-as uint sv-32)) + (set! (-> s2-0 nav-count) (min (-> obj buf-nav-control-count) (the-as int (- sv-40 (the-as uint sv-32))))) + (set! (-> s2-0 i-pass) sv-24) + (set! (-> s2-0 mem-addr) (the-as (pointer nav-mesh) (-> sv-44 sv-32))) + (set! (-> s2-0 q-size) (the-as uint (* 18 (-> s2-0 nav-count)))) + (set! (-> s2-0 done) 0) + (when (>= sv-24 (-> obj max-pass-count)) + (set! (-> s2-0 nav-count) 0) + 0 + ) + (if (> (-> s2-0 nav-count) 0) + (upload-nav-to-spr obj s2-0) + (dma-sync (the-as pointer #x1000d400) 0 0) + ) + (set! sv-32 (+ sv-32 (-> s2-0 nav-count))) + (when (>= sv-32 (the-as int sv-40)) + (set! sv-32 0) + (set! sv-24 (+ sv-24 1)) + (if (= sv-24 (-> obj max-pass-count)) + (set! (-> s2-0 done) 1) + ) + ) + ) + (let ((v1-32 (+ s5-0 1))) + (let ((a0-13 2)) + (set-on-less-than a0-14 a0-13 v1-32) + ) + (move-if-not-zero v1-33 0 a0-14 v1-32) + ) + (set! s5-0 v1-33) + (let ((s2-1 (-> obj work-buf-array s4-0))) + (when (> (-> s2-1 nav-count) 0) + (download-nav-from-spr obj s2-1) + (when (= (-> s2-1 done) 1) + (dma-sync (the-as pointer #x1000d000) 0 0) + (set! sv-16 #t) + ) + ) + ) + (let ((v1-44 (+ s4-0 1))) + (let ((a0-18 2)) + (set-on-less-than a0-19 a0-18 v1-44) + ) + (move-if-not-zero v1-45 0 a0-19 v1-44) + ) + (set! s4-0 v1-45) + (set! sv-48 (-> obj work-buf-array s3-0)) + (when (> (-> sv-48 nav-count) 0) + (if (zero? (-> sv-48 i-pass)) + (reloc-ptrs-to-spad obj sv-48) + ) + (do-callbacks obj sv-48) + (if (= (-> sv-48 i-pass) (+ (-> obj max-pass-count) -1)) + (reloc-ptrs-to-mem obj sv-48) + ) + ) + (let ((v1-65 (+ s3-0 1))) + (let ((a0-25 2)) + (set-on-less-than a0-26 a0-25 v1-65) + ) + (move-if-not-zero v1-66 0 a0-26 v1-65) + ) + (set! s3-0 v1-66) + ) + ) + 0 + (none) + ) + +;; definition for method 16 of type nav-engine +;; WARN: Return type mismatch int vs none. +(defmethod update-nav-controls-in-spr nav-engine ((obj nav-engine)) + (flush-cache 0) + (set! (-> obj max-pass-count) 1) + (let ((gp-0 (the-as object (-> obj work-buf-array)))) + (set! (-> (the-as (inline-array nav-engine-spr-buffer) gp-0) 0 i-nav) (the-as uint 0)) + (set! (-> (the-as (inline-array nav-engine-spr-buffer) gp-0) 0 nav-count) + (the-as int (-> obj nav-mesh-addr nav-control-count)) + ) + (set! (-> (the-as (inline-array nav-engine-spr-buffer) gp-0) 0 i-pass) 0) + (set! (-> (the-as (inline-array nav-engine-spr-buffer) gp-0) 0 mem-addr) + (the-as (pointer nav-mesh) (-> obj nav-mesh-addr nav-control-array)) + ) + (set! (-> (the-as (inline-array nav-engine-spr-buffer) gp-0) 0 q-size) + (the-as uint (* 18 (-> (the-as (inline-array nav-engine-spr-buffer) gp-0) 0 nav-count))) + ) + (set! (-> (the-as (inline-array nav-engine-spr-buffer) gp-0) 0 done) 0) + (when (> (-> (the-as (inline-array nav-engine-spr-buffer) gp-0) 0 nav-count) 0) + (upload-nav-to-spr obj (the-as nav-engine-spr-buffer gp-0)) + (dma-sync (the-as pointer #x1000d400) 0 0) + (reloc-ptrs-to-spad obj (the-as nav-engine-spr-buffer gp-0)) + (while (< (-> (the-as (inline-array nav-engine-spr-buffer) gp-0) 0 i-pass) (-> obj max-pass-count)) + (do-callbacks obj (the-as nav-engine-spr-buffer gp-0)) + (+! (-> (the-as (inline-array nav-engine-spr-buffer) gp-0) 0 i-pass) 1) + ) + (reloc-ptrs-to-mem obj (the-as nav-engine-spr-buffer gp-0)) + (dotimes (s4-0 (-> (the-as (inline-array nav-engine-spr-buffer) gp-0) 0 nav-count)) + (let ((a2-1 (-> (the-as (inline-array nav-engine-spr-buffer) gp-0) 0 spr-addr s4-0 state mesh))) + (when (>= (the-as uint a2-1) (the-as uint #x70000000)) + (format 0 "nav-engine::update-nav-controls-in-spr: (pre-dma) bad mesh pointer found (#x0~x)~%" a2-1) + (break!) + 0 + ) + ) + ) + (download-nav-from-spr obj (the-as nav-engine-spr-buffer gp-0)) + (dma-sync (the-as pointer #x1000d000) 0 0) + (dotimes (s5-1 (-> (the-as (inline-array nav-engine-spr-buffer) gp-0) 0 nav-count)) + (let ((a2-3 (-> (&+ (-> (the-as nav-engine-spr-buffer gp-0) mem-addr) (* 288 s5-1)) 31))) + (when (>= (the-as uint a2-3) (the-as uint #x70000000)) + (format 0 "nav-engine::update-nav-controls-in-spr: (post-dma) bad mesh pointer found (#x0~x)~%" a2-3) + (break!) + 0 + ) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 26 of type nav-mesh +;; WARN: Return type mismatch int vs none. +(defmethod update-navigation nav-mesh ((obj nav-mesh)) + (local-vars (sp-0 int)) + (when (zero? (-> obj next-nav-mesh)) + (set! (-> obj next-nav-mesh) (the-as surface (nav-mesh-from-res-tag (-> obj entity) 'next-actor 0))) + (set! (-> obj prev-nav-mesh) (the-as surface (nav-mesh-from-res-tag (-> obj entity) 'prev-actor 0))) + ) + (when (> (-> obj nav-control-count) 0) + (the-as none sp-0) + (set! sp-0 #x70003fc0) + (set! (-> obj work mesh) obj) + (let ((s4-0 (the-as nav-engine #x70000000))) + (lay-out-spad-memory s4-0 obj) + (add-all-spheres s4-0) + (do-sphere-lookups s4-0) + (when (nonzero? (-> s4-0 output-sphere-hash)) + (let ((s3-0 (-> s4-0 nav-mesh-addr sphere-hash))) + (quad-copy! (-> s3-0 mem-bucket-array) (-> s3-0 bucket-array) (/ (-> s3-0 bucket-memory-size) 16)) + (quad-copy! + (the-as pointer (-> s3-0 mem-sphere-array)) + (the-as pointer (-> s3-0 sphere-array)) + (-> s3-0 object-count) + ) + (set! (-> s3-0 bucket-array) (-> s3-0 mem-bucket-array)) + (set! (-> s3-0 sphere-array) (the-as (inline-array sphere) (-> s3-0 mem-sphere-array))) + ) + ) + (if (< (the-as uint (* 3 (-> s4-0 buf-nav-control-count))) (-> obj nav-control-count)) + (update-nav-controls-pipelined-in-spr s4-0) + (update-nav-controls-in-spr s4-0) + ) + (set-up-mem-work s4-0) + ) + ) + 0 + (none) + ) + +;; definition for method 9 of type nav-mesh +;; WARN: Return type mismatch int vs none. +(defmethod debug-draw nav-mesh ((obj nav-mesh)) + (local-vars (sv-32 vector) (sv-36 int)) + (set! sv-32 (new 'stack-no-clear 'vector)) + (set! sv-36 16) + (add-debug-sphere + (logtest? sv-36 4) + (bucket-id debug2) + (-> obj bounds) + (-> obj bounds w) + (new 'static 'rgba :r #xff :g #xff :a #x20) + ) + (add-debug-vector #t (bucket-id debug-no-zbuf1) (-> obj bounds) *x-vector* (meters 1) *color-red*) + (add-debug-vector #t (bucket-id debug-no-zbuf1) (-> obj bounds) *z-vector* (meters 1) *color-blue*) + (when (logtest? sv-36 16) + (dotimes (s5-0 (the-as int (-> obj static-sphere-count))) + (add-debug-sphere + #t + (bucket-id debug2) + (-> obj static-sphere s5-0) + (-> obj static-sphere s5-0 r) + *color-light-blue* + ) + (let ((s4-0 add-debug-text-3d) + (s3-0 #t) + (s2-0 318) + ) + (format (clear *temp-string*) "~D" s5-0) + (s4-0 + s3-0 + (the-as bucket-id s2-0) + *temp-string* + (-> obj static-sphere s5-0) + (font-color cyan-#00fefe) + (the-as vector2h #f) + ) + ) + ) + (dotimes (s5-1 (the-as int (-> obj poly-count))) + (let ((s4-1 (-> obj poly-array s5-1))) + (debug-draw-poly obj s4-1 (cond + ((logtest? (the-as int (-> s4-1 pat)) 1) + *color-black* + ) + ((logtest? (the-as int (-> s4-1 pat)) 2) + *color-gray* + ) + ((logtest? (the-as int (-> s4-1 pat)) 4) + (if (-> obj link-array (-> s4-1 link) dest-mesh) + *color-green* + *color-light-red* + ) + ) + (else + *color-cyan* + ) + ) + ) + (when (logtest? sv-36 32) + (let ((s3-1 add-debug-text-3d) + (s2-1 #t) + (s1-1 318) + ) + (format (clear *temp-string*) "~D" (-> s4-1 id)) + (s3-1 + s2-1 + (the-as bucket-id s1-1) + *temp-string* + (poly-centroid obj s4-1 sv-32) + (font-color cyan-#00fefe) + (the-as vector2h #f) + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 12 of type nav-mesh +(defmethod poly-centroid-local nav-mesh ((obj nav-mesh) (arg0 nav-poly) (arg1 vector)) + (rlet ((vf0 :class vf)) + (init-vf0-vector) + (let ((v1-0 (new 'stack-no-clear 'nav-vertex))) + (.svf (&-> v1-0 quad) vf0) + (dotimes (a0-2 (the-as int (-> arg0 vertex-count))) + (vector+! (the-as vector v1-0) (the-as vector v1-0) (-> arg0 vertex a0-2)) + ) + (vector-float*! arg1 (the-as vector v1-0) (/ 1.0 (the float (-> arg0 vertex-count)))) + ) + ) + ) + +;; definition for method 11 of type nav-mesh +(defmethod poly-centroid nav-mesh ((obj nav-mesh) (arg0 nav-poly) (arg1 vector)) + (poly-centroid-local obj arg0 arg1) + (vector+! arg1 arg1 (-> obj bounds)) + ) + +;; definition for function vu-point-triangle-intersection? +(defun vu-point-triangle-intersection? ((arg0 vector) (arg1 vector) (arg2 vector) (arg3 vector)) + (local-vars (v1-0 float) (v1-1 int) (v1-3 int) (a0-1 float) (a0-2 int) (a0-4 int) (a1-1 float) (a1-2 int)) + (rlet ((acc :class vf) + (vf1 :class vf) + (vf10 :class vf) + (vf11 :class vf) + (vf12 :class vf) + (vf13 :class vf) + (vf14 :class vf) + (vf15 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf9 :class vf) + ) + (.lvf vf1 (&-> arg1 quad)) + (.lvf vf2 (&-> arg2 quad)) + (.sub.vf vf1 vf1 vf1 :mask #b1010) + (.lvf vf3 (&-> arg3 quad)) + (.sub.vf vf2 vf2 vf2 :mask #b1010) + (.lvf vf12 (&-> arg0 quad)) + (.sub.vf vf3 vf3 vf3 :mask #b1010) + (.sub.vf vf4 vf2 vf1) + (.sub.vf vf9 vf1 vf12) + (.sub.vf vf5 vf3 vf2) + (.sub.vf vf10 vf2 vf12) + (.sub.vf vf6 vf1 vf3) + (.sub.vf vf11 vf3 vf12) + (.outer.product.a.vf acc vf9 vf4) + (.outer.product.b.vf vf13 vf4 vf9 acc) + (.outer.product.a.vf acc vf10 vf5) + (.outer.product.b.vf vf14 vf5 vf10 acc) + (.outer.product.a.vf acc vf11 vf6) + (.outer.product.b.vf vf15 vf6 vf11 acc) + (.mov v1-0 vf13) + (.mov a1-1 vf14) + (.mov a0-1 vf15) + (set-on-less-than v1-1 v1-0 0) + (set-on-less-than a1-2 a1-1 0) + (set-on-less-than a0-2 a0-1 0) + (let ((a0-3 (logxor a1-2 a0-2)) + (v1-2 (logxor v1-1 a1-2)) + ) + (set-on-less-than a0-4 a0-3 1) + (set-on-less-than v1-3 v1-2 1) + ) + (logtest? v1-3 a0-4) + ) + ) + +;; definition for function poly-in-height-range? +(defun poly-in-height-range? ((arg0 nav-poly) (arg1 float) (arg2 float)) + (and (>= (+ (-> arg0 vertex3 w) arg2) arg1) (>= arg1 (- (-> arg0 vertex2 w) arg2))) + ) + +;; definition for method 42 of type nav-mesh +(defmethod find-poly-containing-point-local nav-mesh ((obj nav-mesh) (arg0 nav-find-poly-parms)) + (local-vars (v1-6 symbol) (v1-15 int) (a0-3 symbol) (sv-16 nav-poly)) + (let ((s4-0 (search-for-point (-> obj poly-hash) (-> arg0 point))) + (s3-0 (-> obj poly-hash bucket-size)) + (s2-0 0) + ) + (until (zero? v1-15) + (let ((s1-0 (* s2-0 8)) + (s0-0 (-> s4-0 0)) + ) + (b! (zero? s0-0) cfg-17 :delay (nop!)) + (label cfg-2) + (let ((v1-2 (logand s0-0 1))) + (nop!) + (b! (zero? v1-2) cfg-16 :delay (nop!)) + ) + (set! sv-16 (-> obj poly-array s1-0)) + (let ((v1-5 sv-16) + (f0-0 (-> arg0 point y)) + (f1-0 (-> arg0 y-threshold)) + ) + (b! (>= (+ (-> v1-5 vertex3 w) f1-0) f0-0) cfg-5 :delay (set! a0-3 #t)) + (set! a0-3 #f) + (label cfg-5) + (set! v1-6 (and a0-3 (begin (b! (>= f0-0 (- (-> v1-5 vertex2 w) f1-0)) cfg-9 :delay (set! v1-6 #t)) #f))) + ) + (label cfg-9) + (when (and v1-6 (zero? (logand (-> sv-16 pat) (-> arg0 ignore)))) + (if (point-in-poly? obj sv-16 (-> arg0 point)) + (return sv-16) + ) + ) + (label cfg-16) + (set! s0-0 (the-as uint (/ (the-as int s0-0) 2))) + (nop!) + (b! (nonzero? s0-0) cfg-2 :delay (set! s1-0 (+ s1-0 1))) + ) + (label cfg-17) + (+! s2-0 1) + (set! s4-0 (&-> s4-0 1)) + (set-on-less-than v1-15 s2-0 s3-0) + (nop!) + ) + ) + 0 + (the-as nav-poly #f) + ) + +;; definition for method 44 of type nav-mesh +;; INFO: Used lq/sq +;; WARN: Stack slot offset 24 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 24 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +(defmethod is-in-mesh-local? nav-mesh ((obj nav-mesh) (arg0 vector) (arg1 float) (arg2 float)) + (local-vars (v1-3 float) (sv-16 float) (sv-20 vector) (sv-24 float)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (set! sv-16 arg2) + (set! sv-20 arg0) + (set! sv-24 arg1) + (let* ((f0-3 (+ sv-24 (-> obj bounds w))) + (f0-5 (* f0-3 f0-3)) + ) + (.lvf vf1 (&-> sv-20 quad)) + (.add.w.vf vf2 vf0 vf0 :mask #b1) + (.mul.vf vf1 vf1 vf1) + (.mul.x.vf acc vf2 vf1 :mask #b1) + (.add.mul.y.vf acc vf2 vf1 acc :mask #b1) + (.add.mul.z.vf vf1 vf2 vf1 acc :mask #b1) + (.mov v1-3 vf1) + (when (>= f0-5 v1-3) + (let ((s5-0 (new 'stack-no-clear 'nav-find-poly-parms))) + (set! (-> s5-0 point quad) (-> sv-20 quad)) + (set! (-> s5-0 y-threshold) sv-16) + (set! (-> s5-0 ignore) (the-as uint 2)) + (find-nearest-poly-to-point-local obj s5-0) + (cond + ((-> s5-0 point-inside?) + #t + ) + (else + (let ((s4-0 (new 'stack-no-clear 'vector))) + (project-point-into-poly-2d obj (-> s5-0 poly) s4-0 sv-20) + (let ((f0-7 (vector-vector-xz-distance-squared s4-0 sv-20)) + (f1-2 sv-24) + ) + (< f0-7 (* f1-2 f1-2)) + ) + ) + ) + ) + ) + ) + ) + ) + ) + +;; definition for function init-ray-local +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defun init-ray-local ((arg0 nav-ray) (arg1 nav-poly) (arg2 vector) (arg3 vector)) + (rlet ((acc :class vf) + (Q :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + ) + (init-vf0-vector) + (set! (-> arg0 current-pos quad) (-> arg2 quad)) + (set! (-> arg0 dest-pos quad) (-> arg3 quad)) + (set! (-> arg0 current-poly) arg1) + (let ((v1-2 arg0)) + (vector-! (-> v1-2 dir) (-> v1-2 dest-pos) (-> v1-2 current-pos)) + (set! (-> v1-2 dir y) 0.0) + (let ((a0-2 (-> v1-2 dir))) + (let ((f0-1 1.0)) + (.lvf vf1 (&-> a0-2 quad)) + (.mul.vf vf2 vf1 vf1 :mask #b111) + (let ((a1-3 f0-1)) + (.mov vf3 a1-3) + ) + ) + (.mul.x.vf acc vf0 vf2 :mask #b1000) + (.add.mul.y.vf acc vf0 vf2 acc :mask #b1000) + (.add.mul.z.vf vf2 vf0 vf2 acc :mask #b1000) + (.isqrt.vf Q vf3 vf2 :fsf #b0 :ftf #b11) + (.wait.vf) + (.mul.vf vf1 vf1 Q :mask #b111) + (.nop.vf) + (.nop.vf) + (.nop.vf) + (.svf (&-> a0-2 quad) vf1) + ) + (set! (-> v1-2 next-poly) #f) + (set! (-> v1-2 len) 0.0) + (set! (-> v1-2 last-edge) -1) + (set! (-> v1-2 terminated) #f) + (set! (-> v1-2 reached-dest) #f) + (set! (-> v1-2 hit-boundary) #f) + (set! (-> v1-2 hit-gap) #f) + (set! (-> v1-2 ignore) (the-as uint 3)) + ) + 0 + (none) + ) + ) + +;; definition for function init-ray-dir-local +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defun init-ray-dir-local ((arg0 nav-ray) (arg1 nav-poly) (arg2 vector) (arg3 vector) (arg4 float)) + (rlet ((acc :class vf) + (Q :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (set! (-> arg0 current-poly) arg1) + (set! (-> arg0 current-pos quad) (-> arg2 quad)) + (let ((a1-3 (-> arg0 dest-pos))) + (let ((v1-1 (-> arg0 current-pos))) + (let ((a2-1 arg3)) + (let ((a3-1 arg4)) + (.mov vf7 a3-1) + ) + (.lvf vf5 (&-> a2-1 quad)) + ) + (.lvf vf4 (&-> v1-1 quad)) + ) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> a1-3 quad) vf6) + ) + (let ((v1-2 arg0)) + (vector-! (-> v1-2 dir) (-> v1-2 dest-pos) (-> v1-2 current-pos)) + (set! (-> v1-2 dir y) 0.0) + (let ((a0-2 (-> v1-2 dir))) + (let ((f0-2 1.0)) + (.lvf vf1 (&-> a0-2 quad)) + (.mul.vf vf2 vf1 vf1 :mask #b111) + (let ((a1-6 f0-2)) + (.mov vf3 a1-6) + ) + ) + (.mul.x.vf acc vf0 vf2 :mask #b1000) + (.add.mul.y.vf acc vf0 vf2 acc :mask #b1000) + (.add.mul.z.vf vf2 vf0 vf2 acc :mask #b1000) + (.isqrt.vf Q vf3 vf2 :fsf #b0 :ftf #b11) + (.wait.vf) + (.mul.vf vf1 vf1 Q :mask #b111) + (.nop.vf) + (.nop.vf) + (.nop.vf) + (.svf (&-> a0-2 quad) vf1) + ) + (set! (-> v1-2 next-poly) #f) + (set! (-> v1-2 len) 0.0) + (set! (-> v1-2 last-edge) -1) + (set! (-> v1-2 terminated) #f) + (set! (-> v1-2 reached-dest) #f) + (set! (-> v1-2 hit-boundary) #f) + (set! (-> v1-2 hit-gap) #f) + (set! (-> v1-2 ignore) (the-as uint 3)) + ) + 0 + (none) + ) + ) + +;; definition for method 17 of type nav-mesh +(defmethod try-move-along-ray nav-mesh ((obj nav-mesh) (arg0 nav-poly) (arg1 vector) (arg2 vector) (arg3 float)) + (local-vars (v1-2 symbol)) + (let ((gp-0 (new 'stack-no-clear 'nav-ray))) + (let ((s4-0 0)) + (init-ray-dir-local gp-0 arg0 arg1 arg2 arg3) + (until v1-2 + (+! s4-0 1) + (move-along-nav-ray! obj gp-0) + (set! v1-2 (or (>= s4-0 15) (-> gp-0 terminated))) + ) + ) + (-> gp-0 len) + ) + ) + +;; definition for function nav-ray-test +(defun nav-ray-test ((arg0 nav-mesh) (arg1 nav-poly) (arg2 vector) (arg3 vector)) + (let ((s4-1 (vector-! (new 'stack-no-clear 'vector) arg2 (-> arg0 bounds))) + (s3-1 (vector-! (new 'stack-no-clear 'vector) arg3 arg2)) + ) + 0.0 + (set! (-> s3-1 y) 0.0) + (let ((f30-0 (vector-vector-xz-distance arg2 arg3))) + (vector-xz-normalize! s3-1 1.0) + (try-move-along-ray arg0 arg1 s4-1 s3-1 f30-0) + ) + ) + ) + +;; definition for function point-poly-distance-min +(defun point-poly-distance-min ((arg0 nav-mesh-work) (arg1 nav-poly) (arg2 float) (arg3 nav-poly)) + (let ((t0-0 (-> arg3 vertex-count)) + (a3-1 (-> arg3 vertex)) + (f0-0 arg2) + ) + (let ((v1-0 0)) + (let ((f1-0 (-> arg1 vertex0 x)) + (f2-0 (-> arg1 vertex0 z)) + (a1-1 0) + ) + (b! #t cfg-10 :delay (nop!)) + (label cfg-1) + (let* ((t2-0 (-> a3-1 (-> arg0 vert0-table a1-1))) + (t1-6 (-> a3-1 (-> arg0 vert1-table a1-1))) + (f5-0 (- (-> t1-6 x) (-> t2-0 x))) + (f6-0 (- (-> t1-6 z) (-> t2-0 z))) + (f4-2 (- f1-0 (-> t2-0 x))) + (f3-4 (- f2-0 (-> t2-0 z))) + (f7-1 (- (* f5-0 f3-4) (* f6-0 f4-2))) + ) + (b! (>= 0.0 f7-1) cfg-9 :delay #f) + (+! v1-0 1) + (let* ((f8-2 f5-0) + (f8-4 (* f8-2 f8-2)) + (f9-0 f6-0) + (f8-5 (+ f8-4 (* f9-0 f9-0))) + ) + (let* ((f9-3 arg2) + (f9-6 (* f8-5 (* f9-3 f9-3))) + (f10-0 f7-1) + ) + (b! (< f9-6 (* f10-0 f10-0)) cfg-13) + ) + (let ((f5-2 (+ (* f5-0 f4-2) (* f6-0 f3-4)))) + arg2 + (b! (>= f5-2 0.0) cfg-5) + (let ((f3-8 (sqrtf (+ (* f4-2 f4-2) (* f3-4 f3-4))))) + (b! #t cfg-8 :delay (nop!)) + (label cfg-5) + (b! (>= f8-5 f5-2) cfg-7) + (let* ((f3-10 (- f1-0 (-> t1-6 x))) + (f3-12 (* f3-10 f3-10)) + (f4-6 (- f2-0 (-> t1-6 z))) + ) + (set! f3-8 (sqrtf (+ f3-12 (* f4-6 f4-6)))) + ) + (b! #t cfg-8 :delay (nop!)) + (label cfg-7) + (set! f0-0 (/ f7-1 (sqrtf f8-5))) + (b! #t cfg-13 :delay (nop!)) + (label cfg-8) + (set! f0-0 (fmin f0-0 f3-8)) + ) + ) + ) + ) + (label cfg-9) + (+! a1-1 1) + (label cfg-10) + (b! (< a1-1 (the-as int t0-0)) cfg-1) + ) + (b! (nonzero? v1-0) cfg-13 :delay (empty-form)) + ) + (set! f0-0 0.0) + (label cfg-13) + f0-0 + ) + ) + +;; definition for method 43 of type nav-mesh +;; WARN: Stack slot offset 28 signed mismatch +;; WARN: Stack slot offset 52 signed mismatch +;; WARN: Stack slot offset 28 signed mismatch +;; WARN: Stack slot offset 52 signed mismatch +;; WARN: Stack slot offset 28 signed mismatch +;; WARN: Stack slot offset 28 signed mismatch +;; WARN: Stack slot offset 52 signed mismatch +;; WARN: Stack slot offset 28 signed mismatch +;; WARN: Stack slot offset 52 signed mismatch +;; WARN: Stack slot offset 28 signed mismatch +;; WARN: Stack slot offset 28 signed mismatch +;; WARN: Stack slot offset 52 signed mismatch +;; WARN: Stack slot offset 28 signed mismatch +;; WARN: Stack slot offset 52 signed mismatch +;; WARN: Stack slot offset 28 signed mismatch +;; WARN: Stack slot offset 28 signed mismatch +;; WARN: Stack slot offset 52 signed mismatch +;; WARN: Stack slot offset 28 signed mismatch +;; WARN: Stack slot offset 52 signed mismatch +;; WARN: Stack slot offset 28 signed mismatch +(defmethod find-nearest-poly-to-point-local nav-mesh ((obj nav-mesh) (arg0 nav-find-poly-parms)) + (local-vars + (v1-16 int) + (v1-34 int) + (sv-16 nav-poly) + (sv-20 (pointer uint8)) + (sv-24 nav-poly) + (sv-28 float) + (sv-32 int) + (sv-40 int) + (sv-48 nav-poly) + (sv-52 float) + ) + (set! sv-16 (the-as nav-poly #f)) + (set! sv-20 (search-for-sphere (-> obj poly-hash) (-> arg0 point) 12288.0)) + (set! (-> arg0 point-inside?) #f) + (let ((s4-0 (-> obj poly-hash bucket-size)) + (s3-0 sv-20) + (s2-0 0) + ) + (nop!) + (label cfg-1) + (let ((s1-0 (* s2-0 8)) + (s0-0 (-> s3-0 0)) + ) + (b! (zero? s0-0) cfg-17 :delay (nop!)) + (label cfg-2) + (let ((v1-3 (logand s0-0 1))) + (nop!) + (b! (zero? v1-3) cfg-16 :delay (nop!)) + ) + (set! sv-24 (-> obj poly-array s1-0)) + (let ((v1-6 sv-24) + (f0-0 (-> arg0 point y)) + (f1-0 (-> arg0 y-threshold)) + ) + (b! + (not (and (and (>= (+ (-> v1-6 vertex3 w) f1-0) f0-0) (>= f0-0 (- (-> v1-6 vertex2 w) f1-0))) + (zero? (logand (-> sv-24 pat) (-> arg0 ignore))) + ) + ) + cfg-16 + :delay (empty-form) + ) + ) + (b! (not (point-in-poly? obj sv-24 (-> arg0 point))) cfg-16 :delay (empty-form)) + (set! (-> arg0 point-inside?) #t) + (set! (-> arg0 dist) 0.0) + (set! sv-16 sv-24) + (b! #t cfg-38 :delay (nop!)) + (nop!) + (label cfg-16) + (set! s0-0 (the-as uint (/ (the-as int s0-0) 2))) + (nop!) + (b! (nonzero? s0-0) cfg-2 :delay (set! s1-0 (+ s1-0 1))) + ) + (label cfg-17) + (+! s2-0 1) + (set! s3-0 (&-> s3-0 1)) + (set-on-less-than v1-16 s2-0 s4-0) + ) + (nop!) + (b! (nonzero? v1-16) cfg-1 :delay (nop!)) + (set! sv-28 (the-as float 10000000000000000000000000000000000000.0)) + (set! sv-32 0) + (set! sv-40 0) + (let ((s4-1 (-> obj poly-hash bucket-size)) + (s3-1 sv-20) + (s2-1 0) + ) + (until (zero? v1-34) + (let ((s1-1 (* s2-1 8)) + (s0-1 (-> s3-1 0)) + ) + (b! (zero? s0-1) cfg-34 :delay (nop!)) + (label cfg-20) + (let ((v1-19 (logand s0-1 1))) + (nop!) + (b! (zero? v1-19) cfg-33 :delay (nop!)) + ) + (set! sv-48 (-> obj poly-array s1-1)) + (let ((v1-22 sv-48) + (f0-3 (-> arg0 point y)) + (f1-2 (-> arg0 y-threshold)) + ) + (when (and (and (>= (+ (-> v1-22 vertex3 w) f1-2) f0-3) (>= f0-3 (- (-> v1-22 vertex2 w) f1-2))) + (zero? (logand (-> sv-48 pat) (-> arg0 ignore))) + ) + (set! sv-40 (+ sv-40 1)) + (set! sv-52 (point-poly-distance-min (-> obj work) (the-as nav-poly (-> arg0 point)) sv-28 sv-48)) + (when (< sv-52 sv-28) + (set! sv-28 sv-52) + (set! sv-16 sv-48) + (nop!) + ) + ) + ) + (label cfg-33) + (set! s0-1 (the-as uint (/ (the-as int s0-1) 2))) + (nop!) + (b! (nonzero? s0-1) cfg-20 :delay (set! s1-1 (+ s1-1 1))) + ) + (label cfg-34) + (+! s2-1 1) + (set! s3-1 (&-> s3-1 1)) + (set-on-less-than v1-34 s2-1 s4-1) + (nop!) + ) + ) + (if (not sv-16) + (set! sv-16 (-> obj poly-array 0)) + ) + (set! (-> arg0 dist) sv-28) + (label cfg-38) + (set! (-> arg0 poly) sv-16) + arg0 + ) + +;; definition for function nav-mesh-route-table-bit-index +(defun nav-mesh-route-table-bit-index ((arg0 nav-mesh) (arg1 uint) (arg2 int)) + (* (+ arg2 (* arg1 (-> arg0 poly-count))) 2) + ) + +;; definition for method 14 of type nav-mesh +;; INFO: Used lq/sq +(defmethod get-route-portal nav-mesh ((obj nav-mesh) (arg0 nav-poly) (arg1 nav-poly) (arg2 nav-route-portal)) + (set! (-> arg2 next-poly) #f) + (cond + ((and arg0 arg1 (!= arg0 arg1)) + (let* ((a1-1 obj) + (v1-1 (-> arg0 id)) + (v1-4 (* (+ (-> arg1 id) (* (the-as uint v1-1) (-> a1-1 poly-count))) 2)) + (s3-0 + (logand (ash (-> (the-as (pointer uint8) (&+ (-> obj route) (shr v1-4 3)))) (- (the-as int (logand v1-4 7)))) + 3 + ) + ) + ) + (set! (-> arg2 edge-index) -1) + (let ((s2-0 (-> arg0 adj-poly s3-0))) + (when (= s2-0 255) + (format 0 "nav-mesh::get-route-portal: data error in nav mesh~%") + (break!) + 0 + ) + (set! (-> arg2 edge-index) (the-as int s3-0)) + (set! (-> arg2 next-poly) (-> obj poly-array s2-0)) + ) + (let ((a0-7 s3-0) + (v1-16 (the-as int (+ s3-0 1))) + ) + (if (>= (the-as uint v1-16) (the-as uint (-> arg0 vertex-count))) + (set! v1-16 0) + ) + (set! (-> arg2 vertex 1 quad) (-> arg0 vertex a0-7 quad)) + (let ((v0-1 (-> arg2 vertex))) + (set! (-> v0-1 0 quad) (-> arg0 vertex v1-16 quad)) + v0-1 + ) + ) + ) + ) + (else + (the-as (inline-array nav-vertex) #f) + ) + ) + ) + +;; definition for method 13 of type nav-mesh +(defmethod lookup-poly-on-route-to-target nav-mesh ((obj nav-mesh) (arg0 nav-poly) (arg1 nav-poly)) + (cond + ((and arg0 arg1 (!= arg0 arg1)) + (let* ((a3-0 obj) + (v1-1 (-> arg0 id)) + (v1-4 (* (+ (-> arg1 id) (* (the-as uint v1-1) (-> a3-0 poly-count))) 2)) + (v1-9 + (logand (ash (-> (the-as (pointer uint8) (&+ (-> obj route) (shr v1-4 3)))) (- (the-as int (logand v1-4 7)))) + 3 + ) + ) + (a2-5 (new 'stack-no-clear 'array 'int8 4)) + ) + (set! (-> a2-5 0) (the-as int (-> arg0 adj-poly0))) + (set! (-> a2-5 1) (the-as int (-> arg0 adj-poly1))) + (set! (-> a2-5 2) (the-as int (-> arg0 adj-poly2))) + (set! (-> a2-5 3) (the-as int (-> arg0 adj-poly3))) + (let ((v1-11 (-> (the-as (pointer uint8) (&+ a2-5 v1-9))))) + (if (= v1-11 255) + (the-as nav-poly #f) + (-> obj poly-array v1-11) + ) + ) + ) + ) + (else + (the-as nav-poly #f) + ) + ) + ) + +;; definition for method 22 of type nav-mesh +;; WARN: Return type mismatch int vs none. +(defmethod compute-bounding-box-from-vertices nav-mesh ((obj nav-mesh) (arg0 vector) (arg1 vector)) + (let ((f0-0 10000000000000000000000000000000000000.0) + (f1-0 -10000000000000000000000000000000000000.0) + ) + (set! (-> arg0 x) f0-0) + (set! (-> arg0 y) f0-0) + (set! (-> arg0 z) f0-0) + (set! (-> arg1 x) f1-0) + (set! (-> arg1 y) f1-0) + (set! (-> arg1 z) f1-0) + ) + (dotimes (v1-3 (the-as int (-> obj poly-count))) + (let ((a3-1 (-> obj poly-array v1-3))) + (dotimes (t0-1 (the-as int (-> a3-1 vertex-count))) + (let ((t1-2 (-> a3-1 vertex t0-1))) + (set! (-> arg0 x) (fmin (-> arg0 x) (-> t1-2 x))) + (set! (-> arg0 y) (fmin (-> arg0 y) (-> t1-2 y))) + (set! (-> arg0 z) (fmin (-> arg0 z) (-> t1-2 z))) + (set! (-> arg1 x) (fmax (-> arg1 x) (-> t1-2 x))) + (set! (-> arg1 y) (fmax (-> arg1 y) (-> t1-2 y))) + (set! (-> arg1 z) (fmax (-> arg1 z) (-> t1-2 z))) + ) + ) + ) + ) + (vector+! arg0 arg0 (-> obj bounds)) + (vector+! arg1 arg1 (-> obj bounds)) + 0 + (none) + ) + +;; definition for method 15 of type nav-mesh +;; WARN: Return type mismatch int vs none. +(defmethod initialize-mesh! nav-mesh ((obj nav-mesh)) + (local-vars + (sv-32 vector) + (sv-36 uint) + (sv-40 int) + (sv-48 int) + (sv-56 int) + (sv-64 symbol) + (sv-68 (inline-array vector)) + (sv-72 vector) + (sv-76 vector) + ) + (with-pp + (rlet ((acc :class vf) + (Q :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + ) + (init-vf0-vector) + (set! sv-32 (new 'stack-no-clear 'vector)) + (set! sv-36 (-> obj poly-count)) + (set! sv-40 0) + (set! sv-48 0) + (set! sv-56 0) + (set! sv-64 (the-as symbol #f)) + (countdown (s5-0 sv-36) + (let ((v1-3 (-> obj poly-array s5-0))) + (if (logtest? (the-as int (-> v1-3 pat)) 1) + (set! sv-56 (+ sv-56 1)) + ) + (set! sv-68 (-> v1-3 vertex)) + (set! sv-72 (-> v1-3 vertex1)) + (set! sv-76 (-> v1-3 vertex2)) + ) + (vector-3pt-cross! sv-32 (the-as vector sv-68) sv-72 sv-76) + (cond + ((= (vector-length sv-32) 0.0) + (set! sv-40 (+ sv-40 1)) + ) + (else + (let ((v1-9 sv-32)) + (let ((f0-1 1.0)) + (.lvf vf1 (&-> v1-9 quad)) + (.mul.vf vf2 vf1 vf1 :mask #b111) + (let ((a0-11 f0-1)) + (.mov vf3 a0-11) + ) + ) + (.mul.x.vf acc vf0 vf2 :mask #b1000) + (.add.mul.y.vf acc vf0 vf2 acc :mask #b1000) + (.add.mul.z.vf vf2 vf0 vf2 acc :mask #b1000) + (.isqrt.vf Q vf3 vf2 :fsf #b0 :ftf #b11) + (.wait.vf) + (.mul.vf vf1 vf1 Q :mask #b111) + (.nop.vf) + (.nop.vf) + (.nop.vf) + (.svf (&-> v1-9 quad) vf1) + ) + (if (>= 0.0 (-> sv-32 y)) + (set! sv-48 (+ sv-48 1)) + ) + ) + ) + ) + (when (zero? sv-36) + (format #t "WARNING: nav-mesh has no triangles. ") + (set! sv-64 #t) + ) + (when (> sv-40 0) + (format #t "WARNING: nav-mesh has ~D triangles with zero area (out of ~D triangles). " sv-40 sv-36) + (set! sv-64 #t) + ) + (when (> sv-48 0) + (format #t "WARNING: nav-mesh has ~D triangles with inverted normals (out of ~D triangles). " sv-48 sv-36) + (set! sv-64 #t) + ) + (when (< (the-as uint 255) sv-36) + (format #t "WARNING: nav-mesh has ~D triangles (only up to ~D are allowed). " sv-36 255) + (set! sv-64 #t) + ) + (when (= sv-56 sv-36) + (format #t "WARNING: nav-mesh only contains gap triangles (~D triangles total). " sv-36) + (set! sv-64 #t) + ) + (when sv-64 + (if pp + (format #t "current process is ~A~%" (-> pp name)) + (format #t "(no current process).~%") + ) + ) + 0 + (none) + ) + ) + ) + +;; definition for function ray-ccw-line-segment-intersection? +(defun ray-ccw-line-segment-intersection? ((arg0 vector) (arg1 vector) (arg2 vector) (arg3 vector)) + (let ((f0-2 (- (* (-> arg2 x) (-> arg1 z)) (* (-> arg2 z) (-> arg1 x)))) + (f2-4 (- (* (-> arg3 x) (-> arg1 z)) (* (-> arg3 z) (-> arg1 x)))) + (f3-4 (- (* (-> arg0 x) (-> arg1 z)) (* (-> arg0 z) (-> arg1 x)))) + (v0-0 #f) + ) + (let ((f1-7 (- f2-4 f0-2)) + (f2-5 (- f2-4 f3-4)) + (f3-5 (- f3-4 f0-2)) + ) + (when (and (>= (fabs f1-7) (fmax (fabs f3-5) (fabs f2-5))) (!= f1-7 0.0)) + (let ((f0-7 (+ (* (-> arg1 x) (- (-> arg3 z) (-> arg2 z))) (* (-> arg1 z) (- (-> arg2 x) (-> arg3 x)))))) + (set! v0-0 (< 0.0 f0-7)) + ) + ) + ) + v0-0 + ) + ) + +;; definition for function ray-line-segment-intersection? +(defun ray-line-segment-intersection? ((arg0 vector) (arg1 vector) (arg2 vector) (arg3 vector)) + (let ((f1-3 (- (* (-> arg2 x) (-> arg1 z)) (* (-> arg2 z) (-> arg1 x)))) + (f0-4 (- (* (-> arg3 x) (-> arg1 z)) (* (-> arg3 z) (-> arg1 x)))) + (f2-6 (- (* (-> arg0 x) (-> arg1 z)) (* (-> arg0 z) (-> arg1 x)))) + (gp-0 #f) + ) + (let ((f30-0 (- f0-4 f1-3)) + (f0-5 (- f0-4 f2-6)) + (f1-4 (- f2-6 f1-3)) + ) + (when (and (>= (fabs f30-0) (fmax (fabs f1-4) (fabs f0-5))) (!= f30-0 0.0)) + (let ((f2-11 (+ (* (-> arg2 x) (-> arg1 x)) (* (-> arg2 z) (-> arg1 z)))) + (f3-11 (+ (* (-> arg3 x) (-> arg1 x)) (* (-> arg3 z) (-> arg1 z)))) + (f28-0 (+ (* (-> arg0 x) (-> arg1 x)) (* (-> arg0 z) (-> arg1 z)))) + ) + (if (>= (* (+ (* f2-11 f0-5) (* f3-11 f1-4)) (sign f30-0)) (* f28-0 (fabs f30-0))) + (set! gp-0 #t) + ) + ) + ) + ) + gp-0 + ) + ) + +;; definition for method 38 of type nav-mesh +;; INFO: Used lq/sq +(defmethod nav-mesh-method-38 nav-mesh ((obj nav-mesh) (arg0 nav-poly) (arg1 vector) (arg2 vector) (arg3 vector) (arg4 (pointer nav-poly))) + (local-vars + (s1-0 vector) + (sv-16 int) + (sv-24 nav-mesh-work) + (sv-28 uint8) + (sv-32 (pointer int8)) + (sv-36 (pointer int8)) + (sv-40 vector) + (sv-44 vector) + ) + (set! sv-16 -1) + (set! sv-24 (-> obj work)) + (set! sv-28 (-> arg0 vertex-count)) + (set! sv-32 (-> sv-24 vert0-table)) + (set! sv-36 (-> sv-24 vert1-table)) + (set! (-> arg2 quad) (-> arg3 quad)) + (dotimes (v1-8 (the-as int sv-28)) + (set! sv-40 (-> arg0 vertex (-> sv-32 v1-8))) + (set! sv-44 (-> arg0 vertex (-> sv-36 v1-8))) + (let* ((f0-1 (- (-> sv-40 z) (-> sv-44 z))) + (f1-2 (- (-> sv-44 x) (-> sv-40 x))) + (f2-4 (+ (* f0-1 (- (-> sv-40 x) (-> arg1 x))) (* f1-2 (- (-> sv-40 z) (-> arg1 z))))) + (f0-3 (+ (* (-> arg2 x) f0-1) (* (-> arg2 z) f1-2))) + ) + (when (< f2-4 f0-3) + (set! sv-16 v1-8) + (let ((f0-4 (/ f2-4 f0-3))) + (set! (-> arg2 x) (* (-> arg2 x) f0-4)) + (set! (-> arg2 z) (* (-> arg2 z) f0-4)) + ) + ) + ) + ) + (when arg4 + (cond + ((= sv-16 -1) + (set! (-> arg4 0) #f) + ) + (else + (while (!= sv-16 -1) + (let ((v1-16 (-> arg0 adj-poly sv-16))) + (cond + ((!= v1-16 255) + (set! (-> arg4 0) (-> obj poly-array v1-16)) + (set! sv-16 -1) + ) + ((let ((a1-1 (-> arg0 vertex (-> sv-32 sv-16)))) + (set! s1-0 (-> arg0 vertex (-> sv-36 sv-16))) + (< (vector-vector-xz-distance arg1 a1-1) (-> obj work nav-poly-min-dist)) + ) + (set! sv-16 (+ sv-16 -1)) + (if (< sv-16 0) + (set! sv-16 (the-as int (+ sv-28 -1))) + ) + ) + ((< (vector-vector-xz-distance arg1 s1-0) (-> obj work nav-poly-min-dist)) + (set! sv-16 (+ sv-16 1)) + (when (>= sv-16 (the-as int sv-28)) + (set! sv-16 0) + 0 + ) + ) + (else + (set! (-> arg4 0) #f) + (set! sv-16 -1) + ) + ) + ) + ) + ) + ) + ) + (set! (-> arg2 y) (-> arg1 y)) + arg2 + ) + +;; definition for function plane-height-at-xz-point +(defun plane-height-at-xz-point ((arg0 plane) (arg1 vector)) + (/ (- (+ (* (-> arg1 x) (-> arg0 x)) (* (-> arg1 z) (-> arg0 z)) (-> arg0 w))) (-> arg0 y)) + ) + +;; definition for function nav-normal-from-3-points +;; WARN: Return type mismatch int vs none. +(defun nav-normal-from-3-points ((arg0 vector) (arg1 vector) (arg2 vector) (arg3 vector)) + (rlet ((acc :class vf) + (Q :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + (vf5 :class vf) + ) + (init-vf0-vector) + (let ((v1-0 arg0)) + (let ((a0-1 arg1) + (a2-1 arg3) + ) + (.lvf vf3 (&-> arg2 quad)) + (.lvf vf1 (&-> a0-1 quad)) + (.lvf vf2 (&-> a2-1 quad)) + ) + (.sub.vf vf1 vf3 vf1) + (.sub.vf vf2 vf3 vf2) + (.outer.product.a.vf acc vf2 vf1) + (.outer.product.b.vf vf4 vf1 vf2 acc) + (.mul.vf vf5 vf4 vf4) + (.add.y.vf vf5 vf5 vf5 :mask #b1) + (.add.z.vf vf5 vf5 vf5 :mask #b1) + (.isqrt.vf Q vf0 vf5 :fsf #b11 :ftf #b0) + (.mov.vf vf4 vf0 :mask #b1000) + (.wait.vf) + (.mul.vf vf4 vf4 Q :mask #b111) + (.nop.vf) + (.nop.vf) + (.svf (&-> v1-0 quad) vf4) + ) + 0 + (none) + ) + ) + +;; definition for method 40 of type nav-mesh +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod project-point-onto-plane-of-poly-local nav-mesh ((obj nav-mesh) (arg0 nav-poly) (arg1 vector) (arg2 vector) (arg3 vector)) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (let ((s4-0 (new 'stack-no-clear 'vector))) + (cond + ((= (-> arg0 vertex-count) 3) + (nav-normal-from-3-points s4-0 (the-as vector (-> arg0 vertex)) (-> arg0 vertex1) (-> arg0 vertex2)) + ) + ((let* ((v1-2 (-> arg0 vertex2)) + (a0-3 (-> arg0 vertex)) + (f0-1 (- (-> a0-3 0 x) (-> v1-2 x))) + (f1-2 (- (-> a0-3 0 z) (-> v1-2 z))) + (f2-2 (- (-> arg3 x) (-> v1-2 x))) + (f0-3 (- (* f0-1 (- (-> arg3 z) (-> v1-2 z))) (* f1-2 f2-2))) + ) + (< 0.0 f0-3) + ) + (nav-normal-from-3-points s4-0 (the-as vector (-> arg0 vertex)) (-> arg0 vertex2) (-> arg0 vertex3)) + ) + (else + (nav-normal-from-3-points s4-0 (the-as vector (-> arg0 vertex)) (-> arg0 vertex1) (-> arg0 vertex2)) + ) + ) + (set! (-> arg2 quad) (-> s4-0 quad)) + (set! (-> s4-0 w) (- (vector-dot s4-0 (the-as vector (-> arg0 vertex))))) + (set! (-> s5-0 quad) (-> arg3 quad)) + (set! (-> s5-0 y) (/ (- (+ (* (-> arg3 x) (-> s4-0 x)) (* (-> arg3 z) (-> s4-0 z)) (-> s4-0 w))) (-> s4-0 y))) + ) + (set! (-> arg1 quad) (-> s5-0 quad)) + ) + 0 + (none) + ) + +;; definition for method 8 of type nav-mesh +;; WARN: Return type mismatch int vs nav-mesh. +(defmethod mem-usage nav-mesh ((obj nav-mesh) (arg0 memory-usage-block) (arg1 int)) + (set! (-> arg0 length) (max 46 (-> arg0 length))) + (set! (-> arg0 data 45 name) "nav-mesh") + (+! (-> arg0 data 45 count) 1) + (let ((v1-6 (asize-of obj))) + (+! (-> arg0 data 45 used) v1-6) + (+! (-> arg0 data 45 total) (logand -16 (+ v1-6 15))) + ) + (set! (-> arg0 length) (max 46 (-> arg0 length))) + (set! (-> arg0 data 45 name) "nav-mesh") + (+! (-> arg0 data 45 count) 1) + (let ((v1-16 (* (-> obj poly-count) 64))) + (+! (-> arg0 data 45 used) v1-16) + (+! (-> arg0 data 45 total) (logand -16 (+ v1-16 15))) + ) + (set! (-> arg0 length) (max 46 (-> arg0 length))) + (set! (-> arg0 data 45 name) "nav-mesh") + (+! (-> arg0 data 45 count) 1) + (let* ((v1-25 (-> obj poly-count)) + (v1-27 (shr (* v1-25 v1-25) 2)) + ) + (+! (-> arg0 data 45 used) v1-27) + (+! (-> arg0 data 45 total) (logand -16 (+ v1-27 15))) + ) + (the-as nav-mesh 0) + ) + +;; definition for function get-nav-mesh +(defun get-nav-mesh ((arg0 actor-id)) + (let ((gp-0 (the-as nav-mesh #f))) + (let* ((s5-0 (entity-nav-mesh-by-aid arg0)) + (v1-0 (if (type? s5-0 entity-nav-mesh) + s5-0 + ) + ) + ) + (if v1-0 + (set! gp-0 (-> v1-0 nav-mesh)) + ) + ) + gp-0 + ) + ) + +;; definition for function find-nearest-nav-mesh +;; WARN: Stack slot offset 72 signed mismatch +;; WARN: Stack slot offset 72 signed mismatch +;; WARN: Stack slot offset 72 signed mismatch +;; WARN: Stack slot offset 72 signed mismatch +(defun find-nearest-nav-mesh ((arg0 vector) (arg1 float)) + (local-vars (v1-15 float) (sv-64 nav-find-poly-parms) (sv-68 nav-mesh) (sv-72 float) (sv-76 vector)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (set! sv-64 (new 'stack-no-clear 'nav-find-poly-parms)) + (set! sv-68 (the-as nav-mesh #f)) + (set! sv-72 arg1) + (set! sv-76 arg0) + (set! (-> sv-64 ignore) (the-as uint 7)) + (dotimes (gp-0 (-> *level* length)) + (let ((v1-5 (-> *level* level gp-0))) + (when (= (-> v1-5 status) 'active) + (let ((s5-0 (-> v1-5 bsp nav-meshes))) + (when (nonzero? s5-0) + (dotimes (s4-0 (-> s5-0 length)) + (let ((s3-0 (-> s5-0 s4-0 nav-mesh))) + (when s3-0 + (vector-! (-> sv-64 point) sv-76 (-> s3-0 bounds)) + (.lvf vf1 (&-> (-> sv-64 point) quad)) + (.add.w.vf vf2 vf0 vf0 :mask #b1) + (.mul.vf vf1 vf1 vf1) + (.mul.x.vf acc vf2 vf1 :mask #b1) + (.add.mul.y.vf acc vf2 vf1 acc :mask #b1) + (.add.mul.z.vf vf1 vf2 vf1 acc :mask #b1) + (.mov v1-15 vf1) + (let ((f0-1 v1-15) + (f1-0 (-> s3-0 bounds w)) + ) + (when (< f0-1 (* f1-0 f1-0)) + (set! (-> sv-64 y-threshold) (-> s3-0 nearest-y-threshold)) + (find-nearest-poly-to-point-local s3-0 sv-64) + (when (>= sv-72 (-> sv-64 dist)) + (set! sv-72 (-> sv-64 dist)) + (set! sv-68 s3-0) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + sv-68 + ) + ) + +;; definition for method 10 of type nav-mesh +(defmethod nav-mesh-method-10 nav-mesh ((obj nav-mesh) (arg0 vector) (arg1 vector) (arg2 nav-poly)) + (local-vars (sv-16 vector)) + (set! sv-16 arg0) + (let ((gp-0 (new 'stack-no-clear 'nav-find-poly-parms))) + (set! (-> gp-0 poly) arg2) + (vector-! (-> gp-0 point) arg1 (-> obj bounds)) + (when (or (not (-> gp-0 poly)) (not (point-in-poly? obj (-> gp-0 poly) (-> gp-0 point)))) + (set! (-> gp-0 y-threshold) (-> obj nearest-y-threshold)) + (set! (-> gp-0 ignore) (the-as uint 3)) + (find-nearest-poly-to-point-local obj gp-0) + (when (-> gp-0 poly) + (project-point-into-poly-2d obj (-> gp-0 poly) sv-16 (-> gp-0 point)) + (vector+! sv-16 sv-16 (-> obj bounds)) + ) + ) + (-> gp-0 poly) + ) + ) + +;; definition for function point-to-poly-boundary +;; INFO: Used lq/sq +(defun point-to-poly-boundary ((arg0 nav-poly) (arg1 vector) (arg2 vector)) + (let ((gp-0 (new 'stack-no-clear 'inline-array 'vector 4))) + (set! (-> gp-0 4 x) (the-as float #x7f800000)) + (let* ((s2-0 (-> arg0 vertex-count)) + (v1-1 (the-as int (+ s2-0 -1))) + ) + (dotimes (s1-0 (the-as int s2-0)) + (when (= (-> arg0 adj-poly v1-1) 255) + (set! (-> gp-0 2 quad) (-> arg0 vertex v1-1 quad)) + (set! (-> gp-0 3 quad) (-> arg0 vertex s1-0 quad)) + (set! (-> gp-0 2 y) (-> arg2 y)) + (set! (-> gp-0 3 y) (-> arg2 y)) + (set! (-> gp-0 2 w) 1.0) + (set! (-> gp-0 3 w) 1.0) + (let ((f0-5 (vector-segment-distance-point! arg2 (-> gp-0 2) (-> gp-0 3) (-> gp-0 0)))) + (when (< f0-5 (-> gp-0 4 x)) + (set! (-> gp-0 4 x) f0-5) + (set! (-> gp-0 1 quad) (-> gp-0 0 quad)) + ) + ) + ) + (set! v1-1 s1-0) + ) + ) + (set! (-> arg1 quad) (-> gp-0 1 quad)) + (-> gp-0 4 x) + ) + ) + +;; definition for method 34 of type nav-mesh +;; INFO: Used lq/sq +(defmethod nav-mesh-method-34 nav-mesh ((obj nav-mesh) (arg0 vector) (arg1 vector) (arg2 float)) + (local-vars (v1-8 symbol) (v1-13 int) (a1-2 symbol) (sv-80 vector) (sv-84 (pointer uint8))) + (let ((gp-0 (new 'stack-no-clear 'nav-poly))) + (set! sv-80 arg0) + (set! (-> gp-0 vertex3 y) (the-as float #x7f800000)) + (set! (-> gp-0 vertex3 x) arg2) + (set! (-> gp-0 vertex1 quad) (-> arg1 quad)) + (set! sv-84 (search-for-sphere (-> obj poly-hash) (-> gp-0 vertex1) (-> gp-0 vertex3 x))) + (let ((s4-0 (-> obj poly-hash bucket-size)) + (s3-0 sv-84) + (s2-0 0) + ) + (until (zero? v1-13) + (let ((s1-0 (* s2-0 8)) + (s0-0 (-> s3-0 0)) + ) + (b! (zero? s0-0) cfg-14 :delay (nop!)) + (label cfg-2) + (let ((v1-5 (logand s0-0 1))) + (nop!) + (b! (zero? v1-5) cfg-13 :delay (nop!)) + ) + (let ((a0-5 (-> obj poly-array s1-0))) + (let ((v1-7 a0-5) + (f0-3 (-> gp-0 vertex1 y)) + (f1-0 (-> obj nearest-y-threshold)) + ) + (b! (>= (+ (-> v1-7 vertex3 w) f1-0) f0-3) cfg-5 :delay (set! a1-2 #t)) + (set! a1-2 #f) + (label cfg-5) + (set! v1-8 (and a1-2 (begin (b! (>= f0-3 (- (-> v1-7 vertex2 w) f1-0)) cfg-9 :delay (set! v1-8 #t)) #f))) + ) + (label cfg-9) + (if v1-8 + (set! (-> gp-0 vertex3 z) (point-to-poly-boundary a0-5 (-> gp-0 vertex2) (-> gp-0 vertex1))) + ) + ) + (when (< (-> gp-0 vertex3 z) (-> gp-0 vertex3 y)) + (set! (-> gp-0 vertex3 y) (-> gp-0 vertex3 z)) + (set! (-> gp-0 vertex 0 quad) (-> gp-0 vertex2 quad)) + (nop!) + ) + (label cfg-13) + (set! s0-0 (the-as uint (/ (the-as int s0-0) 2))) + (nop!) + (b! (nonzero? s0-0) cfg-2 :delay (set! s1-0 (+ s1-0 1))) + ) + (label cfg-14) + (+! s2-0 1) + (set! s3-0 (&-> s3-0 1)) + (set-on-less-than v1-13 s2-0 s4-0) + (nop!) + ) + ) + 0 + (set! (-> sv-80 quad) (-> gp-0 vertex 0 quad)) + (-> gp-0 vertex3 y) + ) + ) + +;; definition for method 35 of type nav-mesh +;; INFO: Used lq/sq +;; WARN: Return type mismatch float vs none. +;; WARN: new jak 2 until loop case, check carefully +(defmethod nav-mesh-method-35 nav-mesh ((obj nav-mesh) (arg0 vector) (arg1 vector) (arg2 float)) + (let ((gp-0 (new 'stack-no-clear 'inline-array 'nav-poly 3))) + (set! (-> gp-0 2 vertex3 y) arg2) + (vector-! (the-as vector (-> gp-0 0)) arg0 (-> obj bounds)) + (vector-! (-> gp-0 0 vertex1) arg1 (-> obj bounds)) + (set! (-> gp-0 2 vertex1 quad) (-> gp-0 0 vertex0 quad)) + (set! (-> gp-0 2 vertex2 x) (-> obj nearest-y-threshold)) + (set! (-> gp-0 2 data 36) (the-as uint 3)) + (let ((a1-4 (find-poly-containing-point-local obj (the-as nav-find-poly-parms (-> gp-0 2 vertex1))))) + (cond + (a1-4 + (init-ray-local (the-as nav-ray (-> gp-0 1)) a1-4 (the-as vector (-> gp-0 0)) (-> gp-0 0 vertex1)) + (until #f + (set! (-> gp-0 2 vertex3 z) + (nav-mesh-method-34 obj (-> gp-0 0 vertex3) (the-as vector (-> gp-0 1)) (-> gp-0 2 vertex3 y)) + ) + (b! (>= (-> gp-0 2 vertex3 z) (-> gp-0 2 vertex3 y)) cfg-4 :delay #f) + (set! (-> gp-0 2 vertex3 y) (-> gp-0 2 vertex3 z)) + (set! (-> gp-0 0 vertex2 quad) (-> gp-0 0 vertex3 quad)) + (label cfg-4) + (b! (-> gp-0 2 vertex0 x) cfg-6 :delay (nop!)) + (move-along-nav-ray! obj (the-as nav-ray (-> gp-0 1))) + ) + #f + (label cfg-6) + (if (-> gp-0 2 vertex0 z) + (set! (-> gp-0 2 vertex3 y) (the-as float #xff800000)) + ) + ) + (else + (set! (-> gp-0 2 vertex3 y) (the-as float #xff800000)) + ) + ) + ) + (-> gp-0 2 vertex3 y) + ) + (none) + ) + +;; failed to figure out what this is: +(none) + +) + + + diff --git a/goal_src/jak2/engine/physics/trajectory.gc b/goal_src/jak2/engine/physics/trajectory.gc index 63a1452e36..651f96f091 100644 --- a/goal_src/jak2/engine/physics/trajectory.gc +++ b/goal_src/jak2/engine/physics/trajectory.gc @@ -314,16 +314,16 @@ ) ) (when s4-1 - (let ((a2-3 ((method-of-type nav-control nav-control-method-11) (the-as nav-control s4-1) arg1))) + (let ((a2-3 ((method-of-type nav-control find-poly-containing-point-1) (the-as nav-control s4-1) arg1))) (if a2-3 - ((method-of-type nav-control nav-control-method-20) + ((method-of-type nav-control clamp-vector-to-mesh-cross-gaps) (the-as nav-control s4-1) arg1 - (the-as nav-poly a2-3) + a2-3 arg0 2048.0 #f - #f + (the-as clamp-travel-vector-to-mesh-return-info #f) ) (set! (-> arg0 quad) (the-as uint128 0)) ) diff --git a/goal_src/jak2/engine/process-drawable/process-drawable.gc b/goal_src/jak2/engine/process-drawable/process-drawable.gc index af0003490e..3e60c95047 100644 --- a/goal_src/jak2/engine/process-drawable/process-drawable.gc +++ b/goal_src/jak2/engine/process-drawable/process-drawable.gc @@ -539,7 +539,7 @@ ) (let ((a0-3 (-> obj nav))) (if (and a0-3 (nonzero? a0-3)) - (nav-control-method-41 a0-3) + (remove! a0-3) ) ) (let* ((s5-0 (-> obj root)) diff --git a/goal_src/jak2/engine/process-drawable/simple-nav-sphere.gc b/goal_src/jak2/engine/process-drawable/simple-nav-sphere.gc index cf5661c165..aef4c36732 100644 --- a/goal_src/jak2/engine/process-drawable/simple-nav-sphere.gc +++ b/goal_src/jak2/engine/process-drawable/simple-nav-sphere.gc @@ -137,8 +137,8 @@ (the-as (function process int symbol event-message-block object) simple-nav-sphere-event-handler) ) (if arg2 - (nav-mesh-method-29 arg2 self #f) - (nav-mesh-connect-from-ent (the-as entity-nav-mesh self)) + (add-process-drawable-to-navmesh arg2 self #f) + (nav-mesh-connect-from-ent self) ) (if (>= (-> self track-joint) 0) (go-virtual active) diff --git a/goal_src/jak2/engine/spatial-hash/spatial-hash-h.gc b/goal_src/jak2/engine/spatial-hash/spatial-hash-h.gc index e8b9cbe00c..e084fade14 100644 --- a/goal_src/jak2/engine/spatial-hash/spatial-hash-h.gc +++ b/goal_src/jak2/engine/spatial-hash/spatial-hash-h.gc @@ -50,7 +50,7 @@ :size-assert #x58 :flag-assert #x1900000058 (:methods - (new (symbol type int int) _type_ 0) + (new (symbol type int) _type_ 0) (update-grid-for-objects-in-box (_type_ int vector vector) none 9) (clear-bucket-array (_type_) none 10) (setup-search-box (_type_ int vector vector vector) none 11) @@ -72,12 +72,12 @@ (deftype find-nav-sphere-ids-params (structure) - ((bsphere sphere :inline :offset-assert 0) - (y-threshold float :offset-assert 16) - (len int16 :offset-assert 20) - (max-len int16 :offset-assert 22) - (mask uint8 :offset-assert 24) - (array uint32 :offset-assert 28) + ((bsphere sphere :inline :offset-assert 0) + (y-threshold float :offset-assert 16) + (len int16 :offset-assert 20) + (max-len int16 :offset-assert 22) + (mask uint8 :offset-assert 24) + (array (pointer uint8) :offset-assert 28) ) :method-count-assert 9 :size-assert #x20 @@ -102,8 +102,8 @@ (add-a-sphere-with-flag (_type_ vector int) int 27) (update-from-spheres (_type_) none 28) (sphere-hash-method-29 (_type_ find-nav-sphere-ids-params int int int) none 29) - (sphere-hash-method-30 (_type_ find-nav-sphere-ids-params) none 30) - (sphere-hash-method-31 (_type_ vector int int) none 31) + (find-nav-sphere-ids (_type_ find-nav-sphere-ids-params) none 30) + (add-sphere-with-mask-and-id (_type_ vector int int) none 31) (sphere-hash-method-32 (_type_ vector vector float int) symbol 32) (remove-by-id (_type_ sphere int) none 33) ) diff --git a/goal_src/jak2/engine/spatial-hash/spatial-hash.gc b/goal_src/jak2/engine/spatial-hash/spatial-hash.gc index 56366822ab..8aec164087 100644 --- a/goal_src/jak2/engine/spatial-hash/spatial-hash.gc +++ b/goal_src/jak2/engine/spatial-hash/spatial-hash.gc @@ -25,9 +25,11 @@ :flag-assert #x900000078 ) + (define *grid-hash-work* (new 'static 'grid-hash-work)) -(defmethod new grid-hash ((allocation symbol) (type-to-make type) (arg0 int) (arg1 int)) +;; WARN: Return type mismatch object vs grid-hash. +(defmethod new grid-hash ((allocation symbol) (type-to-make type) (arg0 int)) (let ((gp-0 (the-as object (object-new allocation type-to-make (the-as int (-> type-to-make size)))))) (when (zero? (the-as grid-hash gp-0)) (set! gp-0 0) diff --git a/goal_src/jak2/game.gp b/goal_src/jak2/game.gp index f8d3b0eccd..c6ed5e4dfd 100644 --- a/goal_src/jak2/game.gp +++ b/goal_src/jak2/game.gp @@ -4668,3 +4668,8 @@ (group-list "all-code" `(,@(reverse *all-gc*)) ) + +(group "engine" + "$OUT/iso/KERNEL.CGO" + "$OUT/iso/GAME.CGO" + ) diff --git a/goal_src/jak2/levels/common/enemy/bouncer.gc b/goal_src/jak2/levels/common/enemy/bouncer.gc index fdb938dabf..c078fbab87 100644 --- a/goal_src/jak2/levels/common/enemy/bouncer.gc +++ b/goal_src/jak2/levels/common/enemy/bouncer.gc @@ -234,7 +234,7 @@ (bouncer-method-24 obj) (process-drawable-from-entity! obj arg0) (init-skeleton! obj) - (nav-mesh-connect-from-ent (the-as entity-nav-mesh obj)) + (nav-mesh-connect-from-ent obj) (set! (-> obj spring-height) (res-lump-float arg0 'spring-height :default 45056.0)) (go (method-of-object obj idle)) (none) diff --git a/goal_src/jak2/levels/common/enemy/hover/hover-nav-control-h.gc b/goal_src/jak2/levels/common/enemy/hover/hover-nav-control-h.gc index 386d91efbb..cfa3813879 100644 --- a/goal_src/jak2/levels/common/enemy/hover/hover-nav-control-h.gc +++ b/goal_src/jak2/levels/common/enemy/hover/hover-nav-control-h.gc @@ -5,5 +5,264 @@ ;; name in dgo: hover-nav-control-h ;; dgos: FOR, DMI, FRA, STR, NEB, D3A, UNB +;; +++net-path-node-status +(defenum net-path-node-status + :bitfield #t + :type uint16 + (open) + (closed)) +;; ---net-path-node-status + +;; NOTE - for nestb-scenes +(declare-type nav-network basic) +(define-extern *nav-network* nav-network) + ;; DECOMP BEGINS +(deftype nav-network-adjacency (structure) + ((index int32 :offset-assert 0) + (dist float :offset-assert 4) + ) + :method-count-assert 9 + :size-assert #x8 + :flag-assert #x900000008 + ) + + +(deftype nav-network-adjacency-array (inline-array-class) + ((data nav-network-adjacency :inline :dynamic :offset-assert 16) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + + +(set! (-> nav-network-adjacency-array heap-base) (the-as uint 16)) + +(deftype list-node (structure) + ((next list-node :offset-assert 0) + (prev list-node :offset-assert 4) + ) + :method-count-assert 9 + :size-assert #x8 + :flag-assert #x900000008 + ) + + +(deftype nav-network-path-node (list-node) + ((row-index int32 :offset-assert 8) + (status net-path-node-status :offset-assert 12) + (parent nav-network-path-node :offset-assert 16) + (cost-to-start float :offset-assert 20) + (cost-to-end float :offset-assert 24) + ) + :method-count-assert 9 + :size-assert #x1c + :flag-assert #x90000001c + ) + + +(deftype nav-network-info (structure) + ((index int32 :offset-assert 0) + (pos vector :inline :offset-assert 16) + (path-node nav-network-path-node :inline :offset-assert 32) + (count int32 :offset-assert 60) + (adjacency (inline-array nav-network-adjacency) :offset-assert 64) + ) + :method-count-assert 9 + :size-assert #x44 + :flag-assert #x900000044 + ) + + +(deftype nav-network-info-array (inline-array-class) + ((data nav-network-info :inline :dynamic :offset-assert 16) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + + +(set! (-> nav-network-info-array heap-base) (the-as uint 80)) + +(deftype hover-nav-sphere (list-node) + ((sphere sphere :inline :offset-assert 16) + (handle uint64 :offset-assert 32) + (timer uint64 :offset-assert 40) + ) + :method-count-assert 9 + :size-assert #x30 + :flag-assert #x900000030 + ) + + +(deftype hover-nav-path-segment (list-node) + ((curve-matrix matrix :inline :offset-assert 16) + (pos-index int32 2 :offset-assert 80) + (dist float :offset-assert 88) + (du float :offset-assert 92) + ) + :method-count-assert 10 + :size-assert #x60 + :flag-assert #xa00000060 + (:methods + (hover-nav-path-segment-method-9 (_type_ float) none 9) + ) + ) + + +(defmethod hover-nav-path-segment-method-9 hover-nav-path-segment ((obj hover-nav-path-segment) (arg0 float)) + (set! (-> obj du) (/ arg0 (-> obj dist))) + 0 + (none) + ) + +(deftype hover-nav-path-info (structure) + ((segment-list hover-nav-path-segment :offset-assert 0) + (tail-segment hover-nav-path-segment :offset-assert 4) + (curr-segment hover-nav-path-segment :offset-assert 8) + (curr-u float :offset-assert 12) + ) + :method-count-assert 10 + :size-assert #x10 + :flag-assert #xa00000010 + (:methods + (hover-nav-path-info-method-9 () none 9) + ) + ) + + +(deftype path-index-array (inline-array-class) + ((data hover-nav-path-info :inline :dynamic :offset-assert 16) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + + +(set! (-> path-index-array heap-base) (the-as uint 4)) + +(deftype nav-network (basic) + ((network basic :offset-assert 4) + (dummy nav-network-info :inline :offset-assert 16) + (control-handle handle :offset-assert 88) + (list-table list-node 5 :offset-assert 96) + (open-list nav-network-path-node :offset 96) + (closed-list nav-network-path-node :offset 100) + (sphere-list hover-nav-sphere :offset 108) + (free-segment-list hover-nav-path-segment :offset 104) + (free-sphere-list hover-nav-sphere :offset 112) + (segment-pool uint32 :offset-assert 116) + (sphere-pool uint32 :offset-assert 120) + ) + :method-count-assert 33 + :size-assert #x7c + :flag-assert #x210000007c + (:methods + (nav-network-method-9 (_type_) none 9) + (nav-network-method-10 (_type_ level (array nav-network-info)) none 10) + (nav-network-method-11 (_type_) none 11) + (nav-network-method-12 (_type_) none 12) + (nav-network-method-13 (_type_) none 13) + (nav-network-method-14 (_type_ int) none 14) + (nav-network-method-15 (_type_) none 15) + (nav-network-method-16 (_type_) none 16) + (nav-network-method-17 (_type_) nav-network-path-node 17) + (nav-network-method-18 (_type_) none 18) + (nav-network-method-19 (_type_) none 19) + (nav-network-method-20 (_type_) none 20) + (nav-network-method-21 (_type_) none 21) + (nav-network-method-22 (_type_) none 22) + (nav-network-method-23 (_type_) none 23) + (nav-network-method-24 (_type_) none 24) + (nav-network-method-25 (_type_) none 25) + (nav-network-method-26 (_type_) none 26) + (nav-network-method-27 (_type_) none 27) + (nav-network-method-28 (_type_) none 28) + (nav-network-method-29 (_type_) symbol 29) + (get-network (_type_) basic 30) + (nav-network-method-31 () none 31) + (nav-network-method-32 () none 32) + ) + ) + + +(defmethod get-network nav-network ((obj nav-network)) + (-> obj network) + ) + +(deftype hover-nav-params (structure) + ((max-speed float :offset-assert 0) + (max-acceleration float :offset-assert 4) + (friction float :offset-assert 8) + (nav-collide-prim-index int32 :offset-assert 12) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + + +(deftype hover-nav-control (basic) + ((root basic :offset-assert 4) + (nav basic :offset-assert 8) + (flags uint16 :offset-assert 12) + (params hover-nav-params :offset-assert 16) + (path-timer uint64 :offset-assert 24) + (transvv vector :inline :offset-assert 32) + (dest-pos vector :inline :offset-assert 48) + (dest-vel vector :inline :offset-assert 64) + (dest-move-dir vector :inline :offset-assert 80) + (dest-offset vector :inline :offset-assert 96) + (move-dir vector :inline :offset-assert 112) + (nav-collide-impulse vector :inline :offset-assert 128) + (nav-collide-impulse-len float :offset-assert 144) + (dest-speed float :offset-assert 148) + (local-dist float :offset-assert 152) + (speed float :offset-assert 156) + (max-los-speed float :offset-assert 160) + (target-speed float :offset-assert 164) + (target-acceleration float :offset-assert 168) + (speed-dest float :offset-assert 172) + (path-info hover-nav-path-info :inline :offset-assert 176) + (curr-dest-pt int32 :offset-assert 192) + (los-obstruction-distance float :offset-assert 196) + (los-last-clear-time time-frame :offset-assert 200) + (max-speed-multiplier float :offset-assert 208) + (max-acceleration-multiplier float :offset-assert 212) + ) + :method-count-assert 32 + :size-assert #xd8 + :flag-assert #x20000000d8 + (:methods + (hover-nav-control-method-9 (_type_) none 9) + (hover-nav-control-method-10 (_type_) none 10) + (hover-nav-control-method-11 (_type_) none 11) + (hover-nav-control-method-12 (_type_) none 12) + (hover-nav-control-method-13 (_type_) none 13) + (hover-nav-control-method-14 (_type_ float float) none 14) + (hover-nav-control-method-15 (_type_) none 15) + (hover-nav-control-method-16 (_type_) none 16) + (hover-nav-control-method-17 (_type_) none 17) + (hover-nav-control-method-18 (_type_) none 18) + (hover-nav-control-method-19 (_type_) none 19) + (hover-nav-control-method-20 (_type_) none 20) + (hover-nav-control-method-21 (_type_) none 21) + (hover-nav-control-method-22 (_type_) hover-nav-path-segment 22) + (hover-nav-control-method-23 (_type_) object 23) + (hover-nav-control-method-24 (_type_) none 24) + (hover-nav-control-method-25 (_type_) none 25) + (hover-nav-control-method-26 (_type_) none 26) + (hover-nav-control-method-27 (_type_) none 27) + (hover-nav-control-method-28 (_type_) none 28) + (hover-nav-control-method-29 (_type_) none 29) + (hover-nav-control-method-30 (_type_) float 30) + (hover-nav-control-method-31 (_type_) float 31) + ) + ) + + +(define *hover-nav-time-offset* 0) diff --git a/goal_src/jak2/levels/common/enemy/hover/hover-nav-network.gc b/goal_src/jak2/levels/common/enemy/hover/hover-nav-network.gc index 6f4924cc7c..1f5c5c0e6e 100644 --- a/goal_src/jak2/levels/common/enemy/hover/hover-nav-network.gc +++ b/goal_src/jak2/levels/common/enemy/hover/hover-nav-network.gc @@ -7,3 +7,3129 @@ ;; DECOMP BEGINS +(define *drill-adjacency* (new 'static 'boxed-array :type nav-network-info + (new 'static 'nav-network-info + :pos (new 'static 'vector :x -617373.3 :y 75837.03 :z 750747.25 :w 1.0) + :path-node (new 'static 'nav-network-path-node :parent #f) + :count 4 + :adjacency (new 'static 'inline-array nav-network-adjacency 4 + (new 'static 'nav-network-adjacency :index 1 :dist 37136.793) + (new 'static 'nav-network-adjacency :index 80 :dist 36590.797) + (new 'static 'nav-network-adjacency :index 4 :dist 78889.78) + (new 'static 'nav-network-adjacency :index #x8f :dist 228475.7) + ) + ) + (new 'static 'nav-network-info + :index 1 + :pos (new 'static 'vector :x -603446.9 :y 75837.03 :z 785174.1 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 1 :parent #f) + :count 4 + :adjacency (new 'static 'inline-array nav-network-adjacency 4 + (new 'static 'nav-network-adjacency :index 2 :dist 66392.06) + (new 'static 'nav-network-adjacency :dist 37136.793) + (new 'static 'nav-network-adjacency :index 4 :dist 87117.01) + (new 'static 'nav-network-adjacency :index 3 :dist 93914.32) + ) + ) + (new 'static 'nav-network-info + :index 2 + :pos (new 'static 'vector :x -613150.3 :y 75837.03 :z 850853.5 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 2 :parent #f) + :count 2 + :adjacency (new 'static 'inline-array nav-network-adjacency 2 + (new 'static 'nav-network-adjacency :index 1 :dist 66392.06) + (new 'static 'nav-network-adjacency :index 3 :dist 78238.516) + ) + ) + (new 'static 'nav-network-info + :index 3 + :pos (new 'static 'vector :x -589946.5 :y 1735.4752 :z 841268.8 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 3 :parent #f) + :count 3 + :adjacency (new 'static 'inline-array nav-network-adjacency 3 + (new 'static 'nav-network-adjacency :index 4 :dist 100528.945) + (new 'static 'nav-network-adjacency :index 2 :dist 78238.516) + (new 'static 'nav-network-adjacency :index 1 :dist 93914.32) + ) + ) + (new 'static 'nav-network-info + :index 4 + :pos (new 'static 'vector :x -592215.6 :y 1735.0656 :z 740765.3 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 4 :parent #f) + :count 5 + :adjacency (new 'static 'inline-array nav-network-adjacency 5 + (new 'static 'nav-network-adjacency :index 5 :dist 112524.086) + (new 'static 'nav-network-adjacency :index 3 :dist 100528.945) + (new 'static 'nav-network-adjacency :dist 78889.78) + (new 'static 'nav-network-adjacency :index 1 :dist 87117.01) + (new 'static 'nav-network-adjacency :index 80 :dist 96502.99) + ) + ) + (new 'static 'nav-network-info + :index 5 + :pos (new 'static 'vector :x -704736.9 :y 1735.0656 :z 739950.2 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 5 :parent #f) + :count 4 + :adjacency (new 'static 'inline-array nav-network-adjacency 4 + (new 'static 'nav-network-adjacency :index 4 :dist 112524.086) + (new 'static 'nav-network-adjacency :index 81 :dist 75498.29) + (new 'static 'nav-network-adjacency :index 80 :dist 90207.84) + (new 'static 'nav-network-adjacency :index #x87 :dist 30534.041) + ) + ) + (new 'static 'nav-network-info + :index 6 + :pos (new 'static 'vector :x 350307.94 :y 120944.64 :z 412311.16 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 6 :parent #f) + :count 2 + :adjacency (new 'static 'inline-array nav-network-adjacency 2 + (new 'static 'nav-network-adjacency :index 8 :dist 62174.414) + (new 'static 'nav-network-adjacency :index 10 :dist 25806.848) + ) + ) + (new 'static 'nav-network-info + :index 7 + :pos (new 'static 'vector :x 280446.97 :y 120945.05 :z 477728.34 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 7 :parent #f) + :count 4 + :adjacency (new 'static 'inline-array nav-network-adjacency 4 + (new 'static 'nav-network-adjacency :index 8 :dist 56979.867) + (new 'static 'nav-network-adjacency :index 9 :dist 39251.15) + (new 'static 'nav-network-adjacency :index 79 :dist 50894.027) + (new 'static 'nav-network-adjacency :index 84 :dist 75572.016) + ) + ) + (new 'static 'nav-network-info + :index 8 + :pos (new 'static 'vector :x 288795.84 :y 120944.64 :z 421363.3 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 8 :parent #f) + :count 4 + :adjacency (new 'static 'inline-array nav-network-adjacency 4 + (new 'static 'nav-network-adjacency :index 7 :dist 56979.867) + (new 'static 'nav-network-adjacency :index 6 :dist 62174.414) + (new 'static 'nav-network-adjacency :index 79 :dist 25042.943) + (new 'static 'nav-network-adjacency :index 10 :dist 56014.438) + ) + ) + (new 'static 'nav-network-info + :index 9 + :pos (new 'static 'vector :x 279275.53 :y 99127.7 :z 510336.62 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 9 :parent #f) + :count 3 + :adjacency (new 'static 'inline-array nav-network-adjacency 3 + (new 'static 'nav-network-adjacency :index 79 :dist 78610.02) + (new 'static 'nav-network-adjacency :index 7 :dist 39251.15) + (new 'static 'nav-network-adjacency :index 84 :dist 70526.16) + ) + ) + (new 'static 'nav-network-info + :index 10 + :pos (new 'static 'vector :x 340384.56 :y 99127.7 :z 421879.4 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 10 :parent #f) + :count 5 + :adjacency (new 'static 'inline-array nav-network-adjacency 5 + (new 'static 'nav-network-adjacency :index 43 :dist 60114.125) + (new 'static 'nav-network-adjacency :index 79 :dist 58953.727) + (new 'static 'nav-network-adjacency :index 8 :dist 56014.438) + (new 'static 'nav-network-adjacency :index 6 :dist 25806.848) + (new 'static 'nav-network-adjacency :index #x8e :dist 124076.445) + ) + ) + (new 'static 'nav-network-info + :index 11 + :pos (new 'static 'vector :x 521543.28 :y 84158.055 :z -8242.381 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 11 :parent #f) + :count 2 + :adjacency (new 'static 'inline-array nav-network-adjacency 2 + (new 'static 'nav-network-adjacency :index 66 :dist 64063.49) + (new 'static 'nav-network-adjacency :index 65 :dist 44519.426) + ) + ) + (new 'static 'nav-network-info + :index 12 + :pos (new 'static 'vector :x 640851.56 :y 99127.7 :z -7164.723 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 12 :parent #f) + :count 2 + :adjacency (new 'static 'inline-array nav-network-adjacency 2 + (new 'static 'nav-network-adjacency :index 63 :dist 52689.305) + (new 'static 'nav-network-adjacency :index 64 :dist 49721.754) + ) + ) + (new 'static 'nav-network-info + :index 13 + :pos (new 'static 'vector :x 740183.6 :y 99127.7 :z -17426.021 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 13 :parent #f) + :count 2 + :adjacency (new 'static 'inline-array nav-network-adjacency 2 + (new 'static 'nav-network-adjacency :index 63 :dist 65961.984) + (new 'static 'nav-network-adjacency :index 62 :dist 24192.205) + ) + ) + (new 'static 'nav-network-info + :index 14 + :pos (new 'static 'vector :x 814292.56 :y 6454.886 :z -95446.22 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 14 :parent #f) + :count 14 + :adjacency (new 'static 'inline-array nav-network-adjacency 14 + (new 'static 'nav-network-adjacency :index 15 :dist 56748.03) + (new 'static 'nav-network-adjacency :index 72 :dist 107959.5) + (new 'static 'nav-network-adjacency :index 31 :dist 52362.035) + (new 'static 'nav-network-adjacency :index 32 :dist 58683.39) + (new 'static 'nav-network-adjacency :index 61 :dist 107154.64) + (new 'static 'nav-network-adjacency :index 50 :dist 112492.13) + (new 'static 'nav-network-adjacency :index 49 :dist 69916.266) + (new 'static 'nav-network-adjacency :index 48 :dist 99997.695) + (new 'static 'nav-network-adjacency :index 36 :dist 97927.17) + (new 'static 'nav-network-adjacency :index 35 :dist 66838.53) + (new 'static 'nav-network-adjacency :index 34 :dist 72425.88) + (new 'static 'nav-network-adjacency :index 33 :dist 108125.39) + (new 'static 'nav-network-adjacency :index 29 :dist 88945.05) + (new 'static 'nav-network-adjacency :index 16 :dist 91750.81) + ) + ) + (new 'static 'nav-network-info + :index 15 + :pos (new 'static 'vector :x 812215.94 :y 6455.296 :z -152156.56 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 15 :parent #f) + :count 17 + :adjacency (new 'static 'inline-array nav-network-adjacency 17 + (new 'static 'nav-network-adjacency :index 73 :dist 103833.6) + (new 'static 'nav-network-adjacency :index 72 :dist 92699.445) + (new 'static 'nav-network-adjacency :index 71 :dist 114826.85) + (new 'static 'nav-network-adjacency :index 59 :dist 108125.39) + (new 'static 'nav-network-adjacency :index 53 :dist 108389.99) + (new 'static 'nav-network-adjacency :index 50 :dist 65329.152) + (new 'static 'nav-network-adjacency :index 49 :dist 41456.844) + (new 'static 'nav-network-adjacency :index 14 :dist 56748.03) + (new 'static 'nav-network-adjacency :index 16 :dist 68193.08) + (new 'static 'nav-network-adjacency :index 48 :dist 79577.5) + (new 'static 'nav-network-adjacency :index 35 :dist 116751.98) + (new 'static 'nav-network-adjacency :index 34 :dist 93113.14) + (new 'static 'nav-network-adjacency :index 31 :dist 109091.63) + (new 'static 'nav-network-adjacency :index 30 :dist 92576.16) + (new 'static 'nav-network-adjacency :index 32 :dist 83090.64) + (new 'static 'nav-network-adjacency :index 33 :dist 56782.027) + (new 'static 'nav-network-adjacency :index 33 :dist 56782.027) + ) + ) + (new 'static 'nav-network-info + :index 16 + :pos (new 'static 'vector :x 744062.56 :y 6454.886 :z -154488.83 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 16 :parent #f) + :count 14 + :adjacency (new 'static 'inline-array nav-network-adjacency 14 + (new 'static 'nav-network-adjacency :index 71 :dist 92695.34) + (new 'static 'nav-network-adjacency :index 29 :dist 113749.195) + (new 'static 'nav-network-adjacency :index 70 :dist 113509.58) + (new 'static 'nav-network-adjacency :index 58 :dist 111597.98) + (new 'static 'nav-network-adjacency :index 50 :dist 74192.484) + (new 'static 'nav-network-adjacency :index 49 :dist 79215.82) + (new 'static 'nav-network-adjacency :index 48 :dist 41458.484) + (new 'static 'nav-network-adjacency :index 47 :dist 78019.79) + (new 'static 'nav-network-adjacency :index 33 :dist 107866.11) + (new 'static 'nav-network-adjacency :index 28 :dist 91670.12) + (new 'static 'nav-network-adjacency :index 15 :dist 68193.08) + (new 'static 'nav-network-adjacency :index 14 :dist 91750.81) + (new 'static 'nav-network-adjacency :index 72 :dist 114094.49) + (new 'static 'nav-network-adjacency :index 73 :dist 109972.69) + ) + ) + (new 'static 'nav-network-info + :index 17 + :pos (new 'static 'vector :x 678174.3 :y 6454.886 :z -153542.66 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 17 :parent #f) + :count 12 + :adjacency (new 'static 'inline-array nav-network-adjacency 12 + (new 'static 'nav-network-adjacency :index 18 :dist 67195.695) + (new 'static 'nav-network-adjacency :index 28 :dist 61837.723) + (new 'static 'nav-network-adjacency :index 25 :dist 91088.484) + (new 'static 'nav-network-adjacency :index 27 :dist 114158.8) + (new 'static 'nav-network-adjacency :index 30 :dist 89952.26) + (new 'static 'nav-network-adjacency :index 46 :dist 79854.8) + (new 'static 'nav-network-adjacency :index 47 :dist 41470.363) + (new 'static 'nav-network-adjacency :index 48 :dist 78042.32) + (new 'static 'nav-network-adjacency :index 57 :dist 111126.53) + (new 'static 'nav-network-adjacency :index 69 :dist 115740.266) + (new 'static 'nav-network-adjacency :index 70 :dist 92718.28) + (new 'static 'nav-network-adjacency :index 71 :dist 113917.13) + ) + ) + (new 'static 'nav-network-info + :index 18 + :pos (new 'static 'vector :x 610979.44 :y 6455.296 :z -153138.8 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 18 :parent #f) + :count 11 + :adjacency (new 'static 'inline-array nav-network-adjacency 11 + (new 'static 'nav-network-adjacency :index 17 :dist 67195.695) + (new 'static 'nav-network-adjacency :index 24 :dist 87894.42) + (new 'static 'nav-network-adjacency :index 26 :dist 113124.97) + (new 'static 'nav-network-adjacency :index 28 :dist 90368.82) + (new 'static 'nav-network-adjacency :index 45 :dist 74518.12) + (new 'static 'nav-network-adjacency :index 46 :dist 41462.99) + (new 'static 'nav-network-adjacency :index 47 :dist 78809.086) + (new 'static 'nav-network-adjacency :index 56 :dist 108632.88) + (new 'static 'nav-network-adjacency :index 68 :dist 111651.63) + (new 'static 'nav-network-adjacency :index 69 :dist 92714.6) + (new 'static 'nav-network-adjacency :index 70 :dist 114763.77) + ) + ) + (new 'static 'nav-network-info + :index 19 + :pos (new 'static 'vector :x 550506.06 :y 6454.886 :z -154057.52 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 19 :parent #f) + :count 12 + :adjacency (new 'static 'inline-array nav-network-adjacency 12 + (new 'static 'nav-network-adjacency :index 20 :dist 70718.26) + (new 'static 'nav-network-adjacency :index 24 :dist 60732.62) + (new 'static 'nav-network-adjacency :index 21 :dist 103704.164) + (new 'static 'nav-network-adjacency :index 23 :dist 113165.93) + (new 'static 'nav-network-adjacency :index 25 :dist 83781.63) + (new 'static 'nav-network-adjacency :index 44 :dist 81785.24) + (new 'static 'nav-network-adjacency :index 45 :dist 41484.29) + (new 'static 'nav-network-adjacency :index 46 :dist 72456.195) + (new 'static 'nav-network-adjacency :index 55 :dist 109923.53) + (new 'static 'nav-network-adjacency :index 67 :dist 116360.4) + (new 'static 'nav-network-adjacency :index 68 :dist 92707.23) + (new 'static 'nav-network-adjacency :index 69 :dist 109556.94) + ) + ) + (new 'static 'nav-network-info + :index 20 + :pos (new 'static 'vector :x 479788.66 :y 6454.886 :z -154471.62 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 20 :parent #f) + :count 8 + :adjacency (new 'static 'inline-array nav-network-adjacency 8 + (new 'static 'nav-network-adjacency :index 19 :dist 70718.26) + (new 'static 'nav-network-adjacency :index 21 :dist 63099.29) + (new 'static 'nav-network-adjacency :index 22 :dist 114034.28) + (new 'static 'nav-network-adjacency :index 24 :dist 90367.18) + (new 'static 'nav-network-adjacency :index 44 :dist 41451.52) + (new 'static 'nav-network-adjacency :index 45 :dist 80728.88) + (new 'static 'nav-network-adjacency :index 67 :dist 92678.96) + (new 'static 'nav-network-adjacency :index 68 :dist 115514.164) + ) + ) + (new 'static 'nav-network-info + :index 21 + :pos (new 'static 'vector :x 466898.53 :y 6454.886 :z -92702.72 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 21 :parent #f) + :count 8 + :adjacency (new 'static 'inline-array nav-network-adjacency 8 + (new 'static 'nav-network-adjacency :index 20 :dist 63099.29) + (new 'static 'nav-network-adjacency :index 22 :dist 51818.906) + (new 'static 'nav-network-adjacency :index 19 :dist 103704.164) + (new 'static 'nav-network-adjacency :index 23 :dist 95258.625) + (new 'static 'nav-network-adjacency :index 39 :dist 101316.61) + (new 'static 'nav-network-adjacency :index 40 :dist 63092.33) + (new 'static 'nav-network-adjacency :index 44 :dist 75171.84) + (new 'static 'nav-network-adjacency :index 45 :dist 110089.42) + ) + ) + (new 'static 'nav-network-info + :index 22 + :pos (new 'static 'vector :x 469163.62 :y 6455.296 :z -40932.965 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 22 :parent #f) + :count 8 + :adjacency (new 'static 'inline-array nav-network-adjacency 8 + (new 'static 'nav-network-adjacency :index 21 :dist 51818.906) + (new 'static 'nav-network-adjacency :index 23 :dist 77708.91) + (new 'static 'nav-network-adjacency :index 20 :dist 114034.28) + (new 'static 'nav-network-adjacency :index 39 :dist 88131.586) + (new 'static 'nav-network-adjacency :index 40 :dist 41667.79) + (new 'static 'nav-network-adjacency :index 41 :dist 107427.84) + (new 'static 'nav-network-adjacency :index 65 :dist 120061.54) + (new 'static 'nav-network-adjacency :index 66 :dist 92678.555) + ) + ) + (new 'static 'nav-network-info + :index 23 + :pos (new 'static 'vector :x 546872.94 :y 6455.296 :z -40949.76 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 23 :parent #f) + :count 12 + :adjacency (new 'static 'inline-array nav-network-adjacency 12 + (new 'static 'nav-network-adjacency :index 22 :dist 77708.91) + (new 'static 'nav-network-adjacency :index 24 :dist 52511.95) + (new 'static 'nav-network-adjacency :index 19 :dist 113165.93) + (new 'static 'nav-network-adjacency :index 21 :dist 95258.625) + (new 'static 'nav-network-adjacency :index 25 :dist 81876.99) + (new 'static 'nav-network-adjacency :index 38 :dist 74582.42) + (new 'static 'nav-network-adjacency :index 39 :dist 41771.83) + (new 'static 'nav-network-adjacency :index 40 :dist 88718.13) + (new 'static 'nav-network-adjacency :index 55 :dist 107287.34) + (new 'static 'nav-network-adjacency :index 64 :dist 110069.35) + (new 'static 'nav-network-adjacency :index 65 :dist 92698.625) + (new 'static 'nav-network-adjacency :index 66 :dist 121558.22) + ) + ) + (new 'static 'nav-network-info + :index 24 + :pos (new 'static 'vector :x 546451.06 :y 6455.296 :z -93460.07 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 24 :parent #f) + :count 13 + :adjacency (new 'static 'inline-array nav-network-adjacency 13 + (new 'static 'nav-network-adjacency :index 23 :dist 52511.95) + (new 'static 'nav-network-adjacency :index 19 :dist 60732.62) + (new 'static 'nav-network-adjacency :index 18 :dist 87894.42) + (new 'static 'nav-network-adjacency :index 20 :dist 90367.18) + (new 'static 'nav-network-adjacency :index 25 :dist 62647.91) + (new 'static 'nav-network-adjacency :index 26 :dist 82173.95) + (new 'static 'nav-network-adjacency :index 38 :dist 90498.25) + (new 'static 'nav-network-adjacency :index 39 :dist 62907.598) + (new 'static 'nav-network-adjacency :index 40 :dist 100596.94) + (new 'static 'nav-network-adjacency :index 44 :dist 99006.46) + (new 'static 'nav-network-adjacency :index 45 :dist 72706.87) + (new 'static 'nav-network-adjacency :index 46 :dist 96258.87) + (new 'static 'nav-network-adjacency :index 68 :dist 109776.9) + ) + ) + (new 'static 'nav-network-info + :index 25 + :pos (new 'static 'vector :x 609095.25 :y 6455.296 :z -94168.68 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 25 :parent #f) + :count 13 + :adjacency (new 'static 'inline-array nav-network-adjacency 13 + (new 'static 'nav-network-adjacency :index 26 :dist 54135.6) + (new 'static 'nav-network-adjacency :index 17 :dist 91088.484) + (new 'static 'nav-network-adjacency :index 19 :dist 83781.63) + (new 'static 'nav-network-adjacency :index 23 :dist 81876.99) + (new 'static 'nav-network-adjacency :index 24 :dist 62647.91) + (new 'static 'nav-network-adjacency :index 27 :dist 88021.81) + (new 'static 'nav-network-adjacency :index 37 :dist 95564.19) + (new 'static 'nav-network-adjacency :index 38 :dist 66093.875) + (new 'static 'nav-network-adjacency :index 39 :dist 88936.445) + (new 'static 'nav-network-adjacency :index 45 :dist 93811.51) + (new 'static 'nav-network-adjacency :index 46 :dist 71793.46) + (new 'static 'nav-network-adjacency :index 47 :dist 99170.305) + (new 'static 'nav-network-adjacency :index 69 :dist 108857.34) + ) + ) + (new 'static 'nav-network-info + :index 26 + :pos (new 'static 'vector :x 608886.4 :y 6455.296 :z -40033.074 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 26 :parent #f) + :count 12 + :adjacency (new 'static 'inline-array nav-network-adjacency 12 + (new 'static 'nav-network-adjacency :index 25 :dist 54135.6) + (new 'static 'nav-network-adjacency :index 27 :dist 69106.484) + (new 'static 'nav-network-adjacency :index 18 :dist 113124.97) + (new 'static 'nav-network-adjacency :index 24 :dist 82173.95) + (new 'static 'nav-network-adjacency :index 28 :dist 85707.164) + (new 'static 'nav-network-adjacency :index 37 :dist 81247.02) + (new 'static 'nav-network-adjacency :index 38 :dist 41533.03) + (new 'static 'nav-network-adjacency :index 39 :dist 74927.31) + (new 'static 'nav-network-adjacency :index 56 :dist 108815.16) + (new 'static 'nav-network-adjacency :index 63 :dist 116495.16) + (new 'static 'nav-network-adjacency :index 64 :dist 92753.1) + (new 'static 'nav-network-adjacency :index 65 :dist 112320.516) + ) + ) + (new 'static 'nav-network-info + :index 27 + :pos (new 'static 'vector :x 677990.0 :y 6454.886 :z -39383.86 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 27 :parent #f) + :count 12 + :adjacency (new 'static 'inline-array nav-network-adjacency 12 + (new 'static 'nav-network-adjacency :index 26 :dist 69106.484) + (new 'static 'nav-network-adjacency :index 29 :dist 66184.4) + (new 'static 'nav-network-adjacency :index 17 :dist 114158.8) + (new 'static 'nav-network-adjacency :index 25 :dist 88021.81) + (new 'static 'nav-network-adjacency :index 30 :dist 82790.4) + (new 'static 'nav-network-adjacency :index 36 :dist 77680.23) + (new 'static 'nav-network-adjacency :index 37 :dist 41653.453) + (new 'static 'nav-network-adjacency :index 38 :dist 80676.45) + (new 'static 'nav-network-adjacency :index 57 :dist 106679.914) + (new 'static 'nav-network-adjacency :index 62 :dist 112348.77) + (new 'static 'nav-network-adjacency :index 63 :dist 92756.79) + (new 'static 'nav-network-adjacency :index 64 :dist 117257.83) + ) + ) + (new 'static 'nav-network-info + :index 28 + :pos (new 'static 'vector :x 677260.9 :y 6454.886 :z -91711.484 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 28 :parent #f) + :count 12 + :adjacency (new 'static 'inline-array nav-network-adjacency 12 + (new 'static 'nav-network-adjacency :index 16 :dist 91670.12) + (new 'static 'nav-network-adjacency :index 17 :dist 61837.723) + (new 'static 'nav-network-adjacency :index 18 :dist 90368.82) + (new 'static 'nav-network-adjacency :index 26 :dist 85707.164) + (new 'static 'nav-network-adjacency :index 29 :dist 84105.22) + (new 'static 'nav-network-adjacency :index 36 :dist 92835.84) + (new 'static 'nav-network-adjacency :index 37 :dist 63632.18) + (new 'static 'nav-network-adjacency :index 38 :dist 93813.555) + (new 'static 'nav-network-adjacency :index 46 :dist 99910.45) + (new 'static 'nav-network-adjacency :index 47 :dist 73337.65) + (new 'static 'nav-network-adjacency :index 48 :dist 100216.016) + (new 'static 'nav-network-adjacency :index 70 :dist 109841.61) + ) + ) + (new 'static 'nav-network-info + :index 29 + :pos (new 'static 'vector :x 744160.9 :y 6454.886 :z -40739.637 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 29 :parent #f) + :count 13 + :adjacency (new 'static 'inline-array nav-network-adjacency 13 + (new 'static 'nav-network-adjacency :index 16 :dist 113749.195) + (new 'static 'nav-network-adjacency :index 27 :dist 66184.4) + (new 'static 'nav-network-adjacency :index 30 :dist 50219.83) + (new 'static 'nav-network-adjacency :index 31 :dist 70137.86) + (new 'static 'nav-network-adjacency :index 14 :dist 88945.05) + (new 'static 'nav-network-adjacency :index 28 :dist 84105.22) + (new 'static 'nav-network-adjacency :index 35 :dist 80823.914) + (new 'static 'nav-network-adjacency :index 36 :dist 41464.63) + (new 'static 'nav-network-adjacency :index 37 :dist 77542.195) + (new 'static 'nav-network-adjacency :index 58 :dist 106080.664) + (new 'static 'nav-network-adjacency :index 61 :dist 116108.086) + (new 'static 'nav-network-adjacency :index 62 :dist 92715.414) + (new 'static 'nav-network-adjacency :index 63 :dist 113075.81) + ) + ) + (new 'static 'nav-network-info + :index 30 + :pos (new 'static 'vector :x 742768.25 :y 6454.886 :z -90940.21 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 30 :parent #f) + :count 14 + :adjacency (new 'static 'inline-array nav-network-adjacency 14 + (new 'static 'nav-network-adjacency :index 15 :dist 92576.16) + (new 'static 'nav-network-adjacency :index 29 :dist 50219.83) + (new 'static 'nav-network-adjacency :index 17 :dist 89952.26) + (new 'static 'nav-network-adjacency :index 27 :dist 82790.4) + (new 'static 'nav-network-adjacency :index 31 :dist 86030.336) + (new 'static 'nav-network-adjacency :index 35 :dist 94968.625) + (new 'static 'nav-network-adjacency :index 36 :dist 64311.707) + (new 'static 'nav-network-adjacency :index 37 :dist 89890.0) + (new 'static 'nav-network-adjacency :index 47 :dist 98317.93) + (new 'static 'nav-network-adjacency :index 48 :dist 75149.31) + (new 'static 'nav-network-adjacency :index 49 :dist 100664.12) + (new 'static 'nav-network-adjacency :index 50 :dist 122651.445) + (new 'static 'nav-network-adjacency :index 62 :dist 105004.234) + (new 'static 'nav-network-adjacency :index 71 :dist 111251.45) + ) + ) + (new 'static 'nav-network-info + :index 31 + :pos (new 'static 'vector :x 814259.8 :y 6455.296 :z -43083.777 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 31 :parent #f) + :count 13 + :adjacency (new 'static 'inline-array nav-network-adjacency 13 + (new 'static 'nav-network-adjacency :index 15 :dist 109091.63) + (new 'static 'nav-network-adjacency :index 29 :dist 70137.86) + (new 'static 'nav-network-adjacency :index 14 :dist 52362.035) + (new 'static 'nav-network-adjacency :index 32 :dist 78694.81) + (new 'static 'nav-network-adjacency :index 30 :dist 86030.336) + (new 'static 'nav-network-adjacency :index 34 :dist 89612.29) + (new 'static 'nav-network-adjacency :index 35 :dist 41454.797) + (new 'static 'nav-network-adjacency :index 36 :dist 81890.92) + (new 'static 'nav-network-adjacency :index 49 :dist 116272.336) + (new 'static 'nav-network-adjacency :index 59 :dist 106962.945) + (new 'static 'nav-network-adjacency :index 61 :dist 92683.47) + (new 'static 'nav-network-adjacency :index 62 :dist 117852.98) + (new 'static 'nav-network-adjacency :index #x6a :dist 134927.97) + ) + ) + (new 'static 'nav-network-info + :index 32 + :pos (new 'static 'vector :x 872976.0 :y 6455.296 :z -95479.4 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 32 :parent #f) + :count 9 + :adjacency (new 'static 'inline-array nav-network-adjacency 9 + (new 'static 'nav-network-adjacency :index 31 :dist 78694.81) + (new 'static 'nav-network-adjacency :index 14 :dist 58683.39) + (new 'static 'nav-network-adjacency :index 15 :dist 83090.64) + (new 'static 'nav-network-adjacency :index 33 :dist 109286.6) + (new 'static 'nav-network-adjacency :index 34 :dist 41455.617) + (new 'static 'nav-network-adjacency :index 35 :dist 89478.35) + (new 'static 'nav-network-adjacency :index 51 :dist 109783.86) + (new 'static 'nav-network-adjacency :index 60 :dist 92716.234) + (new 'static 'nav-network-adjacency :index 61 :dist 122276.25) + ) + ) + (new 'static 'nav-network-info + :index 33 + :pos (new 'static 'vector :x 841424.5 :y -5001.216 :z -199483.39 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 33 :parent #f) + :count 13 + :adjacency (new 'static 'inline-array nav-network-adjacency 13 + (new 'static 'nav-network-adjacency :index 16 :dist 107866.11) + (new 'static 'nav-network-adjacency :index 15 :dist 56782.027) + (new 'static 'nav-network-adjacency :index 15 :dist 56782.027) + (new 'static 'nav-network-adjacency :index 32 :dist 109286.6) + (new 'static 'nav-network-adjacency :index 14 :dist 108125.39) + (new 'static 'nav-network-adjacency :index 34 :dist 120770.97) + (new 'static 'nav-network-adjacency :index 48 :dist 119735.914) + (new 'static 'nav-network-adjacency :index 49 :dist 77321.42) + (new 'static 'nav-network-adjacency :index 50 :dist 74737.664) + (new 'static 'nav-network-adjacency :index 51 :dist 63254.938) + (new 'static 'nav-network-adjacency :index 52 :dist 99625.78) + (new 'static 'nav-network-adjacency :index 53 :dist 79921.97) + (new 'static 'nav-network-adjacency :index #x6f :dist 97601.125) + ) + ) + (new 'static 'nav-network-info + :index 34 + :pos (new 'static 'vector :x 873684.56 :y 47903.54 :z -95820.59 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 34 :parent #f) + :count 13 + :adjacency (new 'static 'inline-array nav-network-adjacency 13 + (new 'static 'nav-network-adjacency :index 15 :dist 93113.14) + (new 'static 'nav-network-adjacency :index 35 :dist 80057.14) + (new 'static 'nav-network-adjacency :index 14 :dist 72425.88) + (new 'static 'nav-network-adjacency :index 31 :dist 89612.29) + (new 'static 'nav-network-adjacency :index 32 :dist 41455.617) + (new 'static 'nav-network-adjacency :index 33 :dist 120770.97) + (new 'static 'nav-network-adjacency :index 59 :dist 80117.35) + (new 'static 'nav-network-adjacency :index 60 :dist 51272.5) + (new 'static 'nav-network-adjacency :index 61 :dist 95435.984) + (new 'static 'nav-network-adjacency :index 72 :dist 98115.586) + (new 'static 'nav-network-adjacency :index 74 :dist 110533.836) + (new 'static 'nav-network-adjacency :index #x6b :dist 70520.83) + (new 'static 'nav-network-adjacency :index #x6a :dist 92629.81) + ) + ) + (new 'static 'nav-network-info + :index 35 + :pos (new 'static 'vector :x 813510.25 :y 47903.54 :z -43017.01 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 35 :parent #f) + :count 15 + :adjacency (new 'static 'inline-array nav-network-adjacency 15 + (new 'static 'nav-network-adjacency :index 15 :dist 116751.98) + (new 'static 'nav-network-adjacency :index 34 :dist 80057.14) + (new 'static 'nav-network-adjacency :index 36 :dist 69876.53) + (new 'static 'nav-network-adjacency :index 14 :dist 66838.53) + (new 'static 'nav-network-adjacency :index 29 :dist 80823.914) + (new 'static 'nav-network-adjacency :index 30 :dist 94968.625) + (new 'static 'nav-network-adjacency :index 31 :dist 41454.797) + (new 'static 'nav-network-adjacency :index 32 :dist 89478.35) + (new 'static 'nav-network-adjacency :index 58 :dist 100538.78) + (new 'static 'nav-network-adjacency :index 59 :dist 74035.61) + (new 'static 'nav-network-adjacency :index 60 :dist 96717.62) + (new 'static 'nav-network-adjacency :index 61 :dist 51245.465) + (new 'static 'nav-network-adjacency :index 62 :dist 88410.11) + (new 'static 'nav-network-adjacency :index 72 :dist 119281.26) + (new 'static 'nav-network-adjacency :index #x6a :dist 118780.73) + ) + ) + (new 'static 'nav-network-info + :index 36 + :pos (new 'static 'vector :x 743644.75 :y 47903.54 :z -41774.285 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 36 :parent #f) + :count 15 + :adjacency (new 'static 'inline-array nav-network-adjacency 15 + (new 'static 'nav-network-adjacency :index 35 :dist 69876.53) + (new 'static 'nav-network-adjacency :index 37 :dist 64983.86) + (new 'static 'nav-network-adjacency :index 14 :dist 97927.17) + (new 'static 'nav-network-adjacency :index 27 :dist 77680.23) + (new 'static 'nav-network-adjacency :index 28 :dist 92835.84) + (new 'static 'nav-network-adjacency :index 29 :dist 41464.63) + (new 'static 'nav-network-adjacency :index 30 :dist 64311.707) + (new 'static 'nav-network-adjacency :index 31 :dist 81890.92) + (new 'static 'nav-network-adjacency :index 57 :dist 96780.695) + (new 'static 'nav-network-adjacency :index 58 :dist 71983.516) + (new 'static 'nav-network-adjacency :index 59 :dist 101477.17) + (new 'static 'nav-network-adjacency :index 61 :dist 87111.68) + (new 'static 'nav-network-adjacency :index 62 :dist 51270.453) + (new 'static 'nav-network-adjacency :index 63 :dist 82167.4) + (new 'static 'nav-network-adjacency :index 71 :dist 121976.016) + ) + ) + (new 'static 'nav-network-info + :index 37 + :pos (new 'static 'vector :x 678682.2 :y 47903.54 :z -43451.188 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 37 :parent #f) + :count 15 + :adjacency (new 'static 'inline-array nav-network-adjacency 15 + (new 'static 'nav-network-adjacency :index 36 :dist 64983.86) + (new 'static 'nav-network-adjacency :index 38 :dist 69832.7) + (new 'static 'nav-network-adjacency :index 25 :dist 95564.19) + (new 'static 'nav-network-adjacency :index 26 :dist 81247.02) + (new 'static 'nav-network-adjacency :index 27 :dist 41653.453) + (new 'static 'nav-network-adjacency :index 28 :dist 63632.18) + (new 'static 'nav-network-adjacency :index 29 :dist 77542.195) + (new 'static 'nav-network-adjacency :index 30 :dist 89890.0) + (new 'static 'nav-network-adjacency :index 56 :dist 97050.625) + (new 'static 'nav-network-adjacency :index 57 :dist 70727.27) + (new 'static 'nav-network-adjacency :index 58 :dist 95275.83) + (new 'static 'nav-network-adjacency :index 62 :dist 81050.01) + (new 'static 'nav-network-adjacency :index 63 :dist 51230.72) + (new 'static 'nav-network-adjacency :index 64 :dist 88731.24) + (new 'static 'nav-network-adjacency :index 70 :dist 118818.81) + ) + ) + (new 'static 'nav-network-info + :index 38 + :pos (new 'static 'vector :x 608853.6 :y 47903.54 :z -42686.465 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 38 :parent #f) + :count 15 + :adjacency (new 'static 'inline-array nav-network-adjacency 15 + (new 'static 'nav-network-adjacency :index 37 :dist 69832.7) + (new 'static 'nav-network-adjacency :index 39 :dist 62183.016) + (new 'static 'nav-network-adjacency :index 23 :dist 74582.42) + (new 'static 'nav-network-adjacency :index 24 :dist 90498.25) + (new 'static 'nav-network-adjacency :index 25 :dist 66093.875) + (new 'static 'nav-network-adjacency :index 26 :dist 41533.03) + (new 'static 'nav-network-adjacency :index 27 :dist 80676.45) + (new 'static 'nav-network-adjacency :index 28 :dist 93813.555) + (new 'static 'nav-network-adjacency :index 55 :dist 95340.95) + (new 'static 'nav-network-adjacency :index 56 :dist 74722.51) + (new 'static 'nav-network-adjacency :index 57 :dist 99887.516) + (new 'static 'nav-network-adjacency :index 63 :dist 87191.96) + (new 'static 'nav-network-adjacency :index 64 :dist 51291.34) + (new 'static 'nav-network-adjacency :index 65 :dist 81489.92) + (new 'static 'nav-network-adjacency :index 69 :dist 120068.51) + ) + ) + (new 'static 'nav-network-info + :index 39 + :pos (new 'static 'vector :x 546766.44 :y 47903.54 :z -46138.164 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 39 :parent #f) + :count 15 + :adjacency (new 'static 'inline-array nav-network-adjacency 15 + (new 'static 'nav-network-adjacency :index 38 :dist 62183.016) + (new 'static 'nav-network-adjacency :index 40 :dist 78227.05) + (new 'static 'nav-network-adjacency :index 21 :dist 101316.61) + (new 'static 'nav-network-adjacency :index 22 :dist 88131.586) + (new 'static 'nav-network-adjacency :index 23 :dist 41771.83) + (new 'static 'nav-network-adjacency :index 24 :dist 62907.598) + (new 'static 'nav-network-adjacency :index 25 :dist 88936.445) + (new 'static 'nav-network-adjacency :index 26 :dist 74927.31) + (new 'static 'nav-network-adjacency :index 54 :dist 106085.58) + (new 'static 'nav-network-adjacency :index 55 :dist 70799.36) + (new 'static 'nav-network-adjacency :index 56 :dist 99649.945) + (new 'static 'nav-network-adjacency :index 64 :dist 78554.73) + (new 'static 'nav-network-adjacency :index 65 :dist 51357.695) + (new 'static 'nav-network-adjacency :index 66 :dist 93956.09) + (new 'static 'nav-network-adjacency :index 68 :dist 117856.26) + ) + ) + (new 'static 'nav-network-info + :index 40 + :pos (new 'static 'vector :x 468545.12 :y 47903.54 :z -45163.727 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 40 :parent #f) + :count 11 + :adjacency (new 'static 'inline-array nav-network-adjacency 11 + (new 'static 'nav-network-adjacency :index 39 :dist 78227.05) + (new 'static 'nav-network-adjacency :index 41 :dist 101895.78) + (new 'static 'nav-network-adjacency :index 21 :dist 63092.33) + (new 'static 'nav-network-adjacency :index 22 :dist 41667.79) + (new 'static 'nav-network-adjacency :index 23 :dist 88718.13) + (new 'static 'nav-network-adjacency :index 24 :dist 100596.94) + (new 'static 'nav-network-adjacency :index 54 :dist 70855.06) + (new 'static 'nav-network-adjacency :index 55 :dist 106708.99) + (new 'static 'nav-network-adjacency :index 65 :dist 92458.19) + (new 'static 'nav-network-adjacency :index 66 :dist 51444.12) + (new 'static 'nav-network-adjacency :index 67 :dist 122187.37) + ) + ) + (new 'static 'nav-network-info + :index 41 + :pos (new 'static 'vector :x 402899.75 :y 47903.54 :z 32768.0 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 41 :parent #f) + :count 5 + :adjacency (new 'static 'inline-array nav-network-adjacency 5 + (new 'static 'nav-network-adjacency :index 40 :dist 101895.78) + (new 'static 'nav-network-adjacency :index 42 :dist 191261.9) + (new 'static 'nav-network-adjacency :index 22 :dist 107427.84) + (new 'static 'nav-network-adjacency :index 66 :dist 110662.04) + (new 'static 'nav-network-adjacency :index 77 :dist 60767.027) + ) + ) + (new 'static 'nav-network-info + :index 42 + :pos (new 'static 'vector :x 334944.25 :y 47903.54 :z 211550.62 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 42 :parent #f) + :count 3 + :adjacency (new 'static 'inline-array nav-network-adjacency 3 + (new 'static 'nav-network-adjacency :index 41 :dist 191261.9) + (new 'static 'nav-network-adjacency :index 43 :dist 179790.23) + (new 'static 'nav-network-adjacency :index 78 :dist 59670.527) + ) + ) + (new 'static 'nav-network-info + :index 43 + :pos (new 'static 'vector :x 332870.03 :y 47903.54 :z 391328.97 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 43 :parent #f) + :count 4 + :adjacency (new 'static 'inline-array nav-network-adjacency 4 + (new 'static 'nav-network-adjacency :index 42 :dist 179790.23) + (new 'static 'nav-network-adjacency :index 10 :dist 60114.125) + (new 'static 'nav-network-adjacency :index 79 :dist 82589.29) + (new 'static 'nav-network-adjacency :index #x8e :dist 124878.44) + ) + ) + (new 'static 'nav-network-info + :index 44 + :pos (new 'static 'vector :x 480001.62 :y 47903.54 :z -154030.9 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 44 :parent #f) + :count 9 + :adjacency (new 'static 'inline-array nav-network-adjacency 9 + (new 'static 'nav-network-adjacency :index 45 :dist 69055.695) + (new 'static 'nav-network-adjacency :index 19 :dist 81785.24) + (new 'static 'nav-network-adjacency :index 20 :dist 41451.52) + (new 'static 'nav-network-adjacency :index 21 :dist 75171.84) + (new 'static 'nav-network-adjacency :index 24 :dist 99006.46) + (new 'static 'nav-network-adjacency :index 54 :dist 79870.36) + (new 'static 'nav-network-adjacency :index 55 :dist 103455.945) + (new 'static 'nav-network-adjacency :index 67 :dist 51244.645) + (new 'static 'nav-network-adjacency :index 68 :dist 85721.086) + ) + ) + (new 'static 'nav-network-info + :index 45 + :pos (new 'static 'vector :x 549052.0 :y 47903.54 :z -153139.2 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 45 :parent #f) + :count 15 + :adjacency (new 'static 'inline-array nav-network-adjacency 15 + (new 'static 'nav-network-adjacency :index 44 :dist 69055.695) + (new 'static 'nav-network-adjacency :index 46 :dist 60871.477) + (new 'static 'nav-network-adjacency :index 18 :dist 74518.12) + (new 'static 'nav-network-adjacency :index 19 :dist 41484.29) + (new 'static 'nav-network-adjacency :index 20 :dist 80728.88) + (new 'static 'nav-network-adjacency :index 21 :dist 110089.42) + (new 'static 'nav-network-adjacency :index 24 :dist 72706.87) + (new 'static 'nav-network-adjacency :index 25 :dist 93811.51) + (new 'static 'nav-network-adjacency :index 54 :dist 113173.71) + (new 'static 'nav-network-adjacency :index 55 :dist 77495.09) + (new 'static 'nav-network-adjacency :index 56 :dist 101286.3) + (new 'static 'nav-network-adjacency :index 65 :dist 121821.59) + (new 'static 'nav-network-adjacency :index 67 :dist 85886.16) + (new 'static 'nav-network-adjacency :index 68 :dist 51232.77) + (new 'static 'nav-network-adjacency :index 69 :dist 78778.37) + ) + ) + (new 'static 'nav-network-info + :index 46 + :pos (new 'static 'vector :x 609922.7 :y 47903.54 :z -152783.25 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 46 :parent #f) + :count 15 + :adjacency (new 'static 'inline-array nav-network-adjacency 15 + (new 'static 'nav-network-adjacency :index 45 :dist 60871.477) + (new 'static 'nav-network-adjacency :index 47 :dist 68081.664) + (new 'static 'nav-network-adjacency :index 17 :dist 79854.8) + (new 'static 'nav-network-adjacency :index 18 :dist 41462.99) + (new 'static 'nav-network-adjacency :index 19 :dist 72456.195) + (new 'static 'nav-network-adjacency :index 24 :dist 96258.87) + (new 'static 'nav-network-adjacency :index 25 :dist 71793.46) + (new 'static 'nav-network-adjacency :index 28 :dist 99910.45) + (new 'static 'nav-network-adjacency :index 55 :dist 99113.78) + (new 'static 'nav-network-adjacency :index 56 :dist 76210.18) + (new 'static 'nav-network-adjacency :index 57 :dist 105086.98) + (new 'static 'nav-network-adjacency :index 64 :dist 121333.35) + (new 'static 'nav-network-adjacency :index 68 :dist 79817.93) + (new 'static 'nav-network-adjacency :index 69 :dist 51256.523) + (new 'static 'nav-network-adjacency :index 70 :dist 85726.0) + ) + ) + (new 'static 'nav-network-info + :index 47 + :pos (new 'static 'vector :x 678002.25 :y 47903.54 :z -152208.6 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 47 :parent #f) + :count 16 + :adjacency (new 'static 'inline-array nav-network-adjacency 16 + (new 'static 'nav-network-adjacency :index 16 :dist 78019.79) + (new 'static 'nav-network-adjacency :index 46 :dist 68081.664) + (new 'static 'nav-network-adjacency :index 48 :dist 66312.195) + (new 'static 'nav-network-adjacency :index 17 :dist 41470.363) + (new 'static 'nav-network-adjacency :index 18 :dist 78809.086) + (new 'static 'nav-network-adjacency :index 25 :dist 99170.305) + (new 'static 'nav-network-adjacency :index 28 :dist 73337.65) + (new 'static 'nav-network-adjacency :index 30 :dist 98317.93) + (new 'static 'nav-network-adjacency :index 50 :dist 119358.26) + (new 'static 'nav-network-adjacency :index 56 :dist 97925.94) + (new 'static 'nav-network-adjacency :index 57 :dist 78887.32) + (new 'static 'nav-network-adjacency :index 58 :dist 101784.78) + (new 'static 'nav-network-adjacency :index 63 :dist 120568.22) + (new 'static 'nav-network-adjacency :index 69 :dist 86043.445) + (new 'static 'nav-network-adjacency :index 70 :dist 51251.2) + (new 'static 'nav-network-adjacency :index 71 :dist 83872.16) + ) + ) + (new 'static 'nav-network-info + :index 48 + :pos (new 'static 'vector :x 744300.1 :y 47903.54 :z -153606.97 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 48 :parent #f) + :count 18 + :adjacency (new 'static 'inline-array nav-network-adjacency 18 + (new 'static 'nav-network-adjacency :index 16 :dist 41458.484) + (new 'static 'nav-network-adjacency :index 15 :dist 79577.5) + (new 'static 'nav-network-adjacency :index 47 :dist 66312.195) + (new 'static 'nav-network-adjacency :index 49 :dist 67238.71) + (new 'static 'nav-network-adjacency :index 50 :dist 61974.527) + (new 'static 'nav-network-adjacency :index 14 :dist 99997.695) + (new 'static 'nav-network-adjacency :index 17 :dist 78042.32) + (new 'static 'nav-network-adjacency :index 28 :dist 100216.016) + (new 'static 'nav-network-adjacency :index 30 :dist 75149.31) + (new 'static 'nav-network-adjacency :index 33 :dist 119735.914) + (new 'static 'nav-network-adjacency :index 53 :dist 120347.85) + (new 'static 'nav-network-adjacency :index 57 :dist 103321.6) + (new 'static 'nav-network-adjacency :index 58 :dist 79885.93) + (new 'static 'nav-network-adjacency :index 59 :dist 102397.54) + (new 'static 'nav-network-adjacency :index 70 :dist 83338.04) + (new 'static 'nav-network-adjacency :index 71 :dist 51236.863) + (new 'static 'nav-network-adjacency :index 72 :dist 83760.336) + (new 'static 'nav-network-adjacency :index 73 :dist 78592.82) + ) + ) + (new 'static 'nav-network-info + :index 49 + :pos (new 'static 'vector :x 811511.4 :y 47903.54 :z -151683.08 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 49 :parent #f) + :count 16 + :adjacency (new 'static 'inline-array nav-network-adjacency 16 + (new 'static 'nav-network-adjacency :index 16 :dist 79215.82) + (new 'static 'nav-network-adjacency :index 15 :dist 41456.844) + (new 'static 'nav-network-adjacency :index 48 :dist 67238.71) + (new 'static 'nav-network-adjacency :index 50 :dist 50595.02) + (new 'static 'nav-network-adjacency :index 53 :dist 100634.625) + (new 'static 'nav-network-adjacency :index 14 :dist 69916.266) + (new 'static 'nav-network-adjacency :index 30 :dist 100664.12) + (new 'static 'nav-network-adjacency :index 31 :dist 116272.336) + (new 'static 'nav-network-adjacency :index 33 :dist 77321.42) + (new 'static 'nav-network-adjacency :index 58 :dist 104489.78) + (new 'static 'nav-network-adjacency :index 59 :dist 75329.945) + (new 'static 'nav-network-adjacency :index 61 :dist 121398.48) + (new 'static 'nav-network-adjacency :index 71 :dist 84418.15) + (new 'static 'nav-network-adjacency :index 72 :dist 51243.418) + (new 'static 'nav-network-adjacency :index 73 :dist 69454.64) + (new 'static 'nav-network-adjacency :index 76 :dist 115332.71) + ) + ) + (new 'static 'nav-network-info + :index 50 + :pos (new 'static 'vector :x 788700.75 :y 47903.54 :z -196844.34 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 50 :parent #f) + :count 14 + :adjacency (new 'static 'inline-array nav-network-adjacency 14 + (new 'static 'nav-network-adjacency :index 16 :dist 74192.484) + (new 'static 'nav-network-adjacency :index 15 :dist 65329.152) + (new 'static 'nav-network-adjacency :index 49 :dist 50595.02) + (new 'static 'nav-network-adjacency :index 48 :dist 61974.527) + (new 'static 'nav-network-adjacency :index 53 :dist 60616.293) + (new 'static 'nav-network-adjacency :index 14 :dist 112492.13) + (new 'static 'nav-network-adjacency :index 30 :dist 122651.445) + (new 'static 'nav-network-adjacency :index 33 :dist 74737.664) + (new 'static 'nav-network-adjacency :index 47 :dist 119358.26) + (new 'static 'nav-network-adjacency :index 59 :dist 115104.98) + (new 'static 'nav-network-adjacency :index 71 :dist 80957.44) + (new 'static 'nav-network-adjacency :index 72 :dist 72311.195) + (new 'static 'nav-network-adjacency :index 73 :dist 51377.355) + (new 'static 'nav-network-adjacency :index 76 :dist 80449.125) + ) + ) + (new 'static 'nav-network-info + :index 51 + :pos (new 'static 'vector :x 876015.2 :y 47903.54 :z -197092.97 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 51 :parent #f) + :count 8 + :adjacency (new 'static 'inline-array nav-network-adjacency 8 + (new 'static 'nav-network-adjacency :index 52 :dist 79925.25) + (new 'static 'nav-network-adjacency :index 32 :dist 109783.86) + (new 'static 'nav-network-adjacency :index 33 :dist 63254.938) + (new 'static 'nav-network-adjacency :index 60 :dist 111644.266) + (new 'static 'nav-network-adjacency :index 74 :dist 51335.99) + (new 'static 'nav-network-adjacency :index 75 :dist 93351.12) + (new 'static 'nav-network-adjacency :index #x6c :dist 79119.56) + (new 'static 'nav-network-adjacency :index #x6b :dist 89692.98) + ) + ) + (new 'static 'nav-network-info + :index 52 + :pos (new 'static 'vector :x 874831.44 :y 47903.54 :z -277009.62 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 52 :parent #f) + :count 6 + :adjacency (new 'static 'inline-array nav-network-adjacency 6 + (new 'static 'nav-network-adjacency :index 51 :dist 79925.25) + (new 'static 'nav-network-adjacency :index 33 :dist 99625.78) + (new 'static 'nav-network-adjacency :index 74 :dist 97754.32) + (new 'static 'nav-network-adjacency :index 75 :dist 51265.945) + (new 'static 'nav-network-adjacency :index #x6c :dist 83596.49) + (new 'static 'nav-network-adjacency :index #x6f :dist 65859.586) + ) + ) + (new 'static 'nav-network-info + :index 53 + :pos (new 'static 'vector :x 813166.2 :y 47903.54 :z -252304.17 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 53 :parent #f) + :count 9 + :adjacency (new 'static 'inline-array nav-network-adjacency 9 + (new 'static 'nav-network-adjacency :index 15 :dist 108389.99) + (new 'static 'nav-network-adjacency :index 50 :dist 60616.293) + (new 'static 'nav-network-adjacency :index 49 :dist 100634.625) + (new 'static 'nav-network-adjacency :index 33 :dist 79921.97) + (new 'static 'nav-network-adjacency :index 48 :dist 120347.85) + (new 'static 'nav-network-adjacency :index 72 :dist 113818.83) + (new 'static 'nav-network-adjacency :index 73 :dist 82042.06) + (new 'static 'nav-network-adjacency :index 76 :dist 51377.355) + (new 'static 'nav-network-adjacency :index #x6f :dist 74742.58) + ) + ) + (new 'static 'nav-network-info + :index 54 + :pos (new 'static 'vector :x 467205.75 :y 99127.7 :z -94100.27 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 54 :parent #f) + :count 7 + :adjacency (new 'static 'inline-array nav-network-adjacency 7 + (new 'static 'nav-network-adjacency :index 66 :dist 53687.09) + (new 'static 'nav-network-adjacency :index 39 :dist 106085.58) + (new 'static 'nav-network-adjacency :index 40 :dist 70855.06) + (new 'static 'nav-network-adjacency :index 44 :dist 79870.36) + (new 'static 'nav-network-adjacency :index 45 :dist 113173.71) + (new 'static 'nav-network-adjacency :index 65 :dist 93656.266) + (new 'static 'nav-network-adjacency :index 68 :dist 100130.41) + ) + ) + (new 'static 'nav-network-info + :index 55 + :pos (new 'static 'vector :x 547786.3 :y 99127.7 :z -95001.4 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 55 :parent #f) + :count 15 + :adjacency (new 'static 'inline-array nav-network-adjacency 15 + (new 'static 'nav-network-adjacency :index 56 :dist 67951.82) + (new 'static 'nav-network-adjacency :index 65 :dist 52384.152) + (new 'static 'nav-network-adjacency :index 68 :dist 57268.633) + (new 'static 'nav-network-adjacency :index 19 :dist 109923.53) + (new 'static 'nav-network-adjacency :index 23 :dist 107287.34) + (new 'static 'nav-network-adjacency :index 38 :dist 95340.95) + (new 'static 'nav-network-adjacency :index 39 :dist 70799.36) + (new 'static 'nav-network-adjacency :index 40 :dist 106708.99) + (new 'static 'nav-network-adjacency :index 44 :dist 103455.945) + (new 'static 'nav-network-adjacency :index 45 :dist 77495.09) + (new 'static 'nav-network-adjacency :index 46 :dist 99113.78) + (new 'static 'nav-network-adjacency :index 64 :dist 78327.4) + (new 'static 'nav-network-adjacency :index 66 :dist 96495.2) + (new 'static 'nav-network-adjacency :index 67 :dist 90734.18) + (new 'static 'nav-network-adjacency :index 69 :dist 83059.914) + ) + ) + (new 'static 'nav-network-info + :index 56 + :pos (new 'static 'vector :x 615718.5 :y 99127.7 :z -96653.72 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 56 :parent #f) + :count 15 + :adjacency (new 'static 'inline-array nav-network-adjacency 15 + (new 'static 'nav-network-adjacency :index 55 :dist 67951.82) + (new 'static 'nav-network-adjacency :index 69 :dist 55053.105) + (new 'static 'nav-network-adjacency :index 64 :dist 54629.17) + (new 'static 'nav-network-adjacency :index 18 :dist 108632.88) + (new 'static 'nav-network-adjacency :index 26 :dist 108815.16) + (new 'static 'nav-network-adjacency :index 37 :dist 97050.625) + (new 'static 'nav-network-adjacency :index 38 :dist 74722.51) + (new 'static 'nav-network-adjacency :index 39 :dist 99649.945) + (new 'static 'nav-network-adjacency :index 45 :dist 101286.3) + (new 'static 'nav-network-adjacency :index 46 :dist 76210.18) + (new 'static 'nav-network-adjacency :index 47 :dist 97925.94) + (new 'static 'nav-network-adjacency :index 63 :dist 83233.18) + (new 'static 'nav-network-adjacency :index 65 :dist 88591.16) + (new 'static 'nav-network-adjacency :index 68 :dist 87075.63) + (new 'static 'nav-network-adjacency :index 70 :dist 82912.87) + ) + ) + (new 'static 'nav-network-info + :index 57 + :pos (new 'static 'vector :x 678854.25 :y 99127.7 :z -92220.21 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 57 :parent #f) + :count 15 + :adjacency (new 'static 'inline-array nav-network-adjacency 15 + (new 'static 'nav-network-adjacency :index 58 :dist 63578.113) + (new 'static 'nav-network-adjacency :index 63 :dist 49151.18) + (new 'static 'nav-network-adjacency :index 70 :dist 58441.727) + (new 'static 'nav-network-adjacency :index 17 :dist 111126.53) + (new 'static 'nav-network-adjacency :index 27 :dist 106679.914) + (new 'static 'nav-network-adjacency :index 36 :dist 96780.695) + (new 'static 'nav-network-adjacency :index 37 :dist 70727.27) + (new 'static 'nav-network-adjacency :index 38 :dist 99887.516) + (new 'static 'nav-network-adjacency :index 46 :dist 105086.98) + (new 'static 'nav-network-adjacency :index 47 :dist 78887.32) + (new 'static 'nav-network-adjacency :index 48 :dist 103321.6) + (new 'static 'nav-network-adjacency :index 62 :dist 80524.086) + (new 'static 'nav-network-adjacency :index 64 :dist 87811.69) + (new 'static 'nav-network-adjacency :index 69 :dist 91570.99) + (new 'static 'nav-network-adjacency :index 71 :dist 89040.9) + ) + ) + (new 'static 'nav-network-info + :index 58 + :pos (new 'static 'vector :x 742432.4 :y 99127.7 :z -92333.67 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 58 :parent #f) + :count 17 + :adjacency (new 'static 'inline-array nav-network-adjacency 17 + (new 'static 'nav-network-adjacency :index 16 :dist 111597.98) + (new 'static 'nav-network-adjacency :index 57 :dist 63578.113) + (new 'static 'nav-network-adjacency :index 59 :dist 69773.72) + (new 'static 'nav-network-adjacency :index 71 :dist 60169.42) + (new 'static 'nav-network-adjacency :index 62 :dist 50758.043) + (new 'static 'nav-network-adjacency :index 29 :dist 106080.664) + (new 'static 'nav-network-adjacency :index 35 :dist 100538.78) + (new 'static 'nav-network-adjacency :index 36 :dist 71983.516) + (new 'static 'nav-network-adjacency :index 37 :dist 95275.83) + (new 'static 'nav-network-adjacency :index 47 :dist 101784.78) + (new 'static 'nav-network-adjacency :index 48 :dist 79885.93) + (new 'static 'nav-network-adjacency :index 49 :dist 104489.78) + (new 'static 'nav-network-adjacency :index 61 :dist 87780.97) + (new 'static 'nav-network-adjacency :index 63 :dist 79989.555) + (new 'static 'nav-network-adjacency :index 70 :dist 86446.49) + (new 'static 'nav-network-adjacency :index 72 :dist 89669.63) + (new 'static 'nav-network-adjacency :index 73 :dist 110875.85) + ) + ) + (new 'static 'nav-network-info + :index 59 + :pos (new 'static 'vector :x 812084.8 :y 99127.7 :z -96452.61 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 59 :parent #f) + :count 16 + :adjacency (new 'static 'inline-array nav-network-adjacency 16 + (new 'static 'nav-network-adjacency :index 15 :dist 108125.39) + (new 'static 'nav-network-adjacency :index 58 :dist 69773.72) + (new 'static 'nav-network-adjacency :index 60 :dist 62415.258) + (new 'static 'nav-network-adjacency :index 61 :dist 54838.066) + (new 'static 'nav-network-adjacency :index 72 :dist 54267.902) + (new 'static 'nav-network-adjacency :index 31 :dist 106962.945) + (new 'static 'nav-network-adjacency :index 34 :dist 80117.35) + (new 'static 'nav-network-adjacency :index 35 :dist 74035.61) + (new 'static 'nav-network-adjacency :index 36 :dist 101477.17) + (new 'static 'nav-network-adjacency :index 48 :dist 102397.54) + (new 'static 'nav-network-adjacency :index 49 :dist 75329.945) + (new 'static 'nav-network-adjacency :index 50 :dist 115104.98) + (new 'static 'nav-network-adjacency :index 62 :dist 89428.79) + (new 'static 'nav-network-adjacency :index 71 :dist 87847.734) + (new 'static 'nav-network-adjacency :index 73 :dist 99142.45) + (new 'static 'nav-network-adjacency :index 74 :dist 116111.77) + ) + ) + (new 'static 'nav-network-info + :index 60 + :pos (new 'static 'vector :x 874483.3 :y 99127.7 :z -97905.05 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 60 :parent #f) + :count 10 + :adjacency (new 'static 'inline-array nav-network-adjacency 10 + (new 'static 'nav-network-adjacency :index 59 :dist 62415.258) + (new 'static 'nav-network-adjacency :index 61 :dist 82523.34) + (new 'static 'nav-network-adjacency :index 32 :dist 92716.234) + (new 'static 'nav-network-adjacency :index 34 :dist 51272.5) + (new 'static 'nav-network-adjacency :index 35 :dist 96717.62) + (new 'static 'nav-network-adjacency :index 51 :dist 111644.266) + (new 'static 'nav-network-adjacency :index 74 :dist 95852.55) + (new 'static 'nav-network-adjacency :index 72 :dist 82945.23) + (new 'static 'nav-network-adjacency :index #x6b :dist 65015.81) + (new 'static 'nav-network-adjacency :index #x6a :dist 90914.41) + ) + ) + (new 'static 'nav-network-info + :index 61 + :pos (new 'static 'vector :x 814104.2 :y 99127.7 :z -41651.406 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 61 :parent #f) + :count 14 + :adjacency (new 'static 'inline-array nav-network-adjacency 14 + (new 'static 'nav-network-adjacency :index 14 :dist 107154.64) + (new 'static 'nav-network-adjacency :index 60 :dist 82523.34) + (new 'static 'nav-network-adjacency :index 62 :dist 72638.46) + (new 'static 'nav-network-adjacency :index 59 :dist 54838.066) + (new 'static 'nav-network-adjacency :index 29 :dist 116108.086) + (new 'static 'nav-network-adjacency :index 31 :dist 92683.47) + (new 'static 'nav-network-adjacency :index 32 :dist 122276.25) + (new 'static 'nav-network-adjacency :index 34 :dist 95435.984) + (new 'static 'nav-network-adjacency :index 35 :dist 51245.465) + (new 'static 'nav-network-adjacency :index 36 :dist 87111.68) + (new 'static 'nav-network-adjacency :index 49 :dist 121398.48) + (new 'static 'nav-network-adjacency :index 58 :dist 87780.97) + (new 'static 'nav-network-adjacency :index 72 :dist 109105.56) + (new 'static 'nav-network-adjacency :index #x6a :dist 115795.15) + ) + ) + (new 'static 'nav-network-info + :index 62 + :pos (new 'static 'vector :x 741465.7 :y 99127.7 :z -41584.64 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 62 :parent #f) + :count 14 + :adjacency (new 'static 'inline-array nav-network-adjacency 14 + (new 'static 'nav-network-adjacency :index 61 :dist 72638.46) + (new 'static 'nav-network-adjacency :index 58 :dist 50758.043) + (new 'static 'nav-network-adjacency :index 27 :dist 112348.77) + (new 'static 'nav-network-adjacency :index 29 :dist 92715.414) + (new 'static 'nav-network-adjacency :index 30 :dist 105004.234) + (new 'static 'nav-network-adjacency :index 31 :dist 117852.98) + (new 'static 'nav-network-adjacency :index 35 :dist 88410.11) + (new 'static 'nav-network-adjacency :index 36 :dist 51270.453) + (new 'static 'nav-network-adjacency :index 37 :dist 81050.01) + (new 'static 'nav-network-adjacency :index 63 :dist 62072.01) + (new 'static 'nav-network-adjacency :index 13 :dist 24192.205) + (new 'static 'nav-network-adjacency :index 57 :dist 80524.086) + (new 'static 'nav-network-adjacency :index 59 :dist 89428.79) + (new 'static 'nav-network-adjacency :index 71 :dist 110925.01) + ) + ) + (new 'static 'nav-network-info + :index 63 + :pos (new 'static 'vector :x 679411.3 :y 99127.7 :z -43071.9 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 63 :parent #f) + :count 15 + :adjacency (new 'static 'inline-array nav-network-adjacency 15 + (new 'static 'nav-network-adjacency :index 64 :dist 73179.13) + (new 'static 'nav-network-adjacency :index 57 :dist 49151.18) + (new 'static 'nav-network-adjacency :index 26 :dist 116495.16) + (new 'static 'nav-network-adjacency :index 27 :dist 92756.79) + (new 'static 'nav-network-adjacency :index 29 :dist 113075.81) + (new 'static 'nav-network-adjacency :index 36 :dist 82167.4) + (new 'static 'nav-network-adjacency :index 37 :dist 51230.72) + (new 'static 'nav-network-adjacency :index 38 :dist 87191.96) + (new 'static 'nav-network-adjacency :index 47 :dist 120568.22) + (new 'static 'nav-network-adjacency :index 13 :dist 65961.984) + (new 'static 'nav-network-adjacency :index 12 :dist 52689.305) + (new 'static 'nav-network-adjacency :index 62 :dist 62072.01) + (new 'static 'nav-network-adjacency :index 56 :dist 83233.18) + (new 'static 'nav-network-adjacency :index 58 :dist 79989.555) + (new 'static 'nav-network-adjacency :index 70 :dist 107592.086) + ) + ) + (new 'static 'nav-network-info + :index 64 + :pos (new 'static 'vector :x 606232.2 :y 99127.7 :z -42854.4 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 64 :parent #f) + :count 13 + :adjacency (new 'static 'inline-array nav-network-adjacency 13 + (new 'static 'nav-network-adjacency :index 63 :dist 73179.13) + (new 'static 'nav-network-adjacency :index 56 :dist 54629.17) + (new 'static 'nav-network-adjacency :index 23 :dist 110069.35) + (new 'static 'nav-network-adjacency :index 26 :dist 92753.1) + (new 'static 'nav-network-adjacency :index 27 :dist 117257.83) + (new 'static 'nav-network-adjacency :index 37 :dist 88731.24) + (new 'static 'nav-network-adjacency :index 38 :dist 51291.34) + (new 'static 'nav-network-adjacency :index 39 :dist 78554.73) + (new 'static 'nav-network-adjacency :index 46 :dist 121333.35) + (new 'static 'nav-network-adjacency :index 12 :dist 49721.754) + (new 'static 'nav-network-adjacency :index 55 :dist 78327.4) + (new 'static 'nav-network-adjacency :index 57 :dist 87811.69) + (new 'static 'nav-network-adjacency :index 69 :dist 108457.58) + ) + ) + (new 'static 'nav-network-info + :index 65 + :pos (new 'static 'vector :x 545476.2 :y 99127.7 :z -42668.03 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 65 :parent #f) + :count 13 + :adjacency (new 'static 'inline-array nav-network-adjacency 13 + (new 'static 'nav-network-adjacency :index 66 :dist 77299.305) + (new 'static 'nav-network-adjacency :index 55 :dist 52384.152) + (new 'static 'nav-network-adjacency :index 22 :dist 120061.54) + (new 'static 'nav-network-adjacency :index 23 :dist 92698.625) + (new 'static 'nav-network-adjacency :index 26 :dist 112320.516) + (new 'static 'nav-network-adjacency :index 38 :dist 81489.92) + (new 'static 'nav-network-adjacency :index 39 :dist 51357.695) + (new 'static 'nav-network-adjacency :index 40 :dist 92458.19) + (new 'static 'nav-network-adjacency :index 45 :dist 121821.59) + (new 'static 'nav-network-adjacency :index 11 :dist 44519.426) + (new 'static 'nav-network-adjacency :index 54 :dist 93656.266) + (new 'static 'nav-network-adjacency :index 56 :dist 88591.16) + (new 'static 'nav-network-adjacency :index 68 :dist 109642.14) + ) + ) + (new 'static 'nav-network-info + :index 66 + :pos (new 'static 'vector :x 468209.25 :y 99127.7 :z -40422.195 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 66 :parent #f) + :count 11 + :adjacency (new 'static 'inline-array nav-network-adjacency 11 + (new 'static 'nav-network-adjacency :index 65 :dist 77299.305) + (new 'static 'nav-network-adjacency :index 54 :dist 53687.09) + (new 'static 'nav-network-adjacency :index 77 :dist 127860.734) + (new 'static 'nav-network-adjacency :index 22 :dist 92678.555) + (new 'static 'nav-network-adjacency :index 23 :dist 121558.22) + (new 'static 'nav-network-adjacency :index 39 :dist 93956.09) + (new 'static 'nav-network-adjacency :index 40 :dist 51444.12) + (new 'static 'nav-network-adjacency :index 41 :dist 110662.04) + (new 'static 'nav-network-adjacency :index 11 :dist 64063.49) + (new 'static 'nav-network-adjacency :index 55 :dist 96495.2) + (new 'static 'nav-network-adjacency :index 67 :dist 115682.51) + ) + ) + (new 'static 'nav-network-info + :index 67 + :pos (new 'static 'vector :x 480153.2 :y 99127.7 :z -155486.62 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 67 :parent #f) + :count 9 + :adjacency (new 'static 'inline-array nav-network-adjacency 9 + (new 'static 'nav-network-adjacency :index 68 :dist 68634.21) + (new 'static 'nav-network-adjacency :index 68 :dist 68634.21) + (new 'static 'nav-network-adjacency :index 19 :dist 116360.4) + (new 'static 'nav-network-adjacency :index 20 :dist 92678.96) + (new 'static 'nav-network-adjacency :index 40 :dist 122187.37) + (new 'static 'nav-network-adjacency :index 44 :dist 51244.645) + (new 'static 'nav-network-adjacency :index 45 :dist 85886.16) + (new 'static 'nav-network-adjacency :index 55 :dist 90734.18) + (new 'static 'nav-network-adjacency :index 66 :dist 115682.51) + ) + ) + (new 'static 'nav-network-info + :index 68 + :pos (new 'static 'vector :x 548712.06 :y 99127.7 :z -152262.66 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 68 :parent #f) + :count 14 + :adjacency (new 'static 'inline-array nav-network-adjacency 14 + (new 'static 'nav-network-adjacency :index 67 :dist 68634.21) + (new 'static 'nav-network-adjacency :index 55 :dist 57268.633) + (new 'static 'nav-network-adjacency :index 67 :dist 68634.21) + (new 'static 'nav-network-adjacency :index 18 :dist 111651.63) + (new 'static 'nav-network-adjacency :index 19 :dist 92707.23) + (new 'static 'nav-network-adjacency :index 20 :dist 115514.164) + (new 'static 'nav-network-adjacency :index 24 :dist 109776.9) + (new 'static 'nav-network-adjacency :index 39 :dist 117856.26) + (new 'static 'nav-network-adjacency :index 44 :dist 85721.086) + (new 'static 'nav-network-adjacency :index 45 :dist 51232.77) + (new 'static 'nav-network-adjacency :index 46 :dist 79817.93) + (new 'static 'nav-network-adjacency :index 54 :dist 100130.41) + (new 'static 'nav-network-adjacency :index 56 :dist 87075.63) + (new 'static 'nav-network-adjacency :index 65 :dist 109642.14) + ) + ) + (new 'static 'nav-network-info + :index 69 + :pos (new 'static 'vector :x 608874.06 :y 99127.7 :z -151280.03 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 69 :parent #f) + :count 14 + :adjacency (new 'static 'inline-array nav-network-adjacency 14 + (new 'static 'nav-network-adjacency :index 70 :dist 69757.336) + (new 'static 'nav-network-adjacency :index 70 :dist 69757.336) + (new 'static 'nav-network-adjacency :index 56 :dist 55053.105) + (new 'static 'nav-network-adjacency :index 17 :dist 115740.266) + (new 'static 'nav-network-adjacency :index 18 :dist 92714.6) + (new 'static 'nav-network-adjacency :index 19 :dist 109556.94) + (new 'static 'nav-network-adjacency :index 25 :dist 108857.34) + (new 'static 'nav-network-adjacency :index 38 :dist 120068.51) + (new 'static 'nav-network-adjacency :index 45 :dist 78778.37) + (new 'static 'nav-network-adjacency :index 46 :dist 51256.523) + (new 'static 'nav-network-adjacency :index 47 :dist 86043.445) + (new 'static 'nav-network-adjacency :index 55 :dist 83059.914) + (new 'static 'nav-network-adjacency :index 57 :dist 91570.99) + (new 'static 'nav-network-adjacency :index 64 :dist 108457.58) + ) + ) + (new 'static 'nav-network-info + :index 70 + :pos (new 'static 'vector :x 678628.94 :y 99127.7 :z -150661.53 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 70 :parent #f) + :count 15 + :adjacency (new 'static 'inline-array nav-network-adjacency 15 + (new 'static 'nav-network-adjacency :index 16 :dist 113509.58) + (new 'static 'nav-network-adjacency :index 69 :dist 69757.336) + (new 'static 'nav-network-adjacency :index 57 :dist 58441.727) + (new 'static 'nav-network-adjacency :index 69 :dist 69757.336) + (new 'static 'nav-network-adjacency :index 17 :dist 92718.28) + (new 'static 'nav-network-adjacency :index 18 :dist 114763.77) + (new 'static 'nav-network-adjacency :index 28 :dist 109841.61) + (new 'static 'nav-network-adjacency :index 37 :dist 118818.81) + (new 'static 'nav-network-adjacency :index 46 :dist 85726.0) + (new 'static 'nav-network-adjacency :index 47 :dist 51251.2) + (new 'static 'nav-network-adjacency :index 48 :dist 83338.04) + (new 'static 'nav-network-adjacency :index 56 :dist 82912.87) + (new 'static 'nav-network-adjacency :index 58 :dist 86446.49) + (new 'static 'nav-network-adjacency :index 63 :dist 107592.086) + (new 'static 'nav-network-adjacency :index 73 :dist 118291.25) + ) + ) + (new 'static 'nav-network-info + :index 71 + :pos (new 'static 'vector :x 744414.8 :y 99127.7 :z -152470.73 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 71 :parent #f) + :count 17 + :adjacency (new 'static 'inline-array nav-network-adjacency 17 + (new 'static 'nav-network-adjacency :index 16 :dist 92695.34) + (new 'static 'nav-network-adjacency :index 15 :dist 114826.85) + (new 'static 'nav-network-adjacency :index 72 :dist 66116.41) + (new 'static 'nav-network-adjacency :index 72 :dist 66116.41) + (new 'static 'nav-network-adjacency :index 58 :dist 60169.42) + (new 'static 'nav-network-adjacency :index 17 :dist 113917.13) + (new 'static 'nav-network-adjacency :index 30 :dist 111251.45) + (new 'static 'nav-network-adjacency :index 36 :dist 121976.016) + (new 'static 'nav-network-adjacency :index 47 :dist 83872.16) + (new 'static 'nav-network-adjacency :index 48 :dist 51236.863) + (new 'static 'nav-network-adjacency :index 49 :dist 84418.15) + (new 'static 'nav-network-adjacency :index 50 :dist 80957.44) + (new 'static 'nav-network-adjacency :index 57 :dist 89040.9) + (new 'static 'nav-network-adjacency :index 59 :dist 87847.734) + (new 'static 'nav-network-adjacency :index 62 :dist 110925.01) + (new 'static 'nav-network-adjacency :index 73 :dist 60276.33) + (new 'static 'nav-network-adjacency :index 76 :dist 121862.14) + ) + ) + (new 'static 'nav-network-info + :index 72 + :pos (new 'static 'vector :x 810507.9 :y 99127.7 :z -150697.98 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 72 :parent #f) + :count 18 + :adjacency (new 'static 'inline-array nav-network-adjacency 18 + (new 'static 'nav-network-adjacency :index 15 :dist 92699.445) + (new 'static 'nav-network-adjacency :index 14 :dist 107959.5) + (new 'static 'nav-network-adjacency :index 71 :dist 66116.41) + (new 'static 'nav-network-adjacency :index 73 :dist 47310.438) + (new 'static 'nav-network-adjacency :index 76 :dist 104310.78) + (new 'static 'nav-network-adjacency :index 74 :dist 77914.52) + (new 'static 'nav-network-adjacency :index 59 :dist 54267.902) + (new 'static 'nav-network-adjacency :index 71 :dist 66116.41) + (new 'static 'nav-network-adjacency :index 16 :dist 114094.49) + (new 'static 'nav-network-adjacency :index 34 :dist 98115.586) + (new 'static 'nav-network-adjacency :index 35 :dist 119281.26) + (new 'static 'nav-network-adjacency :index 48 :dist 83760.336) + (new 'static 'nav-network-adjacency :index 49 :dist 51243.418) + (new 'static 'nav-network-adjacency :index 50 :dist 72311.195) + (new 'static 'nav-network-adjacency :index 53 :dist 113818.83) + (new 'static 'nav-network-adjacency :index 58 :dist 89669.63) + (new 'static 'nav-network-adjacency :index 60 :dist 82945.23) + (new 'static 'nav-network-adjacency :index 61 :dist 109105.56) + ) + ) + (new 'static 'nav-network-info + :index 73 + :pos (new 'static 'vector :x 789122.7 :y 99127.7 :z -192899.48 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 73 :parent #f) + :count 14 + :adjacency (new 'static 'inline-array nav-network-adjacency 14 + (new 'static 'nav-network-adjacency :index 15 :dist 103833.6) + (new 'static 'nav-network-adjacency :index 72 :dist 47310.438) + (new 'static 'nav-network-adjacency :index 74 :dist 86327.3) + (new 'static 'nav-network-adjacency :index 16 :dist 109972.69) + (new 'static 'nav-network-adjacency :index 48 :dist 78592.82) + (new 'static 'nav-network-adjacency :index 49 :dist 69454.64) + (new 'static 'nav-network-adjacency :index 50 :dist 51377.355) + (new 'static 'nav-network-adjacency :index 53 :dist 82042.06) + (new 'static 'nav-network-adjacency :index 58 :dist 110875.85) + (new 'static 'nav-network-adjacency :index 59 :dist 99142.45) + (new 'static 'nav-network-adjacency :index 70 :dist 118291.25) + (new 'static 'nav-network-adjacency :index 71 :dist 60276.33) + (new 'static 'nav-network-adjacency :index 75 :dist 118156.91) + (new 'static 'nav-network-adjacency :index 76 :dist 65609.32) + ) + ) + (new 'static 'nav-network-info + :index 74 + :pos (new 'static 'vector :x 875445.9 :y 99127.7 :z -193753.1 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 74 :parent #f) + :count 15 + :adjacency (new 'static 'inline-array nav-network-adjacency 15 + (new 'static 'nav-network-adjacency :index 73 :dist 86327.3) + (new 'static 'nav-network-adjacency :index 75 :dist 81368.266) + (new 'static 'nav-network-adjacency :index 76 :dist 89445.99) + (new 'static 'nav-network-adjacency :index 72 :dist 77914.52) + (new 'static 'nav-network-adjacency :index 34 :dist 110533.836) + (new 'static 'nav-network-adjacency :index 51 :dist 51335.99) + (new 'static 'nav-network-adjacency :index 52 :dist 97754.32) + (new 'static 'nav-network-adjacency :index 60 :dist 95852.55) + (new 'static 'nav-network-adjacency :index 59 :dist 116111.77) + (new 'static 'nav-network-adjacency :index #x68 :dist 113408.82) + (new 'static 'nav-network-adjacency :index #x66 :dist 127257.805) + (new 'static 'nav-network-adjacency :index #x6c :dist 77866.6) + (new 'static 'nav-network-adjacency :index #x6b :dist 84522.19) + (new 'static 'nav-network-adjacency :index #x6e :dist 95304.5) + (new 'static 'nav-network-adjacency :index #x77 :dist 191884.08) + ) + ) + (new 'static 'nav-network-info + :index 75 + :pos (new 'static 'vector :x 873991.8 :y 99127.7 :z -275108.66 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 75 :parent #f) + :count 9 + :adjacency (new 'static 'inline-array nav-network-adjacency 9 + (new 'static 'nav-network-adjacency :index 74 :dist 81368.266) + (new 'static 'nav-network-adjacency :index 76 :dist 66820.09) + (new 'static 'nav-network-adjacency :index 51 :dist 93351.12) + (new 'static 'nav-network-adjacency :index 52 :dist 51265.945) + (new 'static 'nav-network-adjacency :index 73 :dist 118156.91) + (new 'static 'nav-network-adjacency :index #x66 :dist 77753.55) + (new 'static 'nav-network-adjacency :index #x68 :dist 58659.637) + (new 'static 'nav-network-adjacency :index #x6c :dist 80076.39) + (new 'static 'nav-network-adjacency :index #x6e :dist 92846.49) + ) + ) + (new 'static 'nav-network-info + :index 76 + :pos (new 'static 'vector :x 810266.2 :y 99127.7 :z -255008.77 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 76 :parent #f) + :count 13 + :adjacency (new 'static 'inline-array nav-network-adjacency 13 + (new 'static 'nav-network-adjacency :index 74 :dist 89445.99) + (new 'static 'nav-network-adjacency :index 75 :dist 66820.09) + (new 'static 'nav-network-adjacency :index 72 :dist 104310.78) + (new 'static 'nav-network-adjacency :index #x77 :dist 174482.23) + (new 'static 'nav-network-adjacency :index 49 :dist 115332.71) + (new 'static 'nav-network-adjacency :index 50 :dist 80449.125) + (new 'static 'nav-network-adjacency :index 53 :dist 51377.355) + (new 'static 'nav-network-adjacency :index 71 :dist 121862.14) + (new 'static 'nav-network-adjacency :index 73 :dist 65609.32) + (new 'static 'nav-network-adjacency :index #x68 :dist 85007.98) + (new 'static 'nav-network-adjacency :index #x6e :dist 141093.69) + (new 'static 'nav-network-adjacency :index #x78 :dist 120880.336) + (new 'static 'nav-network-adjacency :index #x79 :dist 135041.84) + ) + ) + (new 'static 'nav-network-info + :index 77 + :pos (new 'static 'vector :x 372208.84 :y 99127.7 :z 44029.953 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 77 :parent #f) + :count 3 + :adjacency (new 'static 'inline-array nav-network-adjacency 3 + (new 'static 'nav-network-adjacency :index 66 :dist 127860.734) + (new 'static 'nav-network-adjacency :index 78 :dist 180409.95) + (new 'static 'nav-network-adjacency :index 41 :dist 60767.027) + ) + ) + (new 'static 'nav-network-info + :index 78 + :pos (new 'static 'vector :x 304341.4 :y 99127.7 :z 211188.12 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 78 :parent #f) + :count 3 + :adjacency (new 'static 'inline-array nav-network-adjacency 3 + (new 'static 'nav-network-adjacency :index 77 :dist 180409.95) + (new 'static 'nav-network-adjacency :index 79 :dist 221696.81) + (new 'static 'nav-network-adjacency :index 42 :dist 59670.527) + ) + ) + (new 'static 'nav-network-info + :index 79 + :pos (new 'static 'vector :x 282268.47 :y 99127.7 :z 431783.53 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 79 :parent #f) + :count 8 + :adjacency (new 'static 'inline-array nav-network-adjacency 8 + (new 'static 'nav-network-adjacency :index 78 :dist 221696.81) + (new 'static 'nav-network-adjacency :index 9 :dist 78610.02) + (new 'static 'nav-network-adjacency :index 10 :dist 58953.727) + (new 'static 'nav-network-adjacency :index 43 :dist 82589.29) + (new 'static 'nav-network-adjacency :index 7 :dist 50894.027) + (new 'static 'nav-network-adjacency :index 8 :dist 25042.943) + (new 'static 'nav-network-adjacency :index 84 :dist 114955.875) + (new 'static 'nav-network-adjacency :index #x8c :dist 85034.19) + ) + ) + (new 'static 'nav-network-info + :index 80 + :pos (new 'static 'vector :x -653745.75 :y 75837.03 :z 746753.6 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 80 :parent #f) + :count 4 + :adjacency (new 'static 'inline-array nav-network-adjacency 4 + (new 'static 'nav-network-adjacency :dist 36590.797) + (new 'static 'nav-network-adjacency :index 81 :dist 65050.625) + (new 'static 'nav-network-adjacency :index 4 :dist 96502.99) + (new 'static 'nav-network-adjacency :index 5 :dist 90207.84) + ) + ) + (new 'static 'nav-network-info + :index 81 + :pos (new 'static 'vector :x -718720.6 :y 75837.03 :z 743612.0 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 81 :parent #f) + :count 4 + :adjacency (new 'static 'inline-array nav-network-adjacency 4 + (new 'static 'nav-network-adjacency :index 80 :dist 65050.625) + (new 'static 'nav-network-adjacency :index 5 :dist 75498.29) + (new 'static 'nav-network-adjacency :index #x85 :dist 82185.83) + (new 'static 'nav-network-adjacency :index #x96 :dist 171794.84) + ) + ) + (new 'static 'nav-network-info + :index 82 + :pos (new 'static 'vector :x -276695.44 :y 75837.03 :z 487050.84 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 82 :parent #f) + :count 4 + :adjacency (new 'static 'inline-array nav-network-adjacency 4 + (new 'static 'nav-network-adjacency :index #x7e :dist 136234.19) + (new 'static 'nav-network-adjacency :index #x7d :dist 236107.36) + (new 'static 'nav-network-adjacency :index #x7b :dist 190530.36) + (new 'static 'nav-network-adjacency :index #x8f :dist 202334.2) + ) + ) + (new 'static 'nav-network-info + :index 83 + :pos (new 'static 'vector :x 97074.79 :y 136962.05 :z 547810.94 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 83 :parent #f) + :count 2 + :adjacency (new 'static 'inline-array nav-network-adjacency 2 + (new 'static 'nav-network-adjacency :index 84 :dist 126510.695) + (new 'static 'nav-network-adjacency :index #x80 :dist 186160.33) + ) + ) + (new 'static 'nav-network-info + :index 84 + :pos (new 'static 'vector :x 220761.3 :y 136962.05 :z 521227.88 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 84 :parent #f) + :count 4 + :adjacency (new 'static 'inline-array nav-network-adjacency 4 + (new 'static 'nav-network-adjacency :index 83 :dist 126510.695) + (new 'static 'nav-network-adjacency :index 7 :dist 75572.016) + (new 'static 'nav-network-adjacency :index 9 :dist 70526.16) + (new 'static 'nav-network-adjacency :index 79 :dist 114955.875) + ) + ) + (new 'static 'nav-network-info + :index 85 + :pos (new 'static 'vector :x 962240.1 :y 90338.51 :z -655990.4 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 85 :parent #f) + :count 5 + :adjacency (new 'static 'inline-array nav-network-adjacency 5 + (new 'static 'nav-network-adjacency :index 86 :dist 147715.69) + (new 'static 'nav-network-adjacency :index 87 :dist 147601.81) + (new 'static 'nav-network-adjacency :index #x69 :dist 317704.2) + (new 'static 'nav-network-adjacency :index #x6d :dist 269643.78) + (new 'static 'nav-network-adjacency :index #x94 :dist 75964.01) + ) + ) + (new 'static 'nav-network-info + :index 86 + :pos (new 'static 'vector :x 874675.8 :y 90338.51 :z -774954.6 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 86 :parent #f) + :count 3 + :adjacency (new 'static 'inline-array nav-network-adjacency 3 + (new 'static 'nav-network-adjacency :index 85 :dist 147715.69) + (new 'static 'nav-network-adjacency :index 87 :dist 63136.152) + (new 'static 'nav-network-adjacency :index 88 :dist 159591.22) + ) + ) + (new 'static 'nav-network-info + :index 87 + :pos (new 'static 'vector :x 833089.1 :y 90338.51 :z -727449.2 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 87 :parent #f) + :count 3 + :adjacency (new 'static 'inline-array nav-network-adjacency 3 + (new 'static 'nav-network-adjacency :index 86 :dist 63136.152) + (new 'static 'nav-network-adjacency :index 85 :dist 147601.81) + (new 'static 'nav-network-adjacency :index 88 :dist 166670.34) + ) + ) + (new 'static 'nav-network-info + :index 88 + :pos (new 'static 'vector :x 746266.2 :y 90338.51 :z -869719.6 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 88 :parent #f) + :count 3 + :adjacency (new 'static 'inline-array nav-network-adjacency 3 + (new 'static 'nav-network-adjacency :index 86 :dist 159591.22) + (new 'static 'nav-network-adjacency :index 87 :dist 166670.34) + (new 'static 'nav-network-adjacency :index 89 :dist 78556.77) + ) + ) + (new 'static 'nav-network-info + :index 89 + :pos (new 'static 'vector :x 669011.56 :y 90338.51 :z -883965.56 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 89 :parent #f) + :count 3 + :adjacency (new 'static 'inline-array nav-network-adjacency 3 + (new 'static 'nav-network-adjacency :index 88 :dist 78556.77) + (new 'static 'nav-network-adjacency :index 90 :dist 92180.89) + (new 'static 'nav-network-adjacency :index 93 :dist 121282.97) + ) + ) + (new 'static 'nav-network-info + :index 90 + :pos (new 'static 'vector :x 576851.56 :y 90338.51 :z -885943.94 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 90 :parent #f) + :count 4 + :adjacency (new 'static 'inline-array nav-network-adjacency 4 + (new 'static 'nav-network-adjacency :index 89 :dist 92180.89) + (new 'static 'nav-network-adjacency :index 91 :dist 66548.125) + (new 'static 'nav-network-adjacency :index 93 :dist 82037.15) + (new 'static 'nav-network-adjacency :index 92 :dist 107153.82) + ) + ) + (new 'static 'nav-network-info + :index 91 + :pos (new 'static 'vector :x 510307.94 :y 90338.51 :z -885153.4 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 91 :parent #f) + :count 4 + :adjacency (new 'static 'inline-array nav-network-adjacency 4 + (new 'static 'nav-network-adjacency :index 90 :dist 66548.125) + (new 'static 'nav-network-adjacency :index 92 :dist 76811.47) + (new 'static 'nav-network-adjacency :index 93 :dist 105681.72) + (new 'static 'nav-network-adjacency :index #x74 :dist 85297.15) + ) + ) + (new 'static 'nav-network-info + :index 92 + :pos (new 'static 'vector :x 502550.12 :y 90338.51 :z -808734.3 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 92 :parent #f) + :count 5 + :adjacency (new 'static 'inline-array nav-network-adjacency 5 + (new 'static 'nav-network-adjacency :index 91 :dist 76811.47) + (new 'static 'nav-network-adjacency :index 93 :dist 75503.62) + (new 'static 'nav-network-adjacency :index 90 :dist 107153.82) + (new 'static 'nav-network-adjacency :index #x74 :dist 87248.08) + (new 'static 'nav-network-adjacency :index #x92 :dist 90930.38) + ) + ) + (new 'static 'nav-network-info + :index 93 + :pos (new 'static 'vector :x 577900.1 :y 90338.51 :z -803913.3 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 93 :parent #f) + :count 5 + :adjacency (new 'static 'inline-array nav-network-adjacency 5 + (new 'static 'nav-network-adjacency :index 92 :dist 75503.62) + (new 'static 'nav-network-adjacency :index 89 :dist 121282.97) + (new 'static 'nav-network-adjacency :index 90 :dist 82037.15) + (new 'static 'nav-network-adjacency :index 91 :dist 105681.72) + (new 'static 'nav-network-adjacency :index #x93 :dist 98365.03) + ) + ) + (new 'static 'nav-network-info + :index 94 + :pos (new 'static 'vector :x -547847.8 :y 126901.45 :z -708370.0 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 94 :parent #f) + :count 4 + :adjacency (new 'static 'inline-array nav-network-adjacency 4 + (new 'static 'nav-network-adjacency :index 95 :dist 52300.594) + (new 'static 'nav-network-adjacency :index #x65 :dist 116690.945) + (new 'static 'nav-network-adjacency :index 100 :dist 138880.2) + (new 'static 'nav-network-adjacency :index #x91 :dist 106824.91) + ) + ) + (new 'static 'nav-network-info + :index 95 + :pos (new 'static 'vector :x -495832.7 :y 126901.45 :z -702910.06 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 95 :parent #f) + :count 5 + :adjacency (new 'static 'inline-array nav-network-adjacency 5 + (new 'static 'nav-network-adjacency :index 94 :dist 52300.594) + (new 'static 'nav-network-adjacency :index 96 :dist 48793.19) + (new 'static 'nav-network-adjacency :index 100 :dist 123212.19) + (new 'static 'nav-network-adjacency :index 99 :dist 129486.44) + (new 'static 'nav-network-adjacency :index #x91 :dist 99453.336) + ) + ) + (new 'static 'nav-network-info + :index 96 + :pos (new 'static 'vector :x -452738.66 :y 126901.05 :z -680025.7 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 96 :parent #f) + :count 7 + :adjacency (new 'static 'inline-array nav-network-adjacency 7 + (new 'static 'nav-network-adjacency :index 95 :dist 48793.19) + (new 'static 'nav-network-adjacency :index 97 :dist 85125.12) + (new 'static 'nav-network-adjacency :index 100 :dist 144396.28) + (new 'static 'nav-network-adjacency :index 98 :dist 144957.03) + (new 'static 'nav-network-adjacency :index 99 :dist 130075.85) + (new 'static 'nav-network-adjacency :index #x90 :dist 108793.04) + (new 'static 'nav-network-adjacency :index #x91 :dist 124317.29) + ) + ) + (new 'static 'nav-network-info + :index 97 + :pos (new 'static 'vector :x -367634.44 :y 126901.45 :z -681913.94 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 97 :parent #f) + :count 4 + :adjacency (new 'static 'inline-array nav-network-adjacency 4 + (new 'static 'nav-network-adjacency :index 96 :dist 85125.12) + (new 'static 'nav-network-adjacency :index 98 :dist 106795.01) + (new 'static 'nav-network-adjacency :index 99 :dist 131996.47) + (new 'static 'nav-network-adjacency :index #x90 :dist 103850.805) + ) + ) + (new 'static 'nav-network-info + :index 98 + :pos (new 'static 'vector :x -356118.12 :y 126901.45 :z -788086.4 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 98 :parent #f) + :count 5 + :adjacency (new 'static 'inline-array nav-network-adjacency 5 + (new 'static 'nav-network-adjacency :index 97 :dist 106795.01) + (new 'static 'nav-network-adjacency :index 99 :dist 62058.496) + (new 'static 'nav-network-adjacency :index 96 :dist 144957.03) + (new 'static 'nav-network-adjacency :index #x70 :dist 93704.195) + (new 'static 'nav-network-adjacency :index #x90 :dist 106693.836) + ) + ) + (new 'static 'nav-network-info + :index 99 + :pos (new 'static 'vector :x -415891.03 :y 126901.45 :z -804773.5 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 99 :parent #f) + :count 7 + :adjacency (new 'static 'inline-array nav-network-adjacency 7 + (new 'static 'nav-network-adjacency :index 98 :dist 62058.496) + (new 'static 'nav-network-adjacency :index 100 :dist 57227.266) + (new 'static 'nav-network-adjacency :index 97 :dist 131996.47) + (new 'static 'nav-network-adjacency :index 96 :dist 130075.85) + (new 'static 'nav-network-adjacency :index 95 :dist 129486.44) + (new 'static 'nav-network-adjacency :index #x90 :dist 105213.13) + (new 'static 'nav-network-adjacency :index #x91 :dist 124316.47) + ) + ) + (new 'static 'nav-network-info + :index 100 + :pos (new 'static 'vector :x -470007.4 :y 126901.45 :z -823385.7 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 100 :parent #f) + :count 6 + :adjacency (new 'static 'inline-array nav-network-adjacency 6 + (new 'static 'nav-network-adjacency :index 99 :dist 57227.266) + (new 'static 'nav-network-adjacency :index #x65 :dist 72413.19) + (new 'static 'nav-network-adjacency :index 95 :dist 123212.19) + (new 'static 'nav-network-adjacency :index 96 :dist 144396.28) + (new 'static 'nav-network-adjacency :index 94 :dist 138880.2) + (new 'static 'nav-network-adjacency :index #x91 :dist 105224.195) + ) + ) + (new 'static 'nav-network-info + :index #x65 + :pos (new 'static 'vector :x -542404.2 :y 126901.45 :z -824934.0 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index #x65 :parent #f) + :count 3 + :adjacency (new 'static 'inline-array nav-network-adjacency 3 + (new 'static 'nav-network-adjacency :index 100 :dist 72413.19) + (new 'static 'nav-network-adjacency :index 94 :dist 116690.945) + (new 'static 'nav-network-adjacency :index #x91 :dist 109435.29) + ) + ) + (new 'static 'nav-network-info + :index #x66 + :pos (new 'static 'vector :x 947064.44 :y 85802.6 :z -298097.88 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index #x66 :parent #f) + :count 7 + :adjacency (new 'static 'inline-array nav-network-adjacency 7 + (new 'static 'nav-network-adjacency :index 75 :dist 77753.55) + (new 'static 'nav-network-adjacency :index #x67 :dist 52563.56) + (new 'static 'nav-network-adjacency :index #x68 :dist 108335.1) + (new 'static 'nav-network-adjacency :index 74 :dist 127257.805) + (new 'static 'nav-network-adjacency :index #x6c :dist 65527.4) + (new 'static 'nav-network-adjacency :index #x6d :dist 118421.914) + (new 'static 'nav-network-adjacency :index #x6e :dist 91147.06) + ) + ) + (new 'static 'nav-network-info + :index #x67 + :pos (new 'static 'vector :x 940830.3 :y 85802.6 :z -350290.75 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index #x67 :parent #f) + :count 4 + :adjacency (new 'static 'inline-array nav-network-adjacency 4 + (new 'static 'nav-network-adjacency :index #x66 :dist 52563.56) + (new 'static 'nav-network-adjacency :index #x69 :dist 104151.45) + (new 'static 'nav-network-adjacency :index #x6d :dist 81621.81) + (new 'static 'nav-network-adjacency :index #x6e :dist 131150.23) + ) + ) + (new 'static 'nav-network-info + :index #x68 + :pos (new 'static 'vector :x 863293.0 :y 154236.52 :z -292124.7 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index #x68 :parent #f) + :count 9 + :adjacency (new 'static 'inline-array nav-network-adjacency 9 + (new 'static 'nav-network-adjacency :index #x77 :dist 134208.31) + (new 'static 'nav-network-adjacency :index #x76 :dist 133167.11) + (new 'static 'nav-network-adjacency :index #x69 :dist 68882.84) + (new 'static 'nav-network-adjacency :index 75 :dist 58659.637) + (new 'static 'nav-network-adjacency :index 76 :dist 85007.98) + (new 'static 'nav-network-adjacency :index #x66 :dist 108335.1) + (new 'static 'nav-network-adjacency :index 74 :dist 113408.82) + (new 'static 'nav-network-adjacency :index #x6d :dist 130308.09) + (new 'static 'nav-network-adjacency :index #x6e :dist 92891.55) + ) + ) + (new 'static 'nav-network-info + :index #x69 + :pos (new 'static 'vector :x 863051.4 :y 154236.52 :z -361007.5 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index #x69 :parent #f) + :count 6 + :adjacency (new 'static 'inline-array nav-network-adjacency 6 + (new 'static 'nav-network-adjacency :index #x76 :dist 130905.7) + (new 'static 'nav-network-adjacency :index #x68 :dist 68882.84) + (new 'static 'nav-network-adjacency :index #x67 :dist 104151.45) + (new 'static 'nav-network-adjacency :index 85 :dist 317704.2) + (new 'static 'nav-network-adjacency :index #x6d :dist 87376.69) + (new 'static 'nav-network-adjacency :index #x6e :dist 144251.7) + ) + ) + (new 'static 'nav-network-info + :index #x6a + :pos (new 'static 'vector :x 927075.94 :y 78619.85 :z -26638.336 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index #x6a :parent #f) + :count 6 + :adjacency (new 'static 'inline-array nav-network-adjacency 6 + (new 'static 'nav-network-adjacency :index #x6b :dist 103449.805) + (new 'static 'nav-network-adjacency :index 60 :dist 90914.41) + (new 'static 'nav-network-adjacency :index 34 :dist 92629.81) + (new 'static 'nav-network-adjacency :index 35 :dist 118780.73) + (new 'static 'nav-network-adjacency :index 31 :dist 134927.97) + (new 'static 'nav-network-adjacency :index 61 :dist 115795.15) + ) + ) + (new 'static 'nav-network-info + :index #x6b + :pos (new 'static 'vector :x 927121.0 :y 78619.85 :z -130088.55 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index #x6b :parent #f) + :count 7 + :adjacency (new 'static 'inline-array nav-network-adjacency 7 + (new 'static 'nav-network-adjacency :index #x6a :dist 103449.805) + (new 'static 'nav-network-adjacency :index #x6c :dist 104056.42) + (new 'static 'nav-network-adjacency :index 74 :dist 84522.19) + (new 'static 'nav-network-adjacency :index 60 :dist 65015.81) + (new 'static 'nav-network-adjacency :index 51 :dist 89692.98) + (new 'static 'nav-network-adjacency :index 34 :dist 70520.83) + (new 'static 'nav-network-adjacency :index #x6e :dist 132655.92) + ) + ) + (new 'static 'nav-network-info + :index #x6c + :pos (new 'static 'vector :x 939224.7 :y 78619.85 :z -233438.83 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index #x6c :parent #f) + :count 7 + :adjacency (new 'static 'inline-array nav-network-adjacency 7 + (new 'static 'nav-network-adjacency :index #x6b :dist 104056.42) + (new 'static 'nav-network-adjacency :index #x66 :dist 65527.4) + (new 'static 'nav-network-adjacency :index 74 :dist 77866.6) + (new 'static 'nav-network-adjacency :index 51 :dist 79119.56) + (new 'static 'nav-network-adjacency :index 75 :dist 80076.39) + (new 'static 'nav-network-adjacency :index 52 :dist 83596.49) + (new 'static 'nav-network-adjacency :index #x6e :dist 75780.51) + ) + ) + (new 'static 'nav-network-info + :index #x6d + :pos (new 'static 'vector :x 943677.0 :y 154236.52 :z -394685.25 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index #x6d :parent #f) + :count 7 + :adjacency (new 'static 'inline-array nav-network-adjacency 7 + (new 'static 'nav-network-adjacency :index #x76 :dist 184588.28) + (new 'static 'nav-network-adjacency :index #x69 :dist 87376.69) + (new 'static 'nav-network-adjacency :index #x67 :dist 81621.81) + (new 'static 'nav-network-adjacency :index #x66 :dist 118421.914) + (new 'static 'nav-network-adjacency :index #x68 :dist 130308.09) + (new 'static 'nav-network-adjacency :index 85 :dist 269643.78) + (new 'static 'nav-network-adjacency :index #x6e :dist 156328.75) + ) + ) + (new 'static 'nav-network-info + :index #x6e + :pos (new 'static 'vector :x 939089.5 :y 154236.52 :z -238423.66 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index #x6e :parent #f) + :count 12 + :adjacency (new 'static 'inline-array nav-network-adjacency 12 + (new 'static 'nav-network-adjacency :index #x77 :dist 170229.34) + (new 'static 'nav-network-adjacency :index #x76 :dist 193325.88) + (new 'static 'nav-network-adjacency :index #x6d :dist 156328.75) + (new 'static 'nav-network-adjacency :index #x68 :dist 92891.55) + (new 'static 'nav-network-adjacency :index #x6c :dist 75780.51) + (new 'static 'nav-network-adjacency :index #x66 :dist 91147.06) + (new 'static 'nav-network-adjacency :index #x67 :dist 131150.23) + (new 'static 'nav-network-adjacency :index #x69 :dist 144251.7) + (new 'static 'nav-network-adjacency :index 74 :dist 95304.5) + (new 'static 'nav-network-adjacency :index 75 :dist 92846.49) + (new 'static 'nav-network-adjacency :index 76 :dist 141093.69) + (new 'static 'nav-network-adjacency :index #x6b :dist 132655.92) + ) + ) + (new 'static 'nav-network-info + :index #x6f + :pos (new 'static 'vector :x 841133.7 :y -5001.216 :z -297084.53 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index #x6f :parent #f) + :count 3 + :adjacency (new 'static 'inline-array nav-network-adjacency 3 + (new 'static 'nav-network-adjacency :index 33 :dist 97601.125) + (new 'static 'nav-network-adjacency :index 52 :dist 65859.586) + (new 'static 'nav-network-adjacency :index 53 :dist 74742.58) + ) + ) + (new 'static 'nav-network-info + :index #x70 + :pos (new 'static 'vector :x -270393.34 :y 90338.51 :z -797830.75 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index #x70 :parent #f) + :count 2 + :adjacency (new 'static 'inline-array nav-network-adjacency 2 + (new 'static 'nav-network-adjacency :index 98 :dist 93704.195) + (new 'static 'nav-network-adjacency :index #x71 :dist 188886.22) + ) + ) + (new 'static 'nav-network-info + :index #x71 + :pos (new 'static 'vector :x -83141.016 :y 90338.51 :z -822623.9 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index #x71 :parent #f) + :count 2 + :adjacency (new 'static 'inline-array nav-network-adjacency 2 + (new 'static 'nav-network-adjacency :index #x72 :dist 153460.33) + (new 'static 'nav-network-adjacency :index #x70 :dist 188886.22) + ) + ) + (new 'static 'nav-network-info + :index #x72 + :pos (new 'static 'vector :x 64994.918 :y 90338.51 :z -862695.0 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index #x72 :parent #f) + :count 2 + :adjacency (new 'static 'inline-array nav-network-adjacency 2 + (new 'static 'nav-network-adjacency :index #x71 :dist 153460.33) + (new 'static 'nav-network-adjacency :index #x73 :dist 186826.34) + ) + ) + (new 'static 'nav-network-info + :index #x73 + :pos (new 'static 'vector :x 251817.58 :y 90338.51 :z -861499.0 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index #x73 :parent #f) + :count 2 + :adjacency (new 'static 'inline-array nav-network-adjacency 2 + (new 'static 'nav-network-adjacency :index #x72 :dist 186826.34) + (new 'static 'nav-network-adjacency :index #x74 :dist 178058.44) + ) + ) + (new 'static 'nav-network-info + :index #x74 + :pos (new 'static 'vector :x 429817.44 :y 90338.51 :z -856923.75 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index #x74 :parent #f) + :count 3 + :adjacency (new 'static 'inline-array nav-network-adjacency 3 + (new 'static 'nav-network-adjacency :index #x73 :dist 178058.44) + (new 'static 'nav-network-adjacency :index 92 :dist 87248.08) + (new 'static 'nav-network-adjacency :index 91 :dist 85297.15) + ) + ) + (new 'static 'nav-network-info + :index #x75 + :pos (new 'static 'vector :x 742071.94 :y 273364.6 :z -340396.84 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index #x75 :parent #f) + :count 2 + :adjacency (new 'static 'inline-array nav-network-adjacency 2 + (new 'static 'nav-network-adjacency :index #x77 :dist 118066.79) + (new 'static 'nav-network-adjacency :index #x76 :dist 76546.87) + ) + ) + (new 'static 'nav-network-info + :index #x76 + :pos (new 'static 'vector :x 818007.6 :y 273364.6 :z -330742.16 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index #x76 :parent #f) + :count 6 + :adjacency (new 'static 'inline-array nav-network-adjacency 6 + (new 'static 'nav-network-adjacency :index #x6d :dist 184588.28) + (new 'static 'nav-network-adjacency :index #x6e :dist 193325.88) + (new 'static 'nav-network-adjacency :index #x69 :dist 130905.7) + (new 'static 'nav-network-adjacency :index #x68 :dist 133167.11) + (new 'static 'nav-network-adjacency :index #x75 :dist 76546.87) + (new 'static 'nav-network-adjacency :index #x77 :dist 80721.92) + ) + ) + (new 'static 'nav-network-info + :index #x77 + :pos (new 'static 'vector :x 818044.5 :y 273365.4 :z -250019.84 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index #x77 :parent #f) + :count 7 + :adjacency (new 'static 'inline-array nav-network-adjacency 7 + (new 'static 'nav-network-adjacency :index #x6e :dist 170229.34) + (new 'static 'nav-network-adjacency :index #x68 :dist 134208.31) + (new 'static 'nav-network-adjacency :index 76 :dist 174482.23) + (new 'static 'nav-network-adjacency :index #x75 :dist 118066.79) + (new 'static 'nav-network-adjacency :index #x76 :dist 80721.92) + (new 'static 'nav-network-adjacency :index 74 :dist 191884.08) + (new 'static 'nav-network-adjacency :index #x79 :dist 84281.75) + ) + ) + (new 'static 'nav-network-info + :index #x78 + :pos (new 'static 'vector :x 732270.2 :y 189093.89 :z -234155.62 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index #x78 :parent #f) + :count 2 + :adjacency (new 'static 'inline-array nav-network-adjacency 2 + (new 'static 'nav-network-adjacency :index 76 :dist 120880.336) + (new 'static 'nav-network-adjacency :index #x79 :dist 39580.06) + ) + ) + (new 'static 'nav-network-info + :index #x79 + :pos (new 'static 'vector :x 752238.2 :y 220797.75 :z -246912.61 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index #x79 :parent #f) + :count 3 + :adjacency (new 'static 'inline-array nav-network-adjacency 3 + (new 'static 'nav-network-adjacency :index #x78 :dist 39580.06) + (new 'static 'nav-network-adjacency :index 76 :dist 135041.84) + (new 'static 'nav-network-adjacency :index #x77 :dist 84281.75) + ) + ) + (new 'static 'nav-network-info + :index #x7a + :pos (new 'static 'vector :x -122299.59 :y 60971.418 :z 303426.34 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index #x7a :parent #f) + :count 4 + :adjacency (new 'static 'inline-array nav-network-adjacency 4 + (new 'static 'nav-network-adjacency :index #x7b :dist 81986.766) + (new 'static 'nav-network-adjacency :index #x7f :dist 87802.67) + (new 'static 'nav-network-adjacency :index #x81 :dist 122315.57) + (new 'static 'nav-network-adjacency :index #x88 :dist 79717.58) + ) + ) + (new 'static 'nav-network-info + :index #x7b + :pos (new 'static 'vector :x -116361.625 :y 60971.83 :z 385198.1 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index #x7b :parent #f) + :count 7 + :adjacency (new 'static 'inline-array nav-network-adjacency 7 + (new 'static 'nav-network-adjacency :index #x7c :dist 80790.32) + (new 'static 'nav-network-adjacency :index #x7a :dist 81986.766) + (new 'static 'nav-network-adjacency :index #x82 :dist 115136.1) + (new 'static 'nav-network-adjacency :index #x7f :dist 113602.15) + (new 'static 'nav-network-adjacency :index #x81 :dist 87455.74) + (new 'static 'nav-network-adjacency :index #x7e :dist 124467.61) + (new 'static 'nav-network-adjacency :index 82 :dist 190530.36) + ) + ) + (new 'static 'nav-network-info + :index #x7c + :pos (new 'static 'vector :x -36131.637 :y 60971.418 :z 394699.16 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index #x7c :parent #f) + :count 4 + :adjacency (new 'static 'inline-array nav-network-adjacency 4 + (new 'static 'nav-network-adjacency :index #x7b :dist 80790.32) + (new 'static 'nav-network-adjacency :index #x81 :dist 121117.9) + (new 'static 'nav-network-adjacency :index #x82 :dist 87498.75) + (new 'static 'nav-network-adjacency :index #x88 :dist 84309.61) + ) + ) + (new 'static 'nav-network-info + :index #x7d + :pos (new 'static 'vector :x -236235.98 :y 99601.61 :z 255652.66 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index #x7d :parent #f) + :count 6 + :adjacency (new 'static 'inline-array nav-network-adjacency 6 + (new 'static 'nav-network-adjacency :index #x7e :dist 251659.06) + (new 'static 'nav-network-adjacency :index 82 :dist 236107.36) + (new 'static 'nav-network-adjacency :index #x83 :dist 103381.4) + (new 'static 'nav-network-adjacency :index #x7f :dist 135940.1) + (new 'static 'nav-network-adjacency :index #x81 :dist 183582.31) + (new 'static 'nav-network-adjacency :index #x89 :dist 92015.82) + ) + ) + (new 'static 'nav-network-info + :index #x7e + :pos (new 'static 'vector :x -147741.48 :y 119650.71 :z 490385.0 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index #x7e :parent #f) + :count 5 + :adjacency (new 'static 'inline-array nav-network-adjacency 5 + (new 'static 'nav-network-adjacency :index #x7d :dist 251659.06) + (new 'static 'nav-network-adjacency :index 82 :dist 136234.19) + (new 'static 'nav-network-adjacency :index #x80 :dist 72550.81) + (new 'static 'nav-network-adjacency :index #x81 :dist 108902.81) + (new 'static 'nav-network-adjacency :index #x7b :dist 124467.61) + ) + ) + (new 'static 'nav-network-info + :index #x7f + :pos (new 'static 'vector :x -122898.43 :y 148270.69 :z 312798.8 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index #x7f :parent #f) + :count 4 + :adjacency (new 'static 'inline-array nav-network-adjacency 4 + (new 'static 'nav-network-adjacency :index #x81 :dist 76326.5) + (new 'static 'nav-network-adjacency :index #x7d :dist 135940.1) + (new 'static 'nav-network-adjacency :index #x7a :dist 87802.67) + (new 'static 'nav-network-adjacency :index #x7b :dist 113602.15) + ) + ) + (new 'static 'nav-network-info + :index #x80 + :pos (new 'static 'vector :x -82639.26 :y 149863.62 :z 500993.62 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index #x80 :parent #f) + :count 4 + :adjacency (new 'static 'inline-array nav-network-adjacency 4 + (new 'static 'nav-network-adjacency :index #x7e :dist 72550.81) + (new 'static 'nav-network-adjacency :index 83 :dist 186160.33) + (new 'static 'nav-network-adjacency :index #x82 :dist 115866.42) + (new 'static 'nav-network-adjacency :index #x8a :dist 161826.81) + ) + ) + (new 'static 'nav-network-info + :index #x81 + :pos (new 'static 'vector :x -119897.29 :y 148270.69 :z 389066.34 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index #x81 :parent #f) + :count 7 + :adjacency (new 'static 'inline-array nav-network-adjacency 7 + (new 'static 'nav-network-adjacency :index #x82 :dist 78316.336) + (new 'static 'nav-network-adjacency :index #x7f :dist 76326.5) + (new 'static 'nav-network-adjacency :index #x7e :dist 108902.81) + (new 'static 'nav-network-adjacency :index #x7d :dist 183582.31) + (new 'static 'nav-network-adjacency :index #x7a :dist 122315.57) + (new 'static 'nav-network-adjacency :index #x7c :dist 121117.9) + (new 'static 'nav-network-adjacency :index #x7b :dist 87455.74) + ) + ) + (new 'static 'nav-network-info + :index #x82 + :pos (new 'static 'vector :x -41661.645 :y 148270.69 :z 392626.6 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index #x82 :parent #f) + :count 4 + :adjacency (new 'static 'inline-array nav-network-adjacency 4 + (new 'static 'nav-network-adjacency :index #x81 :dist 78316.336) + (new 'static 'nav-network-adjacency :index #x80 :dist 115866.42) + (new 'static 'nav-network-adjacency :index #x7c :dist 87498.75) + (new 'static 'nav-network-adjacency :index #x7b :dist 115136.1) + ) + ) + (new 'static 'nav-network-info + :index #x83 + :pos (new 'static 'vector :x -136882.17 :y 99601.61 :z 227077.33 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index #x83 :parent #f) + :count 1 + :adjacency (new 'static 'inline-array nav-network-adjacency 1 + (new 'static 'nav-network-adjacency :index #x7d :dist 103381.4) + ) + ) + (new 'static 'nav-network-info + :index #x84 + :pos (new 'static 'vector :x -794795.6 :y 15622.963 :z 839790.2 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index #x84 :parent #f) + :count 1 + :adjacency (new 'static 'inline-array nav-network-adjacency 1 + (new 'static 'nav-network-adjacency :index #x85 :dist 90690.35) + ) + ) + (new 'static 'nav-network-info + :index #x85 + :pos (new 'static 'vector :x -774098.56 :y 15622.963 :z 751492.7 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index #x85 :parent #f) + :count 3 + :adjacency (new 'static 'inline-array nav-network-adjacency 3 + (new 'static 'nav-network-adjacency :index #x84 :dist 90690.35) + (new 'static 'nav-network-adjacency :index 81 :dist 82185.83) + (new 'static 'nav-network-adjacency :index #x96 :dist 131120.75) + ) + ) + (new 'static 'nav-network-info + :index #x86 + :pos (new 'static 'vector :x -689217.1 :y -23266.918 :z 822394.5 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index #x86 :parent #f) + :count 1 + :adjacency (new 'static 'inline-array nav-network-adjacency 1 + (new 'static 'nav-network-adjacency :index #x87 :dist 60431.156) + ) + ) + (new 'static 'nav-network-info + :index #x87 + :pos (new 'static 'vector :x -704372.3 :y -16737.076 :z 764259.94 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index #x87 :parent #f) + :count 2 + :adjacency (new 'static 'inline-array nav-network-adjacency 2 + (new 'static 'nav-network-adjacency :index #x86 :dist 60431.156) + (new 'static 'nav-network-adjacency :index 5 :dist 30534.041) + ) + ) + (new 'static 'nav-network-info + :index #x88 + :pos (new 'static 'vector :x -42910.926 :y 60971.418 :z 310662.34 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index #x88 :parent #f) + :count 2 + :adjacency (new 'static 'inline-array nav-network-adjacency 2 + (new 'static 'nav-network-adjacency :index #x7a :dist 79717.58) + (new 'static 'nav-network-adjacency :index #x7c :dist 84309.61) + ) + ) + (new 'static 'nav-network-info + :index #x89 + :pos (new 'static 'vector :x -214346.14 :y 48071.066 :z 182629.58 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index #x89 :parent #f) + :count 1 + :adjacency (new 'static 'inline-array nav-network-adjacency 1 + (new 'static 'nav-network-adjacency :index #x7d :dist 92015.82) + ) + ) + (new 'static 'nav-network-info + :index #x8a + :pos (new 'static 'vector :x 46803.76 :y 52765.082 :z 503025.25 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index #x8a :parent #f) + :count 1 + :adjacency (new 'static 'inline-array nav-network-adjacency 1 + (new 'static 'nav-network-adjacency :index #x80 :dist 161826.81) + ) + ) + (new 'static 'nav-network-info + :index #x8b + :pos (new 'static 'vector :x 387128.53 :y 27469.824 :z 513494.62 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index #x8b :parent #f) + :count 1 + :adjacency (new 'static 'inline-array nav-network-adjacency 1 + (new 'static 'nav-network-adjacency :index #x8c :dist 91539.05) + ) + ) + (new 'static 'nav-network-info + :index #x8c + :pos (new 'static 'vector :x 306124.38 :y 27469.824 :z 470859.38 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index #x8c :parent #f) + :count 2 + :adjacency (new 'static 'inline-array nav-network-adjacency 2 + (new 'static 'nav-network-adjacency :index #x8b :dist 91539.05) + (new 'static 'nav-network-adjacency :index 79 :dist 85034.19) + ) + ) + (new 'static 'nav-network-info + :index #x8d + :pos (new 'static 'vector :x 457399.9 :y 54504.242 :z 499547.75 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index #x8d :parent #f) + :count 1 + :adjacency (new 'static 'inline-array nav-network-adjacency 1 + (new 'static 'nav-network-adjacency :index #x8e :dist 87120.69) + ) + ) + (new 'static 'nav-network-info + :index #x8e + :pos (new 'static 'vector :x 455773.8 :y 54504.242 :z 412442.22 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index #x8e :parent #f) + :count 3 + :adjacency (new 'static 'inline-array nav-network-adjacency 3 + (new 'static 'nav-network-adjacency :index #x8d :dist 87120.69) + (new 'static 'nav-network-adjacency :index 43 :dist 124878.44) + (new 'static 'nav-network-adjacency :index 10 :dist 124076.445) + ) + ) + (new 'static 'nav-network-info + :index #x8f + :pos (new 'static 'vector :x -436924.0 :y 75837.03 :z 610606.7 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index #x8f :parent #f) + :count 2 + :adjacency (new 'static 'inline-array nav-network-adjacency 2 + (new 'static 'nav-network-adjacency :index 82 :dist 202334.2) + (new 'static 'nav-network-adjacency :dist 228475.7) + ) + ) + (new 'static 'nav-network-info + :index #x90 + :pos (new 'static 'vector :x -405252.5 :y 47227.29 :z -736886.4 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index #x90 :parent #f) + :count 5 + :adjacency (new 'static 'inline-array nav-network-adjacency 5 + (new 'static 'nav-network-adjacency :index 99 :dist 105213.13) + (new 'static 'nav-network-adjacency :index 96 :dist 108793.04) + (new 'static 'nav-network-adjacency :index 98 :dist 106693.836) + (new 'static 'nav-network-adjacency :index 97 :dist 103850.805) + (new 'static 'nav-network-adjacency :index #x91 :dist 99311.62) + ) + ) + (new 'static 'nav-network-info + :index #x91 + :pos (new 'static 'vector :x -501288.56 :y 47227.29 :z -762183.25 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index #x91 :parent #f) + :count 7 + :adjacency (new 'static 'inline-array nav-network-adjacency 7 + (new 'static 'nav-network-adjacency :index 95 :dist 99453.336) + (new 'static 'nav-network-adjacency :index 100 :dist 105224.195) + (new 'static 'nav-network-adjacency :index 99 :dist 124316.47) + (new 'static 'nav-network-adjacency :index 96 :dist 124317.29) + (new 'static 'nav-network-adjacency :index #x90 :dist 99311.62) + (new 'static 'nav-network-adjacency :index #x65 :dist 109435.29) + (new 'static 'nav-network-adjacency :index 94 :dist 106824.91) + ) + ) + (new 'static 'nav-network-info + :index #x92 + :pos (new 'static 'vector :x 528760.44 :y 5666.816 :z -788434.56 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index #x92 :parent #f) + :count 1 + :adjacency (new 'static 'inline-array nav-network-adjacency 1 + (new 'static 'nav-network-adjacency :index 92 :dist 90930.38) + ) + ) + (new 'static 'nav-network-info + :index #x93 + :pos (new 'static 'vector :x 529837.7 :y 5666.816 :z -789896.8 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index #x93 :parent #f) + :count 1 + :adjacency (new 'static 'inline-array nav-network-adjacency 1 + (new 'static 'nav-network-adjacency :index 93 :dist 98365.03) + ) + ) + (new 'static 'nav-network-info + :index #x94 + :pos (new 'static 'vector :x 972832.4 :y 15529.574 :z -663862.9 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index #x94 :parent #f) + :count 1 + :adjacency (new 'static 'inline-array nav-network-adjacency 1 + (new 'static 'nav-network-adjacency :index 85 :dist 75964.01) + ) + ) + (new 'static 'nav-network-info + :index #x95 + :pos (new 'static 'vector :x -921939.56 :y 65672.805 :z 577024.0 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index #x95 :parent #f) + :count 1 + :adjacency (new 'static 'inline-array nav-network-adjacency 1 + (new 'static 'nav-network-adjacency :index #x96 :dist 131980.5) + ) + ) + (new 'static 'nav-network-info + :index #x96 + :pos (new 'static 'vector :x -885550.7 :y 65672.805 :z 703889.0 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index #x96 :parent #f) + :count 3 + :adjacency (new 'static 'inline-array nav-network-adjacency 3 + (new 'static 'nav-network-adjacency :index #x95 :dist 131980.5) + (new 'static 'nav-network-adjacency :index 81 :dist 171794.84) + (new 'static 'nav-network-adjacency :index #x85 :dist 131120.75) + ) + ) + ) + ) + +(define *fortress-adjacency* (new 'static 'boxed-array :type nav-network-info + (new 'static 'nav-network-info + :pos (new 'static 'vector :x 2337074.5 :y 81567.74 :z 911146.6 :w 1.0) + :path-node (new 'static 'nav-network-path-node :parent #f) + :count 5 + :adjacency (new 'static 'inline-array nav-network-adjacency 5 + (new 'static 'nav-network-adjacency :index 4 :dist 51954.074) + (new 'static 'nav-network-adjacency :index 7 :dist 70445.47) + (new 'static 'nav-network-adjacency :index 5 :dist 104932.555) + (new 'static 'nav-network-adjacency :index 6 :dist 130163.914) + (new 'static 'nav-network-adjacency :index 8 :dist 59898.266) + ) + ) + (new 'static 'nav-network-info + :index 1 + :pos (new 'static 'vector :x 2519514.8 :y 71680.0 :z 885993.06 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 1 :parent #f) + :count 3 + :adjacency (new 'static 'inline-array nav-network-adjacency 3 + (new 'static 'nav-network-adjacency :index 2 :dist 88945.46) + (new 'static 'nav-network-adjacency :index 5 :dist 79895.34) + (new 'static 'nav-network-adjacency :index 22 :dist 60069.887) + ) + ) + (new 'static 'nav-network-info + :index 2 + :pos (new 'static 'vector :x 2597932.8 :y 71680.0 :z 927968.9 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 2 :parent #f) + :count 7 + :adjacency (new 'static 'inline-array nav-network-adjacency 7 + (new 'static 'nav-network-adjacency :index 3 :dist 71611.59) + (new 'static 'nav-network-adjacency :index 1 :dist 88945.46) + (new 'static 'nav-network-adjacency :index 9 :dist 53971.355) + (new 'static 'nav-network-adjacency :index 11 :dist 66837.71) + (new 'static 'nav-network-adjacency :index 20 :dist 43391.387) + (new 'static 'nav-network-adjacency :index 21 :dist 26702.234) + (new 'static 'nav-network-adjacency :index 22 :dist 77070.336) + ) + ) + (new 'static 'nav-network-info + :index 3 + :pos (new 'static 'vector :x 2542255.8 :y 81567.74 :z 971906.7 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 3 :parent #f) + :count 4 + :adjacency (new 'static 'inline-array nav-network-adjacency 4 + (new 'static 'nav-network-adjacency :index 2 :dist 71611.59) + (new 'static 'nav-network-adjacency :index 6 :dist 89853.13) + (new 'static 'nav-network-adjacency :index 9 :dist 62548.79) + (new 'static 'nav-network-adjacency :index 22 :dist 33792.41) + ) + ) + (new 'static 'nav-network-info + :index 4 + :pos (new 'static 'vector :x 2381270.8 :y 81567.74 :z 883834.5 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 4 :parent #f) + :count 4 + :adjacency (new 'static 'inline-array nav-network-adjacency 4 + (new 'static 'nav-network-adjacency :dist 51954.074) + (new 'static 'nav-network-adjacency :index 5 :dist 62992.383) + (new 'static 'nav-network-adjacency :index 7 :dist 87042.05) + (new 'static 'nav-network-adjacency :index 6 :dist 112192.72) + ) + ) + (new 'static 'nav-network-info + :index 5 + :pos (new 'static 'vector :x 2441051.2 :y 71680.0 :z 901054.06 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 5 :parent #f) + :count 5 + :adjacency (new 'static 'inline-array nav-network-adjacency 5 + (new 'static 'nav-network-adjacency :index 4 :dist 62992.383) + (new 'static 'nav-network-adjacency :index 6 :dist 69527.96) + (new 'static 'nav-network-adjacency :dist 104932.555) + (new 'static 'nav-network-adjacency :index 7 :dist 95899.65) + (new 'static 'nav-network-adjacency :index 1 :dist 79895.34) + ) + ) + (new 'static 'nav-network-info + :index 6 + :pos (new 'static 'vector :x 2452979.0 :y 71680.0 :z 969551.44 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 6 :parent #f) + :count 6 + :adjacency (new 'static 'inline-array nav-network-adjacency 6 + (new 'static 'nav-network-adjacency :index 5 :dist 69527.96) + (new 'static 'nav-network-adjacency :index 7 :dist 78542.03) + (new 'static 'nav-network-adjacency :index 4 :dist 112192.72) + (new 'static 'nav-network-adjacency :dist 130163.914) + (new 'static 'nav-network-adjacency :index 3 :dist 89853.13) + (new 'static 'nav-network-adjacency :index 22 :dist 73879.96) + ) + ) + (new 'static 'nav-network-info + :index 7 + :pos (new 'static 'vector :x 2374438.0 :y 71680.0 :z 970043.0 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 7 :parent #f) + :count 5 + :adjacency (new 'static 'inline-array nav-network-adjacency 5 + (new 'static 'nav-network-adjacency :index 6 :dist 78542.03) + (new 'static 'nav-network-adjacency :dist 70445.47) + (new 'static 'nav-network-adjacency :index 5 :dist 95899.65) + (new 'static 'nav-network-adjacency :index 4 :dist 87042.05) + (new 'static 'nav-network-adjacency :index 8 :dist 43008.0) + ) + ) + (new 'static 'nav-network-info + :index 8 + :pos (new 'static 'vector :x 2331430.0 :y 71679.18 :z 969952.9 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 8 :parent #f) + :count 2 + :adjacency (new 'static 'inline-array nav-network-adjacency 2 + (new 'static 'nav-network-adjacency :index 7 :dist 43008.0) + (new 'static 'nav-network-adjacency :dist 59898.266) + ) + ) + (new 'static 'nav-network-info + :index 9 + :pos (new 'static 'vector :x 2604145.8 :y 80344.266 :z 980876.9 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 9 :parent #f) + :count 4 + :adjacency (new 'static 'inline-array nav-network-adjacency 4 + (new 'static 'nav-network-adjacency :index 2 :dist 53971.355) + (new 'static 'nav-network-adjacency :index 3 :dist 62548.79) + (new 'static 'nav-network-adjacency :index 10 :dist 51110.297) + (new 'static 'nav-network-adjacency :index 20 :dist 33129.266) + ) + ) + (new 'static 'nav-network-info + :index 10 + :pos (new 'static 'vector :x 2655117.0 :y 80344.266 :z 984653.44 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 10 :parent #f) + :count 2 + :adjacency (new 'static 'inline-array nav-network-adjacency 2 + (new 'static 'nav-network-adjacency :index 9 :dist 51110.297) + (new 'static 'nav-network-adjacency :index 20 :dist 38163.25) + ) + ) + (new 'static 'nav-network-info + :index 11 + :pos (new 'static 'vector :x 2647498.2 :y 71678.77 :z 883129.94 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 11 :parent #f) + :count 5 + :adjacency (new 'static 'inline-array nav-network-adjacency 5 + (new 'static 'nav-network-adjacency :index 19 :dist 41889.793) + (new 'static 'nav-network-adjacency :index 2 :dist 66837.71) + (new 'static 'nav-network-adjacency :index 12 :dist 45715.457) + (new 'static 'nav-network-adjacency :index 21 :dist 51198.363) + (new 'static 'nav-network-adjacency :index 13 :dist 71453.49) + ) + ) + (new 'static 'nav-network-info + :index 12 + :pos (new 'static 'vector :x 2650853.0 :y 71680.0 :z 837537.4 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 12 :parent #f) + :count 4 + :adjacency (new 'static 'inline-array nav-network-adjacency 4 + (new 'static 'nav-network-adjacency :index 11 :dist 45715.457) + (new 'static 'nav-network-adjacency :index 13 :dist 52642.61) + (new 'static 'nav-network-adjacency :index 18 :dist 70539.67) + (new 'static 'nav-network-adjacency :index 19 :dist 30808.473) + ) + ) + (new 'static 'nav-network-info + :index 13 + :pos (new 'static 'vector :x 2703482.5 :y 71680.0 :z 838729.3 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 13 :parent #f) + :count 3 + :adjacency (new 'static 'inline-array nav-network-adjacency 3 + (new 'static 'nav-network-adjacency :index 12 :dist 52642.61) + (new 'static 'nav-network-adjacency :index 14 :dist 62040.062) + (new 'static 'nav-network-adjacency :index 11 :dist 71453.49) + ) + ) + (new 'static 'nav-network-info + :index 14 + :pos (new 'static 'vector :x 2761653.8 :y 71680.0 :z 860294.75 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 14 :parent #f) + :count 3 + :adjacency (new 'static 'inline-array nav-network-adjacency 3 + (new 'static 'nav-network-adjacency :index 13 :dist 62040.062) + (new 'static 'nav-network-adjacency :index 15 :dist 100182.836) + (new 'static 'nav-network-adjacency :index 17 :dist 43101.39) + ) + ) + (new 'static 'nav-network-info + :index 15 + :pos (new 'static 'vector :x 2772868.8 :y 71680.0 :z 959848.06 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 15 :parent #f) + :count 3 + :adjacency (new 'static 'inline-array nav-network-adjacency 3 + (new 'static 'nav-network-adjacency :index 14 :dist 100182.836) + (new 'static 'nav-network-adjacency :index 16 :dist 45114.164) + (new 'static 'nav-network-adjacency :index 17 :dist 68985.65) + ) + ) + (new 'static 'nav-network-info + :index 16 + :pos (new 'static 'vector :x 2812550.2 :y 71679.18 :z 981311.06 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 16 :parent #f) + :count 1 + :adjacency (new 'static 'inline-array nav-network-adjacency 1 + (new 'static 'nav-network-adjacency :index 15 :dist 45114.164) + ) + ) + (new 'static 'nav-network-info + :index 17 + :pos (new 'static 'vector :x 2789768.5 :y 71680.0 :z 892964.44 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 17 :parent #f) + :count 2 + :adjacency (new 'static 'inline-array nav-network-adjacency 2 + (new 'static 'nav-network-adjacency :index 15 :dist 68985.65) + (new 'static 'nav-network-adjacency :index 14 :dist 43101.39) + ) + ) + (new 'static 'nav-network-info + :index 18 + :pos (new 'static 'vector :x 2582265.5 :y 80344.266 :z 823516.75 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 18 :parent #f) + :count 2 + :adjacency (new 'static 'inline-array nav-network-adjacency 2 + (new 'static 'nav-network-adjacency :index 12 :dist 70539.67) + (new 'static 'nav-network-adjacency :index 19 :dist 48671.13) + ) + ) + (new 'static 'nav-network-info + :index 19 + :pos (new 'static 'vector :x 2622476.0 :y 71680.0 :z 849534.56 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 19 :parent #f) + :count 3 + :adjacency (new 'static 'inline-array nav-network-adjacency 3 + (new 'static 'nav-network-adjacency :index 11 :dist 41889.793) + (new 'static 'nav-network-adjacency :index 12 :dist 30808.473) + (new 'static 'nav-network-adjacency :index 18 :dist 48671.13) + ) + ) + (new 'static 'nav-network-info + :index 20 + :pos (new 'static 'vector :x 2627841.8 :y 71680.0 :z 959405.7 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 20 :parent #f) + :count 4 + :adjacency (new 'static 'inline-array nav-network-adjacency 4 + (new 'static 'nav-network-adjacency :index 10 :dist 38163.25) + (new 'static 'nav-network-adjacency :index 9 :dist 33129.266) + (new 'static 'nav-network-adjacency :index 2 :dist 43391.387) + (new 'static 'nav-network-adjacency :index 21 :dist 30644.225) + ) + ) + (new 'static 'nav-network-info + :index 21 + :pos (new 'static 'vector :x 2624617.8 :y 71679.18 :z 928931.44 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 21 :parent #f) + :count 3 + :adjacency (new 'static 'inline-array nav-network-adjacency 3 + (new 'static 'nav-network-adjacency :index 11 :dist 51198.363) + (new 'static 'nav-network-adjacency :index 2 :dist 26702.234) + (new 'static 'nav-network-adjacency :index 20 :dist 30644.225) + ) + ) + (new 'static 'nav-network-info + :index 22 + :pos (new 'static 'vector :x 2522992.2 :y 71680.0 :z 945962.6 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 22 :parent #f) + :count 4 + :adjacency (new 'static 'inline-array nav-network-adjacency 4 + (new 'static 'nav-network-adjacency :index 3 :dist 33792.41) + (new 'static 'nav-network-adjacency :index 1 :dist 60069.887) + (new 'static 'nav-network-adjacency :index 2 :dist 77070.336) + (new 'static 'nav-network-adjacency :index 6 :dist 73879.96) + ) + ) + ) + ) + +(define *forest-adjacency* (new 'static 'boxed-array :type nav-network-info + (new 'static 'nav-network-info + :pos (new 'static 'vector :x -2368880.2 :y 122140.67 :z 3622034.8 :w 1.0) + :path-node (new 'static 'nav-network-path-node :parent #f) + :count 12 + :adjacency (new 'static 'inline-array nav-network-adjacency 12 + (new 'static 'nav-network-adjacency :index 1 :dist 129781.35) + (new 'static 'nav-network-adjacency :index 3 :dist 85524.48) + (new 'static 'nav-network-adjacency :index 4 :dist 111945.73) + (new 'static 'nav-network-adjacency :index 10 :dist 123697.97) + (new 'static 'nav-network-adjacency :index 9 :dist 118688.98) + (new 'static 'nav-network-adjacency :index 20 :dist 84649.984) + (new 'static 'nav-network-adjacency :index 17 :dist 78633.37) + (new 'static 'nav-network-adjacency :index 15 :dist 125326.54) + (new 'static 'nav-network-adjacency :index 16 :dist 130749.65) + (new 'static 'nav-network-adjacency :index 32 :dist 219675.03) + (new 'static 'nav-network-adjacency :index 23 :dist 107214.85) + (new 'static 'nav-network-adjacency :index 38 :dist 112257.84) + ) + ) + (new 'static 'nav-network-info + :index 1 + :pos (new 'static 'vector :x -2384215.8 :y 122140.67 :z 3750907.5 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 1 :parent #f) + :count 11 + :adjacency (new 'static 'inline-array nav-network-adjacency 11 + (new 'static 'nav-network-adjacency :dist 129781.35) + (new 'static 'nav-network-adjacency :index 3 :dist 164965.98) + (new 'static 'nav-network-adjacency :index 4 :dist 97910.78) + (new 'static 'nav-network-adjacency :index 9 :dist 178428.72) + (new 'static 'nav-network-adjacency :index 8 :dist 127346.69) + (new 'static 'nav-network-adjacency :index 5 :dist 95617.44) + (new 'static 'nav-network-adjacency :index 15 :dist 83521.54) + (new 'static 'nav-network-adjacency :index 16 :dist 79391.13) + (new 'static 'nav-network-adjacency :index 20 :dist 144876.34) + (new 'static 'nav-network-adjacency :index 17 :dist 154862.39) + (new 'static 'nav-network-adjacency :index 32 :dist 111190.016) + ) + ) + (new 'static 'nav-network-info + :index 2 + :pos (new 'static 'vector :x -2427690.5 :y 203764.12 :z 3530059.2 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 2 :parent #f) + :count 5 + :adjacency (new 'static 'inline-array nav-network-adjacency 5 + (new 'static 'nav-network-adjacency :index 3 :dist 86278.96) + (new 'static 'nav-network-adjacency :index 10 :dist 115770.57) + (new 'static 'nav-network-adjacency :index 9 :dist 175158.48) + (new 'static 'nav-network-adjacency :index 24 :dist 112130.87) + (new 'static 'nav-network-adjacency :index 25 :dist 125953.64) + ) + ) + (new 'static 'nav-network-info + :index 3 + :pos (new 'static 'vector :x -2389990.5 :y 203764.12 :z 3607665.8 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 3 :parent #f) + :count 7 + :adjacency (new 'static 'inline-array nav-network-adjacency 7 + (new 'static 'nav-network-adjacency :index 2 :dist 86278.96) + (new 'static 'nav-network-adjacency :index 4 :dist 89296.08) + (new 'static 'nav-network-adjacency :index 9 :dist 109071.16) + (new 'static 'nav-network-adjacency :index 10 :dist 97467.19) + (new 'static 'nav-network-adjacency :index 8 :dist 176226.3) + (new 'static 'nav-network-adjacency :dist 85524.48) + (new 'static 'nav-network-adjacency :index 1 :dist 164965.98) + ) + ) + (new 'static 'nav-network-info + :index 4 + :pos (new 'static 'vector :x -2385403.5 :y 203764.12 :z 3696844.5 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 4 :parent #f) + :count 9 + :adjacency (new 'static 'inline-array nav-network-adjacency 9 + (new 'static 'nav-network-adjacency :index 3 :dist 89296.08) + (new 'static 'nav-network-adjacency :index 5 :dist 95870.98) + (new 'static 'nav-network-adjacency :index 8 :dist 112442.984) + (new 'static 'nav-network-adjacency :index 9 :dist 123003.29) + (new 'static 'nav-network-adjacency :index 7 :dist 186659.22) + (new 'static 'nav-network-adjacency :index 1 :dist 97910.78) + (new 'static 'nav-network-adjacency :dist 111945.73) + (new 'static 'nav-network-adjacency :index 12 :dist 180434.12) + (new 'static 'nav-network-adjacency :index 16 :dist 155761.45) + ) + ) + (new 'static 'nav-network-info + :index 5 + :pos (new 'static 'vector :x -2418855.0 :y 203764.12 :z 3786690.2 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 5 :parent #f) + :count 4 + :adjacency (new 'static 'inline-array nav-network-adjacency 4 + (new 'static 'nav-network-adjacency :index 4 :dist 95870.98) + (new 'static 'nav-network-adjacency :index 6 :dist 68017.766) + (new 'static 'nav-network-adjacency :index 7 :dist 139329.95) + (new 'static 'nav-network-adjacency :index 1 :dist 95617.44) + ) + ) + (new 'static 'nav-network-info + :index 6 + :pos (new 'static 'vector :x -2475081.0 :y 203764.12 :z 3824966.8 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 6 :parent #f) + :count 3 + :adjacency (new 'static 'inline-array nav-network-adjacency 3 + (new 'static 'nav-network-adjacency :index 5 :dist 68017.766) + (new 'static 'nav-network-adjacency :index 29 :dist 113601.74) + (new 'static 'nav-network-adjacency :index 34 :dist 70013.336) + ) + ) + (new 'static 'nav-network-info + :index 7 + :pos (new 'static 'vector :x -2303241.5 :y 203764.12 :z 3864448.5 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 7 :parent #f) + :count 4 + :adjacency (new 'static 'inline-array nav-network-adjacency 4 + (new 'static 'nav-network-adjacency :index 8 :dist 115393.33) + (new 'static 'nav-network-adjacency :index 4 :dist 186659.22) + (new 'static 'nav-network-adjacency :index 5 :dist 139329.95) + (new 'static 'nav-network-adjacency :index 30 :dist 109565.54) + ) + ) + (new 'static 'nav-network-info + :index 8 + :pos (new 'static 'vector :x -2286468.8 :y 203764.12 :z 3750280.5 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 8 :parent #f) + :count 9 + :adjacency (new 'static 'inline-array nav-network-adjacency 9 + (new 'static 'nav-network-adjacency :index 7 :dist 115393.33) + (new 'static 'nav-network-adjacency :index 9 :dist 121590.58) + (new 'static 'nav-network-adjacency :index 3 :dist 176226.3) + (new 'static 'nav-network-adjacency :index 4 :dist 112442.984) + (new 'static 'nav-network-adjacency :index 1 :dist 127346.69) + (new 'static 'nav-network-adjacency :index 12 :dist 103250.33) + (new 'static 'nav-network-adjacency :index 22 :dist 110587.086) + (new 'static 'nav-network-adjacency :index 30 :dist 119299.69) + (new 'static 'nav-network-adjacency :index 13 :dist 180773.69) + ) + ) + (new 'static 'nav-network-info + :index 9 + :pos (new 'static 'vector :x -2282974.5 :y 203764.12 :z 3628740.2 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 9 :parent #f) + :count 9 + :adjacency (new 'static 'inline-array nav-network-adjacency 9 + (new 'static 'nav-network-adjacency :index 8 :dist 121590.58) + (new 'static 'nav-network-adjacency :index 10 :dist 86629.58) + (new 'static 'nav-network-adjacency :index 2 :dist 175158.48) + (new 'static 'nav-network-adjacency :index 3 :dist 109071.16) + (new 'static 'nav-network-adjacency :index 4 :dist 123003.29) + (new 'static 'nav-network-adjacency :dist 118688.98) + (new 'static 'nav-network-adjacency :index 1 :dist 178428.72) + (new 'static 'nav-network-adjacency :index 12 :dist 96829.85) + (new 'static 'nav-network-adjacency :index 22 :dist 105110.734) + ) + ) + (new 'static 'nav-network-info + :index 10 + :pos (new 'static 'vector :x -2313252.5 :y 203764.12 :z 3547573.8 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 10 :parent #f) + :count 6 + :adjacency (new 'static 'inline-array nav-network-adjacency 6 + (new 'static 'nav-network-adjacency :index 9 :dist 86629.58) + (new 'static 'nav-network-adjacency :index 2 :dist 115770.57) + (new 'static 'nav-network-adjacency :index 3 :dist 97467.19) + (new 'static 'nav-network-adjacency :dist 123697.97) + (new 'static 'nav-network-adjacency :index 24 :dist 141944.02) + (new 'static 'nav-network-adjacency :index 23 :dist 91214.234) + ) + ) + (new 'static 'nav-network-info + :index 11 + :pos (new 'static 'vector :x -2199191.2 :y 52720.434 :z 3684564.2 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 11 :parent #f) + :count 3 + :adjacency (new 'static 'inline-array nav-network-adjacency 3 + (new 'static 'nav-network-adjacency :index 13 :dist 86080.72) + (new 'static 'nav-network-adjacency :index 18 :dist 79022.08) + (new 'static 'nav-network-adjacency :index 21 :dist 64492.34) + ) + ) + (new 'static 'nav-network-info + :index 12 + :pos (new 'static 'vector :x -2205265.0 :y 203764.12 :z 3686510.2 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 12 :parent #f) + :count 7 + :adjacency (new 'static 'inline-array nav-network-adjacency 7 + (new 'static 'nav-network-adjacency :index 8 :dist 103250.33) + (new 'static 'nav-network-adjacency :index 9 :dist 96829.85) + (new 'static 'nav-network-adjacency :index 4 :dist 180434.12) + (new 'static 'nav-network-adjacency :index 21 :dist 90400.766) + (new 'static 'nav-network-adjacency :index 22 :dist 125247.08) + (new 'static 'nav-network-adjacency :index 30 :dist 170006.12) + (new 'static 'nav-network-adjacency :index 13 :dist 173362.38) + ) + ) + (new 'static 'nav-network-info + :index 13 + :pos (new 'static 'vector :x -2189135.5 :y 52719.617 :z 3770056.0 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 13 :parent #f) + :count 6 + :adjacency (new 'static 'inline-array nav-network-adjacency 6 + (new 'static 'nav-network-adjacency :index 11 :dist 86080.72) + (new 'static 'nav-network-adjacency :index 14 :dist 89017.14) + (new 'static 'nav-network-adjacency :index 30 :dist 104423.016) + (new 'static 'nav-network-adjacency :index 12 :dist 173362.38) + (new 'static 'nav-network-adjacency :index 8 :dist 180773.69) + (new 'static 'nav-network-adjacency :index 21 :dist 119484.83) + ) + ) + (new 'static 'nav-network-info + :index 14 + :pos (new 'static 'vector :x -2276785.2 :y 39343.72 :z 3762142.5 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 14 :parent #f) + :count 2 + :adjacency (new 'static 'inline-array nav-network-adjacency 2 + (new 'static 'nav-network-adjacency :index 13 :dist 89017.14) + (new 'static 'nav-network-adjacency :index 15 :dist 80542.516) + ) + ) + (new 'static 'nav-network-info + :index 15 + :pos (new 'static 'vector :x -2346413.8 :y 52720.434 :z 3723931.2 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 15 :parent #f) + :count 7 + :adjacency (new 'static 'inline-array nav-network-adjacency 7 + (new 'static 'nav-network-adjacency :index 14 :dist 80542.516) + (new 'static 'nav-network-adjacency :index 16 :dist 65499.137) + (new 'static 'nav-network-adjacency :index 17 :dist 124506.93) + (new 'static 'nav-network-adjacency :index 20 :dist 87812.51) + (new 'static 'nav-network-adjacency :index 1 :dist 83521.54) + (new 'static 'nav-network-adjacency :dist 125326.54) + (new 'static 'nav-network-adjacency :index 22 :dist 90754.664) + ) + ) + (new 'static 'nav-network-info + :index 16 + :pos (new 'static 'vector :x -2411912.5 :y 52720.434 :z 3724135.8 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 16 :parent #f) + :count 7 + :adjacency (new 'static 'inline-array nav-network-adjacency 7 + (new 'static 'nav-network-adjacency :index 15 :dist 65499.137) + (new 'static 'nav-network-adjacency :index 4 :dist 155761.45) + (new 'static 'nav-network-adjacency :index 17 :dist 110320.84) + (new 'static 'nav-network-adjacency :index 20 :dist 122594.51) + (new 'static 'nav-network-adjacency :index 1 :dist 79391.13) + (new 'static 'nav-network-adjacency :dist 130749.65) + (new 'static 'nav-network-adjacency :index 36 :dist 135989.25) + ) + ) + (new 'static 'nav-network-info + :index 17 + :pos (new 'static 'vector :x -2404937.0 :y 52720.434 :z 3614035.2 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 17 :parent #f) + :count 7 + :adjacency (new 'static 'inline-array nav-network-adjacency 7 + (new 'static 'nav-network-adjacency :index 16 :dist 110320.84) + (new 'static 'nav-network-adjacency :index 15 :dist 124506.93) + (new 'static 'nav-network-adjacency :index 20 :dist 85160.76) + (new 'static 'nav-network-adjacency :dist 78633.37) + (new 'static 'nav-network-adjacency :index 1 :dist 154862.39) + (new 'static 'nav-network-adjacency :index 23 :dist 139519.19) + (new 'static 'nav-network-adjacency :index 38 :dist 52616.4) + ) + ) + (new 'static 'nav-network-info + :index 18 + :pos (new 'static 'vector :x -2190974.2 :y 52720.027 :z 3605970.0 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 18 :parent #f) + :count 3 + :adjacency (new 'static 'inline-array nav-network-adjacency 3 + (new 'static 'nav-network-adjacency :index 11 :dist 79022.08) + (new 'static 'nav-network-adjacency :index 19 :dist 69116.31) + (new 'static 'nav-network-adjacency :index 21 :dist 89141.25) + ) + ) + (new 'static 'nav-network-info + :index 19 + :pos (new 'static 'vector :x -2257919.5 :y 39343.72 :z 3595177.2 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 19 :parent #f) + :count 2 + :adjacency (new 'static 'inline-array nav-network-adjacency 2 + (new 'static 'nav-network-adjacency :index 18 :dist 69116.31) + (new 'static 'nav-network-adjacency :index 20 :dist 80130.05) + ) + ) + (new 'static 'nav-network-info + :index 20 + :pos (new 'static 'vector :x -2323561.8 :y 52720.027 :z 3639143.8 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 20 :parent #f) + :count 8 + :adjacency (new 'static 'inline-array nav-network-adjacency 8 + (new 'static 'nav-network-adjacency :index 19 :dist 80130.05) + (new 'static 'nav-network-adjacency :index 15 :dist 87812.51) + (new 'static 'nav-network-adjacency :index 17 :dist 85160.76) + (new 'static 'nav-network-adjacency :index 16 :dist 122594.51) + (new 'static 'nav-network-adjacency :dist 84649.984) + (new 'static 'nav-network-adjacency :index 1 :dist 144876.34) + (new 'static 'nav-network-adjacency :index 22 :dist 82706.02) + (new 'static 'nav-network-adjacency :index 23 :dist 122530.61) + ) + ) + (new 'static 'nav-network-info + :index 21 + :pos (new 'static 'vector :x -2200083.8 :y 115259.39 :z 3668836.0 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 21 :parent #f) + :count 7 + :adjacency (new 'static 'inline-array nav-network-adjacency 7 + (new 'static 'nav-network-adjacency :index 22 :dist 95058.74) + (new 'static 'nav-network-adjacency :index 11 :dist 64492.34) + (new 'static 'nav-network-adjacency :index 12 :dist 90400.766) + (new 'static 'nav-network-adjacency :index 32 :dist 198217.31) + (new 'static 'nav-network-adjacency :index 30 :dist 163425.89) + (new 'static 'nav-network-adjacency :index 13 :dist 119484.83) + (new 'static 'nav-network-adjacency :index 18 :dist 89141.25) + ) + ) + (new 'static 'nav-network-info + :index 22 + :pos (new 'static 'vector :x -2293862.0 :y 115259.39 :z 3684388.5 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 22 :parent #f) + :count 7 + :adjacency (new 'static 'inline-array nav-network-adjacency 7 + (new 'static 'nav-network-adjacency :index 21 :dist 95058.74) + (new 'static 'nav-network-adjacency :index 15 :dist 90754.664) + (new 'static 'nav-network-adjacency :index 20 :dist 82706.02) + (new 'static 'nav-network-adjacency :index 9 :dist 105110.734) + (new 'static 'nav-network-adjacency :index 8 :dist 110587.086) + (new 'static 'nav-network-adjacency :index 12 :dist 125247.08) + (new 'static 'nav-network-adjacency :index 32 :dist 150130.28) + ) + ) + (new 'static 'nav-network-info + :index 23 + :pos (new 'static 'vector :x -2308316.2 :y 113705.37 :z 3533967.0 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 23 :parent #f) + :count 6 + :adjacency (new 'static 'inline-array nav-network-adjacency 6 + (new 'static 'nav-network-adjacency :index 24 :dist 104885.86) + (new 'static 'nav-network-adjacency :index 17 :dist 139519.19) + (new 'static 'nav-network-adjacency :index 32 :dist 299664.2) + (new 'static 'nav-network-adjacency :index 10 :dist 91214.234) + (new 'static 'nav-network-adjacency :dist 107214.85) + (new 'static 'nav-network-adjacency :index 20 :dist 122530.61) + ) + ) + (new 'static 'nav-network-info + :index 24 + :pos (new 'static 'vector :x -2393447.8 :y 113705.37 :z 3472699.0 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 24 :parent #f) + :count 4 + :adjacency (new 'static 'inline-array nav-network-adjacency 4 + (new 'static 'nav-network-adjacency :index 23 :dist 104885.86) + (new 'static 'nav-network-adjacency :index 25 :dist 174672.28) + (new 'static 'nav-network-adjacency :index 2 :dist 112130.87) + (new 'static 'nav-network-adjacency :index 10 :dist 141944.02) + ) + ) + (new 'static 'nav-network-info + :index 25 + :pos (new 'static 'vector :x -2549890.8 :y 174656.72 :z 3520876.2 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 25 :parent #f) + :count 3 + :adjacency (new 'static 'inline-array nav-network-adjacency 3 + (new 'static 'nav-network-adjacency :index 26 :dist 39926.58) + (new 'static 'nav-network-adjacency :index 24 :dist 174672.28) + (new 'static 'nav-network-adjacency :index 2 :dist 125953.64) + ) + ) + (new 'static 'nav-network-info + :index 26 + :pos (new 'static 'vector :x -2563202.8 :y 174657.12 :z 3558518.2 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 26 :parent #f) + :count 2 + :adjacency (new 'static 'inline-array nav-network-adjacency 2 + (new 'static 'nav-network-adjacency :index 25 :dist 39926.58) + (new 'static 'nav-network-adjacency :index 27 :dist 80087.04) + ) + ) + (new 'static 'nav-network-info + :index 27 + :pos (new 'static 'vector :x -2534080.0 :y 174657.12 :z 3633123.0 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 27 :parent #f) + :count 2 + :adjacency (new 'static 'inline-array nav-network-adjacency 2 + (new 'static 'nav-network-adjacency :index 26 :dist 80087.04) + (new 'static 'nav-network-adjacency :index 28 :dist 96868.35) + ) + ) + (new 'static 'nav-network-info + :index 28 + :pos (new 'static 'vector :x -2535996.5 :y 174656.72 :z 3729972.5 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 28 :parent #f) + :count 2 + :adjacency (new 'static 'inline-array nav-network-adjacency 2 + (new 'static 'nav-network-adjacency :index 27 :dist 96868.35) + (new 'static 'nav-network-adjacency :index 29 :dist 106853.58) + ) + ) + (new 'static 'nav-network-info + :index 29 + :pos (new 'static 'vector :x -2584891.0 :y 174656.72 :z 3824983.8 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 29 :parent #f) + :count 4 + :adjacency (new 'static 'inline-array nav-network-adjacency 4 + (new 'static 'nav-network-adjacency :index 28 :dist 106853.58) + (new 'static 'nav-network-adjacency :index 31 :dist 211829.14) + (new 'static 'nav-network-adjacency :index 6 :dist 113601.74) + (new 'static 'nav-network-adjacency :index 34 :dist 119784.66) + ) + ) + (new 'static 'nav-network-info + :index 30 + :pos (new 'static 'vector :x -2253942.2 :y 115066.88 :z 3823131.8 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 30 :parent #f) + :count 7 + :adjacency (new 'static 'inline-array nav-network-adjacency 7 + (new 'static 'nav-network-adjacency :index 31 :dist 166265.23) + (new 'static 'nav-network-adjacency :index 32 :dist 57272.32) + (new 'static 'nav-network-adjacency :index 13 :dist 104423.016) + (new 'static 'nav-network-adjacency :index 21 :dist 163425.89) + (new 'static 'nav-network-adjacency :index 12 :dist 170006.12) + (new 'static 'nav-network-adjacency :index 8 :dist 119299.69) + (new 'static 'nav-network-adjacency :index 7 :dist 109565.54) + ) + ) + (new 'static 'nav-network-info + :index 31 + :pos (new 'static 'vector :x -2398297.8 :y 115067.29 :z 3905629.5 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 31 :parent #f) + :count 3 + :adjacency (new 'static 'inline-array nav-network-adjacency 3 + (new 'static 'nav-network-adjacency :index 30 :dist 166265.23) + (new 'static 'nav-network-adjacency :index 29 :dist 211829.14) + (new 'static 'nav-network-adjacency :index 32 :dist 113745.92) + ) + ) + (new 'static 'nav-network-info + :index 32 + :pos (new 'static 'vector :x -2310246.0 :y 115066.88 :z 3833622.0 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 32 :parent #f) + :count 7 + :adjacency (new 'static 'inline-array nav-network-adjacency 7 + (new 'static 'nav-network-adjacency :index 30 :dist 57272.32) + (new 'static 'nav-network-adjacency :index 1 :dist 111190.016) + (new 'static 'nav-network-adjacency :index 22 :dist 150130.28) + (new 'static 'nav-network-adjacency :index 21 :dist 198217.31) + (new 'static 'nav-network-adjacency :dist 219675.03) + (new 'static 'nav-network-adjacency :index 23 :dist 299664.2) + (new 'static 'nav-network-adjacency :index 31 :dist 113745.92) + ) + ) + (new 'static 'nav-network-info + :index 33 + :pos (new 'static 'vector :x -2528517.8 :y 174656.72 :z 3931729.0 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 33 :parent #f) + :count 2 + :adjacency (new 'static 'inline-array nav-network-adjacency 2 + (new 'static 'nav-network-adjacency :index 34 :dist 62949.785) + (new 'static 'nav-network-adjacency :index 35 :dist 128975.26) + ) + ) + (new 'static 'nav-network-info + :index 34 + :pos (new 'static 'vector :x -2483105.5 :y 174656.72 :z 3888135.2 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 34 :parent #f) + :count 3 + :adjacency (new 'static 'inline-array nav-network-adjacency 3 + (new 'static 'nav-network-adjacency :index 33 :dist 62949.785) + (new 'static 'nav-network-adjacency :index 29 :dist 119784.66) + (new 'static 'nav-network-adjacency :index 6 :dist 70013.336) + ) + ) + (new 'static 'nav-network-info + :index 35 + :pos (new 'static 'vector :x -2570424.0 :y 52720.434 :z 3928555.0 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 35 :parent #f) + :count 2 + :adjacency (new 'static 'inline-array nav-network-adjacency 2 + (new 'static 'nav-network-adjacency :index 36 :dist 129879.66) + (new 'static 'nav-network-adjacency :index 33 :dist 128975.26) + ) + ) + (new 'static 'nav-network-info + :index 36 + :pos (new 'static 'vector :x -2468826.8 :y 52720.027 :z 3847642.8 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 36 :parent #f) + :count 2 + :adjacency (new 'static 'inline-array nav-network-adjacency 2 + (new 'static 'nav-network-adjacency :index 35 :dist 129879.66) + (new 'static 'nav-network-adjacency :index 16 :dist 135989.25) + ) + ) + (new 'static 'nav-network-info + :index 37 + :pos (new 'static 'vector :x -2461089.5 :y 52720.434 :z 3515432.2 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 37 :parent #f) + :count 1 + :adjacency (new 'static 'inline-array nav-network-adjacency 1 + (new 'static 'nav-network-adjacency :index 38 :dist 71242.95) + ) + ) + (new 'static 'nav-network-info + :index 38 + :pos (new 'static 'vector :x -2449264.2 :y 52720.434 :z 3585687.2 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 38 :parent #f) + :count 3 + :adjacency (new 'static 'inline-array nav-network-adjacency 3 + (new 'static 'nav-network-adjacency :index 37 :dist 71242.95) + (new 'static 'nav-network-adjacency :index 17 :dist 52616.4) + (new 'static 'nav-network-adjacency :dist 112257.84) + ) + ) + ) + ) + +(define *under-adjacency* (new 'static 'boxed-array :type nav-network-info)) + +(define *nestb-adjacency* (new 'static 'boxed-array :type nav-network-info)) diff --git a/goal_src/jak2/levels/common/flitter.gc b/goal_src/jak2/levels/common/flitter.gc index 0de96cfae6..8e6867ddbe 100644 --- a/goal_src/jak2/levels/common/flitter.gc +++ b/goal_src/jak2/levels/common/flitter.gc @@ -896,7 +896,7 @@ (vector-normalize! s3-2 f28-1) (vector+! s3-2 s3-2 s4-2) ) - (nav-state-method-41 (-> obj nav state) s3-2) + (clamp-vector-to-mesh-cross-gaps (-> obj nav state) s3-2) (vector+! s2-0 s5-1 s3-2) (set! (-> obj target-pos quad) (-> s2-0 quad)) ) diff --git a/goal_src/jak2/levels/nest/boss/nest-texture.gc b/goal_src/jak2/levels/nest/boss/nest-texture.gc index debb8b4242..3f9bc7949c 100644 --- a/goal_src/jak2/levels/nest/boss/nest-texture.gc +++ b/goal_src/jak2/levels/nest/boss/nest-texture.gc @@ -5,5 +5,8 @@ ;; name in dgo: nest-texture ;; dgos: NEB +;; NOTE - for nestb-scenes +(define-extern set-darkjak-highres-nest-texture-morph! (function int none)) + ;; DECOMP BEGINS diff --git a/goal_src/jak2/levels/nest/boss/nestb-scenes.gc b/goal_src/jak2/levels/nest/boss/nestb-scenes.gc index deae3991df..1afdd125ce 100644 --- a/goal_src/jak2/levels/nest/boss/nestb-scenes.gc +++ b/goal_src/jak2/levels/nest/boss/nestb-scenes.gc @@ -7,3 +7,1771 @@ ;; DECOMP BEGINS +(set-subtask-hook! *game-info* 245 0 (lambda :behavior scene-player + () + 0.0 + (let ((a1-0 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-0 from) (process->ppointer self)) + (set! (-> a1-0 num-params) 1) + (set! (-> a1-0 message) 'test-pickup) + (set! (-> a1-0 param 0) (the-as uint 7)) + (let ((f30-0 (send-event-function *target* a1-0))) + (let ((gp-0 (-> self clock frame-counter))) + (until (>= (- (-> self clock frame-counter) gp-0) (seconds 0.1)) + (suspend) + ) + ) + (send-event *target* 'change-mode 'darkjak #f 64) + (let ((gp-1 (-> self clock frame-counter))) + (until (>= (- (-> self clock frame-counter) gp-1) (seconds 0.1)) + (suspend) + ) + ) + (send-event *target* 'get-pickup 7 f30-0) + ) + ) + (send-event *target* 'end-mode) + (none) + ) + ) + +(defskelgroup skel-metalkor-fma-spinner metalkor-fma-spinner 0 2 + ((1 (meters 999999))) + :bounds (static-spherem 0 0 0 20) + :origin-joint-index 3 + ) + +(defpartgroup group-nest-break-precipice-explosion + :id 1239 + :linger-duration (seconds 3) + :flags (use-local-clock) + :bounds (static-bspherem 0 0 0 64) + :parts ((sp-item 5290) (sp-item 5291) (sp-item 5292) (sp-item 5293)) + ) + +(defpart 5290 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #xc)) + (sp-flt spt-num 10.0) + (sp-rnd-flt spt-x (meters 0) (meters 0.6) 1.0) + (sp-flt spt-y (meters 4)) + (sp-rnd-flt spt-scale-x (meters 9) (meters 5) 1.0) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 3600.0) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 128.0) + (sp-rnd-flt spt-g 96.0 32.0 1.0) + (sp-rnd-flt spt-b 64.0 32.0 1.0) + (sp-rnd-flt spt-a 16.0 32.0 1.0) + (sp-rnd-flt spt-vel-y (meters 0.033333335) (meters 0.04) 1.0) + (sp-rnd-flt spt-scalevel-x (meters 0.016666668) (meters 0.016666668) 1.0) + (sp-rnd-flt spt-rotvel-z (degrees -0.12) (degrees 0.24) 1.0) + (sp-copy-from-other spt-scalevel-y -4) + (sp-rnd-flt spt-fade-a 0.32 0.32 1.0) + (sp-rnd-flt spt-friction 0.94 0.04 1.0) + (sp-int spt-timer 2400) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-12) + (sp-int-plain-rnd spt-next-time 70 29 1) + (sp-launcher-by-id spt-next-launcher 5294) + (sp-rnd-flt spt-conerot-x (degrees 0.0) (degrees 3600.0) 1.0) + (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 3600.0) 1.0) + (sp-flt spt-rotate-y (degrees 0.0)) + ) + ) + +(defpart 5294 + :init-specs ((sp-flt spt-scalevel-x (meters 0.008333334)) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-a 0.0) + (sp-int-plain-rnd spt-next-time 100 149 1) + (sp-launcher-by-id spt-next-launcher 5295) + ) + ) + +(defpart 5295 + :init-specs ((sp-flt spt-scalevel-x (meters 0.0033333334)) + (sp-copy-from-other spt-scalevel-y -4) + (sp-rnd-flt spt-fade-a -0.21333334 -0.10666667 1.0) + ) + ) + +(defpart 5291 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x32 :page #xc)) + (sp-rnd-flt spt-num 10.0 20.0 1.0) + (sp-flt spt-x (meters 0.25)) + (sp-flt spt-y (meters 4)) + (sp-rnd-flt spt-scale-x (meters 1) (meters 2) 1.0) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 128.0) + (sp-rnd-flt spt-g 96.0 32.0 1.0) + (sp-rnd-flt spt-b 64.0 32.0 1.0) + (sp-rnd-flt spt-a 16.0 32.0 1.0) + (sp-rnd-flt spt-vel-y (meters 0) (meters 0.13333334) 1.0) + (sp-rnd-flt spt-scalevel-x (meters 0.006666667) (meters 0.0033333334) 1.0) + (sp-rnd-flt spt-rotvel-z (degrees -0.12) (degrees 0.24) 1.0) + (sp-copy-from-other spt-scalevel-y -4) + (sp-rnd-flt spt-accel-y -0.68266666 -2.7306666 1.0) + (sp-rnd-flt spt-friction 0.88 0.02 1.0) + (sp-int spt-timer 6000) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-12) + (sp-int-plain-rnd spt-next-time 70 29 1) + (sp-launcher-by-id spt-next-launcher 5296) + (sp-rnd-flt spt-conerot-x (degrees 0.0) (degrees 3600.0) 1.0) + (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 3600.0) 1.0) + (sp-flt spt-rotate-y (degrees 0.0)) + (sp-rnd-flt spt-conerot-radius (meters 0) (meters 3) 1.0) + ) + ) + +(defpart 5296 + :init-specs ((sp-flt spt-scalevel-x (meters 0.01)) + (sp-copy-from-other spt-scalevel-y -4) + (sp-int-plain-rnd spt-next-time 90 29 1) + (sp-launcher-by-id spt-next-launcher 5297) + ) + ) + +(defpart 5297 + :init-specs ((sp-flt spt-scalevel-x (meters 0.0033333334)) + (sp-copy-from-other spt-scalevel-y -4) + (sp-rnd-flt spt-fade-a -0.053333335 -0.053333335 1.0) + ) + ) + +(defpart 5292 + :init-specs ((sp-func spt-birth-func 'birth-func-texture-group) + (sp-rnd-flt spt-num 10.0 20.0 1.0) + (sp-flt spt-y (meters 4)) + (sp-rnd-flt spt-scale-x (meters 6) (meters 3) 1.0) + (new 'static 'sp-field-init-spec + :field (sp-field-id spt-rot-z) + :flags (sp-flag spflag7) + :random-rangef 655360.0 + :random-multf 1.0 + ) + (sp-rnd-flt spt-scale-y (meters 8) (meters 3.5) 1.0) + (sp-flt spt-r 128.0) + (sp-rnd-flt spt-g 96.0 32.0 1.0) + (sp-rnd-flt spt-b 64.0 32.0 1.0) + (sp-rnd-flt spt-a 16.0 32.0 1.0) + (sp-rnd-flt spt-vel-y (meters 0.05) (meters 0.1) 1.0) + (sp-rnd-flt spt-scalevel-x (meters 0.033333335) (meters 0.033333335) 1.0) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-a -0.13333334) + (sp-rnd-flt spt-friction 0.92 0.02 1.0) + (sp-int spt-timer 2000) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-12) + (new 'static 'sp-field-init-spec + :field (sp-field-id spt-userdata) + :flags (sp-flag plain-v2) + :object (new 'static 'boxed-array :type int32 80 1 0 #xc00000 #xc03300) + ) + (sp-int spt-next-time 50) + (sp-launcher-by-id spt-next-launcher 5298) + (new 'static 'sp-field-init-spec + :field (sp-field-id spt-conerot-x) + :flags (sp-flag from-pointer) + :func '*sp-temp* + ) + (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 3600.0) 1.0) + (sp-flt spt-rotate-y (degrees 0.0)) + (sp-rnd-flt spt-conerot-radius (meters 0) (meters 2) 1.0) + ) + ) + +(defpart 5293 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x34 :page #xc)) + (sp-rnd-flt spt-num 10.0 20.0 1.0) + (sp-flt spt-y (meters 4)) + (sp-rnd-flt spt-scale-x (meters 6) (meters 3) 1.0) + (sp-int spt-rot-x 4) + (new 'static 'sp-field-init-spec + :field (sp-field-id spt-rot-z) + :flags (sp-flag spflag7) + :random-rangef 65536.0 + :random-multf 1.0 + ) + (sp-rnd-flt spt-scale-y (meters 8) (meters 3.5) 1.0) + (sp-flt spt-r 128.0) + (sp-rnd-flt spt-g 96.0 32.0 1.0) + (sp-rnd-flt spt-b 64.0 32.0 1.0) + (sp-rnd-flt spt-a 16.0 32.0 1.0) + (sp-rnd-flt spt-vel-y (meters 0.05) (meters 0.1) 1.0) + (sp-rnd-flt spt-scalevel-x (meters 0.033333335) (meters 0.033333335) 1.0) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-a -0.13333334) + (sp-rnd-flt spt-friction 0.92 0.02 1.0) + (sp-int spt-timer 2000) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-12) + (sp-func spt-func 'sparticle-motion-blur) + (sp-int spt-next-time 50) + (sp-launcher-by-id spt-next-launcher 5298) + (new 'static 'sp-field-init-spec + :field (sp-field-id spt-conerot-x) + :flags (sp-flag from-pointer) + :func '*sp-temp* + ) + (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 3600.0) 1.0) + (sp-flt spt-rotate-y (degrees 0.0)) + (sp-rnd-flt spt-conerot-radius (meters 0) (meters -5) 1.0) + ) + ) + +(defpart 5298 + :init-specs ((sp-rnd-flt spt-scalevel-x (meters 0.033333335) (meters 0.033333335) 1.0) + (sp-copy-from-other spt-scalevel-y -4) + (sp-int-plain-rnd spt-next-time 60 19 1) + (sp-launcher-by-id spt-next-launcher 5299) + ) + ) + +(defpart 5299 + :init-specs ((sp-rnd-flt spt-scalevel-x (meters 0.016666668) (meters 0.016666668) 1.0) + (sp-copy-from-other spt-scalevel-y -4) + (sp-rnd-flt spt-fade-a -0.18 -0.12 1.0) + ) + ) + +(defpartgroup group-nest-break-precipice-trailer + :id 1240 + :bounds (static-bspherem 0 0 0 15) + :parts ((sp-item 5300)) + ) + +(defpart 5300 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #xc)) + (sp-flt spt-num 1.0) + (sp-rnd-flt spt-x (meters -0.25) (meters 1) 1.0) + (sp-rnd-flt spt-scale-x (meters 1) (meters 2) 1.0) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 3600.0) 1.0) + (sp-rnd-flt spt-scale-y (meters 1) (meters 2) 1.0) + (sp-flt spt-r 128.0) + (sp-rnd-flt spt-g 96.0 32.0 1.0) + (sp-rnd-flt spt-b 64.0 32.0 1.0) + (sp-rnd-flt spt-a 16.0 32.0 1.0) + (sp-rnd-flt spt-vel-y (meters -0.013333334) (meters -0.013333334) 1.0) + (sp-rnd-flt spt-scalevel-x (meters 0.006666667) (meters 0.006666667) 1.0) + (sp-rnd-flt spt-rotvel-z (degrees -0.3) (degrees 0.6) 1.0) + (sp-copy-from-other spt-scalevel-y -4) + (sp-rnd-flt spt-fade-a -0.08 -0.08 1.0) + (sp-rnd-flt spt-friction 0.95 0.03 1.0) + (sp-int spt-timer 1200) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-12) + (sp-rnd-flt spt-rotate-y (degrees 0.0) (degrees 3600.0) 1.0) + ) + ) + +(defpartgroup group-nest-break-precipice-billow + :id 1241 + :flags (always-draw) + :bounds (static-bspherem 0 0 0 15) + :parts ((sp-item 5301)) + ) + +(defpart 5301 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #xc)) + (sp-rnd-flt spt-num 1.0 0.5 1.0) + (sp-rnd-flt spt-x (meters -6) (meters 12) 1.0) + (sp-rnd-flt spt-scale-x (meters 1) (meters 2) 1.0) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 3600.0) 1.0) + (sp-rnd-flt spt-scale-y (meters 1) (meters 2) 1.0) + (sp-flt spt-r 128.0) + (sp-rnd-flt spt-g 96.0 32.0 1.0) + (sp-rnd-flt spt-b 64.0 32.0 1.0) + (sp-rnd-flt spt-a 16.0 32.0 1.0) + (sp-rnd-flt spt-vel-x (meters 0.02) (meters 0.02) 1.0) + (sp-rnd-flt spt-scalevel-x (meters 0.033333335) (meters 0.006666667) 1.0) + (sp-rnd-flt spt-rotvel-z (degrees -0.3) (degrees 0.6) 1.0) + (sp-copy-from-other spt-scalevel-y -4) + (sp-rnd-flt spt-fade-a -0.04 -0.08 1.0) + (sp-flt spt-accel-y 2.7306666) + (sp-rnd-flt spt-friction 0.95 0.03 1.0) + (sp-int spt-timer 1300) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-12) + (sp-rnd-flt spt-rotate-y (degrees 0.0) (degrees 3600.0) 1.0) + ) + ) + +(defpartgroup group-nestb-precursor-stone-glow + :id 1242 + :bounds (static-bspherem 0 0 0 3) + :parts ((sp-item 5302 :flags (bit6))) + ) + +(defpart 5302 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xca :page #xc)) + (sp-flt spt-num 1.0) + (sp-flt spt-scale-x (meters 3.5)) + (sp-flt spt-rot-x 8192.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 16.0) + (sp-flt spt-g 192.0) + (sp-flt spt-b 16.0) + (sp-flt spt-a 24.0) + (sp-int spt-timer 5) + (sp-cpuinfo-flags glow) + (sp-flt spt-userdata 4096.0) + ) + ) + +(defpartgroup group-nest-metalkor-shot-anticipate + :id 1243 + :bounds (static-bspherem 0 0 0 160) + :parts ((sp-item 5303 :fade-after (meters 80) :falloff-to (meters 80)) + (sp-item 5304 :fade-after (meters 220) :flags (bit6)) + ) + ) + +(defpart 5303 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xc9 :page #xc)) + (sp-flt spt-num 8.0) + (sp-flt spt-scale-x (meters 0)) + (sp-flt spt-rot-z (degrees 90.0)) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 255.0) + (sp-flt spt-g 255.0) + (sp-flt spt-b 255.0) + (sp-flt spt-a 32.0) + (sp-flt spt-vel-y (meters -0.02)) + (sp-rnd-flt spt-scalevel-x (meters 0.005) (meters 0.005) 1.0) + (sp-rnd-flt spt-rotvel-z (degrees -1.2) (degrees 2.4) 1.0) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-r -0.98) + (sp-flt spt-fade-g -0.98) + (sp-flt spt-fade-a 0.19393939) + (sp-int spt-timer 250) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3) + (sp-int spt-next-time 165) + (sp-launcher-by-id spt-next-launcher 5305) + (sp-rnd-flt spt-conerot-x (degrees 0.0) (degrees 3600.0) 1.0) + (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 3600.0) 1.0) + (sp-flt spt-conerot-radius (meters 4)) + ) + ) + +(defpart 5305 + :init-specs ((sp-flt spt-fade-a -0.7529412) (sp-flt spt-friction 0.1)) + ) + +(defpart 5304 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xca :page #xc)) + (sp-flt spt-num 1.0) + (sp-flt spt-scale-x (meters 8)) + (sp-flt spt-rot-x 1228.8) + (sp-copy-from-other spt-scale-y -4) + (sp-rnd-flt spt-r 128.0 16.0 1.0) + (sp-rnd-flt spt-g 146.0 16.0 1.0) + (sp-rnd-flt spt-b 128.0 16.0 1.0) + (sp-flt spt-a 32.0) + (sp-flt spt-omega 822476.8) + (sp-int spt-timer 5) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow) + (sp-flt spt-userdata 8192.0) + ) + ) + +(defun movie-nest-metalkor-shot-draw-fire ((arg0 vector) (arg1 vector)) + (let ((s5-1 (vector-! (new 'stack-no-clear 'vector) arg1 arg0))) + (draw-beam (-> *part-id-table* 624) arg0 s5-1 #f #t) + (let* ((a0-4 (vector-normalize-copy! (new 'stack-no-clear 'vector) s5-1 8192.0)) + (v1-3 (vector+! (new 'stack-no-clear 'vector) arg0 a0-4)) + (t9-2 sp-launch-particles-var) + (a0-5 *sp-particle-system-2d*) + (a1-4 (-> *part-id-table* 625)) + (a2-2 *launch-matrix*) + ) + (set! (-> a2-2 trans quad) (-> v1-3 quad)) + (t9-2 a0-5 a1-4 a2-2 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) + ) + ) + 0 + (none) + ) + +(defun movie-nest-metalkor-shot-draw-moving ((arg0 vector) (arg1 vector) (arg2 float)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (let ((s4-0 (new 'stack-no-clear 'vector))) + (set! (-> s4-0 quad) (-> arg0 quad)) + (let ((gp-0 (new 'stack-no-clear 'vector))) + (set! (-> gp-0 quad) (-> arg1 quad)) + (let ((s5-1 (vector-! (new 'stack-no-clear 'vector) gp-0 s4-0))) + (let ((s1-0 s4-0)) + (let ((s3-0 s4-0)) + (let ((s2-0 s5-1)) + (let ((v1-5 (lerp-scale -0.5 0.5 arg2 2475.0 2499.0))) + (.mov vf7 v1-5) + ) + (.lvf vf5 (&-> s2-0 quad)) + ) + (.lvf vf4 (&-> s3-0 quad)) + ) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> s1-0 quad) vf6) + ) + (vector+! gp-0 s4-0 (vector-normalize-copy! (new 'stack-no-clear 'vector) s5-1 49152.0)) + (vector-! s5-1 gp-0 s4-0) + (let ((f30-0 (vector-length s5-1))) + (let ((s3-2 (new 'stack-no-clear 'vector))) + (let ((v1-10 s4-0)) + (let ((a0-5 s5-1)) + (let ((a1-6 0.8)) + (.mov vf7 a1-6) + ) + (.lvf vf5 (&-> a0-5 quad)) + ) + (.lvf vf4 (&-> v1-10 quad)) + ) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> s3-2 quad) vf6) + (let ((f28-0 (-> *part-id-table* 621 init-specs 4 initial-valuef))) + (set! (-> *part-id-table* 621 init-specs 4 initial-valuef) (fmin f28-0 f30-0)) + (draw-beam (-> *part-id-table* 621) s4-0 s5-1 #f #t) + (set! (-> *part-id-table* 621 init-specs 4 initial-valuef) f28-0) + ) + (vector-normalize! s5-1 1.0) + (let ((t9-4 sp-launch-particles-var) + (a0-8 *sp-particle-system-2d*) + (a1-9 (-> *part-id-table* 622)) + (a2-3 *launch-matrix*) + ) + (set! (-> a2-3 trans quad) (-> s3-2 quad)) + (t9-4 a0-8 a1-9 a2-3 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) + ) + ) + (let ((s4-1 (new 'stack-no-clear 'matrix)) + (f26-0 (* 0.000020345053 f30-0)) + (f30-1 (-> *part-id-table* 623 init-specs 3 initial-valuef)) + (f28-1 (-> *part-id-table* 623 init-specs 5 initial-valuef)) + ) + (forward-up->inv-matrix s4-1 s5-1 *up-vector*) + (set! (-> s4-1 trans quad) (-> gp-0 quad)) + (set! (-> *part-id-table* 623 init-specs 3 initial-valuef) (* f26-0 f30-1)) + (set! (-> *part-id-table* 623 init-specs 5 initial-valuef) (* f26-0 f28-1)) + (sp-launch-particles-var + *sp-particle-system-2d* + (-> *part-id-table* 623) + s4-1 + (the-as sparticle-launch-state #f) + (the-as sparticle-launch-control #f) + 1.0 + ) + (set! (-> *part-id-table* 623 init-specs 3 initial-valuef) f30-1) + (set! (-> *part-id-table* 623 init-specs 5 initial-valuef) f28-1) + ) + ) + ) + ) + ) + 0 + (none) + ) + ) + +(defun movie-nest-metalkor-shot-draw-impact ((arg0 scene-player) (arg1 vector) (arg2 vector)) + (local-vars + (sv-240 (function vector entity-actor skeleton-group vector object none :behavior manipy)) + (sv-256 vector) + (sv-272 entity-actor) + ) + (let ((v0-0 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) arg2 arg1) 2048.0)) + (gp-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> gp-0 quad) (-> arg1 quad)) + (vector+! gp-0 gp-0 v0-0) + (let ((s4-0 (get-process *default-dead-pool* part-tracker #x4000))) + (when s4-0 + (let ((t9-2 (method-of-type part-tracker activate))) + (t9-2 + (the-as part-tracker s4-0) + *entity-pool* + (symbol->string (-> part-tracker symbol)) + (the-as pointer #x70004000) + ) + ) + (let ((t9-3 run-function-in-process) + (a0-7 s4-0) + (a1-6 part-tracker-init) + (a2-5 (-> *part-group-id-table* 141)) + (a3-1 0) + (t0-0 #f) + (t1-0 #f) + (t2-0 #f) + (t3-0 *launch-matrix*) + ) + (set! (-> t3-0 trans quad) (-> gp-0 quad)) + ((the-as (function object object object object object object object object none) t9-3) + a0-7 + a1-6 + a2-5 + a3-1 + t0-0 + t1-0 + t2-0 + t3-0 + ) + ) + (-> s4-0 ppointer) + ) + ) + ) + (let ((s4-1 (new 'stack-no-clear 'vector))) + (set! (-> s4-1 quad) (-> arg1 quad)) + (let ((gp-1 (new 'stack-no-clear 'quaternion))) + (let ((s3-0 (lambda :behavior scene-player + () + (set-vector! (-> self draw color-mult) 0.0 0.0 0.0 1.0) + (cond + ((>= 10.0 (ja-aframe-num 0)) + (let ((v0-1 (the-as vector (-> self draw color-emissive)))) + (set! (-> (the-as rgbaf v0-1) x) 1.0) + (set! (-> (the-as rgbaf v0-1) y) 1.0) + (set! (-> (the-as rgbaf v0-1) z) 1.0) + (set! (-> (the-as rgbaf v0-1) w) 1.0) + v0-1 + ) + ) + ((>= 20.0 (ja-aframe-num 0)) + (vector-lerp! + (-> self draw color-emissive) + (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + (new 'static 'vector :x 0.5 :z 0.5 :w 1.0) + (lerp-scale 0.0 1.0 (ja-aframe-num 0) 10.0 20.0) + ) + ) + (else + (vector-lerp! + (-> self draw color-emissive) + (new 'static 'vector :x 0.5 :z 0.5 :w 1.0) + (new 'static 'vector :w 1.0) + (lerp-scale 0.0 1.0 (ja-aframe-num 0) 20.0 30.0) + ) + ) + ) + ) + ) + ) + (let ((s2-0 (new 'stack-no-clear 'matrix))) + (vector-normalize-copy! (-> s2-0 vector 1) (vector-! (new 'stack-no-clear 'vector) arg2 arg1) -1.0) + (cond + ((and (< (fabs (-> s2-0 vector 1 y)) (fabs (-> s2-0 vector 1 x))) + (< (fabs (-> s2-0 vector 1 y)) (fabs (-> s2-0 vector 1 z))) + ) + (set-vector! (-> s2-0 vector 2) (-> s2-0 vector 1 z) 0.0 (- (-> s2-0 vector 1 x)) 1.0) + ) + ((< (fabs (-> s2-0 vector 1 z)) (fabs (-> s2-0 vector 1 x))) + (set-vector! (-> s2-0 vector 2) (-> s2-0 vector 1 y) (- (-> s2-0 vector 1 x)) 0.0 1.0) + ) + (else + (set-vector! (-> s2-0 vector 2) 0.0 (-> s2-0 vector 1 z) (- (-> s2-0 vector 1 y)) 0.0) + ) + ) + (vector-normalize! (-> s2-0 vector 2) 1.0) + (vector-cross! (the-as vector (-> s2-0 vector)) (-> s2-0 vector 1) (-> s2-0 vector 2)) + (matrix->quaternion gp-1 s2-0) + ) + (sound-play "nboss-shoot-hit") + (let* ((s1-2 (get-process *default-dead-pool* manipy #x4000)) + (s2-2 (when s1-2 + (let ((t9-10 (method-of-type manipy activate))) + (t9-10 (the-as manipy s1-2) arg0 (symbol->string (-> manipy symbol)) (the-as pointer #x70004000)) + ) + (let ((s2-3 run-function-in-process) + (s0-1 s1-2) + ) + (set! sv-240 manipy-init) + (set! sv-256 s4-1) + (set! sv-272 (-> arg0 entity)) + (let ((t0-2 (art-group-get-by-name *level* "skel-bomb-blast" (the-as (pointer uint32) #f))) + (t1-2 #f) + (t2-2 0) + ) + ((the-as (function object object object object object object object none) s2-3) + s0-1 + sv-240 + sv-256 + sv-272 + t0-2 + t1-2 + t2-2 + ) + ) + ) + (-> s1-2 ppointer) + ) + ) + ) + (when s2-2 + (send-event (ppointer->process s2-2) 'anim-mode 'play1) + (send-event (ppointer->process s2-2) 'anim "idle") + (set-vector! (-> (the-as process-drawable (-> s2-2 0)) root scale) 1.0 1.0 1.0 1.0) + (send-event (ppointer->process s2-2) 'trans-hook s3-0) + (send-event (ppointer->process s2-2) 'rot-quat gp-1) + ) + ) + ) + (let ((s3-1 (process-spawn + manipy + :init manipy-init + s4-1 + (-> arg0 entity) + (art-group-get-by-name *level* "skel-generic-blast" (the-as (pointer uint32) #f)) + #f + 0 + :to arg0 + ) + ) + ) + (when s3-1 + (send-event (ppointer->process s3-1) 'anim-mode 'play1) + (send-event (ppointer->process s3-1) 'anim "idle") + (set-vector! (-> (the-as process-drawable (-> s3-1 0)) root scale) 1.0 1.0 1.0 1.0) + (send-event (ppointer->process s3-1) 'rot-quat gp-1) + ) + ) + ) + ) + 0 + (none) + ) + +(scene-method-16 + (new 'static 'scene + :name "nest-kor-boss-fight-intro-b" + :extra #f + :info #f + :mask-to-clear #x1282000 + :entity "scene-stage-91" + :art-group "scenecamera" + :anim "nest-kor-boss-fight-intro-b" + :parts 49 + :command-list '((0 + (kill "metalkor-1") + (kill "nest-break-precipice-1") + (kill "crate-942") + (kill "crate-943") + (kill "crate-944") + (kill "crate-945") + (kill "crate-946") + (kill "crate-947") + (kill "crate-948") + (kill "crate-949") + (setting-reset gem mode #t) + (setting-reset music mode 'danger4) + (send-event + "darkjak-highres" + 'trans-hook + ,(lambda :behavior scene-player () (set-darkjak-highres-nest-texture-morph! 0) (none)) + ) + (fadein (frame-time-30 5)) + (part-tracker + "group-nestb-precursor-stone-glow" + entity + "precursor-stone" + joint + "main" + track + #t + duration + (frame-range 0 2555) + ) + ) + (78 + (setting-reset gem mode #f) + (part-tracker + "group-nestb-force-field" + entity + "kid-highres" + joint + "main" + track + #t + duration + (frame-range 78 276) + ) + ) + (204 (setting-reset gem mode #t)) + (276 + (setting-reset gem mode #f) + (part-tracker + "group-nestb-force-field-upclose" + entity + "kid-highres" + joint + "main" + track + #t + duration + (frame-range 276 321) + ) + ) + (376 + (setting-reset gem mode #t) + (part-tracker + "group-nestb-force-field" + entity + "kid-highres" + joint + "main" + track + #t + duration + (frame-range 376 506) + ) + ) + (559 + (setting-reset gem mode #f) + (part-tracker + "group-nestb-force-field-upclose" + entity + "kid-highres" + joint + "main" + track + #t + duration + (frame-range 559 611) + ) + ) + (611 (setting-reset gem mode #t)) + (1223 + (part-tracker + "group-nestb-force-field-upclose-2" + entity + "kid-highres" + joint + "main" + track + #t + duration + (frame-range 1223 1417) + ) + ) + (2412 + (part-tracker + "group-nest-metalkor-shot-anticipate" + entity + "metalkor-highres" + joint + "head" + track + #t + duration + (frame-range 2412 2475) + ) + ) + (2475 + (send-event + "metalkor-highres" + 'trans-hook + ,(lambda :behavior scene-player + () + (let ((f30-0 (ja-aframe-num 0)) + (gp-0 (the-as target (command-get-process "metalkor-highres" *target*))) + (v1-0 (the-as target (command-get-process "nest-break-precipice" *target*))) + ) + (when (and gp-0 v1-0) + (let ((gp-1 (-> gp-0 node-list data 6 bone transform trans)) + (s5-0 (-> v1-0 node-list data 9 bone transform trans)) + ) + (if (and (>= f30-0 2475.0) (< f30-0 2476.0)) + (movie-nest-metalkor-shot-draw-fire gp-1 s5-0) + ) + (if (and (>= f30-0 2476.0) (< f30-0 2499.0)) + (movie-nest-metalkor-shot-draw-moving gp-1 s5-0 f30-0) + ) + ) + ) + ) + (none) + ) + ) + ) + (2499 + (part-tracker + "group-target-hit" + entity + "darkjak-highres" + joint + "Lball" + track + #f + duration + (frame-range 2499 2514) + ) + (send-event + "nest-break-precipice" + 'eval + ,(lambda :behavior scene-player + () + (ja-aframe-num 0) + (let ((gp-0 (the-as target (command-get-process "metalkor-highres" *target*))) + (v1-0 (the-as target (command-get-process "nest-break-precipice" *target*))) + ) + (when (and gp-0 v1-0) + (let ((a2-0 (-> gp-0 node-list data 6 bone transform trans)) + (a1-2 (-> v1-0 node-list data 9 bone transform trans)) + ) + (movie-nest-metalkor-shot-draw-impact self a1-2 a2-0) + ) + ) + ) + (none) + ) + ) + ) + (2500 + (part-tracker + "group-nest-break-precipice-explosion" + entity + "nest-break-precipice" + joint + "ah" + track + #t + duration + (frame-range 2500 2502) + ) + (part-tracker + "group-nest-break-precipice-trailer" + entity + "nest-break-precipice" + joint + "bf" + track + #t + duration + (frame-range 2500 2512) + ) + (part-tracker + "group-nest-break-precipice-trailer" + entity + "nest-break-precipice" + joint + "bg" + track + #t + duration + (frame-range 2500 2512) + ) + (part-tracker + "group-nest-break-precipice-trailer" + entity + "nest-break-precipice" + joint + "d" + track + #t + duration + (frame-range 2500 2512) + ) + (part-tracker + "group-nest-break-precipice-trailer" + entity + "nest-break-precipice" + joint + "t" + track + #t + duration + (frame-range 2500 2512) + ) + (part-tracker + "group-nest-break-precipice-trailer" + entity + "nest-break-precipice" + joint + "bi" + track + #t + duration + (frame-range 2500 2512) + ) + (part-tracker + "group-nest-break-precipice-trailer" + entity + "nest-break-precipice" + joint + "u" + track + #t + duration + (frame-range 2500 2512) + ) + ) + (2502 + (part-tracker + "group-nest-break-precipice-trailer" + entity + "nest-break-precipice" + joint + "c" + track + #t + duration + (frame-range 2502 2512) + ) + (part-tracker + "group-nest-break-precipice-trailer" + entity + "nest-break-precipice" + joint + "v" + track + #t + duration + (frame-range 2502 2512) + ) + (part-tracker + "group-nest-break-precipice-trailer" + entity + "nest-break-precipice" + joint + "i" + track + #t + duration + (frame-range 2502 2512) + ) + (part-tracker + "group-nest-break-precipice-trailer" + entity + "nest-break-precipice" + joint + "al" + track + #t + duration + (frame-range 2502 2512) + ) + (part-tracker + "group-nest-break-precipice-trailer" + entity + "nest-break-precipice" + joint + "e" + track + #t + duration + (frame-range 2502 2512) + ) + (part-tracker + "group-nest-break-precipice-trailer" + entity + "nest-break-precipice" + joint + "f" + track + #t + duration + (frame-range 2502 2512) + ) + ) + (2503 + (part-tracker + "group-nest-break-precipice-trailer" + entity + "nest-break-precipice" + joint + "an" + track + #t + duration + (frame-range 2503 2512) + ) + (part-tracker + "group-nest-break-precipice-trailer" + entity + "nest-break-precipice" + joint + "ax" + track + #t + duration + (frame-range 2503 2512) + ) + ) + (2502 + (part-tracker + "group-nest-break-precipice-trailer" + entity + "nest-break-precipice" + joint + "r" + track + #t + duration + (frame-range 2502 2511) + ) + (part-tracker + "group-nest-break-precipice-trailer" + entity + "nest-break-precipice" + joint + "bd" + track + #t + duration + (frame-range 2502 2511) + ) + (part-tracker + "group-nest-break-precipice-trailer" + entity + "nest-break-precipice" + joint + "bm" + track + #t + duration + (frame-range 2502 2511) + ) + (part-tracker + "group-nest-break-precipice-trailer" + entity + "nest-break-precipice" + joint + "p" + track + #t + duration + (frame-range 2502 2511) + ) + (part-tracker + "group-nest-break-precipice-trailer" + entity + "nest-break-precipice" + joint + "bb" + track + #t + duration + (frame-range 2502 2511) + ) + (part-tracker + "group-nest-break-precipice-trailer" + entity + "nest-break-precipice" + joint + "f" + track + #t + duration + (frame-range 2502 2511) + ) + (part-tracker + "group-nest-break-precipice-trailer" + entity + "nest-break-precipice" + joint + "bo" + track + #t + duration + (frame-range 2502 2511) + ) + ) + (2507 + (part-tracker + "group-nest-break-precipice-trailer" + entity + "nest-break-precipice" + joint + "bn" + track + #t + duration + (frame-range 2507 2514) + ) + (part-tracker + "group-nest-break-precipice-trailer" + entity + "nest-break-precipice" + joint + "ac" + track + #t + duration + (frame-range 2507 2514) + ) + ) + (2532 + (part-tracker + "group-nest-break-precipice-trailer" + entity + "nest-break-precipice" + joint + "bf" + track + #t + duration + (frame-range 2532 2542) + ) + (part-tracker + "group-nest-break-precipice-trailer" + entity + "nest-break-precipice" + joint + "aj" + track + #t + duration + (frame-range 2532 2542) + ) + ) + (2530 + (part-tracker + "group-nest-break-precipice-billow" + entity + "nest-break-precipice" + joint + "bk" + track + #t + duration + (frame-range 2530 2570) + ) + ) + (2635 (setting-reset gem mode #t)) + (2700 + (send-event + "darkjak-highres" + 'trans-hook + ,(lambda :behavior scene-player + () + (let ((f30-0 (ja-aframe-num 0))) + (when (and (< 2715.0 f30-0) (< f30-0 2800.0)) + (if (zero? (rand-vu-int-count 4)) + (process-drawable-shock-effect + self + (-> *lightning-spec-id-table* 8) + lightning-probe-callback + (-> *part-id-table* 179) + 0 + 0 + 40960.0 + ) + ) + ) + (if (>= f30-0 2700.0) + (set-darkjak-highres-nest-texture-morph! #x3f800000) + (set-darkjak-highres-nest-texture-morph! 0) + ) + ) + (none) + ) + ) + ) + (10000 + (task-close! "nest-boss-introduction") + (apply ,(lambda :behavior scene-player () (set-darkjak-highres-nest-texture-morph! 0) (none))) + (setting-pers music mode 'danger4 time (seconds 5)) + ) + ) + :cut-list '(78 + 143 + 204 + 276 + 321 + 376 + 506 + 559 + 611 + 633 + 692 + 824 + 861 + 969 + 1084 + 1139 + 1223 + 1417 + 1531 + 1588 + 1660 + 2075 + 2255 + 2350 + 2412 + 2489 + 2510 + 2555 + 2612 + 2671 + 2814 + ) + :wait-ground-time (seconds 1) + :draw-target #f + :abort #t + :actor (new 'static 'boxed-array :type scene-actor + (new 'static 'scene-actor + :name "scenecamera" + :level #f + :art-group "skel-scenecamera" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :camera 4 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "sidekick-highres" + :level 'nestb + :art-group "skel-sidekick-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "darkjak-highres" + :level 'nestb + :art-group "skel-darkjak-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "metalkor-highres" + :level 'nestb + :art-group "skel-metalkor-highres" + :prefix "" + :draw-frames '((min 2671) (2800 max)) + :scissor-frames '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "metalkor-highres-lowtorso" + :level 'nestb + :art-group "skel-metalkor-highres-lowtorso" + :prefix "lowtorso-" + :draw-frames '((min 2671) (2800 max)) + :scissor-frames '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "metalkor-highres-legs" + :level 'nestb + :art-group "skel-metalkor-highres-legs" + :prefix "legs-" + :draw-frames '((min 2671) (2800 max)) + :scissor-frames '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "metalkor-highres-wings" + :level 'nestb + :art-group "skel-metalkor-highres-wings" + :prefix "wings-" + :draw-frames '((min 2671) (2800 max)) + :scissor-frames '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "metalkor-fma-spinner" + :level 'nestb + :art-group "skel-metalkor-fma-spinner" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "metalkor-fma-spinner" + :level 'nestb + :art-group "skel-metalkor-fma-spinner" + :prefix "b-" + :draw-frames '((min max)) + :scissor-frames '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "metalkor-fma-spinner" + :level 'nestb + :art-group "skel-metalkor-fma-spinner" + :prefix "c-" + :draw-frames '((min max)) + :scissor-frames '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "metalkor-fma-spinner" + :level 'nestb + :art-group "skel-metalkor-fma-spinner" + :prefix "d-" + :draw-frames '((min max)) + :scissor-frames '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "metalkor-fma-spinner" + :level 'nestb + :art-group "skel-metalkor-fma-spinner" + :prefix "e-" + :draw-frames '((min max)) + :scissor-frames '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "metalkor-fma-spinner" + :level 'nestb + :art-group "skel-metalkor-fma-spinner" + :prefix "f-" + :draw-frames '((min max)) + :scissor-frames '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "metalkor-fma-spinner" + :level 'nestb + :art-group "skel-metalkor-fma-spinner" + :prefix "g-" + :draw-frames '((min max)) + :scissor-frames '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "metalkor-fma-spinner" + :level 'nestb + :art-group "skel-metalkor-fma-spinner" + :prefix "h-" + :draw-frames '((min max)) + :scissor-frames '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "kid-highres" + :level 'nestb + :art-group "skel-kid-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "nest-break-precipice" + :level 'nestb + :art-group "skel-nest-break-precipice" + :prefix "" + :draw-frames '((min (new 'static 'bfloat :data 558.99)) (1660 (new 'static 'bfloat :data 2074.99)) (2474 2611) (2671 2814)) + :scissor-frames '() + :light-index #x11 + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "precursor-stone" + :level 'nestb + :art-group "skel-precursor-stone" + :prefix "" + :draw-frames '((min 2671)) + :scissor-frames '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "particleman" + :level 'nestb + :art-group "skel-particleman" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-flags -1 + :shadow-volume-joint #f + ) + ) + :load-point-obj "nestb-boss" + :end-point-obj "nestb-boss-pit" + :borrow '() + :sfx-volume -1.0 + :ambient-volume -1.0 + :music-volume -1.0 + :blackout-end #t + :peaceful #t + :save #t + ) + ) + +(scene-method-16 + (new 'static 'scene + :name "nest-kor-boss-fight-mid" + :extra #f + :info #f + :mask-to-clear #x1282000 + :entity "scene-stage-91" + :art-group "scenecamera" + :anim "nest-kor-boss-fight-mid" + :parts 2 + :command-list '((0 + (kill "metalkor-1") + (kill "crate-942") + (kill "crate-943") + (kill "crate-944") + (kill "crate-945") + (kill "crate-946") + (kill "crate-947") + (kill "crate-948") + (kill "crate-949") + (setting-reset music mode 'danger4) + (setting-reset gem mode #t) + (send-event + "darkjak-highres" + 'trans-hook + ,(lambda :behavior scene-player () (set-darkjak-highres-nest-texture-morph! 0) (none)) + ) + ) + (10000 (setting-pers music mode 'danger4 time (seconds 5))) + ) + :cut-list '(82) + :wait-ground-time (seconds 1) + :draw-target #f + :abort #t + :actor (new 'static 'boxed-array :type scene-actor + (new 'static 'scene-actor + :name "scenecamera" + :level #f + :art-group "skel-scenecamera" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :camera 4 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "sidekick-highres" + :level 'nestb + :art-group "skel-sidekick-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "darkjak-highres" + :level 'nestb + :art-group "skel-darkjak-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "metalkor-highres" + :level 'nestb + :art-group "skel-metalkor-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "metalkor-highres-lowtorso" + :level 'nestb + :art-group "skel-metalkor-highres-lowtorso" + :prefix "lowtorso-" + :draw-frames '((min max)) + :scissor-frames '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "metalkor-highres-legs" + :level 'nestb + :art-group "skel-metalkor-highres-legs" + :prefix "legs-" + :draw-frames '((min max)) + :scissor-frames '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "metalkor-highres-wings" + :level 'nestb + :art-group "skel-metalkor-highres-wings" + :prefix "wings-" + :draw-frames '((min max)) + :scissor-frames '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "metalkor-fma-spinner" + :level 'nestb + :art-group "skel-metalkor-fma-spinner" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "metalkor-fma-spinner" + :level 'nestb + :art-group "skel-metalkor-fma-spinner" + :prefix "b-" + :draw-frames '((min max)) + :scissor-frames '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "metalkor-fma-spinner" + :level 'nestb + :art-group "skel-metalkor-fma-spinner" + :prefix "c-" + :draw-frames '((min max)) + :scissor-frames '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "metalkor-fma-spinner" + :level 'nestb + :art-group "skel-metalkor-fma-spinner" + :prefix "d-" + :draw-frames '((min max)) + :scissor-frames '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "metalkor-fma-spinner" + :level 'nestb + :art-group "skel-metalkor-fma-spinner" + :prefix "e-" + :draw-frames '((min max)) + :scissor-frames '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "metalkor-fma-spinner" + :level 'nestb + :art-group "skel-metalkor-fma-spinner" + :prefix "f-" + :draw-frames '((min max)) + :scissor-frames '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "metalkor-fma-spinner" + :level 'nestb + :art-group "skel-metalkor-fma-spinner" + :prefix "g-" + :draw-frames '((min max)) + :scissor-frames '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "metalkor-fma-spinner" + :level 'nestb + :art-group "skel-metalkor-fma-spinner" + :prefix "h-" + :draw-frames '((min max)) + :scissor-frames '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + ) + :load-point-obj "nestb-boss-pit" + :end-point-obj #f + :borrow '() + :sfx-volume -1.0 + :ambient-volume -1.0 + :music-volume -1.0 + :blackout-end #t + :peaceful #t + :save #t + ) + ) + +(deftype nest-gun-parts (process-drawable) + () + :heap-base #x50 + :method-count-assert 21 + :size-assert #xc8 + :flag-assert #x15005000c8 + (:methods + (idle () _type_ :state 20) + ) + ) + + +(defskelgroup skel-nest-gun-parts nest-gun-parts 0 2 + ((1 (meters 999999))) + :bounds (static-spherem 0 0 25 40) + :origin-joint-index 3 + ) + +(defstate idle (nest-gun-parts) + :virtual #t + :code (behavior () + (until #f + (ja-no-eval :group! (ja-group) + :num! (seek! (the float (+ (-> (ja-group) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + #f + (none) + ) + :post (the-as (function none :behavior nest-gun-parts) ja-post) + ) + +;; WARN: Return type mismatch object vs none. +(defmethod init-from-entity! nest-gun-parts ((obj nest-gun-parts) (arg0 entity-actor)) + (set! (-> obj root) (new 'process 'trsqv)) + (process-drawable-from-entity! obj arg0) + (initialize-skeleton + obj + (the-as skeleton-group (art-group-get-by-name *level* "skel-nest-gun-parts" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (set! (-> obj draw light-index) (the-as uint 11)) + (go (method-of-object obj idle)) + (none) + ) + +(deftype nest-unbroken-rocks (process-drawable) + () + :heap-base #x50 + :method-count-assert 21 + :size-assert #xc8 + :flag-assert #x15005000c8 + (:methods + (idle () _type_ :state 20) + ) + ) + + +(defskelgroup skel-nest-unbroken-rocks nest-unbroken-rocks 0 2 + ((1 (meters 999999))) + :bounds (static-spherem 75 0 -75 55) + :origin-joint-index 3 + ) + +(defstate idle (nest-unbroken-rocks) + :virtual #t + :code (behavior () + (until #f + (ja-no-eval :group! (ja-group) + :num! (seek! (the float (+ (-> (ja-group) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + #f + (none) + ) + :post (the-as (function none :behavior nest-unbroken-rocks) ja-post) + ) + +(defmethod init-from-entity! nest-unbroken-rocks ((obj nest-unbroken-rocks) (arg0 entity-actor)) + (set! (-> obj root) (new 'process 'trsqv)) + (process-drawable-from-entity! obj arg0) + (initialize-skeleton + obj + (the-as + skeleton-group + (art-group-get-by-name *level* "skel-nest-unbroken-rocks" (the-as (pointer uint32) #f)) + ) + (the-as pair 0) + ) + (set! (-> obj draw light-index) (the-as uint 1)) + (if (task-node-closed? (game-task-node nest-get-to-gun-resolution)) + (cleanup-for-death obj) + (go (method-of-object obj idle)) + ) + (none) + ) + +(defun nestb-login () + (set! *nav-network* (new 'loading-level 'nav-network)) + (nav-network-method-9 *nav-network*) + 0 + (none) + ) + +(defun nestb-deactivate () + (if (not (level-get *level* 'nest)) + (set-time-for-random-weather! *mood-control* 0.0 0.0) + ) + (set! *nav-network* (the-as nav-network 0)) + 0 + (none) + ) + +(defun nestb-activate ((arg0 level)) + (nav-network-method-10 *nav-network* arg0 *nestb-adjacency*) + 0 + (none) + ) diff --git a/test/decompiler/reference/jak2/engine/ai/enemy_REF.gc b/test/decompiler/reference/jak2/engine/ai/enemy_REF.gc index c957659d70..299e3a2bf0 100644 --- a/test/decompiler/reference/jak2/engine/ai/enemy_REF.gc +++ b/test/decompiler/reference/jak2/engine/ai/enemy_REF.gc @@ -2351,7 +2351,7 @@ ) (logclear! (-> self draw status) (draw-control-status no-draw)) (logclear! (-> self enemy-flags) (enemy-flag victory)) - (logior! (-> self root-override2 nav-flags) (nav-flags nav-flags0)) + (logior! (-> self root-override2 nav-flags) (nav-flags has-root-sphere)) (none) ) :code (the-as (function none :behavior enemy) sleep-code) diff --git a/test/decompiler/reference/jak2/engine/anim/fma-sphere_REF.gc b/test/decompiler/reference/jak2/engine/anim/fma-sphere_REF.gc index 2906196602..3257efa6d1 100644 --- a/test/decompiler/reference/jak2/engine/anim/fma-sphere_REF.gc +++ b/test/decompiler/reference/jak2/engine/anim/fma-sphere_REF.gc @@ -248,10 +248,10 @@ ) (logclear! (-> self mask) (process-mask actor-pause enemy)) (when (logtest? (-> self mode) (fma-sphere-mode nav)) - (let ((a0-32 (find-nearest-nav-mesh (-> self root-override trans) #x7f800000))) + (let ((a0-32 (find-nearest-nav-mesh (-> self root-override trans) (the-as float #x7f800000)))) (cond (a0-32 - (nav-mesh-method-29 a0-32 self #f) + (add-process-drawable-to-navmesh a0-32 self #f) ) (else (format 0 "ERROR: fma-sphere-init-by-other: failed to find nearest nav-mesh!~%") diff --git a/test/decompiler/reference/jak2/engine/collide/collide-shape-h_REF.gc b/test/decompiler/reference/jak2/engine/collide/collide-shape-h_REF.gc index 9c3527c3f1..99f016e404 100644 --- a/test/decompiler/reference/jak2/engine/collide/collide-shape-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/collide/collide-shape-h_REF.gc @@ -1966,7 +1966,7 @@ (set! (-> s5-0 actor-hash-index) -1) (set! (-> s5-0 process) arg0) (set! (-> s5-0 max-iteration-count) (the-as uint 1)) - (set! (-> s5-0 nav-flags) (nav-flags nav-flags0)) + (set! (-> s5-0 nav-flags) (nav-flags has-root-sphere)) (set! (-> s5-0 event-self) #f) (set! (-> s5-0 event-other) #f) (set! (-> s5-0 riders) (the-as (inline-array collide-rider) #f)) diff --git a/test/decompiler/reference/jak2/engine/common_objs/basebutton_REF.gc b/test/decompiler/reference/jak2/engine/common_objs/basebutton_REF.gc index a173914899..a9ad2a3812 100644 --- a/test/decompiler/reference/jak2/engine/common_objs/basebutton_REF.gc +++ b/test/decompiler/reference/jak2/engine/common_objs/basebutton_REF.gc @@ -484,7 +484,7 @@ ) (set! (-> obj timeout) (res-lump-float arg0 'timeout)) (if (not (logtest? (-> obj button-status) (button-status button-status-1))) - (nav-mesh-connect-from-ent (the-as entity-nav-mesh obj)) + (nav-mesh-connect-from-ent obj) ) (prepare-trigger-event! obj) (basebutton-method-33 obj) diff --git a/test/decompiler/reference/jak2/engine/common_objs/crates_REF.gc b/test/decompiler/reference/jak2/engine/common_objs/crates_REF.gc index e4de4f0955..c4b8b48445 100644 --- a/test/decompiler/reference/jak2/engine/common_objs/crates_REF.gc +++ b/test/decompiler/reference/jak2/engine/common_objs/crates_REF.gc @@ -1415,7 +1415,7 @@ ) (set! (-> obj base quad) (-> obj root-override2 trans quad)) (crate-post) - (nav-mesh-connect-from-ent (the-as entity-nav-mesh obj)) + (nav-mesh-connect-from-ent obj) (none) ) diff --git a/test/decompiler/reference/jak2/engine/common_objs/generic-obs_REF.gc b/test/decompiler/reference/jak2/engine/common_objs/generic-obs_REF.gc index 43a048af08..2bdbefe6d9 100644 --- a/test/decompiler/reference/jak2/engine/common_objs/generic-obs_REF.gc +++ b/test/decompiler/reference/jak2/engine/common_objs/generic-obs_REF.gc @@ -2861,7 +2861,7 @@ ) ) (set! (-> obj sound-id) (new-sound-id)) - (nav-mesh-connect-from-ent (the-as entity-nav-mesh obj)) + (nav-mesh-connect-from-ent obj) (go (method-of-object obj idle)) (none) ) diff --git a/test/decompiler/reference/jak2/engine/debug/debug_REF.gc b/test/decompiler/reference/jak2/engine/debug/debug_REF.gc index 205cf12a84..15b7aef966 100644 --- a/test/decompiler/reference/jak2/engine/debug/debug_REF.gc +++ b/test/decompiler/reference/jak2/engine/debug/debug_REF.gc @@ -1619,6 +1619,7 @@ ) ;; definition for method 3 of type debug-vertex-stats +;; INFO: this function exists in multiple non-identical object files (defmethod inspect debug-vertex-stats ((obj debug-vertex-stats)) (format #t "[~8x] ~A~%" obj (-> obj type)) (format #t "~Tlength: ~D~%" (-> obj length)) diff --git a/test/decompiler/reference/jak2/engine/draw/drawable_REF.gc b/test/decompiler/reference/jak2/engine/draw/drawable_REF.gc index 6732f8eec8..0161848819 100644 --- a/test/decompiler/reference/jak2/engine/draw/drawable_REF.gc +++ b/test/decompiler/reference/jak2/engine/draw/drawable_REF.gc @@ -1589,7 +1589,7 @@ ) 0 ) - (level-group-method-18 *level*) + (update-nav-meshes *level*) (when *debug-segment* (let ((gp-10 (-> *display* frames (-> *display* on-screen) profile-array data 0))) (when (and *dproc* *debug-segment*) @@ -2234,7 +2234,3 @@ (display-sync arg0) (none) ) - - - - diff --git a/test/decompiler/reference/jak2/engine/entity/entity-h_REF.gc b/test/decompiler/reference/jak2/engine/entity/entity-h_REF.gc index dbeb380c48..ed0d296a9c 100644 --- a/test/decompiler/reference/jak2/engine/entity/entity-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/entity/entity-h_REF.gc @@ -255,7 +255,7 @@ :size-assert #x38 :flag-assert #x1d00000038 (:methods - (entity-nav-mesh-method-27 (_type_) none 27) + (initialize-nav-mesh! (_type_) none 27) (debug-draw (_type_) none 28) ) ) @@ -289,8 +289,8 @@ (prev-actor (_type_) entity-actor 28) (debug-print (_type_ symbol type) none 29) (toggle-status (_type_ entity-perm-status symbol) none 30) - (entity-actor-method-31 (_type_ vector vector vector object float) nav-mesh 31) - (entity-actor-method-32 (_type_ vector vector nav-poly float) nav-poly 32) + (get-simple-travel-vector (_type_ vector vector vector object float) nav-mesh 31) + (project-point-to-nav-mesh (_type_ vector vector nav-poly float) nav-poly 32) ) ) diff --git a/test/decompiler/reference/jak2/engine/entity/entity_REF.gc b/test/decompiler/reference/jak2/engine/entity/entity_REF.gc index 561869a5d7..b0603bc2a0 100644 --- a/test/decompiler/reference/jak2/engine/entity/entity_REF.gc +++ b/test/decompiler/reference/jak2/engine/entity/entity_REF.gc @@ -1,11 +1,17 @@ +;;-*-Lisp-*- (in-package goal) +;; definition for symbol *spawn-actors*, type symbol (define *spawn-actors* #t) +;; definition for symbol *compact-actors*, type symbol (define *compact-actors* #t) +;; definition for symbol *vis-actors*, type symbol (define *vis-actors* #t) +;; definition for method 8 of type drawable-actor +;; WARN: Return type mismatch int vs drawable-actor. (defmethod mem-usage drawable-actor ((obj drawable-actor) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 44 (-> arg0 length))) (set! (-> arg0 data 43 name) "entity") @@ -18,6 +24,8 @@ (the-as drawable-actor 0) ) +;; definition for method 8 of type drawable-inline-array-actor +;; WARN: Return type mismatch int vs drawable-inline-array-actor. (defmethod mem-usage drawable-inline-array-actor ((obj drawable-inline-array-actor) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 1 (-> arg0 length))) (set! (-> arg0 data 0 name) (symbol->string 'drawable-group)) @@ -32,11 +40,13 @@ (the-as drawable-inline-array-actor 0) ) +;; definition for method 2 of type entity-links (defmethod print entity-links ((obj entity-links)) (format #t "#" (-> obj process) obj) obj ) +;; definition for method 2 of type entity-perm (defmethod print entity-perm ((obj entity-perm)) (format #t @@ -50,6 +60,7 @@ obj ) +;; definition for method 2 of type actor-group (defmethod print actor-group ((obj actor-group)) (format #t "# obj length)) @@ -59,6 +70,8 @@ obj ) +;; definition for method 3 of type actor-group +;; INFO: this function exists in multiple non-identical object files (defmethod inspect actor-group ((obj actor-group)) (format #t "[~8x] ~A~%" obj (-> obj type)) (format #t "~Tlength: ~D~%" (-> obj length)) @@ -70,21 +83,25 @@ obj ) +;; definition for method 22 of type entity (defmethod birth! entity ((obj entity)) (format #t "birth ~A~%" obj) obj ) +;; definition for method 23 of type entity (defmethod kill! entity ((obj entity)) (format #t "kill ~A~%" obj) obj ) +;; definition for method 2 of type entity (defmethod print entity ((obj entity)) (format #t "#<~A :name ~S @ #x~X>" (-> obj type) (res-lump-struct obj 'name structure) obj) obj ) +;; definition for method 26 of type entity (defmethod get-level entity ((obj entity)) (dotimes (v1-0 (-> *level* length)) (let ((a1-3 (-> *level* level v1-0))) @@ -100,6 +117,7 @@ (-> *level* default-level) ) +;; definition for function entity-by-name (defun entity-by-name ((arg0 string)) (dotimes (s5-0 (-> *level* length)) (let ((s4-0 (-> *level* level s5-0))) @@ -154,6 +172,7 @@ (the-as entity #f) ) +;; definition for function entity-by-type (defun entity-by-type ((arg0 type)) (dotimes (s5-0 (-> *level* length)) (let ((v1-3 (-> *level* level s5-0))) @@ -175,6 +194,7 @@ (the-as entity-actor #f) ) +;; definition for function entity-by-aid (defun entity-by-aid ((arg0 uint)) (dotimes (v1-0 (-> *level* length)) (let ((a1-3 (-> *level* level v1-0))) @@ -212,6 +232,8 @@ (the-as entity #f) ) +;; definition for function entity-actor-from-level-name +;; WARN: Return type mismatch entity vs entity-actor. (defun entity-actor-from-level-name ((arg0 level)) (let ((v0-0 (the-as entity #f))) (dotimes (s5-0 (-> *level* length)) @@ -234,7 +256,9 @@ ) ) -(defmethod level-group-method-18 level-group ((obj level-group)) +;; definition for method 18 of type level-group +;; WARN: Return type mismatch int vs none. +(defmethod update-nav-meshes level-group ((obj level-group)) (when (not (paused?)) (dotimes (s5-0 (-> obj length)) (let ((v1-4 (-> obj level s5-0))) @@ -242,7 +266,7 @@ (let ((s4-0 (-> v1-4 bsp nav-meshes))) (when (nonzero? s4-0) (dotimes (s3-0 (-> s4-0 length)) - (nav-mesh-method-26 (-> s4-0 s3-0 nav-mesh)) + (update-navigation (-> s4-0 s3-0 nav-mesh)) ) ) ) @@ -254,6 +278,7 @@ (none) ) +;; definition for function entity-nav-mesh-by-aid (defun entity-nav-mesh-by-aid ((arg0 actor-id)) (dotimes (v1-0 (-> *level* length)) (let ((a1-3 (-> *level* level v1-0))) @@ -291,6 +316,7 @@ (the-as entity-nav-mesh #f) ) +;; definition for function nav-mesh-from-res-tag (defun nav-mesh-from-res-tag ((arg0 entity) (arg1 symbol) (arg2 int)) (let ((v1-1 (res-lump-data arg0 arg1 pointer)) (gp-0 (the-as nav-mesh #f)) @@ -311,6 +337,7 @@ ) ) +;; definition for function entity-by-meters (defun entity-by-meters ((arg0 float) (arg1 float) (arg2 float)) (dotimes (v1-0 (-> *level* length)) (let ((a3-3 (-> *level* level v1-0))) @@ -337,6 +364,7 @@ (the-as entity-actor #f) ) +;; definition for function process-by-ename (defun process-by-ename ((arg0 string)) (let ((v1-0 (entity-by-name arg0))) (if v1-0 @@ -345,6 +373,7 @@ ) ) +;; definition for function entity-process-count (defun entity-process-count ((arg0 symbol)) (let ((gp-0 0)) (dotimes (s4-0 (-> *level* length)) @@ -375,6 +404,7 @@ ) ) +;; definition for function entity-count (defun entity-count () (let ((v0-0 0)) (dotimes (v1-0 (-> *level* length)) @@ -393,6 +423,8 @@ ) ) +;; definition for function entity-remap-names +;; WARN: Return type mismatch int vs none. (defun entity-remap-names ((arg0 pair)) (let ((s5-0 (car arg0))) (while (not (null? arg0)) @@ -419,6 +451,8 @@ (none) ) +;; definition (debug) for function process-status-bits +;; WARN: Return type mismatch int vs none. (defun-debug process-status-bits ((arg0 process) (arg1 symbol)) (let* ((s5-0 arg0) (s3-0 (if (type? s5-0 process-drawable) @@ -480,6 +514,7 @@ (none) ) +;; definition for function process-entity-set! (defun process-entity-set! ((arg0 process) (arg1 entity-actor)) (set! (-> arg0 entity) arg1) (if arg1 @@ -489,10 +524,12 @@ arg1 ) +;; definition for function process-task-mask (defun process-task-mask ((arg0 process)) (-> arg0 level task-mask) ) +;; definition for method 2 of type process (defmethod print process ((obj process)) (cond ((and (-> obj top-thread) (!= (-> obj status) 'dead)) @@ -528,6 +565,7 @@ obj ) +;; definition for method 3 of type entity (defmethod inspect entity ((obj entity)) ((the-as (function entity entity) (find-parent-method entity 3)) obj) (format #t "~Ttrans: ~`vector`P~%" (-> obj trans)) @@ -535,6 +573,7 @@ obj ) +;; definition for method 3 of type entity-nav-mesh (defmethod inspect entity-nav-mesh ((obj entity-nav-mesh)) ((the-as (function object object) (find-parent-method entity-nav-mesh 3)) obj) (format #t "~Tnav-mesh ~A~%" (-> obj nav-mesh)) @@ -544,6 +583,7 @@ obj ) +;; definition for method 3 of type entity-actor (defmethod inspect entity-actor ((obj entity-actor)) ((the-as (function entity entity) (find-parent-method entity-actor 3)) obj) (format #t "~Tetype: ~A~%" (-> obj etype)) @@ -614,6 +654,8 @@ obj ) +;; definition for method 29 of type entity-actor +;; WARN: Return type mismatch entity-actor vs none. (defmethod debug-print entity-actor ((obj entity-actor) (arg0 symbol) (arg1 type)) (let ((s4-0 (-> obj etype))) (when (or (not arg1) (and s4-0 (valid? s4-0 type #f #f 0) (type-type? s4-0 arg1))) @@ -686,6 +728,8 @@ (none) ) +;; definition for method 14 of type level-group +;; WARN: Return type mismatch int vs none. (defmethod debug-print-entities level-group ((obj level-group) (arg0 symbol) (arg1 type)) (let ((t9-0 format) (a0-1 #t) @@ -723,6 +767,9 @@ (none) ) +;; definition for method 24 of type entity-actor +;; INFO: Used lq/sq +;; WARN: Return type mismatch entity-actor vs none. (defmethod add-to-level! entity-actor ((obj entity-actor) (arg0 level-group) (arg1 level) (arg2 actor-id)) (let ((v1-4 (-> arg1 entity data (-> arg1 entity length)))) (+! (-> arg1 entity length) 1) @@ -794,6 +841,7 @@ (none) ) +;; definition for method 25 of type entity (defmethod remove-from-level! entity ((obj entity) (arg0 level-group)) (let ((v1-0 (-> obj extra))) (cond @@ -812,6 +860,8 @@ obj ) +;; definition for function update-actor-vis-box +;; WARN: Return type mismatch int vs none. (defun update-actor-vis-box ((arg0 process-drawable) (arg1 vector) (arg2 vector)) (when (and arg0 (nonzero? (-> arg0 draw)) (zero? (logand (-> arg0 draw status) (draw-control-status no-draw)))) (let ((v1-5 (-> arg0 draw origin)) @@ -829,6 +879,8 @@ (none) ) +;; definition for method 25 of type level-group +;; WARN: Return type mismatch int vs none. (defmethod update-vis-volumes level-group ((obj level-group)) (local-vars (sv-16 pointer) (sv-20 pointer) (sv-24 pointer) (sv-28 process)) (dotimes (s5-0 (-> obj length)) @@ -876,6 +928,8 @@ (none) ) +;; definition for function expand-bounding-box +;; WARN: Return type mismatch int vs none. (defun expand-bounding-box ((arg0 vector) (arg1 vector) (arg2 vector) (arg3 vector)) (set! (-> arg0 x) (fmin (-> arg0 x) (-> arg2 x))) (set! (-> arg0 y) (fmin (-> arg0 y) (-> arg2 y))) @@ -887,6 +941,45 @@ (none) ) +;; definition for method 26 of type level-group +;; INFO: Used lq/sq +;; WARN: Stack slot offset 28 signed mismatch +;; WARN: Stack slot offset 28 signed mismatch +;; WARN: Stack slot offset 28 signed mismatch +;; WARN: Stack slot offset 32 signed mismatch +;; WARN: Stack slot offset 32 signed mismatch +;; WARN: Stack slot offset 32 signed mismatch +;; WARN: Stack slot offset 28 signed mismatch +;; WARN: Stack slot offset 28 signed mismatch +;; WARN: Stack slot offset 28 signed mismatch +;; WARN: Stack slot offset 32 signed mismatch +;; WARN: Stack slot offset 32 signed mismatch +;; WARN: Stack slot offset 32 signed mismatch +;; WARN: Stack slot offset 28 signed mismatch +;; WARN: Stack slot offset 28 signed mismatch +;; WARN: Stack slot offset 28 signed mismatch +;; WARN: Stack slot offset 32 signed mismatch +;; WARN: Stack slot offset 32 signed mismatch +;; WARN: Stack slot offset 32 signed mismatch +;; WARN: Stack slot offset 28 signed mismatch +;; WARN: Stack slot offset 28 signed mismatch +;; WARN: Stack slot offset 28 signed mismatch +;; WARN: Stack slot offset 32 signed mismatch +;; WARN: Stack slot offset 32 signed mismatch +;; WARN: Stack slot offset 32 signed mismatch +;; WARN: Stack slot offset 28 signed mismatch +;; WARN: Stack slot offset 28 signed mismatch +;; WARN: Stack slot offset 28 signed mismatch +;; WARN: Stack slot offset 32 signed mismatch +;; WARN: Stack slot offset 32 signed mismatch +;; WARN: Stack slot offset 32 signed mismatch +;; WARN: Stack slot offset 28 signed mismatch +;; WARN: Stack slot offset 28 signed mismatch +;; WARN: Stack slot offset 28 signed mismatch +;; WARN: Stack slot offset 32 signed mismatch +;; WARN: Stack slot offset 32 signed mismatch +;; WARN: Stack slot offset 32 signed mismatch +;; WARN: Return type mismatch int vs none. (defmethod update-vis-volumes-from-nav-mesh level-group ((obj level-group)) (local-vars (sv-16 pointer) @@ -945,7 +1038,7 @@ (when a0-25 (set! sv-96 (new 'stack-no-clear 'vector)) (set! sv-112 (new 'stack-no-clear 'vector)) - (nav-mesh-method-22 a0-25 sv-96 sv-112) + (compute-bounding-box-from-vertices a0-25 sv-96 sv-112) (expand-bounding-box sv-20 sv-24 sv-96 sv-112) ) ) @@ -957,7 +1050,7 @@ (else (let ((a0-28 (nav-mesh-from-res-tag sv-40 'nav-mesh-actor 0))) (if a0-28 - (nav-mesh-method-22 a0-28 sv-20 sv-24) + (compute-bounding-box-from-vertices a0-28 sv-20 sv-24) ) ) ) @@ -984,6 +1077,15 @@ (none) ) +;; definition for method 27 of type level-group +;; INFO: Used lq/sq +;; WARN: Stack slot offset 20 signed mismatch +;; WARN: Stack slot offset 20 signed mismatch +;; WARN: Stack slot offset 20 signed mismatch +;; WARN: Stack slot offset 20 signed mismatch +;; WARN: Stack slot offset 20 signed mismatch +;; WARN: Stack slot offset 20 signed mismatch +;; WARN: Return type mismatch int vs none. (defmethod print-volume-sizes level-group ((obj level-group)) (local-vars (sv-16 pointer) @@ -1064,6 +1166,8 @@ (none) ) +;; definition for function expand-vis-box-with-point +;; WARN: Return type mismatch int vs none. (defun expand-vis-box-with-point ((arg0 entity) (arg1 vector)) (let ((v1-1 (res-lump-data arg0 'visvol (inline-array vector)))) (when v1-1 @@ -1083,6 +1187,7 @@ (none) ) +;; definition of type debug-actor-info (deftype debug-actor-info (basic) ((name basic :offset-assert 4) (handle handle :offset-assert 8) @@ -1094,6 +1199,7 @@ :flag-assert #x900000018 ) +;; definition for method 3 of type debug-actor-info (defmethod inspect debug-actor-info ((obj debug-actor-info)) (when (not obj) (set! obj obj) @@ -1108,10 +1214,14 @@ obj ) +;; definition for symbol *debug-actor-info*, type debug-actor-info (define *debug-actor-info* (new 'static 'debug-actor-info :name #f)) +;; definition for symbol *pid-string*, type string (define *pid-string* (new 'global 'string 128 (the-as string #f))) +;; definition (debug) for function debug-actor +;; WARN: Return type mismatch int vs none. (defun-debug debug-actor ((arg0 string)) (let ((gp-0 *debug-actor-info*)) (set! (-> gp-0 name) #f) @@ -1148,6 +1258,8 @@ (none) ) +;; definition (debug) for function draw-actor-marks +;; WARN: Return type mismatch int vs none. (defun-debug draw-actor-marks ((arg0 process)) (local-vars (sv-16 entity-actor) (sv-20 (pointer int32))) (b! @@ -1281,6 +1393,9 @@ (none) ) +;; definition for method 15 of type level-group +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. (defmethod debug-draw-actors level-group ((obj level-group) (arg0 symbol)) (local-vars (sv-16 symbol) @@ -1659,16 +1774,20 @@ ) ) +;; definition for method 22 of type entity-camera (defmethod birth! entity-camera ((obj entity-camera)) (add-connection *camera-engine* *camera* nothing obj #f #f) obj ) +;; definition for method 23 of type entity-camera (defmethod kill! entity-camera ((obj entity-camera)) (remove-by-param1 *camera-engine* (the-as int obj)) obj ) +;; definition for function init-entity +;; WARN: Return type mismatch process vs none. (defun init-entity ((arg0 process) (arg1 entity-actor) (arg2 process)) (activate arg0 *entity-pool* (res-lump-struct arg1 'name basic) (the-as pointer #x70004000)) (set! (-> arg0 entity) arg1) @@ -1678,6 +1797,7 @@ (none) ) +;; definition for method 22 of type entity-actor (defmethod birth! entity-actor ((obj entity-actor)) (let* ((s5-0 (-> obj etype)) (v1-0 (entity-info-lookup s5-0)) @@ -1708,6 +1828,8 @@ obj ) +;; definition for function entity-deactivate-handler +;; WARN: Return type mismatch symbol vs none. (defun entity-deactivate-handler ((arg0 process) (arg1 entity-actor)) (when (= arg0 (-> arg1 extra process)) (logclear! (-> arg1 extra perm status) (entity-perm-status bit-1 no-kill)) @@ -1716,6 +1838,7 @@ (none) ) +;; definition for method 23 of type entity-actor (defmethod kill! entity-actor ((obj entity-actor)) (let ((a0-1 (-> obj extra process))) (if a0-1 @@ -1726,6 +1849,11 @@ obj ) +;; definition for method 17 of type bsp-header +;; INFO: Used lq/sq +;; WARN: Return type mismatch bsp-header vs none. +;; ERROR: Unsupported inline assembly instruction kind - [mfc0 s5, Count] +;; ERROR: Unsupported inline assembly instruction kind - [mfc0 v1, Count] (defmethod birth bsp-header ((obj bsp-header)) (local-vars (v1-74 int) (s5-0 int) (sv-16 int)) (.mfc0 s5-0 Count) @@ -1798,6 +1926,8 @@ (none) ) +;; definition for function check-for-rougue-process +;; WARN: Return type mismatch int vs none. (defun check-for-rougue-process ((arg0 process) (arg1 int) (arg2 int) (arg3 level)) (cond ((-> arg0 entity) @@ -1902,6 +2032,8 @@ (none) ) +;; definition for method 18 of type bsp-header +;; WARN: Return type mismatch bsp-header vs none. (defmethod deactivate-entities bsp-header ((obj bsp-header)) (let ((v1-1 (-> obj level heap base)) (a0-2 (-> obj level heap top-base)) @@ -1988,6 +2120,9 @@ (none) ) +;; definition for function process-drawable-scale-from-entity! +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. (defun process-drawable-scale-from-entity! ((arg0 process-drawable) (arg1 entity)) (let ((v1-1 (res-lump-struct arg1 'scale structure))) (if v1-1 @@ -1999,6 +2134,9 @@ (none) ) +;; definition for function process-drawable-from-entity! +;; INFO: Used lq/sq +;; WARN: Return type mismatch process-drawable vs none. (defun process-drawable-from-entity! ((arg0 process-drawable) (arg1 entity-actor)) (logior! (-> arg0 mask) (process-mask actor-pause)) (set! (-> arg0 root trans quad) (-> arg1 extra trans quad)) @@ -2007,6 +2145,7 @@ (none) ) +;; definition for method 9 of type entity-perm (defmethod update entity-perm ((obj entity-perm) (arg0 symbol) (arg1 entity-perm-status)) (cond ((= arg0 'game) @@ -2037,6 +2176,8 @@ obj ) +;; definition for function reset-actors +;; WARN: Return type mismatch int vs none. (defun reset-actors ((arg0 symbol)) (let* ((v1-0 arg0) (s5-0 (cond @@ -2121,6 +2262,8 @@ (none) ) +;; definition for function reset-cameras +;; WARN: Return type mismatch int vs none. (defun reset-cameras () (remove-all *camera-engine*) (dotimes (gp-0 (-> *level* length)) @@ -2140,6 +2283,7 @@ (none) ) +;; definition for method 12 of type process-drawable (defmethod run-logic? process-drawable ((obj process-drawable)) (or (not (logtest? (-> obj mask) (process-mask actor-pause))) (or (>= (+ (-> *ACTOR-bank* pause-dist) (-> obj root pause-adjust-distance)) @@ -2151,12 +2295,21 @@ ) ) +;; definition for method 9 of type entity-links (defmethod birth? entity-links ((obj entity-links) (arg0 vector)) (and (not (logtest? (-> obj perm status) (entity-perm-status bit-0 dead))) (< (vector-vector-distance (-> obj trans) arg0) (-> *ACTOR-bank* birth-dist)) ) ) +;; definition for method 17 of type level-group +;; INFO: Used lq/sq +;; ERROR: Stack slot load at 96 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 96 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 96 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 96 mismatch: defined as size 4, got size 16 +;; WARN: Return type mismatch int vs none. +;; WARN: Function (method 17 level-group) has a return type of none, but the expression builder found a return statement. (defmethod actors-update level-group ((obj level-group)) (local-vars (sv-16 vector) @@ -2363,6 +2516,7 @@ ) ) +;; definition for function entity-birth-no-kill (defun entity-birth-no-kill ((arg0 entity)) (let ((gp-0 (-> arg0 extra))) (logior! (-> gp-0 perm status) (entity-perm-status no-kill)) @@ -2373,6 +2527,8 @@ ) ) +;; definition for function entity-task-complete-on +;; WARN: Return type mismatch int vs none. (defun entity-task-complete-on ((arg0 entity)) (let ((v1-0 (-> arg0 extra))) (if (nonzero? (-> v1-0 perm task)) @@ -2383,6 +2539,8 @@ (none) ) +;; definition for function entity-task-complete-off +;; WARN: Return type mismatch int vs none. (defun entity-task-complete-off ((arg0 entity)) (let ((v1-0 (-> arg0 extra))) (if (!= (-> v1-0 perm task) 1) @@ -2393,6 +2551,8 @@ (none) ) +;; definition for method 30 of type entity-actor +;; WARN: Return type mismatch entity-perm-status vs none. (defmethod toggle-status entity-actor ((obj entity-actor) (arg0 entity-perm-status) (arg1 symbol)) (let ((v1-0 (-> obj extra))) (if arg1 @@ -2404,6 +2564,8 @@ (none) ) +;; definition for function process-entity-status! +;; WARN: Return type mismatch int vs entity-perm-status. (defun process-entity-status! ((arg0 process) (arg1 entity-perm-status) (arg2 symbol)) (the-as entity-perm-status (cond ((and (-> arg0 entity) arg0 (= arg0 (-> arg0 entity extra process))) @@ -2422,6 +2584,8 @@ ) ) +;; definition for function find-nearest-entity +;; WARN: Return type mismatch entity-actor vs entity. (defun find-nearest-entity ((arg0 vector) (arg1 type)) (local-vars (v1-9 object)) (let ((gp-0 (the-as entity-actor #f))) @@ -2461,6 +2625,8 @@ ) ) +;; definition (debug) for function entity-speed-test +;; ERROR: Unsupported inline assembly instruction kind - [mfc0 s4, Count] (defun-debug entity-speed-test ((arg0 string)) (local-vars (s4-0 int)) (let ((gp-0 (entity-by-name arg0))) @@ -2480,6 +2646,9 @@ ) ) +;; definition (debug) for function dump-entity-remap +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. (defun-debug dump-entity-remap ((arg0 object) (arg1 object)) (local-vars (sv-16 symbol) diff --git a/test/decompiler/reference/jak2/engine/gfx/sprite/particles/sparticle-launcher_REF.gc b/test/decompiler/reference/jak2/engine/gfx/sprite/particles/sparticle-launcher_REF.gc index d6c983e8a9..ab6daadc8f 100644 --- a/test/decompiler/reference/jak2/engine/gfx/sprite/particles/sparticle-launcher_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/sprite/particles/sparticle-launcher_REF.gc @@ -2,6 +2,7 @@ (in-package goal) ;; definition for method 3 of type sparticle-launcher +;; INFO: this function exists in multiple non-identical object files ;; WARN: Return type mismatch int vs sparticle-launcher. (defmethod inspect sparticle-launcher ((obj sparticle-launcher)) (format #t "~X: sparticle-launcher~%" obj) diff --git a/test/decompiler/reference/jak2/engine/level/level-h_REF.gc b/test/decompiler/reference/jak2/engine/level/level-h_REF.gc index fbb09b6861..daddc51f86 100644 --- a/test/decompiler/reference/jak2/engine/level/level-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/level/level-h_REF.gc @@ -694,7 +694,7 @@ (debug-draw-actors (_type_ symbol) none 15) (assign-draw-indices (_type_) none 16) (actors-update (_type_) none 17) - (level-group-method-18 (_type_) none 18) + (update-nav-meshes (_type_) none 18) (level-update (_type_) none 19) (level-get-target-inside (_type_) level 20) (alloc-levels-if-needed (_type_ symbol) none 21) diff --git a/test/decompiler/reference/jak2/engine/level/level_REF.gc b/test/decompiler/reference/jak2/engine/level/level_REF.gc index 48a2d0d074..29d22670ad 100644 --- a/test/decompiler/reference/jak2/engine/level/level_REF.gc +++ b/test/decompiler/reference/jak2/engine/level/level_REF.gc @@ -1,5 +1,7 @@ +;;-*-Lisp-*- (in-package goal) +;; definition for function lookup-level-info (defun lookup-level-info ((arg0 symbol)) (let* ((v1-0 *level-load-list*) (a1-0 (car v1-0)) @@ -17,6 +19,8 @@ default-level ) +;; definition for method 24 of type level-group +;; WARN: Return type mismatch object vs pair. (defmethod alt-load-command-get-index level-group ((obj level-group) (arg0 symbol) (arg1 int)) (let ((v1-1 (-> (lookup-level-info arg0) alt-load-commands))) (while (nonzero? arg1) @@ -30,10 +34,12 @@ ) ) +;; definition for method 29 of type level-group (defmethod load-in-progress? level-group ((obj level-group)) (!= (-> *level* loading-level) (-> *level* default-level)) ) +;; definition for method 11 of type level-group (defmethod get-level-by-heap-ptr-and-status level-group ((obj level-group) (arg0 pointer) (arg1 symbol)) (case arg1 (('active) @@ -66,6 +72,7 @@ (the-as level #f) ) +;; definition for function remap-level-name (defun remap-level-name ((arg0 level-load-info)) (if (-> *level* vis?) (-> arg0 visname) @@ -73,6 +80,7 @@ ) ) +;; definition for method 21 of type level (defmethod get-art-group-by-name level ((obj level) (arg0 string)) (countdown (s4-0 (-> obj art-group art-group-array length)) (if (name= (-> obj art-group art-group-array s4-0 name) arg0) @@ -82,6 +90,7 @@ (the-as art-group #f) ) +;; definition for method 13 of type level (defmethod bsp-name level ((obj level)) (if (and (!= (-> obj status) 'inactive) (-> obj bsp) (nonzero? (-> obj bsp name))) (-> obj bsp name) @@ -89,6 +98,7 @@ ) ) +;; definition for function add-bsp-drawable (defun add-bsp-drawable ((arg0 bsp-header) (arg1 level) (arg2 symbol) (arg3 display-frame)) (draw arg0 arg0 arg3) (if (nonzero? *display-strip-lines*) @@ -97,11 +107,13 @@ (none) ) +;; definition for method 2 of type level (defmethod print level ((obj level)) (format #t "#<~A ~A ~S @ #x~X>" (-> obj type) (-> obj status) (-> obj name) obj) obj ) +;; definition for method 7 of type bsp-header (defmethod relocate bsp-header ((obj bsp-header) (arg0 int)) (let ((s5-0 (-> *level* loading-level))) (when s5-0 @@ -140,6 +152,7 @@ ) ) +;; definition for method 27 of type level (defmethod load-required-packages level ((obj level)) (when (not (or (not (-> obj bsp)) (= *kernel-boot-mode* 'debug-boot))) (if (not (null? (-> obj info packages))) @@ -149,6 +162,9 @@ obj ) +;; definition for method 29 of type level +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. (defmethod vis-clear level ((obj level)) (countdown (v1-0 8) (nop!) @@ -162,6 +178,8 @@ (none) ) +;; definition for method 28 of type level +;; WARN: Return type mismatch int vs none. (defmethod init-vis-from-bsp level ((obj level)) (when (not (or (= (-> obj status) 'inactive) (not (-> obj bsp)))) (set! (-> obj all-visible?) 'loading) @@ -192,6 +210,7 @@ (none) ) +;; definition for method 12 of type level-group (defmethod level-get-for-use level-group ((obj level-group) (arg0 symbol) (arg1 symbol)) (local-vars (s5-1 level)) (alloc-levels-if-needed obj #f) @@ -239,6 +258,7 @@ s5-1 ) +;; definition for method 28 of type level-group (defmethod level-status level-group ((obj level-group) (arg0 symbol)) (let ((v1-1 (level-get *level* arg0))) (if v1-1 @@ -247,6 +267,8 @@ ) ) +;; definition for method 26 of type level +;; INFO: Used lq/sq (defmethod level-status-update! level ((obj level) (arg0 symbol)) (case arg0 (('inactive) @@ -315,10 +337,14 @@ obj ) +;; definition for symbol *login-state*, type login-state (define *login-state* (new 'global 'login-state)) +;; definition for symbol *print-login*, type symbol (define *print-login* #t) +;; definition for function load-buffer-resize +;; WARN: Return type mismatch int vs none. (defun load-buffer-resize ((arg0 level) (arg1 dgo-header)) (case (-> arg0 load-buffer-mode) (((load-buffer-mode small-center)) @@ -341,6 +367,7 @@ (none) ) +;; definition for method 17 of type level (defmethod load-continue level ((obj level)) (local-vars (sv-16 symbol)) (when (-> obj linking) @@ -460,6 +487,7 @@ obj ) +;; definition for method 18 of type level (defmethod load-begin level ((obj level)) (local-vars (bits-to-use int) (borrow-from-lev level) (found-borrow symbol)) (dotimes (v1-0 2) @@ -738,6 +766,7 @@ obj ) +;; definition for method 19 of type level (defmethod login-begin level ((obj level)) (set! (-> *texture-pool* allocate-func) texture-page-default-allocate) (cond @@ -787,6 +816,12 @@ obj ) +;; definition for function level-update-after-load +;; WARN: Found some very strange gotos. Check result carefully, this is not well tested. +;; INFO: Used lq/sq +;; ERROR: Unsupported inline assembly instruction kind - [mfc0 s5, Count] +;; ERROR: Unsupported inline assembly instruction kind - [mfc0 v1, Count] +;; ERROR: Unsupported inline assembly instruction kind - [mfc0 v1, Count] (defun level-update-after-load ((lev level) (lstate login-state)) (local-vars (current-time int) @@ -984,7 +1019,7 @@ (+! (-> lstate state) 1) ) (else - (entity-nav-mesh-method-27 (-> lev-bsp nav-meshes (the-as uint login-state-pos))) + (initialize-nav-mesh! (-> lev-bsp nav-meshes (the-as uint login-state-pos))) (+! (-> lstate pos) 1) ) ) @@ -1058,6 +1093,8 @@ lev ) +;; definition for method 25 of type level +;; INFO: Used lq/sq (defmethod birth level ((obj level)) (local-vars (sv-96 int)) (case (-> obj status) @@ -1130,6 +1167,8 @@ obj ) +;; definition for method 9 of type level +;; INFO: Used lq/sq (defmethod deactivate level ((obj level)) (case (-> obj status) (('active 'alive) @@ -1174,6 +1213,8 @@ obj ) +;; definition for method 12 of type level +;; WARN: Using new Jak 2 rtype-of (defmethod unload! level ((obj level)) (deactivate obj) (when (!= (-> obj status) 'inactive) @@ -1335,6 +1376,8 @@ obj ) +;; definition for method 10 of type level +;; ERROR: Unsupported inline assembly instruction kind - [addiu a0, a0, 56] (defmethod is-object-visible? level ((obj level) (arg0 int)) (local-vars (a0-1 int) (a0-3 int)) (let ((v1-0 (-> obj vis-bits))) @@ -1348,6 +1391,7 @@ ) ) +;; definition for method 15 of type level (defmethod inside-boxes-check level ((obj level) (arg0 vector)) (cond ((not (-> obj bsp)) @@ -1362,6 +1406,8 @@ ) ) +;; definition for method 20 of type level +;; WARN: Return type mismatch int vs none. (defmethod debug-print-region-splitbox level ((obj level) (arg0 vector) (arg1 object)) (cond ((or (not (-> obj bsp)) (zero? (-> obj bsp region-tree))) @@ -1374,6 +1420,7 @@ (none) ) +;; definition for method 8 of type level (defmethod mem-usage level ((obj level) (arg0 memory-usage-block) (arg1 int)) (when (= (-> obj status) 'active) (set! (-> arg0 length) (max 67 (-> arg0 length))) @@ -1428,6 +1475,8 @@ obj ) +;; definition for method 21 of type level-group +;; WARN: Return type mismatch int vs none. (defmethod alloc-levels-if-needed level-group ((obj level-group) (arg0 symbol)) (when (zero? (-> *level* heap base)) (kmemopen global "level-heaps") @@ -1457,6 +1506,7 @@ (none) ) +;; definition for method 10 of type level-group (defmethod level-get-with-status level-group ((obj level-group) (arg0 symbol)) (dotimes (v1-0 (-> obj length)) (if (= (-> obj level v1-0 status) arg0) @@ -1466,6 +1516,7 @@ (the-as level #f) ) +;; definition for method 30 of type level-group (defmethod level-get-most-disposable level-group ((obj level-group)) (dotimes (v1-0 (-> obj length)) (case (-> obj level v1-0 status) @@ -1504,6 +1555,7 @@ ) ) +;; definition for method 9 of type level-group (defmethod level-get level-group ((obj level-group) (arg0 symbol)) (dotimes (v1-0 (-> obj length)) (if (and (!= (-> obj level v1-0 status) 'inactive) @@ -1515,6 +1567,7 @@ (the-as level #f) ) +;; definition for method 23 of type level-group (defmethod art-group-get-by-name level-group ((obj level-group) (arg0 string) (arg1 (pointer uint32))) (countdown (s4-0 7) (let ((s3-0 (-> *level* level s4-0))) @@ -1533,6 +1586,7 @@ (the-as art-group #f) ) +;; definition for method 13 of type level-group (defmethod activate-levels! level-group ((obj level-group)) (dotimes (s5-0 (-> obj length)) (level-status-update! (-> obj level s5-0) 'active) @@ -1540,6 +1594,7 @@ 0 ) +;; definition for method 20 of type level-group (defmethod level-get-target-inside level-group ((obj level-group)) (let ((s5-0 (target-pos 0))) (let ((v1-1 (-> *load-state* vis-nick))) @@ -1609,12 +1664,15 @@ ) ) +;; definition for method 22 of type level-group +;; WARN: Return type mismatch int vs none. (defmethod load-commands-set! level-group ((obj level-group) (arg0 pair)) (set! (-> obj load-commands) arg0) 0 (none) ) +;; definition for method 8 of type level-group (defmethod mem-usage level-group ((obj level-group) (arg0 memory-usage-block) (arg1 int)) (dotimes (s3-0 (-> obj length)) (mem-usage (-> obj level s3-0) arg0 arg1) @@ -1622,6 +1680,9 @@ obj ) +;; definition for function bg +;; WARN: Return type mismatch int vs none. +;; WARN: Using new Jak 2 rtype-of (defun bg ((arg0 symbol)) (set! *cheat-mode* (if *debug-segment* 'debug @@ -1688,6 +1749,7 @@ (none) ) +;; definition for function play (defun play ((arg0 symbol) (arg1 symbol)) (kmemopen global "level-boot") (when *kernel-boot-level* @@ -1772,6 +1834,8 @@ 0 ) +;; definition for function play-boot +;; WARN: Return type mismatch int vs none. (defun play-boot () (process-spawn-function process @@ -1783,6 +1847,7 @@ (none) ) +;; definition for function update-sound-banks (defun update-sound-banks () (local-vars (v1-21 level-load-info) (v1-28 level-load-info) (a0-24 symbol)) (if (or (nonzero? (rpc-busy? 1)) @@ -1906,6 +1971,7 @@ 0 ) +;; definition for method 10 of type load-state (defmethod update! load-state ((obj load-state)) (local-vars (all-levels-inactive symbol)) (let ((discarded-level #f)) @@ -2089,6 +2155,8 @@ 0 ) +;; definition for method 16 of type level-group +;; WARN: Return type mismatch int vs none. (defmethod assign-draw-indices level-group ((obj level-group)) (local-vars (t0-3 symbol)) (set! (-> obj draw-level-count) 0) @@ -2142,6 +2210,8 @@ (none) ) +;; definition for method 19 of type level-group +;; WARN: Return type mismatch int vs none. (defmethod level-update level-group ((obj level-group)) (local-vars (v1-101 symbol)) (camera-pos) @@ -2421,6 +2491,7 @@ (none) ) +;; definition (debug) for function show-level (defun-debug show-level ((arg0 symbol)) (set! (-> *setting-control* user-default border-mode) #t) (let ((s5-0 (new 'stack-no-clear 'array 'symbol 10))) @@ -2436,6 +2507,7 @@ 0 ) +;; failed to figure out what this is: (when (zero? (-> *level* level0 art-group)) (kmemopen global "level") (let ((gp-0 *level*)) diff --git a/test/decompiler/reference/jak2/engine/nav/nav-control-h_REF.gc b/test/decompiler/reference/jak2/engine/nav/nav-control-h_REF.gc index cb05304e17..fbc1f102f8 100644 --- a/test/decompiler/reference/jak2/engine/nav/nav-control-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/nav/nav-control-h_REF.gc @@ -1,5 +1,7 @@ +;;-*-Lisp-*- (in-package goal) +;; definition of type check-vector-collision-with-nav-spheres-info (deftype check-vector-collision-with-nav-spheres-info (structure) ((u float :offset-assert 0) (intersect vector :inline :offset-assert 16) @@ -10,6 +12,7 @@ :flag-assert #x900000030 ) +;; definition for method 3 of type check-vector-collision-with-nav-spheres-info (defmethod inspect check-vector-collision-with-nav-spheres-info ((obj check-vector-collision-with-nav-spheres-info)) (when (not obj) (set! obj obj) @@ -23,6 +26,7 @@ obj ) +;; definition of type nav-gap-info (deftype nav-gap-info (structure) ((dest vector :inline :offset-assert 0) (poly nav-poly :offset-assert 16) @@ -32,6 +36,7 @@ :flag-assert #x900000014 ) +;; definition for method 3 of type nav-gap-info (defmethod inspect nav-gap-info ((obj nav-gap-info)) (when (not obj) (set! obj obj) @@ -44,6 +49,7 @@ obj ) +;; definition of type nav-avoid-spheres-params (deftype nav-avoid-spheres-params (structure) ((current-pos vector :inline :offset-assert 0) (travel vector :inline :offset-assert 16) @@ -57,6 +63,7 @@ :flag-assert #x900000058 ) +;; definition for method 3 of type nav-avoid-spheres-params (defmethod inspect nav-avoid-spheres-params ((obj nav-avoid-spheres-params)) (when (not obj) (set! obj obj) @@ -73,6 +80,7 @@ obj ) +;; definition of type nav-callback-info (deftype nav-callback-info (structure) ((callback-count int32 :offset-assert 0) (callback-array (function object nav-control none) 10 :offset-assert 4) @@ -82,6 +90,7 @@ :flag-assert #x90000002c ) +;; definition for method 3 of type nav-callback-info (defmethod inspect nav-callback-info ((obj nav-callback-info)) (when (not obj) (set! obj obj) @@ -94,6 +103,7 @@ obj ) +;; definition of type nav-state (deftype nav-state (structure) ((flags nav-state-flag :offset-assert 0) (nav nav-control :offset-assert 4) @@ -123,53 +133,54 @@ (:methods (debug-draw (_type_) none 9) (nav-state-method-10 (_type_) none 10) - (nav-state-method-11 (_type_ nav-gap-info) symbol 11) - (nav-state-method-12 (_type_ vector) vector 12) - (nav-state-method-13 (_type_ vector) vector 13) - (nav-state-method-14 (_type_ vector) vector 14) - (nav-state-method-15 (_type_ vector) vector 15) + (plan-over-pat1-polys-using-route (_type_ nav-gap-info) symbol 11) + (get-velocity (_type_ vector) vector 12) + (get-travel (_type_ vector) vector 13) + (get-heading (_type_ vector) vector 14) + (get-target-post (_type_ vector) vector 15) (get-speed (_type_) meters 16) (get-rotation-rate (_type_) float 17) - (nav-state-method-18 (_type_ vector object vector) none 18) + (try-projecting-to-current-poly (_type_ vector object vector) symbol 18) (get-current-poly (_type_) nav-poly 19) (copy-nav-state! (_type_ (pointer nav-state)) none 20) (nav-state-method-21 () none 21) (nav-state-method-22 () none 22) (nav-state-method-23 () none 23) - (nav-state-method-24 (_type_) none 24) - (nav-state-method-25 (_type_) none 25) - (nav-state-method-26 (_type_) none 26) - (nav-state-method-27 (_type_) none 27) - (nav-state-method-28 (_type_) none 28) + (turn-and-navigate-to-destination (_type_) none 24) + (navigate-using-route-portals-wrapper (_type_) none 25) + (navigate-using-best-dir-recompute-avoid-spheres-1-wrapper (_type_) none 26) + (navigate-within-poly-wrapper (_type_) none 27) + (compute-travel-speed (_type_) none 28) (nav-state-method-29 (_type_) none 29) (nav-state-method-30 (_type_) none 30) - (nav-state-method-31 (_type_) none 31) - (nav-state-method-32 (_type_) none 32) - (nav-state-method-33 (_type_) none 33) - (nav-state-method-34 (_type_) none 34) - (nav-state-method-35 (_type_) none 35) - (nav-state-method-36 (_type_ vector) none 36) - (nav-state-method-37 (_type_) none 37) + (navigate-using-best-dir-recompute-avoid-spheres-2 (_type_) none 31) + (update-travel-dir-from-spheres (_type_) none 32) + (compute-speed-simple (_type_) none 33) + (navigate-v1! (_type_) none 34) + (reset-target! (_type_) none 35) + (add-offset-to-target! (_type_ vector) none 36) + (navigate-v2! (_type_) none 37) (set-current-poly! (_type_ nav-poly) none 38) - (nav-state-method-39 () none 39) - (nav-state-method-40 (_type_) none 40) - (nav-state-method-41 (_type_ vector) symbol 41) - (nav-state-method-42 (_type_ vector) none 42) - (nav-state-method-43 (_type_ vector) none 43) + (nav-state-method-39 (_type_) symbol 39) + (do-navigation-to-destination (_type_ vector) none 40) + (clamp-vector-to-mesh-cross-gaps (_type_ vector) symbol 41) + (set-target-post! (_type_ vector) none 42) + (set-travel! (_type_ vector) none 43) (set-velocity! (_type_ vector) none 44) (set-heading! (_type_ vector) none 45) (set-speed! (_type_ meters) none 46) - (nav-state-method-47 (_type_ nav-control) none 47) + (reset! (_type_ nav-control) none 47) (nav-state-method-48 () none 48) - (nav-state-method-49 (_type_ clamp-travel-vector-to-mesh-return-info) none 49) + (navigate-using-best-dir-use-existing-avoid-spheres (_type_ nav-avoid-spheres-params) none 49) (nav-state-method-50 (_type_) none 50) - (nav-state-method-51 () none 51) - (nav-state-method-52 (_type_) none 52) - (nav-state-method-53 (_type_) none 53) - (nav-state-method-54 (_type_) none 54) + (navigate-using-route-portals (_type_) none 51) + (navigate-using-best-dir-recompute-avoid-spheres-1 (_type_) none 52) + (navigate-within-poly (_type_) none 53) + (clamp-travel-vector (_type_) none 54) ) ) +;; definition for method 3 of type nav-state (defmethod inspect nav-state ((obj nav-state)) (when (not obj) (set! obj obj) @@ -249,6 +260,7 @@ obj ) +;; definition of type nav-control (deftype nav-control (structure) ((flags nav-control-flag :offset-assert 0) (callback-info nav-callback-info :offset-assert 4) @@ -278,28 +290,28 @@ :flag-assert #x2f00000120 (:methods (debug-draw (_type_) none 9) - (point-in-bounds? (_type_ vector) symbol 10) - (nav-control-method-11 (_type_ vector) vector 11) - (nav-control-method-12 (_type_ vector vector nav-poly) nav-poly 12) - (find-poly (_type_ vector) nav-poly 13) - (nav-control-method-14 (_type_ nav-poly vector object vector) none 14) - (nav-control-method-15 (_type_ vector) none 15) - (nav-control-method-16 (_type_ vector float) symbol 16) + (point-in-bsphere? (_type_ vector) symbol 10) + (find-poly-containing-point-1 (_type_ vector) nav-poly 11) + (cloest-point-on-mesh (_type_ vector vector nav-poly) nav-poly 12) + (find-nearest-poly-to-point (_type_ vector) nav-poly 13) + (project-point-onto-plane-of-poly (_type_ nav-poly vector vector vector) none 14) + (find-poly-containing-point-2 (_type_ vector) nav-poly 15) + (is-above-poly-max-height? (_type_ vector float) symbol 16) (is-in-mesh? (_type_ vector float) symbol 17) - (nav-control-method-18 () none 18) - (nav-control-method-19 () none 19) - (nav-control-method-20 (_type_ vector nav-poly vector float symbol symbol) none 20) - (nav-control-method-21 (_type_) none 21) - (nav-control-method-22 (_type_ vector nav-avoid-spheres-params) float 22) - (nav-control-method-23 (_type_) none 23) - (nav-control-method-24 (_type_ vector int) none 24) + (avoid-spheres-1! (_type_ nav-avoid-spheres-params) symbol 18) + (avoid-spheres-2! (_type_ nav-avoid-spheres-params) symbol 19) + (clamp-vector-to-mesh-cross-gaps (_type_ vector nav-poly vector float symbol clamp-travel-vector-to-mesh-return-info) none 20) + (clamp-vector-to-mesh-no-gaps (_type_ vector nav-poly vector clamp-travel-vector-to-mesh-return-info) none 21) + (find-first-sphere-and-update-avoid-params (_type_ vector nav-avoid-spheres-params) float 22) + (set-spheres-from-nav-ids (_type_) none 23) + (add-root-sphere-to-hash! (_type_ vector int) none 24) (get-max-rotation-rate (_type_) float 25) - (get-sphere-mask (_type_) none 26) + (get-sphere-mask (_type_) uint 26) (get-target-speed (_type_) meters 27) - (nav-control-method-28 (_type_) none 28) - (nav-control-method-29 (_type_) none 29) + (enable-extra-sphere! (_type_) none 28) + (disable-extra-sphere! (_type_) none 29) (copy-extra-nav-sphere! (_type_ sphere) none 30) - (set-extra-nav-sphere! (_type_ sphere) none 31) + (set-extra-nav-sphere-xyz! (_type_ sphere) none 31) (set-extra-nav-sphere-radius! (_type_ float) none 32) (set-nearest-y-thres! (_type_ float) none 33) (set-nav-cull-radius! (_type_ meters) none 34) @@ -309,15 +321,16 @@ (set-turning-acceleration! (_type_ meters) none 38) (set-max-rotation-rate! (_type_ float) none 39) (set-sphere-mask! (_type_ uint) none 40) - (nav-control-method-41 (_type_) none 41) + (remove! (_type_) none 41) (init! (_type_ collide-shape) none 42) (display-marks? (_type_) symbol 43) (nav-control-method-44 () none 44) - (nav-control-method-45 (_type_ vector vector vector) sphere 45) - (find-sphere (_type_ symbol) none 46) + (find-first-sphere-intersecting-ray (_type_ vector vector vector) sphere 45) + (find-sphere-ids-from-sphere-hash (_type_ symbol) none 46) ) ) +;; definition for method 3 of type nav-control (defmethod inspect nav-control ((obj nav-control)) (when (not obj) (set! obj obj) @@ -384,4 +397,5 @@ obj ) +;; failed to figure out what this is: 0 diff --git a/test/decompiler/reference/jak2/engine/nav/nav-control_REF.gc b/test/decompiler/reference/jak2/engine/nav/nav-control_REF.gc new file mode 100644 index 0000000000..12cb5b6fc8 --- /dev/null +++ b/test/decompiler/reference/jak2/engine/nav/nav-control_REF.gc @@ -0,0 +1,4361 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition for symbol *nav-triangle-test-count*, type int +(define *nav-triangle-test-count* 0) + +;; definition for symbol *nav-last-triangle-test-count*, type int +(define *nav-last-triangle-test-count* 0) + +;; definition for function debug-nav-validate-current-poly +(defun debug-nav-validate-current-poly ((arg0 nav-mesh) (arg1 nav-poly) (arg2 vector)) + (local-vars (sv-32 vector) (sv-36 float)) + (when (not (point-in-poly? arg0 arg1 arg2)) + (set! sv-32 (new 'stack-no-clear 'vector)) + (project-point-into-poly-2d arg0 arg1 sv-32 arg2) + (set! sv-36 (vector-vector-xz-distance arg2 sv-32)) + #f + ) + ) + +;; definition for function debug-report-nav-stats +;; WARN: Return type mismatch int vs none. +(defun debug-report-nav-stats () + "Does nothing" + 0 + (none) + ) + +;; definition for method 7 of type nav-control +(defmethod relocate nav-control ((obj nav-control) (arg0 int)) + (&+! (-> obj process) arg0) + (&+! (-> obj shape) arg0) + obj + ) + +;; definition for method 41 of type nav-control +;; WARN: Return type mismatch int vs none. +(defmethod remove! nav-control ((obj nav-control)) + "Remove this nav-control from the nav-mesh it belongs to." + (remove-nav-control (-> obj state mesh) obj) + 0 + (none) + ) + +;; definition for method 28 of type nav-control +;; WARN: Return type mismatch int vs none. +(defmethod enable-extra-sphere! nav-control ((obj nav-control)) + "Sets a flag indicating that this nav-control has an extra-nav-sphere." + (logior! (-> obj shape nav-flags) (nav-flags has-extra-sphere)) + 0 + (none) + ) + +;; definition for method 29 of type nav-control +;; WARN: Return type mismatch int vs none. +(defmethod disable-extra-sphere! nav-control ((obj nav-control)) + "Clears a flag indicating that this nav-control has an extra-nav-sphere." + (logclear! (-> obj shape nav-flags) (nav-flags has-extra-sphere)) + 0 + (none) + ) + +;; definition for method 30 of type nav-control +;; WARN: Return type mismatch int vs none. +(defmethod copy-extra-nav-sphere! nav-control ((obj nav-control) (arg0 sphere)) + "Copies the given [[sphere]] into `extra-nav-sphere`" + (mem-copy! (the-as pointer (-> obj extra-nav-sphere)) (the-as pointer arg0) 16) + 0 + (none) + ) + +;; definition for method 31 of type nav-control +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod set-extra-nav-sphere-xyz! nav-control ((obj nav-control) (arg0 sphere)) + "Set the `extra-nav-sphere` with the data in the given [[sphere]]" + (let ((f0-0 (-> obj extra-nav-sphere w))) + (set! (-> obj extra-nav-sphere quad) (-> arg0 quad)) + (set! (-> obj extra-nav-sphere w) f0-0) + ) + 0 + (none) + ) + +;; definition for method 32 of type nav-control +;; WARN: Return type mismatch int vs none. +(defmethod set-extra-nav-sphere-radius! nav-control ((obj nav-control) (arg0 float)) + "Set's `extra-nav-sphere`'s radius" + (set! (-> obj extra-nav-sphere w) arg0) + 0 + (none) + ) + +;; definition for method 33 of type nav-control +;; WARN: Return type mismatch int vs none. +(defmethod set-nearest-y-thres! nav-control ((obj nav-control) (arg0 float)) + "Set `nearest-y-threshold`" + (set! (-> obj nearest-y-threshold) arg0) + 0 + (none) + ) + +;; definition for method 34 of type nav-control +;; WARN: Return type mismatch int vs none. +(defmethod set-nav-cull-radius! nav-control ((obj nav-control) (arg0 meters)) + "Set `nav-cull-radius`" + (set! (-> obj nav-cull-radius) arg0) + 0 + (none) + ) + +;; definition for method 35 of type nav-control +;; WARN: Return type mismatch int vs none. +(defmethod set-speed-scale! nav-control ((obj nav-control) (arg0 float)) + "Set `speed-scale`" + (set! (-> obj speed-scale) arg0) + 0 + (none) + ) + +;; definition for method 36 of type nav-control +;; WARN: Return type mismatch int vs none. +(defmethod set-target-speed! nav-control ((obj nav-control) (arg0 meters)) + "Set `target-speed`" + (set! (-> obj target-speed) arg0) + 0 + (none) + ) + +;; definition for method 27 of type nav-control +(defmethod get-target-speed nav-control ((obj nav-control)) + (-> obj target-speed) + ) + +;; definition for method 37 of type nav-control +;; WARN: Return type mismatch int vs none. +(defmethod set-acceleration! nav-control ((obj nav-control) (arg0 meters)) + "Set `acceleration`" + (set! (-> obj acceleration) arg0) + 0 + (none) + ) + +;; definition for method 38 of type nav-control +;; WARN: Return type mismatch int vs none. +(defmethod set-turning-acceleration! nav-control ((obj nav-control) (arg0 meters)) + "Set `turning-acceleration`" + (set! (-> obj turning-acceleration) arg0) + 0 + (none) + ) + +;; definition for method 39 of type nav-control +;; WARN: Return type mismatch int vs none. +(defmethod set-max-rotation-rate! nav-control ((obj nav-control) (arg0 float)) + "Set `max-rotation-rate`" + (set! (-> obj max-rotation-rate) arg0) + 0 + (none) + ) + +;; definition for method 25 of type nav-control +(defmethod get-max-rotation-rate nav-control ((obj nav-control)) + (-> obj max-rotation-rate) + ) + +;; definition for method 40 of type nav-control +;; WARN: Return type mismatch int vs none. +(defmethod set-sphere-mask! nav-control ((obj nav-control) (arg0 uint)) + "TODO - probably an enum - Set `sphere-mask`" + (set! (-> obj sphere-mask) arg0) + 0 + (none) + ) + +;; definition for method 26 of type nav-control +(defmethod get-sphere-mask nav-control ((obj nav-control)) + (-> obj sphere-mask) + ) + +;; definition for method 10 of type nav-control +(defmethod point-in-bsphere? nav-control ((obj nav-control) (arg0 vector)) + "Is the given point ([[vector]]) outside of the [[nav-mesh]]'s `bounds` [[sphere]] radius" + (let ((v1-1 (-> obj state mesh bounds))) + (>= (-> v1-1 w) (vector-vector-distance arg0 v1-1)) + ) + ) + +;; definition for method 43 of type nav-control +(defmethod display-marks? nav-control ((obj nav-control)) + "Returns if navigation related marks should be displayed" + (and *display-nav-marks* (logtest? (-> obj flags) (nav-control-flag display-marks))) + ) + +;; definition for method 42 of type nav-control +;; WARN: Return type mismatch int vs none. +(defmethod init! nav-control ((obj nav-control) (arg0 collide-shape)) + "Initializes the [[nav-control]], setting `shape` with the provided [[collide-shape]]" + (set! (-> obj callback-info) #f) + (logior! (-> obj flags) (nav-control-flag update-heading-from-facing output-sphere-hash)) + (let ((v1-2 obj)) + (set! (-> v1-2 sphere-mask) (the-as uint #x800f8)) + ) + 0 + (set! (-> obj sphere-count) 0) + (set! (-> obj sphere-array) (the-as (inline-array sphere) #f)) + (set! (-> obj shape) arg0) + (set! (-> obj process) (-> arg0 process)) + (set! (-> obj speed-scale) 1.0) + (set! (-> obj acceleration) 4096.0) + (set! (-> obj turning-acceleration) 4096.0) + (set! (-> obj max-rotation-rate) 131072.0) + (set! (-> obj target-speed) 0.0) + (set! (-> obj nav-cull-radius) 40960.0) + (reset! (-> obj state) obj) + 0 + (none) + ) + +;; definition for function get-nav-control +;; WARN: Function get-nav-control has a return type of none, but the expression builder found a return statement. +(defun get-nav-control ((arg0 process-drawable) (arg1 nav-mesh)) + "Given a [[process-drawable]] get the associated [[nav-control]] using either: + - the provided `nav-mesh` arg + - the `nav-mesh` associated with the [[process-drawable]]'s [[entity]] + If no [[nav-mesh]] is set or found, set the [[entity]]'s [[entity-perm-status]] to TODO and return an error. + Note that this doesn't actually return the nav-control, but instead adds this process-drawable to the nav-mesh." + (if (not arg1) + (set! arg1 (nav-mesh-from-res-tag (-> arg0 entity) 'nav-mesh-actor 0)) + ) + (when (not arg1) + (if (-> arg0 entity) + (logior! (-> arg0 entity extra perm status) (entity-perm-status bit-1)) + ) + (go process-drawable-art-error "no nav-mesh") + (return 0) + ) + (add-process-drawable-to-navmesh arg1 arg0 #t) + (none) + ) + +;; definition for method 13 of type nav-control +(defmethod find-nearest-poly-to-point nav-control ((obj nav-control) (arg0 vector)) + "Find the nav-poly closest to this point in the nav-mesh." + (let ((gp-0 (new 'stack 'nav-find-poly-parms))) + (vector-! (-> gp-0 point) arg0 (-> obj state mesh bounds)) + (set! (-> gp-0 y-threshold) (-> obj nearest-y-threshold)) + (set! (-> gp-0 ignore) (the-as uint 2)) + (find-nearest-poly-to-point-local (-> obj state mesh) gp-0) + (-> gp-0 poly) + ) + ) + +;; definition for method 14 of type nav-control +;; WARN: Return type mismatch int vs none. +(defmethod project-point-onto-plane-of-poly nav-control ((obj nav-control) (arg0 nav-poly) (arg1 vector) (arg2 vector) (arg3 vector)) + "Move a point to the be on the plane containing the given nav-poly. Return the normal too" + (project-point-onto-plane-of-poly-local + (-> obj state mesh) + arg0 + arg1 + arg2 + (vector-! (new 'stack-no-clear 'vector) arg3 (-> obj state mesh bounds)) + ) + (vector+! arg1 arg1 (-> obj state mesh bounds)) + 0 + (none) + ) + +;; definition for method 17 of type nav-control +(defmethod is-in-mesh? nav-control ((obj nav-control) (arg0 vector) (arg1 float)) + "Is this point in the mesh?" + (let ((v1-0 (new 'stack-no-clear 'vector))) + (vector-! v1-0 arg0 (-> obj state mesh bounds)) + (let ((a1-1 (-> obj state mesh))) + (is-in-mesh-local? a1-1 v1-0 arg1 (-> obj nearest-y-threshold)) + ) + ) + ) + +;; definition for method 9 of type nav-control +;; WARN: Return type mismatch int vs none. +(defmethod debug-draw nav-control ((obj nav-control)) + (local-vars (sv-32 nav-mesh) (sv-36 vector)) + (when (display-marks? obj) + (debug-draw (-> obj state mesh)) + (set! sv-32 (-> obj state mesh)) + (set! sv-36 (new 'stack-no-clear 'vector)) + (if (logtest? (-> obj shape nav-flags) (nav-flags has-root-sphere)) + (add-debug-sphere + #t + (bucket-id debug-no-zbuf1) + (-> obj root-nav-sphere) + (-> obj root-nav-sphere w) + (new 'static 'rgba :g #xff :b #xff :a #x20) + ) + ) + (if (logtest? (-> obj shape nav-flags) (nav-flags has-extra-sphere)) + (add-debug-sphere + #t + (bucket-id debug-no-zbuf1) + (-> obj extra-nav-sphere) + (-> obj extra-nav-sphere w) + (new 'static 'rgba :g #xff :b #xff :a #x20) + ) + ) + (dotimes (s5-0 (-> obj sphere-count)) + (let ((v1-19 (-> obj state mesh work debug sphere-array s5-0))) + (vector+! sv-36 (-> sv-32 bounds) (the-as vector v1-19)) + (add-debug-sphere + #t + (bucket-id debug-no-zbuf1) + sv-36 + (- (-> v1-19 r) (-> obj shape nav-radius)) + (new 'static 'rgba :g #xff :b #xff :a #x20) + ) + ) + ) + (dotimes (s5-1 (the-as int (-> sv-32 static-sphere-count))) + (let ((s4-0 (-> sv-32 static-sphere s5-1))) + (add-debug-sphere #t (bucket-id debug2) s4-0 (-> s4-0 r) *color-blue*) + (let ((s3-0 add-debug-text-3d) + (s2-0 #t) + (s1-0 318) + ) + (format (clear *temp-string*) "~D" s5-1) + (s3-0 s2-0 (the-as bucket-id s1-0) *temp-string* s4-0 (font-color cyan-#00fefe) (the-as vector2h #f)) + ) + ) + ) + (debug-draw (-> obj state)) + ) + 0 + (none) + ) + +;; definition for method 11 of type nav-control +(defmethod find-poly-containing-point-1 nav-control ((obj nav-control) (arg0 vector)) + "Find nav-poly containing this point." + (let ((v1-0 (new 'stack-no-clear 'nav-find-poly-parms))) + (vector-! (-> v1-0 point) arg0 (-> obj state mesh bounds)) + (set! (-> v1-0 y-threshold) (-> obj nearest-y-threshold)) + (set! (-> v1-0 ignore) (the-as uint 2)) + (find-poly-containing-point-local (-> obj state mesh) v1-0) + ) + ) + +;; definition for method 15 of type nav-control +(defmethod find-poly-containing-point-2 nav-control ((obj nav-control) (arg0 vector)) + "Find nav-poly containing this point - same as 1" + (let ((v1-0 (new 'stack-no-clear 'nav-find-poly-parms))) + (vector-! (-> v1-0 point) arg0 (-> obj state mesh bounds)) + (set! (-> v1-0 y-threshold) (-> obj nearest-y-threshold)) + (set! (-> v1-0 ignore) (the-as uint 2)) + (find-poly-containing-point-local (-> obj state mesh) v1-0) + ) + ) + +;; definition for method 16 of type nav-control +;; WARN: Return type mismatch object vs symbol. +(defmethod is-above-poly-max-height? nav-control ((obj nav-control) (arg0 vector) (arg1 float)) + "Is the point in a poly, and lower than a max height?" + (let ((a1-1 (new 'stack-no-clear 'nav-find-poly-parms))) + (vector-! (-> a1-1 point) arg0 (-> obj state mesh bounds)) + (set! (-> a1-1 y-threshold) (-> obj nearest-y-threshold)) + (set! (-> a1-1 ignore) (the-as uint 2)) + (the-as symbol (and (find-poly-containing-point-local (-> obj state mesh) a1-1) + (< (-> arg0 y) (+ (-> obj state mesh bounds y) arg1)) + ) + ) + ) + ) + +;; definition for method 45 of type nav-control +(defmethod find-first-sphere-intersecting-ray nav-control ((obj nav-control) (arg0 vector) (arg1 vector) (arg2 vector)) + "Find the first sphere that this ray intersects" + (let ((s5-0 (the-as sphere #f))) + (let ((f30-0 -0.000001)) + (countdown (s1-0 (-> obj sphere-count)) + (let* ((s0-0 (-> obj sphere-array s1-0)) + (f0-1 (ray-circle-intersect arg0 arg1 s0-0 (-> s0-0 r))) + ) + (when (< f30-0 f0-1) + (set! s5-0 s0-0) + (set! f30-0 f0-1) + ) + ) + ) + (set! (-> arg2 x) f30-0) + ) + s5-0 + ) + ) + +;; definition for function add-nav-sphere +;; WARN: Return type mismatch int vs none. +(defun add-nav-sphere ((nav nav-control) (sphere sphere) (max-spheres int)) + "Adds the given [[sphere]] to the [[nav-control]]'s `sphere-array` so long as + `max-spheres` is less than [[nav-control]]'s `sphere-count`" + (local-vars (a2-4 float)) + (rlet ((vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + ) + (when (< (-> nav sphere-count) max-spheres) + (let ((v1-3 (-> nav sphere-array (-> nav sphere-count)))) + (let ((a2-3 sphere) + (a3-0 (-> nav root-nav-sphere)) + ) + (.lvf vf2 (&-> a2-3 quad)) + (.lvf vf3 (&-> a3-0 quad)) + ) + (.sub.vf vf1 vf3 vf2) + (.mul.vf vf1 vf1 vf1) + (.add.z.vf vf1 vf1 vf1 :mask #b1) + (.mov a2-4 vf1) + (let ((f1-0 a2-4) + (f0-1 (+ (-> sphere r) (-> nav shape nav-radius))) + ) + (when (and (< 0.0 f1-0) (let ((f2-3 (+ f0-1 (-> nav nav-cull-radius)))) + (< f1-0 (* f2-3 f2-3)) + ) + ) + (vector-! (the-as vector v1-3) (the-as vector sphere) (-> nav state mesh bounds)) + (set! (-> v1-3 r) f0-1) + (+! (-> nav sphere-count) 1) + ) + ) + ) + ) + 0 + (none) + ) + ) + +;; definition for function add-collide-shape-spheres +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defun add-collide-shape-spheres ((arg0 nav-control) (arg1 collide-shape) (arg2 sphere)) + (local-vars (a2-6 float) (t0-4 float)) + (rlet ((vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + ) + (when (logtest? (-> arg1 nav-flags) (nav-flags has-root-sphere)) + (set! (-> arg2 quad) (-> arg1 trans quad)) + (set! (-> arg2 r) (-> arg1 nav-radius)) + (let ((v1-4 arg0) + (a3-2 16) + ) + (when (< (-> v1-4 sphere-count) a3-2) + (let ((a3-5 (-> v1-4 sphere-array (-> v1-4 sphere-count)))) + (let ((t0-3 arg2) + (t1-0 (-> v1-4 root-nav-sphere)) + ) + (.lvf vf2 (&-> t0-3 quad)) + (.lvf vf3 (&-> t1-0 quad)) + ) + (.sub.vf vf1 vf3 vf2) + (.mul.vf vf1 vf1 vf1) + (.add.z.vf vf1 vf1 vf1 :mask #b1) + (.mov t0-4 vf1) + (let ((f1-0 t0-4) + (f0-2 (+ (-> arg2 r) (-> v1-4 shape nav-radius))) + ) + (when (and (< 0.0 f1-0) (let ((f2-3 (+ f0-2 (-> v1-4 nav-cull-radius)))) + (< f1-0 (* f2-3 f2-3)) + ) + ) + (vector-! (the-as vector a3-5) (the-as vector arg2) (-> v1-4 state mesh bounds)) + (set! (-> a3-5 r) f0-2) + (+! (-> v1-4 sphere-count) 1) + ) + ) + ) + ) + ) + 0 + ) + (when (logtest? (-> arg1 nav-flags) (nav-flags has-extra-sphere)) + (let ((v1-9 arg0) + (a0-1 (-> arg1 process nav extra-nav-sphere)) + (a1-2 16) + ) + (when (< (-> v1-9 sphere-count) a1-2) + (let ((a1-5 (-> v1-9 sphere-array (-> v1-9 sphere-count)))) + (let ((a2-5 a0-1) + (a3-6 (-> v1-9 root-nav-sphere)) + ) + (.lvf vf2 (&-> a2-5 quad)) + (.lvf vf3 (&-> a3-6 quad)) + ) + (.sub.vf vf1 vf3 vf2) + (.mul.vf vf1 vf1 vf1) + (.add.z.vf vf1 vf1 vf1 :mask #b1) + (.mov a2-6 vf1) + (let ((f1-1 a2-6) + (f0-4 (+ (-> a0-1 w) (-> v1-9 shape nav-radius))) + ) + (when (and (< 0.0 f1-1) (let ((f2-9 (+ f0-4 (-> v1-9 nav-cull-radius)))) + (< f1-1 (* f2-9 f2-9)) + ) + ) + (vector-! (the-as vector a1-5) a0-1 (-> v1-9 state mesh bounds)) + (set! (-> a1-5 r) f0-4) + (+! (-> v1-9 sphere-count) 1) + ) + ) + ) + ) + ) + 0 + ) + (none) + ) + ) + +;; definition for method 46 of type nav-control +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod find-sphere-ids-from-sphere-hash nav-control ((obj nav-control) (arg0 symbol)) + "Use sphere-hash to look up navigation sphere IDs and save them." + (let ((s5-0 (new 'stack-no-clear 'find-nav-sphere-ids-params))) + (set! (-> s5-0 bsphere quad) (-> obj root-nav-sphere quad)) + (+! (-> s5-0 bsphere r) (-> obj nav-cull-radius)) + (set! (-> s5-0 max-len) 16) + (set! (-> s5-0 mask) (-> obj sphere-mask)) + (set! (-> s5-0 array) (-> obj sphere-id-array)) + (set! (-> s5-0 y-threshold) (-> obj nearest-y-threshold)) + (find-nav-sphere-ids (-> obj state mesh sphere-hash) s5-0) + (set! (-> obj sphere-count) (-> s5-0 len)) + ) + 0 + (none) + ) + +;; definition for method 23 of type nav-control +;; WARN: Return type mismatch int vs none. +(defmethod set-spheres-from-nav-ids nav-control ((obj nav-control)) + "Set up spheres from sphere ids previously found by find-sphere-ids-from-sphere-hash" + (let ((v1-2 (-> obj state mesh sphere-hash sphere-array)) + (a1-0 (-> obj sphere-id-array)) + (a2-1 (-> obj state mesh bounds)) + (a3-0 (-> obj root-nav-sphere)) + (t0-0 (-> obj sphere-count)) + ) + (dotimes (t1-0 t0-0) + (let ((t3-0 (-> v1-2 (-> a1-0 t1-0))) + (t2-4 (-> obj sphere-array t1-0)) + ) + (vector-! (the-as vector t2-4) (the-as vector t3-0) a2-1) + (set! (-> t2-4 r) (+ (-> t3-0 r) (-> a3-0 w))) + ) + ) + ) + 0 + (none) + ) + +;; definition of type nav-control-cfs-work +(deftype nav-control-cfs-work (structure) + ((in-dir vector :inline :offset-assert 0) + (right-dir vector :inline :offset-assert 16) + (best-dir vector 2 :inline :offset-assert 32) + (temp-dir vector 2 :inline :offset-assert 64) + (away-dir vector :inline :offset-assert 96) + (best-dir-angle degrees 2 :offset-assert 112) + (ignore-mask uint64 :offset-assert 120) + (initial-ignore-mask uint64 :offset-assert 128) + (i-sphere int32 :offset-assert 136) + (i-first-sphere int32 :offset-assert 140) + (i-inside-sphere int32 :offset-assert 144) + (inside-sphere-dist float :offset-assert 148) + (sign float :offset-assert 152) + (travel-len float :offset-assert 156) + (dist2 float :offset-assert 160) + (inside-dist float :offset-assert 164) + (rand-angle float :offset-assert 168) + (dir-update basic :offset-assert 172) + (debug-offset vector :inline :offset-assert 176) + ) + :method-count-assert 9 + :size-assert #xc0 + :flag-assert #x9000000c0 + ) + +;; definition for method 3 of type nav-control-cfs-work +(defmethod inspect nav-control-cfs-work ((obj nav-control-cfs-work)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'nav-control-cfs-work) + (format #t "~1Tin-dir: #~%" (-> obj in-dir)) + (format #t "~1Tright-dir: #~%" (-> obj right-dir)) + (format #t "~1Tbest-dir[2] @ #x~X~%" (-> obj best-dir)) + (format #t "~1Ttemp-dir[2] @ #x~X~%" (-> obj temp-dir)) + (format #t "~1Taway-dir: #~%" (-> obj away-dir)) + (format #t "~1Tbest-dir-angle[2] @ #x~X~%" (-> obj best-dir-angle)) + (format #t "~1Tignore-mask: ~D~%" (-> obj ignore-mask)) + (format #t "~1Tinitial-ignore-mask: ~D~%" (-> obj initial-ignore-mask)) + (format #t "~1Ti-sphere: ~D~%" (-> obj i-sphere)) + (format #t "~1Ti-first-sphere: ~D~%" (-> obj i-first-sphere)) + (format #t "~1Ti-inside-sphere: ~D~%" (-> obj i-inside-sphere)) + (format #t "~1Tinside-sphere-dist: ~f~%" (-> obj inside-sphere-dist)) + (format #t "~1Tsign: ~f~%" (-> obj sign)) + (format #t "~1Ttravel-len: ~f~%" (-> obj travel-len)) + (format #t "~1Tdist2: ~f~%" (-> obj dist2)) + (format #t "~1Tinside-dist: ~f~%" (-> obj inside-dist)) + (format #t "~1Trand-angle: ~f~%" (-> obj rand-angle)) + (format #t "~1Tdir-update: ~A~%" (-> obj dir-update)) + (format #t "~1Tdebug-offset: #~%" (-> obj debug-offset)) + (label cfg-4) + obj + ) + +;; definition for function circle-tangent-directions +;; INFO: Used lq/sq +(defun circle-tangent-directions ((arg0 vector) (arg1 vector) (arg2 vector) (arg3 vector)) + (rlet ((acc :class vf) + (Q :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (let ((t1-0 (new 'stack-no-clear 'vector)) + (t0-0 (new 'stack-no-clear 'vector)) + (v1-0 (new 'stack-no-clear 'vector)) + ) + (vector-! t1-0 arg1 arg0) + (set! (-> t1-0 y) 0.0) + (let ((a0-1 t0-0)) + (let ((t3-2 t1-0)) + (set! (-> a0-1 quad) (-> t3-2 quad)) + ) + (let ((f0-1 1.0)) + (.lvf vf1 (&-> a0-1 quad)) + (.mul.vf vf2 vf1 vf1 :mask #b111) + (let ((t2-3 f0-1)) + (.mov vf3 t2-3) + ) + ) + (.mul.x.vf acc vf0 vf2 :mask #b1000) + (.add.mul.y.vf acc vf0 vf2 acc :mask #b1000) + (.add.mul.z.vf vf2 vf0 vf2 acc :mask #b1000) + (.isqrt.vf Q vf3 vf2 :fsf #b0 :ftf #b11) + (.wait.vf) + (.mul.vf vf1 vf1 Q :mask #b111) + (.nop.vf) + (.nop.vf) + (.nop.vf) + (.svf (&-> a0-1 quad) vf1) + ) + (set! (-> v1-0 quad) (-> t0-0 quad)) + (set! (-> v1-0 x) (-> t0-0 z)) + (set! (-> v1-0 z) (- (-> t0-0 x))) + (let* ((f0-5 (-> arg1 w)) + (f1-1 (vector-dot t0-0 t1-0)) + (f0-6 (fmin f0-5 f1-1)) + (f2-0 f1-1) + (f2-2 (* f2-0 f2-0)) + (f3-0 f0-6) + (f2-4 (sqrtf (- f2-2 (* f3-0 f3-0)))) + (f3-4 (/ 1.0 f1-1)) + (f1-3 (* f2-4 f3-4)) + (f0-7 (* f0-6 f3-4)) + (a0-9 (new 'stack-no-clear 'vector)) + ) + (vector-float*! a0-9 t0-0 f1-3) + (let ((t0-1 arg2)) + (let ((a1-3 a0-9)) + (let ((a2-1 v1-0)) + (let ((t1-1 f0-7)) + (.mov vf7 t1-1) + ) + (.lvf vf5 (&-> a2-1 quad)) + ) + (.lvf vf4 (&-> a1-3 quad)) + ) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> t0-1 quad) vf6) + ) + (let ((v0-0 arg3)) + (let ((a1-4 (- f0-7))) + (.mov vf7 a1-4) + ) + (.lvf vf5 (&-> v1-0 quad)) + (.lvf vf4 (&-> a0-9 quad)) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> v0-0 quad) vf6) + v0-0 + ) + ) + ) + ) + ) + +;; definition for function circle-ray-intersection? +(defun circle-ray-intersection? ((arg0 vector) (arg1 vector) (arg2 float) (arg3 vector)) + (let ((f1-1 (- (-> arg3 x) (-> arg0 x))) + (f0-2 (- (-> arg3 z) (-> arg0 z))) + ) + (when (< (fabs (- (* (-> arg1 z) f1-1) (* (-> arg1 x) f0-2))) (-> arg3 w)) + (let ((f2-7 (+ (* (-> arg1 x) f1-1) (* (-> arg1 z) f0-2)))) + (cond + ((< f2-7 0.0) + (let ((f0-5 (+ (* f1-1 f1-1) (* f0-2 f0-2))) + (f1-4 (-> arg3 w)) + ) + (< f0-5 (* f1-4 f1-4)) + ) + ) + ((< arg2 f2-7) + (let* ((f0-8 (- (-> arg3 x) (+ (-> arg0 x) (* (-> arg1 x) arg2)))) + (f1-10 (- (-> arg3 z) (+ (-> arg0 z) (* (-> arg1 z) arg2)))) + (f0-11 (+ (* f0-8 f0-8) (* f1-10 f1-10))) + (f1-13 (-> arg3 w)) + ) + (< f0-11 (* f1-13 f1-13)) + ) + ) + (else + #t + ) + ) + ) + ) + ) + ) + +;; definition for function find-closest-circle-ray-intersection +(defun find-closest-circle-ray-intersection ((arg0 vector) (arg1 vector) (arg2 float) (arg3 int) (arg4 (inline-array vector)) (arg5 int)) + 1.0 + (let ((v0-0 -1)) + (vector-float*! (new 'stack-no-clear 'vector) arg1 arg2) + (let ((v1-3 0)) + (b! #t cfg-18 :delay (nop!)) + (label cfg-1) + (b! (logtest? arg5 (ash 1 v1-3)) cfg-17 :delay (empty-form)) + (let* ((t4-0 arg0) + (t3-1 arg1) + (f0-2 arg2) + (t2-6 (-> arg4 v1-3)) + (f2-1 (- (-> t2-6 x) (-> t4-0 x))) + (f1-2 (- (-> t2-6 z) (-> t4-0 z))) + ) + (b! + (not (when (< (fabs (- (* (-> t3-1 z) f2-1) (* (-> t3-1 x) f1-2))) (-> t2-6 w)) + (let ((f3-7 (+ (* (-> t3-1 x) f2-1) (* (-> t3-1 z) f1-2)))) + (cond + ((< f3-7 0.0) + (let ((f0-5 (+ (* f2-1 f2-1) (* f1-2 f1-2))) + (f1-5 (-> t2-6 w)) + ) + (< f0-5 (* f1-5 f1-5)) + ) + ) + ((< f0-2 f3-7) + (let* ((f1-9 (- (-> t2-6 x) (+ (-> t4-0 x) (* (-> t3-1 x) f0-2)))) + (f2-5 (- (-> t2-6 z) (+ (-> t4-0 z) (* (-> t3-1 z) f0-2)))) + (f0-10 (+ (* f1-9 f1-9) (* f2-5 f2-5))) + (f1-12 (-> t2-6 w)) + ) + (< f0-10 (* f1-12 f1-12)) + ) + ) + (else + #t + ) + ) + ) + ) + ) + cfg-17 + :delay (empty-form) + ) + ) + (set! v0-0 v1-3) + (b! #t cfg-20 :delay (nop!)) + (label cfg-17) + (+! v1-3 1) + (label cfg-18) + (b! (< v1-3 arg3) cfg-1) + ) + (label cfg-20) + v0-0 + ) + ) + +;; definition for function compute-dir-parm +(defun compute-dir-parm ((arg0 vector) (arg1 vector) (arg2 vector)) + (let ((a2-1 (the-as number (vector-dot arg0 arg2))) + (a3-1 #xffffffff80000000) + (v1-2 #x3f800000) + ) + (* (the-as float (logior (logand (the-as uint a2-1) a3-1) v1-2)) (- 1.0 (vector-dot arg0 arg1))) + ) + ) + +;; definition for method 18 of type nav-control +;; INFO: Used lq/sq +(defmethod avoid-spheres-1! nav-control ((obj nav-control) (arg0 nav-avoid-spheres-params)) + (local-vars (v1-28 int) (a0-29 int) (a1-3 float)) + (rlet ((acc :class vf) + (Q :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + ) + (init-vf0-vector) + (let ((s5-0 (new 'stack-no-clear 'nav-control-cfs-work))) + (set! (-> s5-0 in-dir quad) (-> arg0 travel quad)) + (set! (-> s5-0 in-dir y) 0.0) + (let ((v1-1 (-> s5-0 in-dir))) + (let ((f0-1 1.0)) + (.lvf vf1 (&-> v1-1 quad)) + (.mul.vf vf2 vf1 vf1 :mask #b111) + (let ((a0-4 f0-1)) + (.mov vf3 a0-4) + ) + ) + (.mul.x.vf acc vf0 vf2 :mask #b1000) + (.add.mul.y.vf acc vf0 vf2 acc :mask #b1000) + (.add.mul.z.vf vf2 vf0 vf2 acc :mask #b1000) + (.isqrt.vf Q vf3 vf2 :fsf #b0 :ftf #b11) + (.wait.vf) + (.mul.vf vf1 vf1 Q :mask #b111) + (.nop.vf) + (.nop.vf) + (.nop.vf) + (.svf (&-> v1-1 quad) vf1) + ) + (set! (-> s5-0 travel-len) (vector-dot (-> s5-0 in-dir) (-> arg0 travel))) + (set! (-> s5-0 right-dir quad) (-> s5-0 in-dir quad)) + (set! (-> s5-0 right-dir x) (- (-> s5-0 in-dir z))) + (set! (-> s5-0 right-dir z) (-> s5-0 in-dir x)) + (set! (-> s5-0 best-dir 0 quad) (-> s5-0 in-dir quad)) + (set! (-> s5-0 best-dir 1 quad) (-> s5-0 in-dir quad)) + (set! (-> s5-0 best-dir-angle 0) 0.0) + (set! (-> s5-0 best-dir-angle 1) 0.0) + (set! (-> s5-0 initial-ignore-mask) (the-as uint 0)) + (set! (-> s5-0 i-inside-sphere) -1) + (set! (-> s5-0 inside-sphere-dist) 0.0) + (let ((f0-10 65536.0)) + (set! (-> arg0 closest-sphere-dist2) (* f0-10 f0-10)) + ) + (dotimes (v1-10 (-> obj sphere-count)) + (let ((a0-13 (-> obj sphere-array v1-10))) + (let ((a1-2 (-> arg0 current-pos)) + (a2-0 a0-13) + ) + (.lvf vf2 (&-> a1-2 quad)) + (.lvf vf3 (&-> a2-0 quad)) + ) + (.sub.vf vf1 vf3 vf2) + (.mul.vf vf1 vf1 vf1) + (.add.z.vf vf1 vf1 vf1 :mask #b1) + (.mov a1-3 vf1) + (set! (-> s5-0 dist2) a1-3) + (let ((f0-14 (-> arg0 closest-sphere-dist2)) + (f1-0 (-> s5-0 dist2)) + (f2-0 (-> a0-13 r)) + ) + (set! (-> arg0 closest-sphere-dist2) (fmin f0-14 (- f1-0 (* f2-0 f2-0)))) + ) + (when (< (-> arg0 closest-sphere-dist2) 0.0) + (vector-! (the-as vector (-> s5-0 temp-dir)) (-> arg0 current-pos) (the-as vector a0-13)) + (set! (-> s5-0 temp-dir 0 y) 0.0) + (if (< 0.0 (vector-dot (the-as vector (-> s5-0 temp-dir)) (-> s5-0 in-dir))) + (+! (-> s5-0 initial-ignore-mask) (ash 1 v1-10)) + ) + (set! (-> s5-0 inside-dist) (- (-> a0-13 r) (sqrtf (-> s5-0 dist2)))) + (when (< (-> s5-0 inside-sphere-dist) (-> s5-0 inside-dist)) + (set! (-> s5-0 i-inside-sphere) v1-10) + (set! (-> s5-0 inside-sphere-dist) (-> s5-0 inside-dist)) + ) + ) + ) + ) + (set! (-> s5-0 i-first-sphere) (find-closest-circle-ray-intersection + (-> arg0 current-pos) + (-> s5-0 in-dir) + (-> s5-0 travel-len) + (-> obj sphere-count) + (-> obj sphere-array) + (the-as int (-> s5-0 initial-ignore-mask)) + ) + ) + (let ((v1-13 -1)) + (b! (!= (-> s5-0 i-first-sphere) v1-13) cfg-13 :delay (empty-form)) + ) + (set! (-> arg0 out-travel 0 quad) (-> arg0 travel quad)) + (set! (-> arg0 out-travel 1 quad) (the-as uint128 0)) + (set! (-> arg0 avoiding-sphere?) #f) + (b! #t cfg-43 :delay (nop!)) + (label cfg-13) + (+! (-> s5-0 initial-ignore-mask) (ash 1 (-> s5-0 i-first-sphere))) + (let ((a1-17 (-> obj sphere-array (-> s5-0 i-first-sphere)))) + (circle-tangent-directions + (-> arg0 current-pos) + a1-17 + (the-as vector (-> s5-0 temp-dir)) + (-> s5-0 temp-dir 1) + ) + ) + (dotimes (v1-20 2) + (let ((a0-28 (vector-dot (-> s5-0 right-dir) (-> s5-0 temp-dir v1-20)))) + (shift-arith-right-32 a0-29 a0-28 31) + ) + (let ((a0-30 (logand a0-29 1)) + (f0-27 (- 1.0 (vector-dot (-> s5-0 in-dir) (-> s5-0 temp-dir v1-20)))) + ) + (set! (-> s5-0 best-dir a0-30 quad) (-> s5-0 temp-dir v1-20 quad)) + (set! (-> s5-0 best-dir-angle a0-30) f0-27) + ) + ) + 0 + (set! (-> s5-0 sign) 1.0) + (let ((s3-0 0)) + (b! #t cfg-34 :delay (nop!)) + (label cfg-20) + (-> s5-0 i-first-sphere) + (set! (-> s5-0 dir-update) (the-as basic #t)) + (set! (-> s5-0 ignore-mask) (-> s5-0 initial-ignore-mask)) + (b! #t cfg-30 :delay (nop!)) + (label cfg-21) + (+! (-> s5-0 ignore-mask) (ash 1 v1-28)) + (circle-tangent-directions + (-> arg0 current-pos) + (-> obj sphere-array v1-28) + (the-as vector (-> s5-0 temp-dir)) + (-> s5-0 temp-dir 1) + ) + (set! (-> s5-0 dir-update) #f) + (dotimes (v1-30 2) + (let* ((f0-29 (-> s5-0 sign)) + (a1-31 (-> s5-0 temp-dir v1-30)) + (a0-39 (-> s5-0 in-dir)) + (a2-14 (-> s5-0 right-dir)) + (a3-7 (vector-dot a1-31 a2-14)) + (t0-1 #xffffffff80000000) + (a2-16 #x3f800000) + (f0-30 + (* f0-29 (* (the-as float (logior (logand a3-7 (the-as uint t0-1)) a2-16)) (- 1.0 (vector-dot a1-31 a0-39)))) + ) + ) + (when (< (-> s5-0 best-dir-angle s3-0) f0-30) + (set! (-> s5-0 best-dir s3-0 quad) (-> s5-0 temp-dir v1-30 quad)) + (set! (-> s5-0 best-dir-angle s3-0) f0-30) + (set! (-> s5-0 dir-update) (the-as basic #t)) + ) + ) + ) + (label cfg-30) + (when (-> s5-0 dir-update) + (set! v1-28 (find-closest-circle-ray-intersection + (-> arg0 current-pos) + (-> s5-0 best-dir s3-0) + (-> s5-0 travel-len) + (-> obj sphere-count) + (-> obj sphere-array) + (the-as int (-> s5-0 ignore-mask)) + ) + ) + (b! (!= v1-28 -1) cfg-21 :delay (nop!)) + ) + (set! (-> s5-0 sign) (* -1.0 (-> s5-0 sign))) + (+! s3-0 1) + (label cfg-34) + (b! (< s3-0 2) cfg-20) + ) + (when (!= (-> s5-0 i-inside-sphere) -1) + (let ((s4-1 (-> obj sphere-array (-> s5-0 i-inside-sphere)))) + (vector-! (-> s5-0 away-dir) (-> arg0 current-pos) (the-as vector s4-1)) + (set! (-> s5-0 away-dir y) 0.0) + (when (>= 40.96 (vector-length (-> s5-0 away-dir))) + (set! (-> s5-0 rand-angle) (* 65536.0 (rand-vu))) + (set! (-> s5-0 away-dir x) (cos (-> s5-0 rand-angle))) + (set! (-> s5-0 away-dir z) (sin (-> s5-0 rand-angle))) + ) + (let ((v1-51 (-> s5-0 away-dir))) + (let ((f0-42 1.0)) + (.lvf vf1 (&-> v1-51 quad)) + (.mul.vf vf2 vf1 vf1 :mask #b111) + (let ((a0-60 f0-42)) + (.mov vf3 a0-60) + ) + ) + (.mul.x.vf acc vf0 vf2 :mask #b1000) + (.add.mul.y.vf acc vf0 vf2 acc :mask #b1000) + (.add.mul.z.vf vf2 vf0 vf2 acc :mask #b1000) + (.isqrt.vf Q vf3 vf2 :fsf #b0 :ftf #b11) + (.wait.vf) + (.mul.vf vf1 vf1 Q :mask #b111) + (.nop.vf) + (.nop.vf) + (.nop.vf) + (.svf (&-> v1-51 quad) vf1) + ) + (let ((f0-44 (/ (-> s5-0 inside-sphere-dist) (-> s4-1 r)))) + (let ((v1-52 (-> s5-0 best-dir))) + (let ((a0-61 (-> s5-0 best-dir)) + (a1-39 (-> s5-0 away-dir)) + (f1-19 f0-44) + ) + (.lvf vf1 (&-> a0-61 0 quad)) + (.lvf vf2 (&-> a1-39 quad)) + (let ((a0-62 f1-19)) + (.mov vf4 a0-62) + ) + ) + (.add.x.vf vf3 vf0 vf0 :mask #b1000) + (.sub.vf vf2 vf2 vf1) + (.mul.x.vf vf2 vf2 vf4) + (.add.vf vf3 vf1 vf2 :mask #b111) + (.svf (&-> v1-52 0 quad) vf3) + ) + (let ((v1-53 (-> s5-0 best-dir 1))) + (let ((a0-63 (-> s5-0 best-dir 1)) + (a1-40 (-> s5-0 away-dir)) + ) + (.lvf vf1 (&-> a0-63 quad)) + (.lvf vf2 (&-> a1-40 quad)) + ) + (let ((a0-64 f0-44)) + (.mov vf4 a0-64) + ) + (.add.x.vf vf3 vf0 vf0 :mask #b1000) + (.sub.vf vf2 vf2 vf1) + (.mul.x.vf vf2 vf2 vf4) + (.add.vf vf3 vf1 vf2 :mask #b111) + (.svf (&-> v1-53 quad) vf3) + ) + ) + ) + (let ((v1-54 (-> s5-0 best-dir))) + (let ((f0-45 1.0)) + (.lvf vf1 (&-> v1-54 0 quad)) + (.mul.vf vf2 vf1 vf1 :mask #b111) + (let ((a0-66 f0-45)) + (.mov vf3 a0-66) + ) + ) + (.mul.x.vf acc vf0 vf2 :mask #b1000) + (.add.mul.y.vf acc vf0 vf2 acc :mask #b1000) + (.add.mul.z.vf vf2 vf0 vf2 acc :mask #b1000) + (.isqrt.vf Q vf3 vf2 :fsf #b0 :ftf #b11) + (.wait.vf) + (.mul.vf vf1 vf1 Q :mask #b111) + (.nop.vf) + (.nop.vf) + (.nop.vf) + (.svf (&-> v1-54 0 quad) vf1) + ) + (let ((v1-55 (-> s5-0 best-dir 1))) + (let ((f0-46 1.0)) + (.lvf vf1 (&-> v1-55 quad)) + (.mul.vf vf2 vf1 vf1 :mask #b111) + (let ((a0-68 f0-46)) + (.mov vf3 a0-68) + ) + ) + (.mul.x.vf acc vf0 vf2 :mask #b1000) + (.add.mul.y.vf acc vf0 vf2 acc :mask #b1000) + (.add.mul.z.vf vf2 vf0 vf2 acc :mask #b1000) + (.isqrt.vf Q vf3 vf2 :fsf #b0 :ftf #b11) + (.wait.vf) + (.mul.vf vf1 vf1 Q :mask #b111) + (.nop.vf) + (.nop.vf) + (.nop.vf) + (.svf (&-> v1-55 quad) vf1) + ) + ) + (vector-dot (-> s5-0 in-dir) (the-as vector (-> s5-0 best-dir))) + (vector-dot (-> s5-0 in-dir) (-> s5-0 best-dir 1)) + (let* ((f0-52 (vector-dot (-> arg0 pref-dir) (the-as vector (-> s5-0 best-dir)))) + (a1-41 (if (< (vector-dot (-> arg0 pref-dir) (-> s5-0 best-dir 1)) f0-52) + 0 + 1 + ) + ) + (v1-65 (- 1 a1-41)) + ) + (vector-float*! (the-as vector (-> arg0 out-travel)) (-> s5-0 best-dir a1-41) (-> s5-0 travel-len)) + (vector-float*! (-> arg0 out-travel 1) (-> s5-0 best-dir v1-65) (-> s5-0 travel-len)) + ) + ) + 0 + (set! (-> arg0 avoiding-sphere?) #t) + (label cfg-43) + (-> arg0 avoiding-sphere?) + ) + ) + +;; definition for method 19 of type nav-control +;; INFO: Used lq/sq +(defmethod avoid-spheres-2! nav-control ((obj nav-control) (arg0 nav-avoid-spheres-params)) + (local-vars (a0-32 int) (a1-3 float)) + (rlet ((acc :class vf) + (Q :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + ) + (init-vf0-vector) + (let ((s5-0 (new 'stack-no-clear 'nav-control-cfs-work))) + (set! (-> s5-0 in-dir quad) (-> arg0 travel quad)) + (set! (-> s5-0 in-dir y) 0.0) + (let ((v1-1 (-> s5-0 in-dir))) + (let ((f0-1 1.0)) + (.lvf vf1 (&-> v1-1 quad)) + (.mul.vf vf2 vf1 vf1 :mask #b111) + (let ((a0-4 f0-1)) + (.mov vf3 a0-4) + ) + ) + (.mul.x.vf acc vf0 vf2 :mask #b1000) + (.add.mul.y.vf acc vf0 vf2 acc :mask #b1000) + (.add.mul.z.vf vf2 vf0 vf2 acc :mask #b1000) + (.isqrt.vf Q vf3 vf2 :fsf #b0 :ftf #b11) + (.wait.vf) + (.mul.vf vf1 vf1 Q :mask #b111) + (.nop.vf) + (.nop.vf) + (.nop.vf) + (.svf (&-> v1-1 quad) vf1) + ) + (set! (-> s5-0 travel-len) (vector-dot (-> s5-0 in-dir) (-> arg0 travel))) + (set! (-> s5-0 right-dir quad) (-> s5-0 in-dir quad)) + (set! (-> s5-0 right-dir x) (- (-> s5-0 in-dir z))) + (set! (-> s5-0 right-dir z) (-> s5-0 in-dir x)) + (set! (-> s5-0 best-dir 0 quad) (-> s5-0 in-dir quad)) + (set! (-> s5-0 best-dir 1 quad) (-> s5-0 in-dir quad)) + (set! (-> s5-0 best-dir-angle 0) 0.0) + (set! (-> s5-0 best-dir-angle 1) 0.0) + (set! (-> s5-0 initial-ignore-mask) (the-as uint 0)) + (let ((f0-9 65536.0)) + (set! (-> arg0 closest-sphere-dist2) (* f0-9 f0-9)) + ) + (dotimes (v1-9 (-> obj sphere-count)) + (let ((a0-13 (-> obj sphere-array v1-9))) + (let ((a1-2 (-> arg0 current-pos)) + (a2-0 a0-13) + ) + (.lvf vf2 (&-> a1-2 quad)) + (.lvf vf3 (&-> a2-0 quad)) + ) + (.sub.vf vf1 vf3 vf2) + (.mul.vf vf1 vf1 vf1) + (.add.z.vf vf1 vf1 vf1 :mask #b1) + (.mov a1-3 vf1) + (set! (-> s5-0 dist2) a1-3) + (let ((f0-13 (-> arg0 closest-sphere-dist2)) + (f1-0 (-> s5-0 dist2)) + (f2-0 (-> a0-13 r)) + ) + (set! (-> arg0 closest-sphere-dist2) (fmin f0-13 (- f1-0 (* f2-0 f2-0)))) + ) + (when (< (-> arg0 closest-sphere-dist2) 0.0) + (vector-! (the-as vector (-> s5-0 temp-dir)) (-> arg0 current-pos) (the-as vector a0-13)) + (set! (-> s5-0 temp-dir 0 y) 0.0) + (if (< 0.0 (vector-dot (the-as vector (-> s5-0 temp-dir)) (-> s5-0 in-dir))) + (+! (-> s5-0 initial-ignore-mask) (ash 1 v1-9)) + ) + ) + ) + ) + (set! (-> s5-0 i-first-sphere) (find-closest-circle-ray-intersection + (-> arg0 current-pos) + (-> s5-0 in-dir) + (-> s5-0 travel-len) + (-> obj sphere-count) + (-> obj sphere-array) + (the-as int (-> s5-0 initial-ignore-mask)) + ) + ) + (let ((v1-12 -1)) + (b! (!= (-> s5-0 i-first-sphere) v1-12) cfg-11 :delay (empty-form)) + ) + (set! (-> arg0 out-travel 0 quad) (-> arg0 travel quad)) + (set! (-> arg0 out-travel 1 quad) (the-as uint128 0)) + (set! (-> arg0 avoiding-sphere?) #f) + (b! #t cfg-21 :delay (nop!)) + (label cfg-11) + (+! (-> s5-0 initial-ignore-mask) (ash 1 (-> s5-0 i-first-sphere))) + (let ((a1-15 (-> obj sphere-array (-> s5-0 i-first-sphere)))) + (circle-tangent-directions + (-> arg0 current-pos) + a1-15 + (the-as vector (-> s5-0 temp-dir)) + (-> s5-0 temp-dir 1) + ) + ) + (dotimes (v1-19 2) + (let ((a0-31 (vector-dot (-> s5-0 right-dir) (-> s5-0 temp-dir v1-19)))) + (shift-arith-right-32 a0-32 a0-31 31) + ) + (let ((a0-33 (logand a0-32 1)) + (f0-22 (- 1.0 (vector-dot (-> s5-0 in-dir) (-> s5-0 temp-dir v1-19)))) + ) + (set! (-> s5-0 best-dir a0-33 quad) (-> s5-0 temp-dir v1-19 quad)) + (set! (-> s5-0 best-dir-angle a0-33) f0-22) + ) + ) + 0 + (vector-dot (-> s5-0 in-dir) (the-as vector (-> s5-0 best-dir))) + (vector-dot (-> s5-0 in-dir) (-> s5-0 best-dir 1)) + (let* ((f0-28 (vector-dot (-> arg0 pref-dir) (the-as vector (-> s5-0 best-dir)))) + (a1-25 (if (< (vector-dot (-> arg0 pref-dir) (-> s5-0 best-dir 1)) f0-28) + 0 + 1 + ) + ) + (v1-32 (- 1 a1-25)) + ) + (vector-float*! (the-as vector (-> arg0 out-travel)) (-> s5-0 best-dir a1-25) (-> s5-0 travel-len)) + (vector-float*! (-> arg0 out-travel 1) (-> s5-0 best-dir v1-32) (-> s5-0 travel-len)) + ) + ) + 0 + (set! (-> arg0 avoiding-sphere?) #t) + (label cfg-21) + (-> arg0 avoiding-sphere?) + ) + ) + +;; definition for method 21 of type nav-control +;; WARN: Return type mismatch int vs none. +(defmethod clamp-vector-to-mesh-no-gaps nav-control ((obj nav-control) (arg0 vector) (arg1 nav-poly) (arg2 vector) (arg3 clamp-travel-vector-to-mesh-return-info)) + (clamp-vector-to-mesh-no-gaps (-> obj state mesh) arg0 arg1 arg2 arg3) + 0 + (none) + ) + +;; definition for method 19 of type nav-mesh +;; INFO: Used lq/sq +;; WARN: Stack slot offset 164 signed mismatch +;; WARN: Stack slot offset 168 signed mismatch +;; WARN: Stack slot offset 200 signed mismatch +;; WARN: Stack slot offset 204 signed mismatch +;; WARN: Stack slot offset 200 signed mismatch +;; WARN: Stack slot offset 204 signed mismatch +;; WARN: Stack slot offset 164 signed mismatch +;; WARN: Stack slot offset 168 signed mismatch +;; WARN: Stack slot offset 164 signed mismatch +;; WARN: Stack slot offset 180 signed mismatch +;; WARN: Stack slot offset 168 signed mismatch +;; WARN: Stack slot offset 184 signed mismatch +;; WARN: Stack slot offset 180 signed mismatch +;; WARN: Stack slot offset 184 signed mismatch +;; WARN: Stack slot offset 164 signed mismatch +;; WARN: Stack slot offset 168 signed mismatch +;; WARN: Stack slot offset 164 signed mismatch +;; WARN: Stack slot offset 168 signed mismatch +;; WARN: Stack slot offset 200 signed mismatch +;; WARN: Stack slot offset 204 signed mismatch +;; WARN: Stack slot offset 200 signed mismatch +;; WARN: Stack slot offset 204 signed mismatch +;; WARN: Stack slot offset 164 signed mismatch +;; WARN: Stack slot offset 168 signed mismatch +;; WARN: Stack slot offset 164 signed mismatch +;; WARN: Stack slot offset 180 signed mismatch +;; WARN: Stack slot offset 168 signed mismatch +;; WARN: Stack slot offset 184 signed mismatch +;; WARN: Stack slot offset 180 signed mismatch +;; WARN: Stack slot offset 184 signed mismatch +;; WARN: Stack slot offset 164 signed mismatch +;; WARN: Stack slot offset 168 signed mismatch +;; WARN: Stack slot offset 164 signed mismatch +;; WARN: Stack slot offset 168 signed mismatch +;; WARN: Stack slot offset 200 signed mismatch +;; WARN: Stack slot offset 204 signed mismatch +;; WARN: Stack slot offset 200 signed mismatch +;; WARN: Stack slot offset 204 signed mismatch +;; WARN: Stack slot offset 164 signed mismatch +;; WARN: Stack slot offset 168 signed mismatch +;; WARN: Stack slot offset 164 signed mismatch +;; WARN: Stack slot offset 180 signed mismatch +;; WARN: Stack slot offset 168 signed mismatch +;; WARN: Stack slot offset 184 signed mismatch +;; WARN: Stack slot offset 180 signed mismatch +;; WARN: Stack slot offset 184 signed mismatch +;; WARN: Stack slot offset 164 signed mismatch +;; WARN: Stack slot offset 168 signed mismatch +;; WARN: Stack slot offset 164 signed mismatch +;; WARN: Stack slot offset 168 signed mismatch +;; WARN: Stack slot offset 164 signed mismatch +;; WARN: Stack slot offset 168 signed mismatch +;; WARN: Stack slot offset 164 signed mismatch +;; WARN: Stack slot offset 180 signed mismatch +;; WARN: Stack slot offset 168 signed mismatch +;; WARN: Stack slot offset 184 signed mismatch +;; WARN: Stack slot offset 180 signed mismatch +;; WARN: Stack slot offset 184 signed mismatch +;; WARN: Stack slot offset 164 signed mismatch +;; WARN: Stack slot offset 168 signed mismatch +;; WARN: Stack slot offset 164 signed mismatch +;; WARN: Stack slot offset 168 signed mismatch +;; WARN: Stack slot offset 200 signed mismatch +;; WARN: Stack slot offset 204 signed mismatch +;; WARN: Stack slot offset 200 signed mismatch +;; WARN: Stack slot offset 204 signed mismatch +;; WARN: Stack slot offset 164 signed mismatch +;; WARN: Stack slot offset 168 signed mismatch +;; WARN: Stack slot offset 164 signed mismatch +;; WARN: Stack slot offset 180 signed mismatch +;; WARN: Stack slot offset 168 signed mismatch +;; WARN: Stack slot offset 184 signed mismatch +;; WARN: Stack slot offset 180 signed mismatch +;; WARN: Stack slot offset 184 signed mismatch +;; WARN: Stack slot offset 164 signed mismatch +;; WARN: Stack slot offset 168 signed mismatch +;; WARN: Stack slot offset 164 signed mismatch +;; WARN: Stack slot offset 168 signed mismatch +;; WARN: Stack slot offset 200 signed mismatch +;; WARN: Stack slot offset 204 signed mismatch +;; WARN: Stack slot offset 200 signed mismatch +;; WARN: Stack slot offset 204 signed mismatch +;; WARN: Stack slot offset 164 signed mismatch +;; WARN: Stack slot offset 168 signed mismatch +;; WARN: Stack slot offset 164 signed mismatch +;; WARN: Stack slot offset 180 signed mismatch +;; WARN: Stack slot offset 168 signed mismatch +;; WARN: Stack slot offset 184 signed mismatch +;; WARN: Stack slot offset 180 signed mismatch +;; WARN: Stack slot offset 184 signed mismatch +;; WARN: Stack slot offset 164 signed mismatch +;; WARN: Stack slot offset 168 signed mismatch +;; WARN: Stack slot offset 164 signed mismatch +;; WARN: Stack slot offset 168 signed mismatch +;; WARN: Stack slot offset 200 signed mismatch +;; WARN: Stack slot offset 204 signed mismatch +;; WARN: Stack slot offset 200 signed mismatch +;; WARN: Stack slot offset 204 signed mismatch +;; WARN: Stack slot offset 164 signed mismatch +;; WARN: Stack slot offset 168 signed mismatch +;; WARN: Stack slot offset 164 signed mismatch +;; WARN: Stack slot offset 180 signed mismatch +;; WARN: Stack slot offset 168 signed mismatch +;; WARN: Stack slot offset 184 signed mismatch +;; WARN: Stack slot offset 180 signed mismatch +;; WARN: Stack slot offset 184 signed mismatch +;; WARN: Stack slot offset 164 signed mismatch +;; WARN: Stack slot offset 168 signed mismatch +;; WARN: Stack slot offset 164 signed mismatch +;; WARN: Stack slot offset 168 signed mismatch +;; WARN: Stack slot offset 164 signed mismatch +;; WARN: Stack slot offset 168 signed mismatch +;; WARN: Stack slot offset 164 signed mismatch +;; WARN: Stack slot offset 180 signed mismatch +;; WARN: Stack slot offset 168 signed mismatch +;; WARN: Stack slot offset 184 signed mismatch +;; WARN: Stack slot offset 180 signed mismatch +;; WARN: Stack slot offset 184 signed mismatch +;; WARN: Stack slot offset 164 signed mismatch +;; WARN: Stack slot offset 168 signed mismatch +;; WARN: Return type mismatch int vs none. +(defmethod clamp-vector-to-mesh-no-gaps nav-mesh ((obj nav-mesh) (arg0 vector) (arg1 nav-poly) (arg2 vector) (arg3 clamp-travel-vector-to-mesh-return-info)) + (local-vars + (v1-12 symbol) + (sv-112 nav-ray) + (sv-116 vector) + (sv-120 symbol) + (sv-124 nav-mesh-work) + (sv-128 int) + (sv-136 int) + (sv-144 nav-mesh-work) + (sv-148 nav-poly) + (sv-152 uint8) + (sv-156 (pointer int8)) + (sv-160 (pointer int8)) + (sv-164 float) + (sv-168 float) + (sv-172 vector) + (sv-176 vector) + (sv-180 float) + (sv-184 float) + (sv-188 uint) + (sv-192 vector) + (sv-196 vector) + (sv-200 float) + (sv-204 float) + (sv-208 float) + (sv-212 float) + ) + (rlet ((acc :class vf) + (Q :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + ) + (init-vf0-vector) + (set! (-> arg3 found-boundary) #f) + (set! (-> arg3 gap-poly) #f) + (set! sv-112 (new 'stack-no-clear 'nav-ray)) + (set! sv-116 (new 'stack-no-clear 'vector)) + (set! sv-120 (the-as symbol #f)) + (set! sv-124 (-> obj work)) + (vector-! sv-116 arg0 (-> obj bounds)) + (set! (-> sv-112 current-poly) arg1) + (set! (-> sv-112 current-pos quad) (-> sv-116 quad)) + (vector+! (-> sv-112 dest-pos) sv-116 arg2) + (let* ((t2-0 obj) + (v1-11 (-> sv-112 dest-pos)) + (a1-4 (-> arg1 vertex-count)) + (a2-1 (-> arg1 vertex)) + (t1-4 (-> t2-0 work vert0-table)) + (t2-2 (-> t2-0 work vert1-table)) + ) + (dotimes (t3-0 (the-as int a1-4)) + (let* ((t4-3 (-> a2-1 (-> t1-4 t3-0))) + (t5-3 (-> a2-1 (-> t2-2 t3-0))) + (f0-1 (- (-> t4-3 z) (-> t5-3 z))) + (f1-2 (- (-> t5-3 x) (-> t4-3 x))) + (f2-2 (- (-> v1-11 x) (-> t4-3 x))) + (f3-2 (- (-> v1-11 z) (-> t4-3 z))) + (f0-3 (+ (* f2-2 f0-1) (* f3-2 f1-2))) + ) + (when (< 0.0 f0-3) + (set! v1-12 #f) + (goto cfg-7) + ) + ) + ) + ) + (set! v1-12 #t) + (label cfg-7) + (b! v1-12 cfg-41 :delay (nop!)) + (set! sv-128 0) + (let ((v1-16 sv-112)) + (vector-! (-> v1-16 dir) (-> v1-16 dest-pos) (-> v1-16 current-pos)) + (set! (-> v1-16 dir y) 0.0) + (let ((a1-6 (-> v1-16 dir))) + (let ((f0-5 1.0)) + (.lvf vf1 (&-> a1-6 quad)) + (.mul.vf vf2 vf1 vf1 :mask #b111) + (let ((a2-4 f0-5)) + (.mov vf3 a2-4) + ) + ) + (.mul.x.vf acc vf0 vf2 :mask #b1000) + (.add.mul.y.vf acc vf0 vf2 acc :mask #b1000) + (.add.mul.z.vf vf2 vf0 vf2 acc :mask #b1000) + (.isqrt.vf Q vf3 vf2 :fsf #b0 :ftf #b11) + (.wait.vf) + (.mul.vf vf1 vf1 Q :mask #b111) + (.nop.vf) + (.nop.vf) + (.nop.vf) + (.svf (&-> a1-6 quad) vf1) + ) + (set! (-> v1-16 next-poly) #f) + (set! (-> v1-16 len) 0.0) + (set! (-> v1-16 last-edge) -1) + (set! (-> v1-16 terminated) #f) + (set! (-> v1-16 reached-dest) #f) + (set! (-> v1-16 hit-boundary) #f) + (set! (-> v1-16 hit-gap) #f) + (set! (-> v1-16 ignore) (the-as uint 3)) + ) + 0 + (until (or (>= sv-128 15) (-> sv-112 terminated)) + (set! sv-128 (+ sv-128 1)) + (let ((a1-9 obj) + (v1-20 sv-112) + ) + (set! sv-136 -1) + (set! sv-144 (-> a1-9 work)) + (set! sv-148 (-> v1-20 current-poly)) + (set! sv-152 (-> v1-20 current-poly vertex-count)) + (set! sv-156 (-> a1-9 work vert0-table)) + (set! sv-160 (-> a1-9 work vert1-table)) + (set! sv-164 (- (-> v1-20 dest-pos x) (-> v1-20 current-pos x))) + (set! sv-168 (- (-> v1-20 dest-pos z) (-> v1-20 current-pos z))) + (dotimes (a2-14 (the-as int sv-152)) + (set! sv-172 (-> sv-148 vertex (-> sv-156 a2-14))) + (set! sv-176 (-> sv-148 vertex (-> sv-160 a2-14))) + (set! sv-180 (- (-> sv-172 z) (-> sv-176 z))) + (set! sv-184 (- (-> sv-176 x) (-> sv-172 x))) + (let ((f0-17 (+ (* sv-164 sv-180) (* sv-168 sv-184)))) + (when (< 0.0 f0-17) + (let ((f1-15 (+ (* sv-180 (- (-> sv-172 x) (-> v1-20 current-pos x))) + (* sv-184 (- (-> sv-172 z) (-> v1-20 current-pos z))) + ) + ) + ) + (when (< f1-15 f0-17) + (set! sv-136 a2-14) + (let ((f0-19 (fmax 0.0 (/ f1-15 f0-17)))) + (set! sv-164 (* sv-164 f0-19)) + (set! sv-168 (* sv-168 f0-19)) + ) + ) + ) + ) + ) + ) + (let ((f0-23 (+ (* sv-164 (-> v1-20 dir x)) (* sv-168 (-> v1-20 dir z))))) + (+! (-> v1-20 len) f0-23) + ) + 0 + (set! (-> v1-20 next-poly) #f) + (cond + ((= sv-136 -1) + (set! (-> v1-20 current-pos quad) (-> v1-20 dest-pos quad)) + (set! (-> v1-20 reached-dest) #t) + (set! (-> v1-20 terminated) #t) + ) + (else + (+! (-> v1-20 current-pos x) sv-164) + (+! (-> v1-20 current-pos z) sv-168) + (set! sv-188 (-> sv-148 adj-poly sv-136)) + (if (!= sv-188 255) + (set! (-> v1-20 next-poly) (-> a1-9 poly-array sv-188)) + ) + (cond + ((and (-> v1-20 next-poly) (zero? (logand (-> v1-20 next-poly pat) (-> v1-20 ignore)))) + (set! (-> v1-20 current-poly) (-> v1-20 next-poly)) + ) + (else + (set! (-> v1-20 last-edge) sv-136) + (if (-> v1-20 next-poly) + (set! (-> v1-20 hit-gap) #t) + (set! (-> v1-20 hit-boundary) #t) + ) + (set! (-> v1-20 terminated) #t) + ) + ) + ) + ) + ) + 0 + ) + (cond + ((or (-> sv-112 hit-boundary) (-> sv-112 hit-gap)) + (set! sv-192 (-> sv-112 current-poly vertex (-> sv-124 vert0-table (-> sv-112 last-edge)))) + (set! sv-196 (-> sv-112 current-poly vertex (-> sv-124 vert1-table (-> sv-112 last-edge)))) + (set! sv-200 (- (-> sv-192 z) (-> sv-196 z))) + (set! sv-204 (- (-> sv-196 x) (-> sv-192 x))) + (set! sv-208 (-> arg2 x)) + (set! sv-212 (-> arg2 z)) + (let* ((f0-35 sv-200) + (f0-37 (* f0-35 f0-35)) + (f1-27 sv-204) + (f0-39 (sqrtf (+ f0-37 (* f1-27 f1-27)))) + (f0-41 (/ 1.0 f0-39)) + ) + (set! sv-200 (* sv-200 f0-41)) + (set! sv-204 (* sv-204 f0-41)) + ) + (set! (-> arg3 found-boundary) #t) + (vector+! (-> arg3 intersection) (-> sv-112 current-pos) (-> obj bounds)) + (set! (-> arg3 boundary-normal x) sv-200) + (set! (-> arg3 boundary-normal y) 0.0) + (set! (-> arg3 boundary-normal z) sv-204) + (set! (-> arg3 poly) (-> sv-112 current-poly)) + (set! (-> arg3 edge) (-> sv-112 last-edge)) + (vector+! (-> arg3 vert-0) sv-192 (-> obj bounds)) + (vector+! (-> arg3 vert-1) sv-196 (-> obj bounds)) + (set! (-> sv-112 dest-pos quad) (-> sv-112 current-pos quad)) + (if (-> sv-112 hit-gap) + (set! (-> arg3 gap-poly) (-> sv-112 next-poly)) + ) + ) + (else + ) + ) + (vector-! arg2 (-> sv-112 current-pos) sv-116) + 0 + (label cfg-41) + 0 + (none) + ) + ) + +;; definition for method 21 of type nav-mesh +;; WARN: Return type mismatch object vs none. +;; WARN: Function (method 21 nav-mesh) has a return type of none, but the expression builder found a return statement. +(defmethod find-adjacent-bounds-one nav-mesh ((obj nav-mesh) (arg0 vector) (arg1 nav-poly) (arg2 int) (arg3 int)) + (local-vars (sv-16 nav-poly)) + (if (zero? arg3) + (set! arg2 (the-as int (mod (the-as uint (+ arg2 1)) (the-as uint (-> arg1 vertex-count))))) + ) + (set! sv-16 arg1) + (let ((s2-0 (-> sv-16 vertex arg2)) + (s3-0 sv-16) + (s1-0 100) + ) + (while (begin (label cfg-21) (nonzero? s1-0)) + (+! s1-0 -1) + (if (nonzero? arg3) + (set! arg2 + (the-as + int + (mod (the-as uint (+ (+ arg2 arg3) (the-as int (-> s3-0 vertex-count)))) (the-as uint (-> s3-0 vertex-count))) + ) + ) + ) + (let ((v1-12 (-> s3-0 adj-poly arg2))) + (cond + ((= v1-12 255) + (if (zero? arg3) + (set! arg2 (the-as int (mod (the-as uint (+ arg2 1)) (the-as uint (-> s3-0 vertex-count))))) + ) + (vector+! arg0 (-> s3-0 vertex arg2) (-> obj bounds)) + (return #f) + ) + (else + (set! s3-0 (-> obj poly-array v1-12)) + (when (= s3-0 sv-16) + (format 0 "ERROR: find-adjacent-bounds-one cur-poly = start-poly after step~%") + (return #f) + ) + (dotimes (s0-0 (the-as int (-> s3-0 vertex-count))) + (when (vector= (-> s3-0 vertex s0-0) s2-0) + (set! arg2 s0-0) + (goto cfg-21) + ) + ) + (format 0 "ERROR: find-adjacent-bounds-one couldn't match vertex~%") + (return #f) + ) + ) + ) + ) + ) + (format 0 "ERROR: find-adjacent-bounds-one took too many steps~%") + (none) + ) + +;; definition for method 20 of type nav-mesh +;; WARN: Return type mismatch int vs none. +(defmethod set-normals-from-adjacent-bounds nav-mesh ((obj nav-mesh) (arg0 clamp-travel-vector-to-mesh-return-info)) + (find-adjacent-bounds-one obj (-> arg0 vert-prev) (-> arg0 poly) (-> arg0 edge) -1) + (find-adjacent-bounds-one obj (-> arg0 vert-next) (-> arg0 poly) (-> arg0 edge) 0) + (vector-! (-> arg0 prev-normal) (-> arg0 vert-0) (-> arg0 vert-prev)) + (vector-! (-> arg0 next-normal) (-> arg0 vert-next) (-> arg0 vert-1)) + (vector-normalize! (-> arg0 prev-normal) 1.0) + (vector-normalize! (-> arg0 next-normal) 1.0) + (let ((f0-0 (-> arg0 prev-normal x))) + (set! (-> arg0 prev-normal x) (-> arg0 prev-normal z)) + (set! (-> arg0 prev-normal z) f0-0) + ) + (let ((f0-1 (-> arg0 next-normal x))) + (set! (-> arg0 next-normal x) (-> arg0 next-normal z)) + (set! (-> arg0 next-normal z) f0-1) + ) + (set! (-> arg0 prev-normal x) (- (-> arg0 prev-normal x))) + (set! (-> arg0 next-normal x) (- (-> arg0 next-normal x))) + 0 + (none) + ) + +;; definition for method 18 of type nav-mesh +;; INFO: Used lq/sq +;; WARN: Stack slot offset 156 signed mismatch +;; WARN: Stack slot offset 160 signed mismatch +;; WARN: Stack slot offset 192 signed mismatch +;; WARN: Stack slot offset 196 signed mismatch +;; WARN: Stack slot offset 192 signed mismatch +;; WARN: Stack slot offset 196 signed mismatch +;; WARN: Stack slot offset 192 signed mismatch +;; WARN: Stack slot offset 200 signed mismatch +;; WARN: Stack slot offset 196 signed mismatch +;; WARN: Stack slot offset 204 signed mismatch +;; WARN: Stack slot offset 200 signed mismatch +;; WARN: Stack slot offset 192 signed mismatch +;; WARN: Stack slot offset 204 signed mismatch +;; WARN: Stack slot offset 196 signed mismatch +;; WARN: Stack slot offset 200 signed mismatch +;; WARN: Stack slot offset 204 signed mismatch +;; WARN: Stack slot offset 156 signed mismatch +;; WARN: Stack slot offset 160 signed mismatch +;; WARN: Stack slot offset 156 signed mismatch +;; WARN: Stack slot offset 172 signed mismatch +;; WARN: Stack slot offset 160 signed mismatch +;; WARN: Stack slot offset 176 signed mismatch +;; WARN: Stack slot offset 172 signed mismatch +;; WARN: Stack slot offset 176 signed mismatch +;; WARN: Stack slot offset 156 signed mismatch +;; WARN: Stack slot offset 160 signed mismatch +;; WARN: Stack slot offset 156 signed mismatch +;; WARN: Stack slot offset 160 signed mismatch +;; WARN: Stack slot offset 192 signed mismatch +;; WARN: Stack slot offset 196 signed mismatch +;; WARN: Stack slot offset 192 signed mismatch +;; WARN: Stack slot offset 196 signed mismatch +;; WARN: Stack slot offset 192 signed mismatch +;; WARN: Stack slot offset 200 signed mismatch +;; WARN: Stack slot offset 196 signed mismatch +;; WARN: Stack slot offset 204 signed mismatch +;; WARN: Stack slot offset 200 signed mismatch +;; WARN: Stack slot offset 192 signed mismatch +;; WARN: Stack slot offset 204 signed mismatch +;; WARN: Stack slot offset 196 signed mismatch +;; WARN: Stack slot offset 200 signed mismatch +;; WARN: Stack slot offset 204 signed mismatch +;; WARN: Stack slot offset 156 signed mismatch +;; WARN: Stack slot offset 160 signed mismatch +;; WARN: Stack slot offset 156 signed mismatch +;; WARN: Stack slot offset 172 signed mismatch +;; WARN: Stack slot offset 160 signed mismatch +;; WARN: Stack slot offset 176 signed mismatch +;; WARN: Stack slot offset 172 signed mismatch +;; WARN: Stack slot offset 176 signed mismatch +;; WARN: Stack slot offset 156 signed mismatch +;; WARN: Stack slot offset 160 signed mismatch +;; WARN: Stack slot offset 156 signed mismatch +;; WARN: Stack slot offset 160 signed mismatch +;; WARN: Stack slot offset 192 signed mismatch +;; WARN: Stack slot offset 196 signed mismatch +;; WARN: Stack slot offset 192 signed mismatch +;; WARN: Stack slot offset 196 signed mismatch +;; WARN: Stack slot offset 192 signed mismatch +;; WARN: Stack slot offset 200 signed mismatch +;; WARN: Stack slot offset 196 signed mismatch +;; WARN: Stack slot offset 204 signed mismatch +;; WARN: Stack slot offset 200 signed mismatch +;; WARN: Stack slot offset 192 signed mismatch +;; WARN: Stack slot offset 204 signed mismatch +;; WARN: Stack slot offset 196 signed mismatch +;; WARN: Stack slot offset 200 signed mismatch +;; WARN: Stack slot offset 204 signed mismatch +;; WARN: Stack slot offset 156 signed mismatch +;; WARN: Stack slot offset 160 signed mismatch +;; WARN: Stack slot offset 156 signed mismatch +;; WARN: Stack slot offset 172 signed mismatch +;; WARN: Stack slot offset 160 signed mismatch +;; WARN: Stack slot offset 176 signed mismatch +;; WARN: Stack slot offset 172 signed mismatch +;; WARN: Stack slot offset 176 signed mismatch +;; WARN: Stack slot offset 156 signed mismatch +;; WARN: Stack slot offset 160 signed mismatch +;; WARN: Stack slot offset 156 signed mismatch +;; WARN: Stack slot offset 160 signed mismatch +;; WARN: Stack slot offset 156 signed mismatch +;; WARN: Stack slot offset 160 signed mismatch +;; WARN: Stack slot offset 156 signed mismatch +;; WARN: Stack slot offset 172 signed mismatch +;; WARN: Stack slot offset 160 signed mismatch +;; WARN: Stack slot offset 176 signed mismatch +;; WARN: Stack slot offset 172 signed mismatch +;; WARN: Stack slot offset 176 signed mismatch +;; WARN: Stack slot offset 156 signed mismatch +;; WARN: Stack slot offset 160 signed mismatch +;; WARN: Stack slot offset 156 signed mismatch +;; WARN: Stack slot offset 160 signed mismatch +;; WARN: Stack slot offset 192 signed mismatch +;; WARN: Stack slot offset 196 signed mismatch +;; WARN: Stack slot offset 192 signed mismatch +;; WARN: Stack slot offset 196 signed mismatch +;; WARN: Stack slot offset 192 signed mismatch +;; WARN: Stack slot offset 200 signed mismatch +;; WARN: Stack slot offset 196 signed mismatch +;; WARN: Stack slot offset 204 signed mismatch +;; WARN: Stack slot offset 200 signed mismatch +;; WARN: Stack slot offset 192 signed mismatch +;; WARN: Stack slot offset 204 signed mismatch +;; WARN: Stack slot offset 196 signed mismatch +;; WARN: Stack slot offset 200 signed mismatch +;; WARN: Stack slot offset 204 signed mismatch +;; WARN: Stack slot offset 156 signed mismatch +;; WARN: Stack slot offset 160 signed mismatch +;; WARN: Stack slot offset 156 signed mismatch +;; WARN: Stack slot offset 172 signed mismatch +;; WARN: Stack slot offset 160 signed mismatch +;; WARN: Stack slot offset 176 signed mismatch +;; WARN: Stack slot offset 172 signed mismatch +;; WARN: Stack slot offset 176 signed mismatch +;; WARN: Stack slot offset 156 signed mismatch +;; WARN: Stack slot offset 160 signed mismatch +;; WARN: Stack slot offset 156 signed mismatch +;; WARN: Stack slot offset 160 signed mismatch +;; WARN: Stack slot offset 192 signed mismatch +;; WARN: Stack slot offset 196 signed mismatch +;; WARN: Stack slot offset 192 signed mismatch +;; WARN: Stack slot offset 196 signed mismatch +;; WARN: Stack slot offset 192 signed mismatch +;; WARN: Stack slot offset 200 signed mismatch +;; WARN: Stack slot offset 196 signed mismatch +;; WARN: Stack slot offset 204 signed mismatch +;; WARN: Stack slot offset 200 signed mismatch +;; WARN: Stack slot offset 192 signed mismatch +;; WARN: Stack slot offset 204 signed mismatch +;; WARN: Stack slot offset 196 signed mismatch +;; WARN: Stack slot offset 200 signed mismatch +;; WARN: Stack slot offset 204 signed mismatch +;; WARN: Stack slot offset 156 signed mismatch +;; WARN: Stack slot offset 160 signed mismatch +;; WARN: Stack slot offset 156 signed mismatch +;; WARN: Stack slot offset 172 signed mismatch +;; WARN: Stack slot offset 160 signed mismatch +;; WARN: Stack slot offset 176 signed mismatch +;; WARN: Stack slot offset 172 signed mismatch +;; WARN: Stack slot offset 176 signed mismatch +;; WARN: Stack slot offset 156 signed mismatch +;; WARN: Stack slot offset 160 signed mismatch +;; WARN: Stack slot offset 156 signed mismatch +;; WARN: Stack slot offset 160 signed mismatch +;; WARN: Stack slot offset 192 signed mismatch +;; WARN: Stack slot offset 196 signed mismatch +;; WARN: Stack slot offset 192 signed mismatch +;; WARN: Stack slot offset 196 signed mismatch +;; WARN: Stack slot offset 192 signed mismatch +;; WARN: Stack slot offset 200 signed mismatch +;; WARN: Stack slot offset 196 signed mismatch +;; WARN: Stack slot offset 204 signed mismatch +;; WARN: Stack slot offset 200 signed mismatch +;; WARN: Stack slot offset 192 signed mismatch +;; WARN: Stack slot offset 204 signed mismatch +;; WARN: Stack slot offset 196 signed mismatch +;; WARN: Stack slot offset 200 signed mismatch +;; WARN: Stack slot offset 204 signed mismatch +;; WARN: Stack slot offset 156 signed mismatch +;; WARN: Stack slot offset 160 signed mismatch +;; WARN: Stack slot offset 156 signed mismatch +;; WARN: Stack slot offset 172 signed mismatch +;; WARN: Stack slot offset 160 signed mismatch +;; WARN: Stack slot offset 176 signed mismatch +;; WARN: Stack slot offset 172 signed mismatch +;; WARN: Stack slot offset 176 signed mismatch +;; WARN: Stack slot offset 156 signed mismatch +;; WARN: Stack slot offset 160 signed mismatch +;; WARN: Stack slot offset 156 signed mismatch +;; WARN: Stack slot offset 160 signed mismatch +;; WARN: Stack slot offset 156 signed mismatch +;; WARN: Stack slot offset 160 signed mismatch +;; WARN: Stack slot offset 156 signed mismatch +;; WARN: Stack slot offset 172 signed mismatch +;; WARN: Stack slot offset 160 signed mismatch +;; WARN: Stack slot offset 176 signed mismatch +;; WARN: Stack slot offset 172 signed mismatch +;; WARN: Stack slot offset 176 signed mismatch +;; WARN: Stack slot offset 156 signed mismatch +;; WARN: Stack slot offset 160 signed mismatch +;; WARN: Return type mismatch int vs none. +(defmethod clamp-vector-to-mesh-cross-gaps nav-mesh ((obj nav-mesh) + (arg0 vector) + (arg1 nav-poly) + (arg2 vector) + (arg3 float) + (arg4 symbol) + (arg5 clamp-travel-vector-to-mesh-return-info) + ) + (local-vars + (v1-11 symbol) + (v1-22 symbol) + (sv-96 nav-ray) + (sv-100 symbol) + (sv-104 int) + (sv-112 nav-mesh-work) + (sv-120 int) + (sv-128 int) + (sv-136 nav-mesh-work) + (sv-140 nav-poly) + (sv-144 uint8) + (sv-148 (pointer int8)) + (sv-152 (pointer int8)) + (sv-156 float) + (sv-160 float) + (sv-164 vector) + (sv-168 vector) + (sv-172 float) + (sv-176 float) + (sv-180 uint) + (sv-184 vector) + (sv-188 vector) + (sv-192 float) + (sv-196 float) + (sv-200 float) + (sv-204 float) + ) + (rlet ((acc :class vf) + (Q :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + ) + (init-vf0-vector) + (when arg5 + (set! (-> arg5 found-boundary) #f) + (set! (-> arg5 gap-poly) #f) + ) + (set! sv-96 (new 'stack-no-clear 'nav-ray)) + (set! sv-100 (the-as symbol #f)) + (set! sv-104 0) + (set! sv-112 (-> obj work)) + (set! (-> sv-96 current-poly) arg1) + (set! (-> sv-96 current-pos quad) (-> arg0 quad)) + (vector+! (-> sv-96 dest-pos) arg0 arg2) + (let* ((t6-0 obj) + (t4-2 arg1) + (v1-10 (-> sv-96 dest-pos)) + (t3-3 (-> t4-2 vertex-count)) + (t4-3 (-> t4-2 vertex)) + (t5-1 (-> t6-0 work vert0-table)) + (t6-2 (-> t6-0 work vert1-table)) + ) + (dotimes (t7-0 (the-as int t3-3)) + (let* ((t8-3 (-> t4-3 (-> t5-1 t7-0))) + (t9-3 (-> t4-3 (-> t6-2 t7-0))) + (f0-1 (- (-> t8-3 z) (-> t9-3 z))) + (f1-2 (- (-> t9-3 x) (-> t8-3 x))) + (f2-2 (- (-> v1-10 x) (-> t8-3 x))) + (f3-2 (- (-> v1-10 z) (-> t8-3 z))) + (f0-3 (+ (* f2-2 f0-1) (* f3-2 f1-2))) + ) + (when (< 0.0 f0-3) + (set! v1-11 #f) + (goto cfg-9) + ) + ) + ) + ) + (set! v1-11 #t) + (label cfg-9) + (b! v1-11 cfg-62 :delay (nop!)) + (until sv-100 + (set! sv-120 0) + (let ((v1-15 sv-96)) + (vector-! (-> v1-15 dir) (-> v1-15 dest-pos) (-> v1-15 current-pos)) + (set! (-> v1-15 dir y) 0.0) + (let ((t3-5 (-> v1-15 dir))) + (let ((f0-5 1.0)) + (.lvf vf1 (&-> t3-5 quad)) + (.mul.vf vf2 vf1 vf1 :mask #b111) + (let ((t4-6 f0-5)) + (.mov vf3 t4-6) + ) + ) + (.mul.x.vf acc vf0 vf2 :mask #b1000) + (.add.mul.y.vf acc vf0 vf2 acc :mask #b1000) + (.add.mul.z.vf vf2 vf0 vf2 acc :mask #b1000) + (.isqrt.vf Q vf3 vf2 :fsf #b0 :ftf #b11) + (.wait.vf) + (.mul.vf vf1 vf1 Q :mask #b111) + (.nop.vf) + (.nop.vf) + (.nop.vf) + (.svf (&-> t3-5 quad) vf1) + ) + (set! (-> v1-15 next-poly) #f) + (set! (-> v1-15 len) 0.0) + (set! (-> v1-15 last-edge) -1) + (set! (-> v1-15 terminated) #f) + (set! (-> v1-15 reached-dest) #f) + (set! (-> v1-15 hit-boundary) #f) + (set! (-> v1-15 hit-gap) #f) + (set! (-> v1-15 ignore) (the-as uint 3)) + ) + 0 + (until v1-22 + (set! sv-120 (+ sv-120 1)) + (let ((t3-8 obj) + (v1-19 sv-96) + ) + (set! sv-128 -1) + (set! sv-136 (-> t3-8 work)) + (set! sv-140 (-> v1-19 current-poly)) + (set! sv-144 (-> v1-19 current-poly vertex-count)) + (set! sv-148 (-> t3-8 work vert0-table)) + (set! sv-152 (-> t3-8 work vert1-table)) + (set! sv-156 (- (-> v1-19 dest-pos x) (-> v1-19 current-pos x))) + (set! sv-160 (- (-> v1-19 dest-pos z) (-> v1-19 current-pos z))) + (dotimes (t4-16 (the-as int sv-144)) + (set! sv-164 (-> sv-140 vertex (-> sv-148 t4-16))) + (set! sv-168 (-> sv-140 vertex (-> sv-152 t4-16))) + (set! sv-172 (- (-> sv-164 z) (-> sv-168 z))) + (set! sv-176 (- (-> sv-168 x) (-> sv-164 x))) + (let ((f0-17 (+ (* sv-156 sv-172) (* sv-160 sv-176)))) + (when (< 0.0 f0-17) + (let ((f1-15 (+ (* sv-172 (- (-> sv-164 x) (-> v1-19 current-pos x))) + (* sv-176 (- (-> sv-164 z) (-> v1-19 current-pos z))) + ) + ) + ) + (when (< f1-15 f0-17) + (set! sv-128 t4-16) + (let ((f0-19 (fmax 0.0 (/ f1-15 f0-17)))) + (set! sv-156 (* sv-156 f0-19)) + (set! sv-160 (* sv-160 f0-19)) + ) + ) + ) + ) + ) + ) + (let ((f0-23 (+ (* sv-156 (-> v1-19 dir x)) (* sv-160 (-> v1-19 dir z))))) + (+! (-> v1-19 len) f0-23) + ) + 0 + (set! (-> v1-19 next-poly) #f) + (cond + ((= sv-128 -1) + (set! (-> v1-19 current-pos quad) (-> v1-19 dest-pos quad)) + (set! (-> v1-19 reached-dest) #t) + (set! (-> v1-19 terminated) #t) + ) + (else + (+! (-> v1-19 current-pos x) sv-156) + (+! (-> v1-19 current-pos z) sv-160) + (set! sv-180 (-> sv-140 adj-poly sv-128)) + (if (!= sv-180 255) + (set! (-> v1-19 next-poly) (-> t3-8 poly-array sv-180)) + ) + (cond + ((and (-> v1-19 next-poly) (zero? (logand (-> v1-19 next-poly pat) (-> v1-19 ignore)))) + (set! (-> v1-19 current-poly) (-> v1-19 next-poly)) + ) + (else + (set! (-> v1-19 last-edge) sv-128) + (if (-> v1-19 next-poly) + (set! (-> v1-19 hit-gap) #t) + (set! (-> v1-19 hit-boundary) #t) + ) + (set! (-> v1-19 terminated) #t) + ) + ) + ) + ) + ) + 0 + (set! v1-22 (or (>= sv-120 15) (or (>= (-> sv-96 len) (fmax 20480.0 arg3)) (-> sv-96 terminated)))) + ) + (cond + ((and (-> sv-96 hit-boundary) (and (< (-> sv-96 len) arg3) (!= (-> sv-96 last-edge) -1) (< sv-104 1))) + (set! sv-104 (+ sv-104 1)) + (set! sv-184 (-> arg1 vertex (-> sv-112 vert0-table (-> sv-96 last-edge)))) + (set! sv-188 (-> arg1 vertex (-> sv-112 vert1-table (-> sv-96 last-edge)))) + (set! sv-192 (- (-> sv-184 z) (-> sv-188 z))) + (set! sv-196 (- (-> sv-188 x) (-> sv-184 x))) + (set! sv-200 (-> arg2 x)) + (set! sv-204 (-> arg2 z)) + (let* ((f0-37 sv-192) + (f0-39 (* f0-37 f0-37)) + (f1-30 sv-196) + (f0-41 (sqrtf (+ f0-39 (* f1-30 f1-30)))) + (f0-43 (/ 1.0 f0-41)) + ) + (set! sv-192 (* sv-192 f0-43)) + (set! sv-196 (* sv-196 f0-43)) + ) + (when arg5 + (set! (-> arg5 found-boundary) #t) + (vector+! (-> arg5 intersection) (-> sv-96 current-pos) (-> obj bounds)) + (set! (-> arg5 boundary-normal x) sv-192) + (set! (-> arg5 boundary-normal y) 0.0) + (set! (-> arg5 boundary-normal z) sv-196) + (set! (-> arg5 poly) (-> sv-96 current-poly)) + (set! (-> arg5 edge) (-> sv-96 last-edge)) + (vector+! (-> arg5 vert-0) sv-184 (-> obj bounds)) + (vector+! (-> arg5 vert-1) sv-188 (-> obj bounds)) + ) + (set! (-> sv-96 dest-pos quad) (-> sv-96 current-pos quad)) + (cond + (arg4 + (let ((f0-49 (* 1.01 (+ (* sv-192 sv-200) (* sv-196 sv-204))))) + (set! sv-200 (- sv-200 (* sv-192 f0-49))) + (set! sv-204 (- sv-204 (* sv-196 f0-49))) + ) + (+! (-> sv-96 dest-pos x) sv-200) + (+! (-> sv-96 dest-pos z) sv-204) + ) + (else + (set! sv-100 #t) + ) + ) + ) + ((-> sv-96 hit-gap) + (if arg5 + (set! (-> arg5 gap-poly) (-> sv-96 next-poly)) + ) + (set! sv-100 #t) + ) + (else + (set! sv-100 #t) + ) + ) + ) + (vector-! arg2 (-> sv-96 current-pos) arg0) + 0 + (label cfg-62) + 0 + (none) + ) + ) + +;; definition for method 22 of type nav-control +(defmethod find-first-sphere-and-update-avoid-params nav-control ((obj nav-control) (arg0 vector) (arg1 nav-avoid-spheres-params)) + (rlet ((acc :class vf) + (Q :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + ) + (init-vf0-vector) + (let ((s2-1 (vector-! (new 'stack-no-clear 'vector) (-> obj root-nav-sphere) (-> obj state mesh bounds))) + (f30-0 -1.0) + ) + (let ((s3-0 -1)) + (countdown (s1-0 (-> obj sphere-count)) + (let* ((s0-0 (-> obj sphere-array s1-0)) + (f0-2 (ray-circle-intersect s2-1 arg0 s0-0 (+ -409.6 (-> s0-0 r)))) + ) + (when (>= f0-2 0.0) + (let ((v1-5 (new 'stack-no-clear 'vector))) + (vector-! v1-5 (the-as vector s0-0) s2-1) + (when (>= (vector-dot v1-5 arg0) 0.0) + (when (or (< f30-0 0.0) (< f0-2 f30-0)) + (set! f30-0 f0-2) + (set! s3-0 s1-0) + ) + ) + ) + ) + ) + ) + (when arg1 + (set! (-> arg1 current-pos x) f30-0) + (when (>= f30-0 0.0) + (vector+float*! (-> arg1 travel) (-> obj root-nav-sphere) arg0 f30-0) + (let ((a0-9 (-> obj sphere-array s3-0)) + (v1-19 (new 'stack-no-clear 'vector)) + ) + (vector+! v1-19 (the-as vector a0-9) (-> obj state mesh bounds)) + (vector-! (-> arg1 pref-dir) (-> arg1 travel) v1-19) + ) + (set! (-> arg1 pref-dir w) 1.0) + (let ((v1-21 (-> arg1 pref-dir))) + (let ((f0-6 1.0)) + (.lvf vf1 (&-> v1-21 quad)) + (.mul.vf vf2 vf1 vf1 :mask #b111) + (let ((a0-12 f0-6)) + (.mov vf3 a0-12) + ) + ) + (.mul.x.vf acc vf0 vf2 :mask #b1000) + (.add.mul.y.vf acc vf0 vf2 acc :mask #b1000) + (.add.mul.z.vf vf2 vf0 vf2 acc :mask #b1000) + (.isqrt.vf Q vf3 vf2 :fsf #b0 :ftf #b11) + (.wait.vf) + (.mul.vf vf1 vf1 Q :mask #b111) + (.nop.vf) + (.nop.vf) + (.nop.vf) + (.svf (&-> v1-21 quad) vf1) + ) + ) + ) + ) + f30-0 + ) + ) + ) + +;; definition for method 24 of type nav-control +(defmethod add-root-sphere-to-hash! nav-control ((obj nav-control) (arg0 vector) (arg1 int)) + "Add our root sphere to the hash (if enabled with output-sphere-hash flag) at the given location." + (if (logtest? (-> obj flags) (nav-control-flag output-sphere-hash)) + (add-sphere-with-mask-and-id + (-> obj state mesh sphere-hash) + arg0 + (logand arg1 255) + (the-as int (-> obj root-sphere-id)) + ) + ) + (none) + ) + +;; definition for method 47 of type nav-state +;; WARN: Return type mismatch int vs none. +(defmethod reset! nav-state ((obj nav-state) (arg0 nav-control)) + (set! (-> obj nav) arg0) + (set! (-> obj flags) (nav-state-flag)) + (set! (-> obj current-poly) #f) + (set! (-> obj next-poly) #f) + (set! (-> obj target-poly) #f) + (set! (-> obj user-poly) #f) + 0 + (none) + ) + +;; definition for method 7 of type nav-state +(defmethod relocate nav-state ((obj nav-state) (arg0 int)) + (break!) + (&+! (-> obj nav) arg0) + obj + ) + +;; definition for method 12 of type nav-state +;; INFO: Used lq/sq +(defmethod get-velocity nav-state ((obj nav-state) (arg0 vector)) + (set! (-> arg0 quad) (-> obj velocity quad)) + arg0 + ) + +;; definition for method 14 of type nav-state +;; INFO: Used lq/sq +(defmethod get-heading nav-state ((obj nav-state) (arg0 vector)) + (set! (-> arg0 quad) (-> obj heading quad)) + arg0 + ) + +;; definition for method 15 of type nav-state +;; INFO: Used lq/sq +(defmethod get-target-post nav-state ((obj nav-state) (arg0 vector)) + (set! (-> arg0 quad) (-> obj target-post quad)) + arg0 + ) + +;; definition for method 19 of type nav-state +(defmethod get-current-poly nav-state ((obj nav-state)) + "@returns `current-poly`" + (-> obj current-poly) + ) + +;; definition for method 16 of type nav-state +(defmethod get-speed nav-state ((obj nav-state)) + "@returns `speed`" + (-> obj speed) + ) + +;; definition for method 17 of type nav-state +(defmethod get-rotation-rate nav-state ((obj nav-state)) + "@returns `rotation-rate`" + (-> obj rotation-rate) + ) + +;; definition for method 13 of type nav-state +;; INFO: Used lq/sq +(defmethod get-travel nav-state ((obj nav-state) (arg0 vector)) + (set! (-> arg0 quad) (-> obj travel quad)) + arg0 + ) + +;; definition for method 44 of type nav-state +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod set-velocity! nav-state ((obj nav-state) (velocity vector)) + (set! (-> obj velocity quad) (-> velocity quad)) + 0 + (none) + ) + +;; definition for method 45 of type nav-state +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod set-heading! nav-state ((obj nav-state) (arg0 vector)) + (set! (-> obj heading quad) (-> arg0 quad)) + 0 + (none) + ) + +;; definition for method 46 of type nav-state +;; WARN: Return type mismatch int vs none. +(defmethod set-speed! nav-state ((obj nav-state) (arg0 meters)) + (set! (-> obj speed) arg0) + 0 + (none) + ) + +;; definition for method 42 of type nav-state +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod set-target-post! nav-state ((obj nav-state) (arg0 vector)) + (logclear! (-> obj flags) (nav-state-flag directional-mode)) + (logior! (-> obj flags) (nav-state-flag target-poly-dirty)) + (set! (-> obj target-post quad) (-> arg0 quad)) + 0 + (none) + ) + +;; definition for method 43 of type nav-state +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod set-travel! nav-state ((obj nav-state) (arg0 vector)) + (logior! (-> obj flags) (nav-state-flag directional-mode)) + (set! (-> obj travel quad) (-> arg0 quad)) + 0 + (none) + ) + +;; definition for method 20 of type nav-state +;; WARN: Return type mismatch int vs none. +(defmethod copy-nav-state! nav-state ((obj nav-state) (arg0 (pointer nav-state))) + "Copies the [[nav-state]] the given pointer points to into the current object" + (mem-copy! (the-as pointer obj) arg0 176) + 0 + (none) + ) + +;; definition for method 10 of type nav-state +;; WARN: Return type mismatch int vs none. +(defmethod nav-state-method-10 nav-state ((obj nav-state)) + "Virtual/Stub" + 0 + (none) + ) + +;; definition for method 9 of type nav-state +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod debug-draw nav-state ((obj nav-state)) + (let ((s5-0 (-> obj mesh))) + (if (-> obj next-poly) + (debug-draw-poly s5-0 (-> obj next-poly) *color-cyan*) + ) + (if (-> obj target-poly) + (debug-draw-poly s5-0 (-> obj target-poly) *color-yellow*) + ) + (if (-> obj current-poly) + (debug-draw-poly s5-0 (-> obj current-poly) *color-red*) + ) + ) + (add-debug-x #t (bucket-id debug-no-zbuf1) (-> obj target-post) *color-yellow*) + (add-debug-vector + #t + (bucket-id debug-no-zbuf1) + (-> obj current-pos) + (-> obj travel) + (meters 0.00024414062) + *color-white* + ) + (let ((s5-1 (new 'stack-no-clear 'vector))) + 0.0 + (-> obj mesh work debug) + (set! (-> s5-1 quad) (-> obj current-pos quad)) + (let ((f30-0 (-> s5-1 y))) + (set! (-> s5-1 y) (+ 2048.0 f30-0)) + (add-debug-vector #t (bucket-id debug-no-zbuf1) s5-1 (-> obj heading) (meters 1) *color-yellow*) + (set! (-> s5-1 y) (+ 4096.0 f30-0)) + ) + ) + 0 + (add-debug-x + #t + (bucket-id debug-no-zbuf1) + (vector+! (new 'stack-no-clear 'vector) (-> obj current-pos) (-> obj travel)) + *color-white* + ) + 0 + (none) + ) + +;; definition for method 38 of type nav-state +;; WARN: Return type mismatch int vs none. +(defmethod set-current-poly! nav-state ((obj nav-state) (arg0 nav-poly)) + (set! (-> obj current-poly) arg0) + 0 + (none) + ) + +;; definition for method 41 of type nav-state +(defmethod clamp-vector-to-mesh-cross-gaps nav-state ((obj nav-state) (arg0 vector)) + (when (-> obj current-poly) + (clamp-vector-to-mesh-cross-gaps + (-> obj nav) + (-> obj current-pos) + (-> obj current-poly) + arg0 + 204.8 + #f + (the-as clamp-travel-vector-to-mesh-return-info #f) + ) + #t + ) + ) + +;; definition for method 40 of type nav-state +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod do-navigation-to-destination nav-state ((obj nav-state) (arg0 vector)) + (local-vars (v1-15 symbol)) + (rlet ((acc :class vf) + (Q :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + ) + (init-vf0-vector) + (cond + ((-> obj current-poly) + (let ((s3-0 (-> obj mesh)) + (s4-0 (new 'stack-no-clear 'nav-ray)) + ) + (let ((s2-0 0)) + (set! (-> s4-0 current-poly) (-> obj current-poly)) + (vector-! (-> s4-0 current-pos) (-> obj current-pos) (-> s3-0 bounds)) + (vector-! (-> s4-0 dest-pos) arg0 (-> s3-0 bounds)) + (b! (not (point-in-poly? s3-0 (-> obj current-poly) (-> s4-0 dest-pos))) cfg-3 :delay (empty-form)) + (logior! (-> obj flags) (nav-state-flag in-mesh)) + (set! (-> obj current-pos quad) (-> arg0 quad)) + (b! #t cfg-17 :delay (nop!)) + (label cfg-3) + (let ((v1-10 s4-0)) + (vector-! (-> v1-10 dir) (-> v1-10 dest-pos) (-> v1-10 current-pos)) + (set! (-> v1-10 dir y) 0.0) + (let ((a0-6 (-> v1-10 dir))) + (let ((f0-1 1.0)) + (.lvf vf1 (&-> a0-6 quad)) + (.mul.vf vf2 vf1 vf1 :mask #b111) + (let ((a1-8 f0-1)) + (.mov vf3 a1-8) + ) + ) + (.mul.x.vf acc vf0 vf2 :mask #b1000) + (.add.mul.y.vf acc vf0 vf2 acc :mask #b1000) + (.add.mul.z.vf vf2 vf0 vf2 acc :mask #b1000) + (.isqrt.vf Q vf3 vf2 :fsf #b0 :ftf #b11) + (.wait.vf) + (.mul.vf vf1 vf1 Q :mask #b111) + (.nop.vf) + (.nop.vf) + (.nop.vf) + (.svf (&-> a0-6 quad) vf1) + ) + (set! (-> v1-10 next-poly) #f) + (set! (-> v1-10 len) 0.0) + (set! (-> v1-10 last-edge) -1) + (set! (-> v1-10 terminated) #f) + (set! (-> v1-10 reached-dest) #f) + (set! (-> v1-10 hit-boundary) #f) + (set! (-> v1-10 hit-gap) #f) + (set! (-> v1-10 ignore) (the-as uint 3)) + ) + 0 + (set! (-> s4-0 ignore) (the-as uint 1)) + (until v1-15 + (+! s2-0 1) + (move-along-nav-ray! s3-0 s4-0) + (set! v1-15 (or (>= s2-0 15) (-> s4-0 terminated))) + ) + ) + (set! (-> obj current-poly) (-> s4-0 current-poly)) + (when (-> s4-0 reached-dest) + (if (not (point-in-poly? s3-0 (-> obj current-poly) (-> s4-0 dest-pos))) + (set! (-> s4-0 reached-dest) #f) + ) + ) + (cond + ((-> s4-0 reached-dest) + (logior! (-> obj flags) (nav-state-flag in-mesh)) + (set! (-> obj current-pos quad) (-> arg0 quad)) + ) + (else + (logclear! (-> obj flags) (nav-state-flag in-mesh)) + (set! (-> obj current-pos quad) (-> arg0 quad)) + (let ((s4-1 (new 'stack 'nav-find-poly-parms))) + (vector-! (-> s4-1 point) arg0 (-> obj mesh bounds)) + (set! (-> s4-1 y-threshold) (-> obj nav nearest-y-threshold)) + (set! (-> s4-1 ignore) (the-as uint 1)) + (find-nearest-poly-to-point-local (-> obj mesh) s4-1) + (set! (-> obj current-poly) (-> s4-1 poly)) + ) + 0 + ) + ) + ) + ) + (else + (set! (-> obj current-pos quad) (-> arg0 quad)) + (let ((s4-2 (new 'stack 'nav-find-poly-parms))) + (vector-! (-> s4-2 point) arg0 (-> obj mesh bounds)) + (set! (-> s4-2 y-threshold) (-> obj nav nearest-y-threshold)) + (set! (-> s4-2 ignore) (the-as uint 1)) + (find-nearest-poly-to-point-local (-> obj mesh) s4-2) + (set! (-> obj current-poly) (-> s4-2 poly)) + (logclear! (-> obj flags) (nav-state-flag in-mesh)) + (if (-> s4-2 point-inside?) + (logior! (-> obj flags) (nav-state-flag in-mesh)) + ) + ) + ) + ) + (label cfg-17) + 0 + (none) + ) + ) + +;; definition for method 18 of type nav-state +(defmethod try-projecting-to-current-poly nav-state ((obj nav-state) (arg0 vector) (arg1 object) (arg2 vector)) + (cond + ((-> obj current-poly) + (let ((s5-0 (-> obj nav)) + (v1-1 (-> obj current-poly)) + (gp-0 arg0) + ) + (let ((t1-0 arg1) + (a1-1 arg2) + ) + (project-point-onto-plane-of-poly-local + (-> s5-0 state mesh) + v1-1 + gp-0 + (the-as vector t1-0) + (vector-! (new 'stack-no-clear 'vector) a1-1 (-> s5-0 state mesh bounds)) + ) + ) + (vector+! gp-0 gp-0 (-> s5-0 state mesh bounds)) + ) + 0 + #t + ) + (else + #f + ) + ) + ) + +;; definition for method 20 of type nav-control +;; WARN: Return type mismatch int vs none. +(defmethod clamp-vector-to-mesh-cross-gaps nav-control ((obj nav-control) + (arg0 vector) + (arg1 nav-poly) + (arg2 vector) + (arg3 float) + (arg4 symbol) + (arg5 clamp-travel-vector-to-mesh-return-info) + ) + (let ((v1-0 (new 'stack-no-clear 'vector))) + (vector-! v1-0 arg0 (-> obj state mesh bounds)) + (clamp-vector-to-mesh-cross-gaps (-> obj state mesh) v1-0 arg1 arg2 arg3 arg4 arg5) + ) + 0 + (none) + ) + +;; definition for method 12 of type nav-control +(defmethod cloest-point-on-mesh nav-control ((obj nav-control) (arg0 vector) (arg1 vector) (arg2 nav-poly)) + (local-vars (sv-16 vector)) + (set! sv-16 arg0) + (let ((gp-0 (new 'stack-no-clear 'nav-find-poly-parms))) + (set! (-> gp-0 poly) arg2) + (vector-! (-> gp-0 point) arg1 (-> obj state mesh bounds)) + (when (or (not (-> gp-0 poly)) (not (point-in-poly? (-> obj state mesh) (-> gp-0 poly) (-> gp-0 point)))) + (set! (-> gp-0 y-threshold) (-> obj nearest-y-threshold)) + (set! (-> gp-0 ignore) (the-as uint 3)) + (find-nearest-poly-to-point-local (-> obj state mesh) gp-0) + (when (-> gp-0 poly) + (project-point-into-poly-2d (-> obj state mesh) (-> gp-0 poly) sv-16 (-> gp-0 point)) + (vector+! sv-16 sv-16 (-> obj state mesh bounds)) + ) + ) + (-> gp-0 poly) + ) + ) + +;; definition for function vector-rotate-y-sincos! +(defun vector-rotate-y-sincos! ((arg0 vector) (arg1 vector) (arg2 float) (arg3 float)) + (let ((f0-0 (-> arg1 x)) + (f1-0 (-> arg1 z)) + ) + (set! (-> arg0 x) (+ (* arg3 f0-0) (* arg2 f1-0))) + (set! (-> arg0 y) (-> arg1 y)) + (set! (-> arg0 z) (- (* arg3 f1-0) (* arg2 f0-0))) + ) + ) + +;; definition for method 39 of type nav-state +;; INFO: function output is handled by mips2c +(defmethod-mips2c "(method 39 nav-state)" 39 nav-state) + +;; definition for method 50 of type nav-state +;; WARN: Return type mismatch int vs none. +(defmethod nav-state-method-50 nav-state ((obj nav-state)) + "Virtual/Stub" + 0 + (none) + ) + +;; definition for function test-xz-point-on-line-segment? +(defun test-xz-point-on-line-segment? ((arg0 vector) (arg1 vector) (arg2 vector) (arg3 float)) + (local-vars (v1-2 float) (v1-4 float)) + (rlet ((vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + ) + (let* ((f0-0 arg3) + (f0-2 (* f0-0 f0-0)) + ) + (let ((v1-1 arg0) + (t0-0 arg1) + ) + (.lvf vf2 (&-> v1-1 quad)) + (.lvf vf3 (&-> t0-0 quad)) + ) + (.sub.vf vf1 vf3 vf2) + (.mul.vf vf1 vf1 vf1) + (.add.z.vf vf1 vf1 vf1 :mask #b1) + (.mov v1-2 vf1) + (let ((f1-0 v1-2)) + (let ((v1-3 arg0) + (t0-1 arg2) + ) + (.lvf vf2 (&-> v1-3 quad)) + (.lvf vf3 (&-> t0-1 quad)) + ) + (.sub.vf vf1 vf3 vf2) + (.mul.vf vf1 vf1 vf1) + (.add.z.vf vf1 vf1 vf1 :mask #b1) + (.mov v1-4 vf1) + (let ((v0-0 (>= f0-2 (fmin f1-0 v1-4)))) + (when (not v0-0) + (let* ((f0-4 (- (-> arg2 x) (-> arg1 x))) + (f1-4 (- (-> arg2 z) (-> arg1 z))) + (f2-2 f0-4) + (f2-4 (* f2-2 f2-2)) + (f3-0 f1-4) + (f2-6 (sqrtf (+ f2-4 (* f3-0 f3-0)))) + (f3-3 f2-6) + (f3-5 (/ 1.0 f3-3)) + (f5-0 (* f3-5 (- f1-4))) + (f6-0 (* f3-5 f0-4)) + (f3-7 (- (-> arg0 x) (-> arg1 x))) + (f4-4 (- (-> arg0 z) (-> arg1 z))) + ) + (when (>= arg3 (fabs (+ (* f3-7 f5-0) (* f4-4 f6-0)))) + (let ((f0-6 (+ (* f3-7 f0-4) (* f4-4 f1-4)))) + (set! v0-0 (and (>= f0-6 0.0) (>= (* f2-6 f2-6) f0-6))) + ) + ) + ) + ) + v0-0 + ) + ) + ) + ) + ) + +;; definition for method 51 of type nav-state +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod navigate-using-route-portals nav-state ((obj nav-state)) + (local-vars + (v1-117 float) + (sv-112 vector) + (sv-116 nav-route-portal) + (sv-120 (inline-array vector)) + (sv-124 symbol) + ) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (set! (-> obj virtual-current-poly) (-> obj current-poly)) + (set! sv-112 (new 'stack-no-clear 'vector)) + (set! sv-116 (new 'stack-no-clear 'nav-route-portal)) + (set! sv-120 (new 'stack-no-clear 'inline-array 'vector 2)) + (set! sv-124 (the-as symbol #f)) + (vector-! (-> obj current-pos-local) (-> obj current-pos) (-> obj mesh bounds)) + (set! (-> obj virtual-current-pos-local quad) (-> obj current-pos-local quad)) + (set! (-> sv-116 next-poly) #f) + (when (not (logtest? (-> obj flags) (nav-state-flag directional-mode))) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (let ((s4-0 (new 'stack-no-clear 'nav-find-poly-parms))) + (vector-! s5-0 (-> obj target-post) (-> obj mesh bounds)) + (when (or (logtest? (-> obj flags) (nav-state-flag target-poly-dirty)) (not (-> obj target-poly))) + (set! (-> s4-0 point quad) (-> s5-0 quad)) + (set! (-> s4-0 y-threshold) (-> obj nav nearest-y-threshold)) + (set! (-> s4-0 ignore) (the-as uint 3)) + (find-nearest-poly-to-point-local (-> obj mesh) s4-0) + (set! (-> obj target-poly) (-> s4-0 poly)) + (if (not (-> obj target-poly)) + (set! (-> obj target-poly) (-> obj current-poly)) + ) + (logclear! (-> obj flags) (nav-state-flag target-poly-dirty)) + ) + ) + (project-point-into-poly-2d (-> obj mesh) (-> obj target-poly) sv-112 s5-0) + ) + (set! (-> sv-112 y) (-> obj current-pos-local y)) + (vector-! (-> obj travel) sv-112 (-> obj current-pos-local)) + (set! (-> obj travel y) 0.0) + (let* ((v1-32 (-> obj travel)) + (f0-6 (+ (* (-> v1-32 x) (-> v1-32 x)) (* (-> v1-32 z) (-> v1-32 z)))) + (f1-3 4096.0) + ) + (if (< f0-6 (* f1-3 f1-3)) + (logior! (-> obj flags) (nav-state-flag at-target)) + ) + ) + (get-route-portal (-> obj mesh) (-> obj current-poly) (-> obj target-poly) sv-116) + ) + (cond + ((not (-> sv-116 next-poly)) + (set! (-> obj next-poly) #f) + ) + (else + (set! (-> obj next-poly) (-> sv-116 next-poly)) + (set! (-> sv-120 0 quad) (-> sv-116 vertex 0 quad)) + (set! (-> sv-120 1 quad) (-> sv-116 vertex 1 quad)) + (set! sv-124 #t) + (while (and sv-124 (-> sv-116 next-poly) (test-xz-point-on-line-segment? + (-> obj current-pos-local) + (the-as vector (-> sv-116 vertex)) + (-> sv-116 vertex 1) + 409.59998 + ) + ) + (when #t + #t + (vector-segment-distance-point! + (-> obj current-pos-local) + (the-as vector (-> sv-116 vertex)) + (-> sv-116 vertex 1) + (-> obj virtual-current-pos-local) + ) + (vector-! (-> obj travel) sv-112 (-> obj virtual-current-pos-local)) + (set! (-> obj travel y) 0.0) + 0 + ) + (set! (-> obj virtual-current-poly) (-> sv-116 next-poly)) + (cond + ((get-route-portal (-> obj mesh) (-> sv-116 next-poly) (-> obj target-poly) sv-116) + (set! (-> obj next-poly) (-> sv-116 next-poly)) + (set! (-> sv-120 0 quad) (-> sv-116 vertex 0 quad)) + (set! (-> sv-120 1 quad) (-> sv-116 vertex 1 quad)) + 0 + ) + (else + (set! (-> obj next-poly) #f) + (set! sv-124 (the-as symbol #f)) + ) + ) + ) + ) + ) + (when sv-124 + (let ((s5-1 (new 'stack-no-clear 'matrix))) + (vector-! (the-as vector (-> s5-1 vector)) (-> sv-120 1) (-> sv-120 0)) + (vector-normalize! (the-as vector (-> s5-1 vector)) 409.6) + (vector+! (-> sv-120 0) (-> sv-120 0) (the-as vector (-> s5-1 vector))) + (vector-! (-> sv-120 1) (-> sv-120 1) (the-as vector (-> s5-1 vector))) + ) + (when (not (ray-ccw-line-segment-intersection? + (-> obj virtual-current-pos-local) + (-> obj travel) + (-> sv-120 0) + (-> sv-120 1) + ) + ) + (let ((s5-2 -1)) + (let* ((f0-8 (cos 8192.0)) + (f0-10 (* f0-8 f0-8)) + (v1-93 (new 'stack-no-clear 'vector)) + (a0-39 (-> obj travel)) + (f1-9 (+ (* (-> a0-39 x) (-> a0-39 x)) (* (-> a0-39 z) (-> a0-39 z)))) + ) + (countdown (a0-41 2) + (vector-! v1-93 (-> sv-120 a0-41) (-> obj virtual-current-pos-local)) + (let ((f2-5 (vector-dot (-> obj travel) v1-93))) + (when (< 0.0 f2-5) + (let* ((f2-7 (* f2-5 f2-5)) + (a1-26 v1-93) + (f2-8 (/ f2-7 (* f1-9 (+ (* (-> a1-26 x) (-> a1-26 x)) (* (-> a1-26 z) (-> a1-26 z)))))) + ) + (when (< f0-10 f2-8) + (set! f0-10 f2-8) + (set! s5-2 a0-41) + ) + ) + ) + ) + ) + ) + (when (= s5-2 -1) + (let ((f30-0 (the-as float #x7f800000)) + (s3-0 (new 'stack-no-clear 'nav-route-portal)) + (s4-1 (new 'stack-no-clear 'vector)) + ) + (get-route-portal (-> obj mesh) (-> sv-116 next-poly) (-> obj target-poly) s3-0) + (cond + ((-> s3-0 next-poly) + (vector+! s4-1 (the-as vector (-> s3-0 vertex)) (the-as vector (-> s3-0 vertex 1))) + (vector-float*! s4-1 s4-1 0.5) + ) + (else + (set! (-> s4-1 quad) (-> sv-112 quad)) + ) + ) + (countdown (s3-1 2) + (let* ((s2-0 (-> sv-120 s3-1)) + (f0-13 (+ (vector-vector-xz-distance-squared (-> obj virtual-current-pos-local) s2-0) + (vector-vector-xz-distance-squared s4-1 s2-0) + ) + ) + ) + (when (< f0-13 f30-0) + (set! f30-0 f0-13) + (set! s5-2 s3-1) + ) + ) + ) + ) + ) + (vector-! (-> obj travel) (-> sv-120 s5-2) (-> obj virtual-current-pos-local)) + ) + (set! (-> obj travel y) 0.0) + ) + ) + (.lvf vf1 (&-> (-> obj travel) quad)) + (.add.w.vf vf2 vf0 vf0 :mask #b1) + (.mul.vf vf1 vf1 vf1) + (.mul.x.vf acc vf2 vf1 :mask #b1) + (.add.mul.y.vf acc vf2 vf1 acc :mask #b1) + (.add.mul.z.vf vf1 vf2 vf1 acc :mask #b1) + (.mov v1-117 vf1) + (let ((f0-15 v1-117) + (f1-10 (-> obj nav nav-cull-radius)) + ) + (if (< (* f1-10 f1-10) f0-15) + (vector-float*! (-> obj travel) (-> obj travel) (/ (-> obj nav nav-cull-radius) (sqrtf f0-15))) + ) + ) + 0 + (none) + ) + ) + +;; definition for method 49 of type nav-state +;; INFO: Used lq/sq +;; WARN: Stack slot offset 124 signed mismatch +;; WARN: Stack slot offset 128 signed mismatch +;; WARN: Stack slot offset 124 signed mismatch +;; WARN: Stack slot offset 128 signed mismatch +;; WARN: Stack slot offset 124 signed mismatch +;; WARN: Stack slot offset 140 signed mismatch +;; WARN: Stack slot offset 128 signed mismatch +;; WARN: Stack slot offset 144 signed mismatch +;; WARN: Stack slot offset 140 signed mismatch +;; WARN: Stack slot offset 144 signed mismatch +;; WARN: Stack slot offset 124 signed mismatch +;; WARN: Stack slot offset 128 signed mismatch +;; WARN: Stack slot offset 124 signed mismatch +;; WARN: Stack slot offset 128 signed mismatch +;; WARN: Stack slot offset 124 signed mismatch +;; WARN: Stack slot offset 128 signed mismatch +;; WARN: Stack slot offset 124 signed mismatch +;; WARN: Stack slot offset 140 signed mismatch +;; WARN: Stack slot offset 128 signed mismatch +;; WARN: Stack slot offset 144 signed mismatch +;; WARN: Stack slot offset 140 signed mismatch +;; WARN: Stack slot offset 144 signed mismatch +;; WARN: Stack slot offset 124 signed mismatch +;; WARN: Stack slot offset 128 signed mismatch +;; WARN: Stack slot offset 124 signed mismatch +;; WARN: Stack slot offset 128 signed mismatch +;; WARN: Stack slot offset 124 signed mismatch +;; WARN: Stack slot offset 128 signed mismatch +;; WARN: Stack slot offset 124 signed mismatch +;; WARN: Stack slot offset 140 signed mismatch +;; WARN: Stack slot offset 128 signed mismatch +;; WARN: Stack slot offset 144 signed mismatch +;; WARN: Stack slot offset 140 signed mismatch +;; WARN: Stack slot offset 144 signed mismatch +;; WARN: Stack slot offset 124 signed mismatch +;; WARN: Stack slot offset 128 signed mismatch +;; WARN: Stack slot offset 124 signed mismatch +;; WARN: Stack slot offset 128 signed mismatch +;; WARN: Stack slot offset 124 signed mismatch +;; WARN: Stack slot offset 128 signed mismatch +;; WARN: Stack slot offset 124 signed mismatch +;; WARN: Stack slot offset 140 signed mismatch +;; WARN: Stack slot offset 128 signed mismatch +;; WARN: Stack slot offset 144 signed mismatch +;; WARN: Stack slot offset 140 signed mismatch +;; WARN: Stack slot offset 144 signed mismatch +;; WARN: Stack slot offset 124 signed mismatch +;; WARN: Stack slot offset 128 signed mismatch +;; WARN: Stack slot offset 124 signed mismatch +;; WARN: Stack slot offset 128 signed mismatch +;; WARN: Stack slot offset 124 signed mismatch +;; WARN: Stack slot offset 128 signed mismatch +;; WARN: Stack slot offset 124 signed mismatch +;; WARN: Stack slot offset 140 signed mismatch +;; WARN: Stack slot offset 128 signed mismatch +;; WARN: Stack slot offset 144 signed mismatch +;; WARN: Stack slot offset 140 signed mismatch +;; WARN: Stack slot offset 144 signed mismatch +;; WARN: Stack slot offset 124 signed mismatch +;; WARN: Stack slot offset 128 signed mismatch +;; WARN: Stack slot offset 124 signed mismatch +;; WARN: Stack slot offset 128 signed mismatch +;; WARN: Stack slot offset 124 signed mismatch +;; WARN: Stack slot offset 128 signed mismatch +;; WARN: Stack slot offset 124 signed mismatch +;; WARN: Stack slot offset 140 signed mismatch +;; WARN: Stack slot offset 128 signed mismatch +;; WARN: Stack slot offset 144 signed mismatch +;; WARN: Stack slot offset 140 signed mismatch +;; WARN: Stack slot offset 144 signed mismatch +;; WARN: Stack slot offset 124 signed mismatch +;; WARN: Stack slot offset 128 signed mismatch +;; WARN: Stack slot offset 124 signed mismatch +;; WARN: Stack slot offset 128 signed mismatch +;; WARN: Stack slot offset 124 signed mismatch +;; WARN: Stack slot offset 128 signed mismatch +;; WARN: Stack slot offset 124 signed mismatch +;; WARN: Stack slot offset 140 signed mismatch +;; WARN: Stack slot offset 128 signed mismatch +;; WARN: Stack slot offset 144 signed mismatch +;; WARN: Stack slot offset 140 signed mismatch +;; WARN: Stack slot offset 144 signed mismatch +;; WARN: Stack slot offset 124 signed mismatch +;; WARN: Stack slot offset 128 signed mismatch +;; WARN: Stack slot offset 124 signed mismatch +;; WARN: Stack slot offset 128 signed mismatch +;; WARN: Stack slot offset 124 signed mismatch +;; WARN: Stack slot offset 128 signed mismatch +;; WARN: Stack slot offset 124 signed mismatch +;; WARN: Stack slot offset 140 signed mismatch +;; WARN: Stack slot offset 128 signed mismatch +;; WARN: Stack slot offset 144 signed mismatch +;; WARN: Stack slot offset 140 signed mismatch +;; WARN: Stack slot offset 144 signed mismatch +;; WARN: Stack slot offset 124 signed mismatch +;; WARN: Stack slot offset 128 signed mismatch +;; WARN: Return type mismatch int vs none. +(defmethod navigate-using-best-dir-use-existing-avoid-spheres nav-state ((obj nav-state) (arg0 nav-avoid-spheres-params)) + (local-vars + (sv-96 int) + (sv-104 nav-mesh-work) + (sv-108 nav-poly) + (sv-112 uint8) + (sv-116 (pointer int8)) + (sv-120 (pointer int8)) + (sv-124 float) + (sv-128 float) + (sv-132 vector) + (sv-136 vector) + (sv-140 float) + (sv-144 float) + (sv-148 uint) + ) + (rlet ((acc :class vf) + (Q :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + ) + (init-vf0-vector) + (when (-> arg0 avoiding-sphere?) + (logior! (-> obj flags) (nav-state-flag avoiding-sphere)) + (let ((f0-0 (-> arg0 closest-sphere-dist2)) + (f1-0 512.0) + ) + (if (< f0-0 (* f1-0 f1-0)) + (logior! (-> obj flags) (nav-state-flag touching-sphere)) + ) + ) + (set! (-> obj travel quad) (-> arg0 out-travel 0 quad)) + (let ((v1-10 (new 'stack-no-clear 'nav-ray))) + (set! (-> v1-10 current-pos quad) (-> obj virtual-current-pos-local quad)) + (set! (-> v1-10 current-poly) (-> obj virtual-current-poly)) + (vector+! (-> v1-10 dest-pos) (-> obj virtual-current-pos-local) (-> obj travel)) + (let ((a2-5 0)) + (let ((a3-3 v1-10)) + (vector-! (-> a3-3 dir) (-> a3-3 dest-pos) (-> a3-3 current-pos)) + (set! (-> a3-3 dir y) 0.0) + (let ((t0-3 (-> a3-3 dir))) + (let ((f0-2 1.0)) + (.lvf vf1 (&-> t0-3 quad)) + (.mul.vf vf2 vf1 vf1 :mask #b111) + (let ((t1-2 f0-2)) + (.mov vf3 t1-2) + ) + ) + (.mul.x.vf acc vf0 vf2 :mask #b1000) + (.add.mul.y.vf acc vf0 vf2 acc :mask #b1000) + (.add.mul.z.vf vf2 vf0 vf2 acc :mask #b1000) + (.isqrt.vf Q vf3 vf2 :fsf #b0 :ftf #b11) + (.wait.vf) + (.mul.vf vf1 vf1 Q :mask #b111) + (.nop.vf) + (.nop.vf) + (.nop.vf) + (.svf (&-> t0-3 quad) vf1) + ) + (set! (-> a3-3 next-poly) #f) + (set! (-> a3-3 len) 0.0) + (set! (-> a3-3 last-edge) -1) + (set! (-> a3-3 terminated) #f) + (set! (-> a3-3 reached-dest) #f) + (set! (-> a3-3 hit-boundary) #f) + (set! (-> a3-3 hit-gap) #f) + (set! (-> a3-3 ignore) (the-as uint 3)) + ) + 0 + (until (or (>= a2-5 15) (-> v1-10 terminated)) + (+! a2-5 1) + (let ((t0-6 (-> obj mesh)) + (a3-5 v1-10) + ) + (set! sv-96 -1) + (set! sv-104 (-> t0-6 work)) + (set! sv-108 (-> a3-5 current-poly)) + (set! sv-112 (-> a3-5 current-poly vertex-count)) + (set! sv-116 (-> t0-6 work vert0-table)) + (set! sv-120 (-> t0-6 work vert1-table)) + (set! sv-124 (- (-> a3-5 dest-pos x) (-> a3-5 current-pos x))) + (set! sv-128 (- (-> a3-5 dest-pos z) (-> a3-5 current-pos z))) + (dotimes (t1-12 (the-as int sv-112)) + (set! sv-132 (-> sv-108 vertex (-> sv-116 t1-12))) + (set! sv-136 (-> sv-108 vertex (-> sv-120 t1-12))) + (set! sv-140 (- (-> sv-132 z) (-> sv-136 z))) + (set! sv-144 (- (-> sv-136 x) (-> sv-132 x))) + (let ((f0-14 (+ (* sv-124 sv-140) (* sv-128 sv-144)))) + (when (< 0.0 f0-14) + (let ((f1-13 + (+ (* sv-140 (- (-> sv-132 x) (-> a3-5 current-pos x))) (* sv-144 (- (-> sv-132 z) (-> a3-5 current-pos z)))) + ) + ) + (when (< f1-13 f0-14) + (set! sv-96 t1-12) + (let ((f0-16 (fmax 0.0 (/ f1-13 f0-14)))) + (set! sv-124 (* sv-124 f0-16)) + (set! sv-128 (* sv-128 f0-16)) + ) + ) + ) + ) + ) + ) + (let ((f0-20 (+ (* sv-124 (-> a3-5 dir x)) (* sv-128 (-> a3-5 dir z))))) + (+! (-> a3-5 len) f0-20) + ) + 0 + (set! (-> a3-5 next-poly) #f) + (cond + ((= sv-96 -1) + (set! (-> a3-5 current-pos quad) (-> a3-5 dest-pos quad)) + (set! (-> a3-5 reached-dest) #t) + (set! (-> a3-5 terminated) #t) + ) + (else + (+! (-> a3-5 current-pos x) sv-124) + (+! (-> a3-5 current-pos z) sv-128) + (set! sv-148 (-> sv-108 adj-poly sv-96)) + (if (!= sv-148 255) + (set! (-> a3-5 next-poly) (-> t0-6 poly-array sv-148)) + ) + (cond + ((and (-> a3-5 next-poly) (zero? (logand (-> a3-5 next-poly pat) (-> a3-5 ignore)))) + (set! (-> a3-5 current-poly) (-> a3-5 next-poly)) + ) + (else + (set! (-> a3-5 last-edge) sv-96) + (if (-> a3-5 next-poly) + (set! (-> a3-5 hit-gap) #t) + (set! (-> a3-5 hit-boundary) #t) + ) + (set! (-> a3-5 terminated) #t) + ) + ) + ) + ) + ) + 0 + ) + ) + (cond + ((or (-> v1-10 reached-dest) (-> v1-10 hit-gap) (>= (-> v1-10 len) 4096.0)) + (set! (-> obj travel quad) (-> arg0 out-travel 0 quad)) + ) + (else + (set! (-> obj travel quad) (-> arg0 out-travel 1 quad)) + (logior! (-> obj flags) (nav-state-flag trapped-by-sphere)) + ) + ) + ) + ) + 0 + (none) + ) + ) + +;; definition for method 52 of type nav-state +;; INFO: Used lq/sq +;; WARN: Stack slot offset 220 signed mismatch +;; WARN: Stack slot offset 224 signed mismatch +;; WARN: Stack slot offset 220 signed mismatch +;; WARN: Stack slot offset 224 signed mismatch +;; WARN: Stack slot offset 220 signed mismatch +;; WARN: Stack slot offset 236 signed mismatch +;; WARN: Stack slot offset 224 signed mismatch +;; WARN: Stack slot offset 240 signed mismatch +;; WARN: Stack slot offset 236 signed mismatch +;; WARN: Stack slot offset 240 signed mismatch +;; WARN: Stack slot offset 220 signed mismatch +;; WARN: Stack slot offset 224 signed mismatch +;; WARN: Stack slot offset 220 signed mismatch +;; WARN: Stack slot offset 224 signed mismatch +;; WARN: Stack slot offset 220 signed mismatch +;; WARN: Stack slot offset 224 signed mismatch +;; WARN: Stack slot offset 220 signed mismatch +;; WARN: Stack slot offset 236 signed mismatch +;; WARN: Stack slot offset 224 signed mismatch +;; WARN: Stack slot offset 240 signed mismatch +;; WARN: Stack slot offset 236 signed mismatch +;; WARN: Stack slot offset 240 signed mismatch +;; WARN: Stack slot offset 220 signed mismatch +;; WARN: Stack slot offset 224 signed mismatch +;; WARN: Stack slot offset 220 signed mismatch +;; WARN: Stack slot offset 224 signed mismatch +;; WARN: Stack slot offset 220 signed mismatch +;; WARN: Stack slot offset 224 signed mismatch +;; WARN: Stack slot offset 220 signed mismatch +;; WARN: Stack slot offset 236 signed mismatch +;; WARN: Stack slot offset 224 signed mismatch +;; WARN: Stack slot offset 240 signed mismatch +;; WARN: Stack slot offset 236 signed mismatch +;; WARN: Stack slot offset 240 signed mismatch +;; WARN: Stack slot offset 220 signed mismatch +;; WARN: Stack slot offset 224 signed mismatch +;; WARN: Stack slot offset 220 signed mismatch +;; WARN: Stack slot offset 224 signed mismatch +;; WARN: Stack slot offset 220 signed mismatch +;; WARN: Stack slot offset 224 signed mismatch +;; WARN: Stack slot offset 220 signed mismatch +;; WARN: Stack slot offset 236 signed mismatch +;; WARN: Stack slot offset 224 signed mismatch +;; WARN: Stack slot offset 240 signed mismatch +;; WARN: Stack slot offset 236 signed mismatch +;; WARN: Stack slot offset 240 signed mismatch +;; WARN: Stack slot offset 220 signed mismatch +;; WARN: Stack slot offset 224 signed mismatch +;; WARN: Stack slot offset 220 signed mismatch +;; WARN: Stack slot offset 224 signed mismatch +;; WARN: Stack slot offset 220 signed mismatch +;; WARN: Stack slot offset 224 signed mismatch +;; WARN: Stack slot offset 220 signed mismatch +;; WARN: Stack slot offset 236 signed mismatch +;; WARN: Stack slot offset 224 signed mismatch +;; WARN: Stack slot offset 240 signed mismatch +;; WARN: Stack slot offset 236 signed mismatch +;; WARN: Stack slot offset 240 signed mismatch +;; WARN: Stack slot offset 220 signed mismatch +;; WARN: Stack slot offset 224 signed mismatch +;; WARN: Stack slot offset 220 signed mismatch +;; WARN: Stack slot offset 224 signed mismatch +;; WARN: Stack slot offset 220 signed mismatch +;; WARN: Stack slot offset 224 signed mismatch +;; WARN: Stack slot offset 220 signed mismatch +;; WARN: Stack slot offset 236 signed mismatch +;; WARN: Stack slot offset 224 signed mismatch +;; WARN: Stack slot offset 240 signed mismatch +;; WARN: Stack slot offset 236 signed mismatch +;; WARN: Stack slot offset 240 signed mismatch +;; WARN: Stack slot offset 220 signed mismatch +;; WARN: Stack slot offset 224 signed mismatch +;; WARN: Stack slot offset 220 signed mismatch +;; WARN: Stack slot offset 224 signed mismatch +;; WARN: Stack slot offset 220 signed mismatch +;; WARN: Stack slot offset 224 signed mismatch +;; WARN: Stack slot offset 220 signed mismatch +;; WARN: Stack slot offset 236 signed mismatch +;; WARN: Stack slot offset 224 signed mismatch +;; WARN: Stack slot offset 240 signed mismatch +;; WARN: Stack slot offset 236 signed mismatch +;; WARN: Stack slot offset 240 signed mismatch +;; WARN: Stack slot offset 220 signed mismatch +;; WARN: Stack slot offset 224 signed mismatch +;; WARN: Stack slot offset 220 signed mismatch +;; WARN: Stack slot offset 224 signed mismatch +;; WARN: Stack slot offset 220 signed mismatch +;; WARN: Stack slot offset 224 signed mismatch +;; WARN: Stack slot offset 220 signed mismatch +;; WARN: Stack slot offset 236 signed mismatch +;; WARN: Stack slot offset 224 signed mismatch +;; WARN: Stack slot offset 240 signed mismatch +;; WARN: Stack slot offset 236 signed mismatch +;; WARN: Stack slot offset 240 signed mismatch +;; WARN: Stack slot offset 220 signed mismatch +;; WARN: Stack slot offset 224 signed mismatch +;; WARN: Return type mismatch int vs none. +(defmethod navigate-using-best-dir-recompute-avoid-spheres-1 nav-state ((obj nav-state)) + (local-vars + (sv-192 int) + (sv-200 nav-mesh-work) + (sv-204 nav-poly) + (sv-208 uint8) + (sv-212 (pointer int8)) + (sv-216 (pointer int8)) + (sv-220 float) + (sv-224 float) + (sv-228 vector) + (sv-232 vector) + (sv-236 float) + (sv-240 float) + (sv-244 uint) + ) + (rlet ((acc :class vf) + (Q :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + ) + (init-vf0-vector) + (let ((s5-0 (new 'stack-no-clear 'nav-avoid-spheres-params))) + (set! (-> s5-0 current-pos quad) (-> obj virtual-current-pos-local quad)) + (set! (-> s5-0 travel quad) (-> obj travel quad)) + (set! (-> s5-0 pref-dir quad) (-> (if (logtest? (-> obj flags) (nav-state-flag trapped-by-sphere)) + (-> obj heading) + (-> obj travel) + ) + quad + ) + ) + (avoid-spheres-1! (-> obj nav) s5-0) + (when (-> s5-0 avoiding-sphere?) + (logior! (-> obj flags) (nav-state-flag avoiding-sphere)) + (let ((f0-0 (-> s5-0 closest-sphere-dist2)) + (f1-0 512.0) + ) + (if (< f0-0 (* f1-0 f1-0)) + (logior! (-> obj flags) (nav-state-flag touching-sphere)) + ) + ) + (set! (-> obj travel quad) (-> s5-0 out-travel 0 quad)) + (let ((v1-15 (new 'stack-no-clear 'nav-ray))) + (set! (-> v1-15 current-pos quad) (-> obj virtual-current-pos-local quad)) + (set! (-> v1-15 current-poly) (-> obj virtual-current-poly)) + (vector+! (-> v1-15 dest-pos) (-> obj virtual-current-pos-local) (-> obj travel)) + (let ((a0-15 0)) + (let ((a1-4 v1-15)) + (vector-! (-> a1-4 dir) (-> a1-4 dest-pos) (-> a1-4 current-pos)) + (set! (-> a1-4 dir y) 0.0) + (let ((a2-3 (-> a1-4 dir))) + (let ((f0-2 1.0)) + (.lvf vf1 (&-> a2-3 quad)) + (.mul.vf vf2 vf1 vf1 :mask #b111) + (let ((a3-2 f0-2)) + (.mov vf3 a3-2) + ) + ) + (.mul.x.vf acc vf0 vf2 :mask #b1000) + (.add.mul.y.vf acc vf0 vf2 acc :mask #b1000) + (.add.mul.z.vf vf2 vf0 vf2 acc :mask #b1000) + (.isqrt.vf Q vf3 vf2 :fsf #b0 :ftf #b11) + (.wait.vf) + (.mul.vf vf1 vf1 Q :mask #b111) + (.nop.vf) + (.nop.vf) + (.nop.vf) + (.svf (&-> a2-3 quad) vf1) + ) + (set! (-> a1-4 next-poly) #f) + (set! (-> a1-4 len) 0.0) + (set! (-> a1-4 last-edge) -1) + (set! (-> a1-4 terminated) #f) + (set! (-> a1-4 reached-dest) #f) + (set! (-> a1-4 hit-boundary) #f) + (set! (-> a1-4 hit-gap) #f) + (set! (-> a1-4 ignore) (the-as uint 3)) + ) + 0 + (until (or (>= a0-15 15) (-> v1-15 terminated)) + (+! a0-15 1) + (let ((a2-6 (-> obj mesh)) + (a1-6 v1-15) + ) + (set! sv-192 -1) + (set! sv-200 (-> a2-6 work)) + (set! sv-204 (-> a1-6 current-poly)) + (set! sv-208 (-> a1-6 current-poly vertex-count)) + (set! sv-212 (-> a2-6 work vert0-table)) + (set! sv-216 (-> a2-6 work vert1-table)) + (set! sv-220 (- (-> a1-6 dest-pos x) (-> a1-6 current-pos x))) + (set! sv-224 (- (-> a1-6 dest-pos z) (-> a1-6 current-pos z))) + (dotimes (a3-12 (the-as int sv-208)) + (set! sv-228 (-> sv-204 vertex (-> sv-212 a3-12))) + (set! sv-232 (-> sv-204 vertex (-> sv-216 a3-12))) + (set! sv-236 (- (-> sv-228 z) (-> sv-232 z))) + (set! sv-240 (- (-> sv-232 x) (-> sv-228 x))) + (let ((f0-14 (+ (* sv-220 sv-236) (* sv-224 sv-240)))) + (when (< 0.0 f0-14) + (let ((f1-13 + (+ (* sv-236 (- (-> sv-228 x) (-> a1-6 current-pos x))) (* sv-240 (- (-> sv-228 z) (-> a1-6 current-pos z)))) + ) + ) + (when (< f1-13 f0-14) + (set! sv-192 a3-12) + (let ((f0-16 (fmax 0.0 (/ f1-13 f0-14)))) + (set! sv-220 (* sv-220 f0-16)) + (set! sv-224 (* sv-224 f0-16)) + ) + ) + ) + ) + ) + ) + (let ((f0-20 (+ (* sv-220 (-> a1-6 dir x)) (* sv-224 (-> a1-6 dir z))))) + (+! (-> a1-6 len) f0-20) + ) + 0 + (set! (-> a1-6 next-poly) #f) + (cond + ((= sv-192 -1) + (set! (-> a1-6 current-pos quad) (-> a1-6 dest-pos quad)) + (set! (-> a1-6 reached-dest) #t) + (set! (-> a1-6 terminated) #t) + ) + (else + (+! (-> a1-6 current-pos x) sv-220) + (+! (-> a1-6 current-pos z) sv-224) + (set! sv-244 (-> sv-204 adj-poly sv-192)) + (if (!= sv-244 255) + (set! (-> a1-6 next-poly) (-> a2-6 poly-array sv-244)) + ) + (cond + ((and (-> a1-6 next-poly) (zero? (logand (-> a1-6 next-poly pat) (-> a1-6 ignore)))) + (set! (-> a1-6 current-poly) (-> a1-6 next-poly)) + ) + (else + (set! (-> a1-6 last-edge) sv-192) + (if (-> a1-6 next-poly) + (set! (-> a1-6 hit-gap) #t) + (set! (-> a1-6 hit-boundary) #t) + ) + (set! (-> a1-6 terminated) #t) + ) + ) + ) + ) + ) + 0 + ) + ) + (cond + ((or (-> v1-15 reached-dest) (-> v1-15 hit-gap) (>= (-> v1-15 len) 4096.0)) + (set! (-> obj travel quad) (-> s5-0 out-travel 0 quad)) + ) + (else + (set! (-> obj travel quad) (-> s5-0 out-travel 1 quad)) + (logior! (-> obj flags) (nav-state-flag trapped-by-sphere)) + ) + ) + ) + ) + ) + 0 + 0 + (none) + ) + ) + +;; definition for method 53 of type nav-state +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod navigate-within-poly nav-state ((obj nav-state)) + (rlet ((acc :class vf) + (Q :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + ) + (init-vf0-vector) + (set! (-> obj target-dir quad) (-> obj travel quad)) + (let ((v1-1 (-> obj target-dir))) + (let ((f0-0 1.0)) + (.lvf vf1 (&-> v1-1 quad)) + (.mul.vf vf2 vf1 vf1 :mask #b111) + (let ((a0-4 f0-0)) + (.mov vf3 a0-4) + ) + ) + (.mul.x.vf acc vf0 vf2 :mask #b1000) + (.add.mul.y.vf acc vf0 vf2 acc :mask #b1000) + (.add.mul.z.vf vf2 vf0 vf2 acc :mask #b1000) + (.isqrt.vf Q vf3 vf2 :fsf #b0 :ftf #b11) + (.wait.vf) + (.mul.vf vf1 vf1 Q :mask #b111) + (.nop.vf) + (.nop.vf) + (.nop.vf) + (.svf (&-> v1-1 quad) vf1) + ) + (cond + ((logtest? (-> obj nav flags) (nav-control-flag limit-rotation-rate)) + (let ((s5-0 (nav-state-method-39 obj))) + (let* ((f0-1 40.96) + (f0-3 (* f0-1 f0-1)) + (v1-8 (-> obj travel)) + ) + (when (< f0-3 (+ (* (-> v1-8 x) (-> v1-8 x)) (* (-> v1-8 z) (-> v1-8 z)))) + (set! (-> obj heading quad) (-> obj travel quad)) + (set! (-> obj heading y) 0.0) + (let ((v1-12 (-> obj heading))) + (let ((f0-5 1.0)) + (.lvf vf1 (&-> v1-12 quad)) + (.mul.vf vf2 vf1 vf1 :mask #b111) + (let ((a0-9 f0-5)) + (.mov vf3 a0-9) + ) + ) + (.mul.x.vf acc vf0 vf2 :mask #b1000) + (.add.mul.y.vf acc vf0 vf2 acc :mask #b1000) + (.add.mul.z.vf vf2 vf0 vf2 acc :mask #b1000) + (.isqrt.vf Q vf3 vf2 :fsf #b0 :ftf #b11) + (.wait.vf) + (.mul.vf vf1 vf1 Q :mask #b111) + (.nop.vf) + (.nop.vf) + (.nop.vf) + (.svf (&-> v1-12 quad) vf1) + ) + ) + ) + (let ((f0-6 + (find-first-sphere-and-update-avoid-params (-> obj nav) (-> obj travel) (the-as nav-avoid-spheres-params #f)) + ) + ) + (when (>= f0-6 0.0) + (vector-float*! (-> obj travel) (-> obj travel) f0-6) + (let ((f0-7 (* f0-6 (-> obj nav nav-cull-radius)))) + (if (and (not s5-0) (>= 40.96 f0-7)) + (logior! (-> obj flags) (nav-state-flag blocked)) + ) + ) + ) + ) + ) + ) + (else + (let* ((f0-8 40.96) + (f0-10 (* f0-8 f0-8)) + (v1-26 (-> obj travel)) + ) + (when (< f0-10 (+ (* (-> v1-26 x) (-> v1-26 x)) (* (-> v1-26 z) (-> v1-26 z)))) + (set! (-> obj heading quad) (-> obj travel quad)) + (set! (-> obj heading y) 0.0) + (let ((v1-30 (-> obj heading))) + (let ((f0-12 1.0)) + (.lvf vf1 (&-> v1-30 quad)) + (.mul.vf vf2 vf1 vf1 :mask #b111) + (let ((a0-15 f0-12)) + (.mov vf3 a0-15) + ) + ) + (.mul.x.vf acc vf0 vf2 :mask #b1000) + (.add.mul.y.vf acc vf0 vf2 acc :mask #b1000) + (.add.mul.z.vf vf2 vf0 vf2 acc :mask #b1000) + (.isqrt.vf Q vf3 vf2 :fsf #b0 :ftf #b11) + (.wait.vf) + (.mul.vf vf1 vf1 Q :mask #b111) + (.nop.vf) + (.nop.vf) + (.nop.vf) + (.svf (&-> v1-30 quad) vf1) + ) + ) + ) + ) + ) + (if (not (logtest? (-> obj flags) (nav-state-flag touching-sphere))) + (logclear! (-> obj flags) (nav-state-flag trapped-by-sphere)) + ) + 0 + (none) + ) + ) + +;; definition for method 54 of type nav-state +;; WARN: Return type mismatch int vs none. +(defmethod clamp-travel-vector nav-state ((obj nav-state)) + (let ((s5-0 (new 'stack-no-clear 'clamp-travel-vector-to-mesh-return-info))) + (clamp-vector-to-mesh-cross-gaps + (-> obj mesh) + (-> obj virtual-current-pos-local) + (-> obj virtual-current-poly) + (-> obj travel) + (-> obj mesh work nav-poly-min-dist) + (not (or (logtest? (-> obj nav flags) (nav-control-flag no-redirect-in-clamp)) + (logtest? (-> obj nav flags) (nav-control-flag limit-rotation-rate)) + ) + ) + s5-0 + ) + (when (-> s5-0 gap-poly) + (set! (-> obj next-poly) (-> s5-0 gap-poly)) + (let* ((v1-12 (-> obj travel)) + (f0-4 (+ (* (-> v1-12 x) (-> v1-12 x)) (* (-> v1-12 z) (-> v1-12 z)))) + (f1-3 1024.0) + ) + (if (< f0-4 (* f1-3 f1-3)) + (logior! (-> obj flags) (nav-state-flag at-gap)) + ) + ) + ) + ) + (let ((v1-19 (new 'stack-no-clear 'vector))) + (vector-! v1-19 (-> obj virtual-current-pos-local) (-> obj current-pos-local)) + (vector+! (-> obj travel) (-> obj travel) v1-19) + ) + (set! (-> obj travel y) 0.0) + 0 + (none) + ) + +;; definition for method 11 of type nav-state +;; INFO: Used lq/sq +;; WARN: Stack slot offset 56 signed mismatch +;; WARN: Stack slot offset 56 signed mismatch +;; WARN: Stack slot offset 56 signed mismatch +;; WARN: Stack slot offset 56 signed mismatch +(defmethod plan-over-pat1-polys-using-route nav-state ((obj nav-state) (arg0 nav-gap-info)) + (local-vars (sv-48 vector) (sv-52 vector) (sv-56 float)) + (let ((a1-1 (-> obj next-poly))) + (when (logtest? (the-as int (-> a1-1 pat)) 1) + (while (and a1-1 (logtest? (the-as int (-> a1-1 pat)) 1)) + (set! a1-1 (lookup-poly-on-route-to-target (-> obj mesh) a1-1 (-> obj target-poly))) + ) + (when (and a1-1 (!= a1-1 (-> obj current-poly))) + (set! (-> arg0 poly) a1-1) + (-> obj mesh) + (let ((s3-0 (-> arg0 poly)) + (s4-0 (-> arg0 dest)) + ) + (let ((s2-0 (-> obj current-pos-local))) + (set! sv-48 (new 'stack-no-clear 'vector)) + (set! sv-52 (new 'stack-no-clear 'vector)) + (set! sv-56 10000000000000000000000000000000000000.0) + (let* ((s1-0 (-> s3-0 vertex-count)) + (v1-13 (the-as int (+ s1-0 -1))) + ) + (dotimes (s0-0 (the-as int s1-0)) + (let ((f0-1 (vector-segment-distance-point! s2-0 (-> s3-0 vertex v1-13) (-> s3-0 vertex s0-0) sv-48))) + (when (< f0-1 sv-56) + (set! sv-56 f0-1) + (set! (-> sv-52 quad) (-> sv-48 quad)) + ) + ) + (set! v1-13 s0-0) + ) + ) + ) + (set! (-> s4-0 quad) (-> sv-52 quad)) + ) + (vector+! (-> arg0 dest) (-> arg0 dest) (-> obj mesh bounds)) + #t + ) + ) + ) + ) + +;; definition for method 24 of type nav-state +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod turn-and-navigate-to-destination nav-state ((obj nav-state)) + (rlet ((acc :class vf) + (Q :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + ) + (init-vf0-vector) + (set! (-> obj rotation-rate) (-> obj nav max-rotation-rate)) + (if (< 0.0 (-> obj speed)) + (set! (-> obj rotation-rate) + (fmin + (-> obj rotation-rate) + (* (/ (-> obj nav turning-acceleration) (-> obj speed)) (-> obj mesh work rad-to-deg)) + ) + ) + ) + (when (logtest? (-> obj nav flags) (nav-control-flag update-heading-from-facing)) + (vector-z-quaternion! (-> obj heading) (-> obj nav shape quat)) + (set! (-> obj heading y) 0.0) + (let ((v1-12 (-> obj heading))) + (let ((f0-5 1.0)) + (.lvf vf1 (&-> v1-12 quad)) + (.mul.vf vf2 vf1 vf1 :mask #b111) + (let ((a0-3 f0-5)) + (.mov vf3 a0-3) + ) + ) + (.mul.x.vf acc vf0 vf2 :mask #b1000) + (.add.mul.y.vf acc vf0 vf2 acc :mask #b1000) + (.add.mul.z.vf vf2 vf0 vf2 acc :mask #b1000) + (.isqrt.vf Q vf3 vf2 :fsf #b0 :ftf #b11) + (.wait.vf) + (.mul.vf vf1 vf1 Q :mask #b111) + (.nop.vf) + (.nop.vf) + (.nop.vf) + (.svf (&-> v1-12 quad) vf1) + ) + ) + (let ((a1-1 (new 'stack-no-clear 'vector))) + (set! (-> a1-1 quad) (-> obj nav shape trans quad)) + (if (or (not (-> obj current-poly)) + (!= (-> obj current-pos x) (-> a1-1 x)) + (!= (-> obj current-pos z) (-> a1-1 z)) + ) + (do-navigation-to-destination obj a1-1) + ) + ) + (logclear! + (-> obj flags) + (nav-state-flag blocked in-target-poly at-target avoiding-sphere touching-sphere at-gap) + ) + 0 + (none) + ) + ) + +;; definition for method 25 of type nav-state +;; WARN: Return type mismatch int vs none. +(defmethod navigate-using-route-portals-wrapper nav-state ((obj nav-state)) + (navigate-using-route-portals obj) + 0 + (none) + ) + +;; definition for method 26 of type nav-state +;; WARN: Return type mismatch int vs none. +(defmethod navigate-using-best-dir-recompute-avoid-spheres-1-wrapper nav-state ((obj nav-state)) + (navigate-using-best-dir-recompute-avoid-spheres-1 obj) + 0 + (none) + ) + +;; definition for method 27 of type nav-state +;; WARN: Return type mismatch int vs none. +(defmethod navigate-within-poly-wrapper nav-state ((obj nav-state)) + (navigate-within-poly obj) + 0 + (none) + ) + +;; definition for method 28 of type nav-state +;; WARN: Stack slot offset 192 signed mismatch +;; WARN: Stack slot offset 192 signed mismatch +;; WARN: Stack slot offset 200 signed mismatch +;; WARN: Stack slot offset 196 signed mismatch +;; WARN: Stack slot offset 196 signed mismatch +;; WARN: Stack slot offset 204 signed mismatch +;; WARN: Stack slot offset 204 signed mismatch +;; WARN: Stack slot offset 192 signed mismatch +;; WARN: Stack slot offset 192 signed mismatch +;; WARN: Stack slot offset 200 signed mismatch +;; WARN: Stack slot offset 196 signed mismatch +;; WARN: Stack slot offset 196 signed mismatch +;; WARN: Stack slot offset 192 signed mismatch +;; WARN: Stack slot offset 192 signed mismatch +;; WARN: Stack slot offset 200 signed mismatch +;; WARN: Stack slot offset 196 signed mismatch +;; WARN: Stack slot offset 196 signed mismatch +;; WARN: Stack slot offset 204 signed mismatch +;; WARN: Stack slot offset 204 signed mismatch +;; WARN: Stack slot offset 192 signed mismatch +;; WARN: Stack slot offset 192 signed mismatch +;; WARN: Stack slot offset 200 signed mismatch +;; WARN: Stack slot offset 196 signed mismatch +;; WARN: Stack slot offset 196 signed mismatch +;; WARN: Stack slot offset 204 signed mismatch +;; WARN: Stack slot offset 204 signed mismatch +;; WARN: Return type mismatch int vs none. +(defmethod compute-travel-speed nav-state ((obj nav-state)) + (local-vars (sv-192 float) (sv-196 float) (sv-200 float) (sv-204 float) (sv-224 vector)) + (let ((s5-0 obj)) + (let ((s4-0 (new 'stack-no-clear 'clamp-travel-vector-to-mesh-return-info))) + (clamp-vector-to-mesh-cross-gaps + (-> s5-0 mesh) + (-> s5-0 virtual-current-pos-local) + (-> s5-0 virtual-current-poly) + (-> s5-0 travel) + (-> s5-0 mesh work nav-poly-min-dist) + (not (or (logtest? (-> s5-0 nav flags) (nav-control-flag no-redirect-in-clamp)) + (logtest? (-> s5-0 nav flags) (nav-control-flag limit-rotation-rate)) + ) + ) + s4-0 + ) + (when (-> s4-0 gap-poly) + (set! (-> s5-0 next-poly) (-> s4-0 gap-poly)) + (let* ((v1-12 (-> s5-0 travel)) + (f0-4 (+ (* (-> v1-12 x) (-> v1-12 x)) (* (-> v1-12 z) (-> v1-12 z)))) + (f1-3 1024.0) + ) + (if (< f0-4 (* f1-3 f1-3)) + (logior! (-> s5-0 flags) (nav-state-flag at-gap)) + ) + ) + ) + ) + (let ((v1-19 (new 'stack-no-clear 'vector))) + (vector-! v1-19 (-> s5-0 virtual-current-pos-local) (-> s5-0 current-pos-local)) + (vector+! (-> s5-0 travel) (-> s5-0 travel) v1-19) + ) + (set! (-> s5-0 travel y) 0.0) + ) + 0 + (cond + ((logtest? (-> obj nav flags) (nav-control-flag use-momentum)) + (set! sv-192 (-> obj nav target-speed)) + (if (not (logtest? (-> obj nav flags) (nav-control-flag momentum-ignore-heading))) + (set! sv-192 (* sv-192 (fmax 0.0 (vector-dot (-> obj heading) (-> obj target-dir))))) + ) + (set! sv-196 (- sv-192 (-> obj speed))) + (set! sv-200 (* (-> obj nav sec-per-frame) (-> obj nav acceleration))) + (set! sv-204 (fmin sv-200 (fabs sv-196))) + (if (< sv-196 0.0) + (set! (-> obj speed) (- (-> obj speed) sv-204)) + (+! (-> obj speed) sv-204) + ) + ) + (else + (set! (-> obj speed) (-> obj nav target-speed)) + ) + ) + (let* ((f0-22 (/ (vector-length (-> obj travel)) (-> obj nav sec-per-frame))) + (f1-18 (fmin (* (-> obj nav speed-scale) (-> obj speed)) f0-22)) + ) + (set! sv-224 (new 'stack-no-clear 'vector)) + (when (< f0-22 (-> obj speed)) + (set! (-> obj prev-speed) (-> obj speed)) + (set! (-> obj speed) (/ f0-22 (-> obj nav speed-scale))) + ) + (vector-normalize-copy! sv-224 (-> obj travel) f1-18) + ) + (set! (-> obj velocity x) (-> sv-224 x)) + (set! (-> obj velocity z) (-> sv-224 z)) + 0 + (none) + ) + +;; definition for method 34 of type nav-state +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod navigate-v1! nav-state ((obj nav-state)) + (rlet ((acc :class vf) + (Q :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + ) + (init-vf0-vector) + (let ((s5-0 obj)) + (set! (-> s5-0 rotation-rate) (-> s5-0 nav max-rotation-rate)) + (if (< 0.0 (-> s5-0 speed)) + (set! (-> s5-0 rotation-rate) + (fmin + (-> s5-0 rotation-rate) + (* (/ (-> s5-0 nav turning-acceleration) (-> s5-0 speed)) (-> s5-0 mesh work rad-to-deg)) + ) + ) + ) + (when (logtest? (-> s5-0 nav flags) (nav-control-flag update-heading-from-facing)) + (vector-z-quaternion! (-> s5-0 heading) (-> s5-0 nav shape quat)) + (set! (-> s5-0 heading y) 0.0) + (let ((v1-12 (-> s5-0 heading))) + (let ((f0-5 1.0)) + (.lvf vf1 (&-> v1-12 quad)) + (.mul.vf vf2 vf1 vf1 :mask #b111) + (let ((a0-3 f0-5)) + (.mov vf3 a0-3) + ) + ) + (.mul.x.vf acc vf0 vf2 :mask #b1000) + (.add.mul.y.vf acc vf0 vf2 acc :mask #b1000) + (.add.mul.z.vf vf2 vf0 vf2 acc :mask #b1000) + (.isqrt.vf Q vf3 vf2 :fsf #b0 :ftf #b11) + (.wait.vf) + (.mul.vf vf1 vf1 Q :mask #b111) + (.nop.vf) + (.nop.vf) + (.nop.vf) + (.svf (&-> v1-12 quad) vf1) + ) + ) + (let ((a1-1 (new 'stack-no-clear 'vector))) + (set! (-> a1-1 quad) (-> s5-0 nav shape trans quad)) + (if (or (not (-> s5-0 current-poly)) + (!= (-> s5-0 current-pos x) (-> a1-1 x)) + (!= (-> s5-0 current-pos z) (-> a1-1 z)) + ) + (do-navigation-to-destination s5-0 a1-1) + ) + ) + (logclear! + (-> s5-0 flags) + (nav-state-flag blocked in-target-poly at-target avoiding-sphere touching-sphere at-gap) + ) + ) + 0 + (navigate-using-route-portals obj) + 0 + (let* ((v1-26 (-> obj nav)) + (a0-13 (-> v1-26 state mesh sphere-hash sphere-array)) + (a1-2 (-> v1-26 sphere-id-array)) + (a2-1 (-> v1-26 state mesh bounds)) + (a3-0 (-> v1-26 root-nav-sphere)) + (t0-0 (-> v1-26 sphere-count)) + ) + (dotimes (t1-0 t0-0) + (let ((t3-0 (-> a0-13 (-> a1-2 t1-0))) + (t2-4 (-> v1-26 sphere-array t1-0)) + ) + (vector-! (the-as vector t2-4) (the-as vector t3-0) a2-1) + (set! (-> t2-4 r) (+ (-> t3-0 r) (-> a3-0 w))) + ) + ) + ) + 0 + (navigate-using-best-dir-recompute-avoid-spheres-1 obj) + 0 + (navigate-within-poly obj) + 0 + (compute-travel-speed obj) + 0 + (none) + ) + ) + +;; definition for method 35 of type nav-state +;; WARN: Return type mismatch int vs none. +(defmethod reset-target! nav-state ((obj nav-state)) + (vector-reset! (-> obj target-dir)) + 0 + (none) + ) + +;; definition for method 36 of type nav-state +;; WARN: Return type mismatch int vs none. +(defmethod add-offset-to-target! nav-state ((obj nav-state) (arg0 vector)) + (vector+! (-> obj target-dir) (-> obj target-dir) arg0) + 0 + (none) + ) + +;; definition for method 29 of type nav-state +;; WARN: Return type mismatch int vs none. +(defmethod nav-state-method-29 nav-state ((obj nav-state)) + 0 + (none) + ) + +;; definition for method 30 of type nav-state +;; WARN: Return type mismatch int vs none. +(defmethod nav-state-method-30 nav-state ((obj nav-state)) + 0 + (none) + ) + +;; definition for method 31 of type nav-state +;; INFO: Used lq/sq +;; WARN: Stack slot offset 220 signed mismatch +;; WARN: Stack slot offset 224 signed mismatch +;; WARN: Stack slot offset 220 signed mismatch +;; WARN: Stack slot offset 224 signed mismatch +;; WARN: Stack slot offset 220 signed mismatch +;; WARN: Stack slot offset 236 signed mismatch +;; WARN: Stack slot offset 224 signed mismatch +;; WARN: Stack slot offset 240 signed mismatch +;; WARN: Stack slot offset 236 signed mismatch +;; WARN: Stack slot offset 240 signed mismatch +;; WARN: Stack slot offset 220 signed mismatch +;; WARN: Stack slot offset 224 signed mismatch +;; WARN: Stack slot offset 220 signed mismatch +;; WARN: Stack slot offset 224 signed mismatch +;; WARN: Stack slot offset 220 signed mismatch +;; WARN: Stack slot offset 224 signed mismatch +;; WARN: Stack slot offset 220 signed mismatch +;; WARN: Stack slot offset 236 signed mismatch +;; WARN: Stack slot offset 224 signed mismatch +;; WARN: Stack slot offset 240 signed mismatch +;; WARN: Stack slot offset 236 signed mismatch +;; WARN: Stack slot offset 240 signed mismatch +;; WARN: Stack slot offset 220 signed mismatch +;; WARN: Stack slot offset 224 signed mismatch +;; WARN: Stack slot offset 220 signed mismatch +;; WARN: Stack slot offset 224 signed mismatch +;; WARN: Stack slot offset 220 signed mismatch +;; WARN: Stack slot offset 224 signed mismatch +;; WARN: Stack slot offset 220 signed mismatch +;; WARN: Stack slot offset 236 signed mismatch +;; WARN: Stack slot offset 224 signed mismatch +;; WARN: Stack slot offset 240 signed mismatch +;; WARN: Stack slot offset 236 signed mismatch +;; WARN: Stack slot offset 240 signed mismatch +;; WARN: Stack slot offset 220 signed mismatch +;; WARN: Stack slot offset 224 signed mismatch +;; WARN: Stack slot offset 220 signed mismatch +;; WARN: Stack slot offset 224 signed mismatch +;; WARN: Stack slot offset 220 signed mismatch +;; WARN: Stack slot offset 224 signed mismatch +;; WARN: Stack slot offset 220 signed mismatch +;; WARN: Stack slot offset 236 signed mismatch +;; WARN: Stack slot offset 224 signed mismatch +;; WARN: Stack slot offset 240 signed mismatch +;; WARN: Stack slot offset 236 signed mismatch +;; WARN: Stack slot offset 240 signed mismatch +;; WARN: Stack slot offset 220 signed mismatch +;; WARN: Stack slot offset 224 signed mismatch +;; WARN: Stack slot offset 220 signed mismatch +;; WARN: Stack slot offset 224 signed mismatch +;; WARN: Stack slot offset 220 signed mismatch +;; WARN: Stack slot offset 224 signed mismatch +;; WARN: Stack slot offset 220 signed mismatch +;; WARN: Stack slot offset 236 signed mismatch +;; WARN: Stack slot offset 224 signed mismatch +;; WARN: Stack slot offset 240 signed mismatch +;; WARN: Stack slot offset 236 signed mismatch +;; WARN: Stack slot offset 240 signed mismatch +;; WARN: Stack slot offset 220 signed mismatch +;; WARN: Stack slot offset 224 signed mismatch +;; WARN: Stack slot offset 220 signed mismatch +;; WARN: Stack slot offset 224 signed mismatch +;; WARN: Stack slot offset 220 signed mismatch +;; WARN: Stack slot offset 224 signed mismatch +;; WARN: Stack slot offset 220 signed mismatch +;; WARN: Stack slot offset 236 signed mismatch +;; WARN: Stack slot offset 224 signed mismatch +;; WARN: Stack slot offset 240 signed mismatch +;; WARN: Stack slot offset 236 signed mismatch +;; WARN: Stack slot offset 240 signed mismatch +;; WARN: Stack slot offset 220 signed mismatch +;; WARN: Stack slot offset 224 signed mismatch +;; WARN: Stack slot offset 220 signed mismatch +;; WARN: Stack slot offset 224 signed mismatch +;; WARN: Stack slot offset 220 signed mismatch +;; WARN: Stack slot offset 224 signed mismatch +;; WARN: Stack slot offset 220 signed mismatch +;; WARN: Stack slot offset 236 signed mismatch +;; WARN: Stack slot offset 224 signed mismatch +;; WARN: Stack slot offset 240 signed mismatch +;; WARN: Stack slot offset 236 signed mismatch +;; WARN: Stack slot offset 240 signed mismatch +;; WARN: Stack slot offset 220 signed mismatch +;; WARN: Stack slot offset 224 signed mismatch +;; WARN: Stack slot offset 220 signed mismatch +;; WARN: Stack slot offset 224 signed mismatch +;; WARN: Stack slot offset 220 signed mismatch +;; WARN: Stack slot offset 224 signed mismatch +;; WARN: Stack slot offset 220 signed mismatch +;; WARN: Stack slot offset 236 signed mismatch +;; WARN: Stack slot offset 224 signed mismatch +;; WARN: Stack slot offset 240 signed mismatch +;; WARN: Stack slot offset 236 signed mismatch +;; WARN: Stack slot offset 240 signed mismatch +;; WARN: Stack slot offset 220 signed mismatch +;; WARN: Stack slot offset 224 signed mismatch +;; WARN: Return type mismatch int vs none. +(defmethod navigate-using-best-dir-recompute-avoid-spheres-2 nav-state ((obj nav-state)) + (local-vars + (sv-192 int) + (sv-200 nav-mesh-work) + (sv-204 nav-poly) + (sv-208 uint8) + (sv-212 (pointer int8)) + (sv-216 (pointer int8)) + (sv-220 float) + (sv-224 float) + (sv-228 vector) + (sv-232 vector) + (sv-236 float) + (sv-240 float) + (sv-244 uint) + ) + (rlet ((acc :class vf) + (Q :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + ) + (init-vf0-vector) + (let ((s5-0 (new 'stack-no-clear 'nav-avoid-spheres-params))) + (set! (-> s5-0 current-pos quad) (-> obj virtual-current-pos-local quad)) + (set! (-> s5-0 travel quad) (-> obj travel quad)) + (set! (-> s5-0 pref-dir quad) (-> (if (logtest? (-> obj flags) (nav-state-flag trapped-by-sphere)) + (-> obj heading) + (-> obj travel) + ) + quad + ) + ) + (avoid-spheres-2! (-> obj nav) s5-0) + (let ((v1-5 obj)) + (when (-> s5-0 avoiding-sphere?) + (logior! (-> v1-5 flags) (nav-state-flag avoiding-sphere)) + (let ((f0-0 (-> s5-0 closest-sphere-dist2)) + (f1-0 512.0) + ) + (if (< f0-0 (* f1-0 f1-0)) + (logior! (-> v1-5 flags) (nav-state-flag touching-sphere)) + ) + ) + (set! (-> v1-5 travel quad) (-> s5-0 out-travel 0 quad)) + (let ((a0-20 (new 'stack-no-clear 'nav-ray))) + (set! (-> a0-20 current-pos quad) (-> v1-5 virtual-current-pos-local quad)) + (set! (-> a0-20 current-poly) (-> v1-5 virtual-current-poly)) + (vector+! (-> a0-20 dest-pos) (-> v1-5 virtual-current-pos-local) (-> v1-5 travel)) + (let ((a1-6 0)) + (let ((a2-3 a0-20)) + (vector-! (-> a2-3 dir) (-> a2-3 dest-pos) (-> a2-3 current-pos)) + (set! (-> a2-3 dir y) 0.0) + (let ((a3-3 (-> a2-3 dir))) + (let ((f0-2 1.0)) + (.lvf vf1 (&-> a3-3 quad)) + (.mul.vf vf2 vf1 vf1 :mask #b111) + (let ((t0-2 f0-2)) + (.mov vf3 t0-2) + ) + ) + (.mul.x.vf acc vf0 vf2 :mask #b1000) + (.add.mul.y.vf acc vf0 vf2 acc :mask #b1000) + (.add.mul.z.vf vf2 vf0 vf2 acc :mask #b1000) + (.isqrt.vf Q vf3 vf2 :fsf #b0 :ftf #b11) + (.wait.vf) + (.mul.vf vf1 vf1 Q :mask #b111) + (.nop.vf) + (.nop.vf) + (.nop.vf) + (.svf (&-> a3-3 quad) vf1) + ) + (set! (-> a2-3 next-poly) #f) + (set! (-> a2-3 len) 0.0) + (set! (-> a2-3 last-edge) -1) + (set! (-> a2-3 terminated) #f) + (set! (-> a2-3 reached-dest) #f) + (set! (-> a2-3 hit-boundary) #f) + (set! (-> a2-3 hit-gap) #f) + (set! (-> a2-3 ignore) (the-as uint 3)) + ) + 0 + (until (or (>= a1-6 15) (-> a0-20 terminated)) + (+! a1-6 1) + (let ((a3-6 (-> v1-5 mesh)) + (a2-5 a0-20) + ) + (set! sv-192 -1) + (set! sv-200 (-> a3-6 work)) + (set! sv-204 (-> a2-5 current-poly)) + (set! sv-208 (-> a2-5 current-poly vertex-count)) + (set! sv-212 (-> a3-6 work vert0-table)) + (set! sv-216 (-> a3-6 work vert1-table)) + (set! sv-220 (- (-> a2-5 dest-pos x) (-> a2-5 current-pos x))) + (set! sv-224 (- (-> a2-5 dest-pos z) (-> a2-5 current-pos z))) + (dotimes (t0-12 (the-as int sv-208)) + (set! sv-228 (-> sv-204 vertex (-> sv-212 t0-12))) + (set! sv-232 (-> sv-204 vertex (-> sv-216 t0-12))) + (set! sv-236 (- (-> sv-228 z) (-> sv-232 z))) + (set! sv-240 (- (-> sv-232 x) (-> sv-228 x))) + (let ((f0-14 (+ (* sv-220 sv-236) (* sv-224 sv-240)))) + (when (< 0.0 f0-14) + (let ((f1-13 + (+ (* sv-236 (- (-> sv-228 x) (-> a2-5 current-pos x))) (* sv-240 (- (-> sv-228 z) (-> a2-5 current-pos z)))) + ) + ) + (when (< f1-13 f0-14) + (set! sv-192 t0-12) + (let ((f0-16 (fmax 0.0 (/ f1-13 f0-14)))) + (set! sv-220 (* sv-220 f0-16)) + (set! sv-224 (* sv-224 f0-16)) + ) + ) + ) + ) + ) + ) + (let ((f0-20 (+ (* sv-220 (-> a2-5 dir x)) (* sv-224 (-> a2-5 dir z))))) + (+! (-> a2-5 len) f0-20) + ) + 0 + (set! (-> a2-5 next-poly) #f) + (cond + ((= sv-192 -1) + (set! (-> a2-5 current-pos quad) (-> a2-5 dest-pos quad)) + (set! (-> a2-5 reached-dest) #t) + (set! (-> a2-5 terminated) #t) + ) + (else + (+! (-> a2-5 current-pos x) sv-220) + (+! (-> a2-5 current-pos z) sv-224) + (set! sv-244 (-> sv-204 adj-poly sv-192)) + (if (!= sv-244 255) + (set! (-> a2-5 next-poly) (-> a3-6 poly-array sv-244)) + ) + (cond + ((and (-> a2-5 next-poly) (zero? (logand (-> a2-5 next-poly pat) (-> a2-5 ignore)))) + (set! (-> a2-5 current-poly) (-> a2-5 next-poly)) + ) + (else + (set! (-> a2-5 last-edge) sv-192) + (if (-> a2-5 next-poly) + (set! (-> a2-5 hit-gap) #t) + (set! (-> a2-5 hit-boundary) #t) + ) + (set! (-> a2-5 terminated) #t) + ) + ) + ) + ) + ) + 0 + ) + ) + (cond + ((or (-> a0-20 reached-dest) (-> a0-20 hit-gap) (>= (-> a0-20 len) 4096.0)) + (set! (-> v1-5 travel quad) (-> s5-0 out-travel 0 quad)) + ) + (else + (set! (-> v1-5 travel quad) (-> s5-0 out-travel 1 quad)) + (logior! (-> v1-5 flags) (nav-state-flag trapped-by-sphere)) + ) + ) + ) + ) + ) + ) + 0 + (if (not (logtest? (-> obj flags) (nav-state-flag touching-sphere))) + (logclear! (-> obj flags) (nav-state-flag trapped-by-sphere)) + ) + 0 + (none) + ) + ) + +;; definition for method 32 of type nav-state +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod update-travel-dir-from-spheres nav-state ((obj nav-state)) + (local-vars (v1-11 float) (v1-25 float)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (let ((s5-0 (new 'stack-no-clear 'nav-control-cfs-work))) + (vector-reset! (-> s5-0 in-dir)) + (set! (-> s5-0 best-dir 0 quad) (-> obj travel quad)) + (set! (-> s5-0 best-dir 0 y) 0.0) + (vector-normalize! (the-as vector (-> s5-0 best-dir)) (-> obj nav target-speed)) + (vector-! (-> s5-0 right-dir) (the-as vector (-> s5-0 best-dir)) (-> obj velocity)) + (vector-float*! (-> s5-0 right-dir) (-> s5-0 right-dir) 4.0) + (vector+! (-> s5-0 in-dir) (-> s5-0 in-dir) (-> s5-0 right-dir)) + (dotimes (s4-0 (-> obj nav sphere-count)) + (let ((s3-0 (-> obj nav sphere-array s4-0))) + (vector-! (-> s5-0 right-dir) (-> obj current-pos-local) (the-as vector s3-0)) + (.lvf vf1 (&-> (-> s5-0 right-dir) quad)) + (.add.w.vf vf2 vf0 vf0 :mask #b1) + (.mul.vf vf1 vf1 vf1) + (.mul.x.vf acc vf2 vf1 :mask #b1) + (.add.mul.y.vf acc vf2 vf1 acc :mask #b1) + (.add.mul.z.vf vf1 vf2 vf1 acc :mask #b1) + (.mov v1-11 vf1) + (let ((f30-0 v1-11)) + (vector-normalize! (-> s5-0 right-dir) 2.0) + (let* ((f0-4 (+ (-> obj nav root-nav-sphere w) (-> s3-0 r))) + (f1-1 (* f0-4 f0-4)) + (f0-7 (fmax 0.0 (/ (- f1-1 f30-0) f1-1))) + ) + (vector-float*! (-> s5-0 right-dir) (-> s5-0 right-dir) (* 81920.0 f0-7)) + ) + ) + ) + (vector+! (-> s5-0 in-dir) (-> s5-0 in-dir) (-> s5-0 right-dir)) + ) + (vector+! (-> obj target-dir) (-> obj target-dir) (-> s5-0 in-dir)) + ) + (set! (-> obj target-dir y) 0.0) + (vector+float*! (-> obj velocity) (-> obj velocity) (-> obj target-dir) (-> obj nav sec-per-frame)) + (.lvf vf1 (&-> (-> obj velocity) quad)) + (.add.w.vf vf2 vf0 vf0 :mask #b1) + (.mul.vf vf1 vf1 vf1) + (.mul.x.vf acc vf2 vf1 :mask #b1) + (.add.mul.y.vf acc vf2 vf1 acc :mask #b1) + (.add.mul.z.vf vf1 vf2 vf1 acc :mask #b1) + (.mov v1-25 vf1) + (let ((f0-11 v1-25) + (f1-4 (-> obj nav target-speed)) + ) + (if (< (* f1-4 f1-4) f0-11) + (vector-float*! (-> obj velocity) (-> obj velocity) (/ (-> obj nav target-speed) (sqrtf f0-11))) + ) + ) + (vector-float*! (-> obj travel) (-> obj velocity) (-> obj nav sec-per-frame)) + 0 + (none) + ) + ) + +;; definition for method 33 of type nav-state +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod compute-speed-simple nav-state ((obj nav-state)) + (rlet ((acc :class vf) + (Q :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + ) + (init-vf0-vector) + (let ((s5-0 (new 'stack-no-clear 'clamp-travel-vector-to-mesh-return-info))) + (clamp-vector-to-mesh-cross-gaps + (-> obj mesh) + (-> obj virtual-current-pos-local) + (-> obj virtual-current-poly) + (-> obj travel) + (-> obj mesh work nav-poly-min-dist) + #t + s5-0 + ) + (if (-> s5-0 gap-poly) + (set! (-> obj next-poly) (-> s5-0 gap-poly)) + ) + ) + (let* ((f0-1 40.96) + (f0-3 (* f0-1 f0-1)) + (v1-9 (-> obj travel)) + ) + (when (< f0-3 (+ (* (-> v1-9 x) (-> v1-9 x)) (* (-> v1-9 z) (-> v1-9 z)))) + (set! (-> obj heading quad) (-> obj travel quad)) + (set! (-> obj heading y) 0.0) + (let ((v1-13 (-> obj heading))) + (let ((f0-5 1.0)) + (.lvf vf1 (&-> v1-13 quad)) + (.mul.vf vf2 vf1 vf1 :mask #b111) + (let ((a0-5 f0-5)) + (.mov vf3 a0-5) + ) + ) + (.mul.x.vf acc vf0 vf2 :mask #b1000) + (.add.mul.y.vf acc vf0 vf2 acc :mask #b1000) + (.add.mul.z.vf vf2 vf0 vf2 acc :mask #b1000) + (.isqrt.vf Q vf3 vf2 :fsf #b0 :ftf #b11) + (.wait.vf) + (.mul.vf vf1 vf1 Q :mask #b111) + (.nop.vf) + (.nop.vf) + (.nop.vf) + (.svf (&-> v1-13 quad) vf1) + ) + ) + ) + (vector-float*! (-> obj velocity) (-> obj travel) (/ 1.0 (-> obj nav sec-per-frame))) + (set! (-> obj speed) (vector-length (-> obj velocity))) + (vector-reset! (-> obj target-dir)) + 0 + (none) + ) + ) + +;; definition for method 37 of type nav-state +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod navigate-v2! nav-state ((obj nav-state)) + (rlet ((acc :class vf) + (Q :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + ) + (init-vf0-vector) + (let ((s5-0 obj)) + (set! (-> s5-0 rotation-rate) (-> s5-0 nav max-rotation-rate)) + (if (< 0.0 (-> s5-0 speed)) + (set! (-> s5-0 rotation-rate) + (fmin + (-> s5-0 rotation-rate) + (* (/ (-> s5-0 nav turning-acceleration) (-> s5-0 speed)) (-> s5-0 mesh work rad-to-deg)) + ) + ) + ) + (when (logtest? (-> s5-0 nav flags) (nav-control-flag update-heading-from-facing)) + (vector-z-quaternion! (-> s5-0 heading) (-> s5-0 nav shape quat)) + (set! (-> s5-0 heading y) 0.0) + (let ((v1-12 (-> s5-0 heading))) + (let ((f0-5 1.0)) + (.lvf vf1 (&-> v1-12 quad)) + (.mul.vf vf2 vf1 vf1 :mask #b111) + (let ((a0-3 f0-5)) + (.mov vf3 a0-3) + ) + ) + (.mul.x.vf acc vf0 vf2 :mask #b1000) + (.add.mul.y.vf acc vf0 vf2 acc :mask #b1000) + (.add.mul.z.vf vf2 vf0 vf2 acc :mask #b1000) + (.isqrt.vf Q vf3 vf2 :fsf #b0 :ftf #b11) + (.wait.vf) + (.mul.vf vf1 vf1 Q :mask #b111) + (.nop.vf) + (.nop.vf) + (.nop.vf) + (.svf (&-> v1-12 quad) vf1) + ) + ) + (let ((a1-1 (new 'stack-no-clear 'vector))) + (set! (-> a1-1 quad) (-> s5-0 nav shape trans quad)) + (if (or (not (-> s5-0 current-poly)) + (!= (-> s5-0 current-pos x) (-> a1-1 x)) + (!= (-> s5-0 current-pos z) (-> a1-1 z)) + ) + (do-navigation-to-destination s5-0 a1-1) + ) + ) + (logclear! + (-> s5-0 flags) + (nav-state-flag blocked in-target-poly at-target avoiding-sphere touching-sphere at-gap) + ) + ) + 0 + (navigate-using-route-portals obj) + 0 + (let* ((v1-26 (-> obj nav)) + (a0-13 (-> v1-26 state mesh sphere-hash sphere-array)) + (a1-2 (-> v1-26 sphere-id-array)) + (a2-1 (-> v1-26 state mesh bounds)) + (a3-0 (-> v1-26 root-nav-sphere)) + (t0-0 (-> v1-26 sphere-count)) + ) + (dotimes (t1-0 t0-0) + (let ((t3-0 (-> a0-13 (-> a1-2 t1-0))) + (t2-4 (-> v1-26 sphere-array t1-0)) + ) + (vector-! (the-as vector t2-4) (the-as vector t3-0) a2-1) + (set! (-> t2-4 r) (+ (-> t3-0 r) (-> a3-0 w))) + ) + ) + ) + 0 + (navigate-using-best-dir-recompute-avoid-spheres-2 obj) + (update-travel-dir-from-spheres obj) + (compute-speed-simple obj) + 0 + (none) + ) + ) diff --git a/test/decompiler/reference/jak2/engine/nav/nav-mesh-h_REF.gc b/test/decompiler/reference/jak2/engine/nav/nav-mesh-h_REF.gc index 374e9f4216..3ba22b4b16 100644 --- a/test/decompiler/reference/jak2/engine/nav/nav-mesh-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/nav/nav-mesh-h_REF.gc @@ -1,5 +1,7 @@ +;;-*-Lisp-*- (in-package goal) +;; definition of type nav-mesh-work-debug (deftype nav-mesh-work-debug (structure) ((debug-vec1 vector :inline :offset-assert 0) (debug-vec2 vector :inline :offset-assert 16) @@ -20,6 +22,7 @@ :flag-assert #x9000001c0 ) +;; definition for method 3 of type nav-mesh-work-debug (defmethod inspect nav-mesh-work-debug ((obj nav-mesh-work-debug)) (when (not obj) (set! obj obj) @@ -43,6 +46,7 @@ obj ) +;; definition of type nav-mesh-work (deftype nav-mesh-work (structure) ((vert0-table int8 4 :offset-assert 0) (vert1-table int8 4 :offset-assert 4) @@ -68,6 +72,7 @@ :flag-assert #x90000013c ) +;; definition for method 3 of type nav-mesh-work (defmethod inspect nav-mesh-work ((obj nav-mesh-work)) (when (not obj) (set! obj obj) @@ -96,6 +101,7 @@ obj ) +;; definition of type nav-mesh-link (deftype nav-mesh-link (structure) ((id uint32 :offset-assert 0) (dest-mesh-id uint32 :offset-assert 4) @@ -110,6 +116,7 @@ :flag-assert #x900000010 ) +;; definition for method 3 of type nav-mesh-link (defmethod inspect nav-mesh-link ((obj nav-mesh-link)) (when (not obj) (set! obj obj) @@ -127,6 +134,7 @@ obj ) +;; definition of type nav-poly (deftype nav-poly (structure) ((data uint8 64 :offset-assert 0) (vertex vector 4 :inline :offset 0) @@ -151,6 +159,7 @@ :flag-assert #x900000040 ) +;; definition for method 3 of type nav-poly (defmethod inspect nav-poly ((obj nav-poly)) (when (not obj) (set! obj obj) @@ -178,6 +187,7 @@ obj ) +;; definition of type nav-vertex (deftype nav-vertex (vector) "A typedef for `vector`, not used because our code looks nicer if everything is `vector`s anyway and declared out of order (cannot use forward declared structures in inline arrays)" @@ -187,6 +197,8 @@ :flag-assert #x900000010 ) +;; definition for method 3 of type nav-vertex +;; INFO: Used lq/sq (defmethod inspect nav-vertex ((obj nav-vertex)) (when (not obj) (set! obj obj) @@ -203,6 +215,7 @@ obj ) +;; definition of type nav-sphere (deftype nav-sphere (structure) ((trans sphere :inline :offset-assert 0) ) @@ -211,6 +224,7 @@ :flag-assert #x900000010 ) +;; definition for method 3 of type nav-sphere (defmethod inspect nav-sphere ((obj nav-sphere)) (when (not obj) (set! obj obj) @@ -222,6 +236,7 @@ obj ) +;; definition of type nav-ray (deftype nav-ray (structure) ((current-pos vector :inline :offset-assert 0) (dir vector :inline :offset-assert 16) @@ -241,6 +256,7 @@ :flag-assert #x900000050 ) +;; definition for method 3 of type nav-ray (defmethod inspect nav-ray ((obj nav-ray)) (when (not obj) (set! obj obj) @@ -263,6 +279,7 @@ obj ) +;; definition of type nav-route-portal (deftype nav-route-portal (structure) ((vertex nav-vertex 2 :inline :offset-assert 0) (next-poly nav-poly :offset-assert 32) @@ -273,6 +290,7 @@ :flag-assert #x900000025 ) +;; definition for method 3 of type nav-route-portal (defmethod inspect nav-route-portal ((obj nav-route-portal)) (when (not obj) (set! obj obj) @@ -286,6 +304,7 @@ obj ) +;; definition of type nav-find-poly-parms (deftype nav-find-poly-parms (structure) ((point vector :inline :offset-assert 0) (y-threshold float :offset-assert 16) @@ -299,6 +318,7 @@ :flag-assert #x900000024 ) +;; definition for method 3 of type nav-find-poly-parms (defmethod inspect nav-find-poly-parms ((obj nav-find-poly-parms)) (when (not obj) (set! obj obj) @@ -315,8 +335,9 @@ obj ) +;; definition of type clamp-travel-vector-to-mesh-return-info (deftype clamp-travel-vector-to-mesh-return-info (structure) - ((found-boundary basic :offset-assert 0) + ((found-boundary symbol :offset-assert 0) (intersection vector :inline :offset-assert 16) (boundary-normal vector :inline :offset-assert 32) (prev-normal vector :inline :offset-assert 48) @@ -335,6 +356,7 @@ :flag-assert #x9000000a0 ) +;; definition for method 3 of type clamp-travel-vector-to-mesh-return-info (defmethod inspect clamp-travel-vector-to-mesh-return-info ((obj clamp-travel-vector-to-mesh-return-info)) (when (not obj) (set! obj obj) @@ -358,6 +380,7 @@ obj ) +;; definition of type nav-mesh (deftype nav-mesh (basic) ((work nav-mesh-work :offset-assert 4) (poly-array (inline-array nav-poly) :offset-assert 8) @@ -388,47 +411,48 @@ :size-assert #x70 :flag-assert #x2f00000070 (:methods - (nav-mesh-method-9 (_type_) none 9) + (debug-draw (_type_) none 9) (nav-mesh-method-10 (_type_ vector vector nav-poly) nav-poly 10) - (nav-mesh-method-11 (_type_ nav-poly vector) vector 11) - (nav-mesh-method-12 (_type_ nav-poly vector) none 12) - (nav-mesh-method-13 (_type_ nav-poly nav-poly) nav-poly 13) + (poly-centroid (_type_ nav-poly vector) vector 11) + (poly-centroid-local (_type_ nav-poly vector) vector 12) + (lookup-poly-on-route-to-target (_type_ nav-poly nav-poly) nav-poly 13) (get-route-portal (_type_ nav-poly nav-poly nav-route-portal) (inline-array nav-vertex) 14) (initialize-mesh! (_type_) none 15) (move-along-nav-ray! (_type_ nav-ray) none 16) (try-move-along-ray (_type_ nav-poly vector vector float) meters 17) - (nav-mesh-method-18 (_type_ vector nav-poly vector float symbol clamp-travel-vector-to-mesh-return-info) none 18) - (nav-mesh-method-19 (_type_) none 19) - (nav-mesh-method-20 (_type_ clamp-travel-vector-to-mesh-return-info) none 20) + (clamp-vector-to-mesh-cross-gaps (_type_ vector nav-poly vector float symbol clamp-travel-vector-to-mesh-return-info) none 18) + (clamp-vector-to-mesh-no-gaps (_type_ vector nav-poly vector clamp-travel-vector-to-mesh-return-info) none 19) + (set-normals-from-adjacent-bounds (_type_ clamp-travel-vector-to-mesh-return-info) none 20) (find-adjacent-bounds-one (_type_ vector nav-poly int int) none 21) - (nav-mesh-method-22 (_type_ vector vector) none 22) - (nav-mesh-method-23 (_type_ entity-nav-mesh) none 23) - (nav-mesh-method-24 (_type_) none 24) - (nav-mesh-method-25 (_type_) none 25) - (nav-mesh-method-26 (_type_) none 26) + (compute-bounding-box-from-vertices (_type_ vector vector) none 22) + (init-from-entity (_type_ entity-nav-mesh) none 23) + (handle-birth (_type_) none 24) + (handle-kill (_type_) none 25) + (update-navigation (_type_) none 26) (new-nav-control (_type_ process-drawable int) nav-control 27) - (nav-mesh-method-28 (_type_ object) none 28) - (nav-mesh-method-29 (_type_ process-drawable symbol) nav-control 29) - (nav-mesh-method-30 (_type_ process-drawable) none 30) - (change-to (_type_ process-drawable) none 31) - (nav-mesh-method-32 (_type_ uint32) none 32) - (nav-mesh-method-33 (_type_ uint32) symbol 33) - (nav-mesh-method-34 (_type_ object vector float) none 34) - (nav-mesh-method-35 () none 35) - (nav-mesh-method-36 (_type_ nav-poly rgba) none 36) + (remove-nav-control (_type_ nav-control) none 28) + (add-process-drawable-to-navmesh (_type_ process-drawable symbol) none 29) + (remove-process-drawable (_type_ process-drawable) none 30) + (change-to (_type_ process-drawable symbol) none 31) + (link-by-id (_type_ uint) symbol 32) + (unlink-by-id (_type_ uint) symbol 33) + (nav-mesh-method-34 (_type_ vector vector float) float 34) + (nav-mesh-method-35 (_type_ vector vector float) none 35) + (debug-draw-poly (_type_ nav-poly rgba) none 36) (point-in-poly? (_type_ nav-poly vector) symbol 37) - (nav-mesh-method-38 (_type_ nav-poly vector vector vector object) vector 38) + (nav-mesh-method-38 (_type_ nav-poly vector vector vector (pointer nav-poly)) vector 38) (closest-point-on-boundary (_type_ nav-poly vector vector) none 39) - (nav-mesh-method-40 (_type_ nav-poly vector object vector) none 40) + (project-point-onto-plane-of-poly-local (_type_ nav-poly vector vector vector) none 40) (project-point-into-poly-2d (_type_ nav-poly vector vector) none 41) - (nav-mesh-method-42 (_type_ nav-find-poly-parms) nav-poly 42) - (nav-mesh-method-43 (_type_ nav-find-poly-parms) none 43) - (nav-mesh-method-44 (_type_ vector float float) symbol 44) - (nav-mesh-method-45 (_type_ entity-perm) none 45) - (nav-mesh-method-46 (_type_ object) none 46) + (find-poly-containing-point-local (_type_ nav-find-poly-parms) nav-poly 42) + (find-nearest-poly-to-point-local (_type_ nav-find-poly-parms) nav-find-poly-parms 43) + (is-in-mesh-local? (_type_ vector float float) symbol 44) + (link-to-other-mesh (_type_ nav-mesh-link) symbol 45) + (unlink-mesh (_type_ nav-mesh-link) none 46) ) ) +;; definition for method 3 of type nav-mesh (defmethod inspect nav-mesh ((obj nav-mesh)) (when (not obj) (set! obj obj) @@ -469,6 +493,7 @@ obj ) +;; definition for function vector-normalize-unity! (defun vector-normalize-unity! ((arg0 vector)) (rlet ((acc :class vf) (Q :class vf) @@ -501,6 +526,8 @@ ) ) +;; definition for function vector-normalize-unity-copy! +;; INFO: Used lq/sq (defun vector-normalize-unity-copy! ((arg0 vector) (arg1 vector)) (rlet ((acc :class vf) (Q :class vf) @@ -534,10 +561,13 @@ ) ) +;; definition (debug) for function debug-validate-current-poly (defun-debug debug-validate-current-poly () #f ) +;; definition for function init-ray +;; WARN: Return type mismatch int vs none. (defun init-ray ((arg0 nav-ray)) (rlet ((acc :class vf) (Q :class vf) @@ -581,6 +611,7 @@ ) ) +;; definition for function point-poly-intersection? (defun point-poly-intersection? ((arg0 nav-mesh) (arg1 vector) (arg2 int) (arg3 (inline-array vector))) (let ((v1-1 (-> arg0 work vert0-table)) (a0-2 (-> arg0 work vert1-table)) @@ -603,6 +634,7 @@ #t ) +;; definition for method 37 of type nav-mesh (defmethod point-in-poly? nav-mesh ((obj nav-mesh) (arg0 nav-poly) (arg1 vector)) (let* ((a3-0 obj) (v1-0 arg1) @@ -629,6 +661,13 @@ #t ) +;; definition for method 39 of type nav-mesh +;; INFO: Used lq/sq +;; WARN: Stack slot offset 56 signed mismatch +;; WARN: Stack slot offset 56 signed mismatch +;; WARN: Stack slot offset 56 signed mismatch +;; WARN: Stack slot offset 56 signed mismatch +;; WARN: Return type mismatch vector vs none. (defmethod closest-point-on-boundary nav-mesh ((obj nav-mesh) (arg0 nav-poly) (arg1 vector) (arg2 vector)) (local-vars (sv-48 vector) (sv-52 vector) (sv-56 float)) (set! sv-48 (new 'stack-no-clear 'vector)) @@ -651,6 +690,13 @@ (none) ) +;; definition for method 41 of type nav-mesh +;; INFO: Used lq/sq +;; WARN: Stack slot offset 56 signed mismatch +;; WARN: Stack slot offset 56 signed mismatch +;; WARN: Stack slot offset 56 signed mismatch +;; WARN: Stack slot offset 56 signed mismatch +;; WARN: Return type mismatch vector vs none. (defmethod project-point-into-poly-2d nav-mesh ((obj nav-mesh) (arg0 nav-poly) (arg1 vector) (arg2 vector)) (local-vars (sv-48 vector) (sv-52 vector) (sv-56 float)) (cond @@ -682,6 +728,57 @@ (none) ) +;; definition for method 16 of type nav-mesh +;; INFO: Used lq/sq +;; WARN: Stack slot offset 44 signed mismatch +;; WARN: Stack slot offset 48 signed mismatch +;; WARN: Stack slot offset 44 signed mismatch +;; WARN: Stack slot offset 48 signed mismatch +;; WARN: Stack slot offset 44 signed mismatch +;; WARN: Stack slot offset 60 signed mismatch +;; WARN: Stack slot offset 48 signed mismatch +;; WARN: Stack slot offset 64 signed mismatch +;; WARN: Stack slot offset 60 signed mismatch +;; WARN: Stack slot offset 64 signed mismatch +;; WARN: Stack slot offset 44 signed mismatch +;; WARN: Stack slot offset 48 signed mismatch +;; WARN: Stack slot offset 44 signed mismatch +;; WARN: Stack slot offset 48 signed mismatch +;; WARN: Stack slot offset 44 signed mismatch +;; WARN: Stack slot offset 48 signed mismatch +;; WARN: Stack slot offset 44 signed mismatch +;; WARN: Stack slot offset 60 signed mismatch +;; WARN: Stack slot offset 48 signed mismatch +;; WARN: Stack slot offset 64 signed mismatch +;; WARN: Stack slot offset 60 signed mismatch +;; WARN: Stack slot offset 64 signed mismatch +;; WARN: Stack slot offset 44 signed mismatch +;; WARN: Stack slot offset 48 signed mismatch +;; WARN: Stack slot offset 44 signed mismatch +;; WARN: Stack slot offset 48 signed mismatch +;; WARN: Stack slot offset 44 signed mismatch +;; WARN: Stack slot offset 48 signed mismatch +;; WARN: Stack slot offset 44 signed mismatch +;; WARN: Stack slot offset 60 signed mismatch +;; WARN: Stack slot offset 48 signed mismatch +;; WARN: Stack slot offset 64 signed mismatch +;; WARN: Stack slot offset 60 signed mismatch +;; WARN: Stack slot offset 64 signed mismatch +;; WARN: Stack slot offset 44 signed mismatch +;; WARN: Stack slot offset 48 signed mismatch +;; WARN: Stack slot offset 44 signed mismatch +;; WARN: Stack slot offset 48 signed mismatch +;; WARN: Stack slot offset 44 signed mismatch +;; WARN: Stack slot offset 48 signed mismatch +;; WARN: Stack slot offset 44 signed mismatch +;; WARN: Stack slot offset 60 signed mismatch +;; WARN: Stack slot offset 48 signed mismatch +;; WARN: Stack slot offset 64 signed mismatch +;; WARN: Stack slot offset 60 signed mismatch +;; WARN: Stack slot offset 64 signed mismatch +;; WARN: Stack slot offset 44 signed mismatch +;; WARN: Stack slot offset 48 signed mismatch +;; WARN: Return type mismatch int vs none. (defmethod move-along-nav-ray! nav-mesh ((obj nav-mesh) (ray nav-ray)) (local-vars (next-poly-idx int) @@ -766,6 +863,8 @@ (none) ) +;; definition (debug) for function nav-sphere-from-cam +;; WARN: Return type mismatch int vs none. (defun-debug nav-sphere-from-cam () (let ((v1-0 (camera-pos))) (format #t "SPHEREM(~4,,1M, ~4,,1M, ~4,,1M, 1.0)~%" (-> v1-0 x) (-> v1-0 y) (-> v1-0 z)) diff --git a/test/decompiler/reference/jak2/engine/nav/nav-mesh_REF.gc b/test/decompiler/reference/jak2/engine/nav/nav-mesh_REF.gc new file mode 100644 index 0000000000..ee46ebad51 --- /dev/null +++ b/test/decompiler/reference/jak2/engine/nav/nav-mesh_REF.gc @@ -0,0 +1,2839 @@ +;;-*-Lisp-*- +(in-package goal) + +(rlet ((vf0 :class vf) (vf4 :class vf) (vf5 :class vf) (vf6 :class vf)) +(init-vf0-vector) + +;; definition for symbol *debug-nav-control-output*, type symbol +(define *debug-nav-control-output* #f) + +;; definition for symbol *debug-nav-control*, type symbol +(define *debug-nav-control* #f) + +;; definition for symbol *debug-nav-mesh-output*, type symbol +(define *debug-nav-mesh-output* #f) + +;; definition for symbol *debug-nav-ray*, type nav-ray +(define *debug-nav-ray* (the-as nav-ray #f)) + +;; definition for symbol *debug-ray-offset*, type vector +(define *debug-ray-offset* (new 'static 'vector)) + +;; definition for symbol *debug-offset*, type vector +(define *debug-offset* (new 'static 'vector :y 4096.0 :w 1.0)) + +;; definition for symbol *nav-mesh-work*, type nav-mesh-work +(define *nav-mesh-work* (new 'static 'nav-mesh-work + :vert0-table (new 'static 'array int8 4 0 1 2 3) + :vert1-table (new 'static 'array int8 4 1 2 3 0) + :edge-mask-table (new 'static 'array uint8 3 #x1 #x2 #x4) + :deg-to-rad 0.000095873795 + :rad-to-deg 10430.379 + :nav-poly-min-dist 204.8 + :nav-poly-epsilon 40.96 + :debug (new 'static 'nav-mesh-work-debug) + :work-struct-in-scratch 1 + :mesh-struct-in-scratch 1 + :polys-in-scratch 1 + ) + ) + +;; definition for symbol *default-nav-mesh*, type nav-mesh +(define *default-nav-mesh* (new 'static 'nav-mesh + :poly-array (new 'static 'inline-array nav-poly 1 + (new 'static 'nav-poly + :vertex (new 'static 'inline-array vector 4 + (new 'static 'vector :w -175458100000000000000000000000000000000.0) + (new 'static 'vector :w (the-as float #xffffffff)) + (new 'static 'vector) + (new 'static 'vector) + ) + ) + ) + :poly-count #x1 + :max-nav-control-count #x80 + :nav-control-array (new 'static 'inline-array nav-control 128 + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + ) + ) + ) + +;; failed to figure out what this is: +(kmemopen global "nav-mesh") + +;; failed to figure out what this is: +(let ((gp-0 *default-nav-mesh*)) + (set! (-> gp-0 work) *nav-mesh-work*) + (if (zero? (-> gp-0 user-list)) + (set! (-> gp-0 user-list) (new 'global 'engine 'nav-engine 128 connection)) + ) + (when (zero? (-> gp-0 poly-hash)) + (set! (-> gp-0 poly-hash) (new 'global 'grid-hash 16)) + (let ((v1-12 (new 'static 'inline-array vector 2 (new 'static 'vector) (new 'static 'vector)))) + (vector-reset! (-> v1-12 0)) + (vector-reset! (-> v1-12 1)) + (let ((a1-3 (-> v1-12 0))) + (let ((a0-5 (-> v1-12 0))) + (let ((a2-3 -4096.0)) + (.mov vf6 a2-3) + ) + (.lvf vf4 (&-> a0-5 quad)) + ) + (.add.x.vf vf5 vf0 vf0 :mask #b1000) + (.add.x.vf vf5 vf4 vf6 :mask #b111) + (.svf (&-> a1-3 quad) vf5) + ) + (let ((a1-4 (-> v1-12 1))) + (let ((a0-6 (-> v1-12 1))) + (let ((a2-5 4096.0)) + (.mov vf6 a2-5) + ) + (.lvf vf4 (&-> a0-6 quad)) + ) + (.add.x.vf vf5 vf0 vf0 :mask #b1000) + (.add.x.vf vf5 vf4 vf6 :mask #b111) + (.svf (&-> a1-4 quad) vf5) + ) + (update-grid-for-objects-in-box + (-> gp-0 poly-hash) + (the-as int (-> gp-0 poly-count)) + (-> v1-12 0) + (-> v1-12 1) + ) + ) + ) + ) + +;; failed to figure out what this is: +(kmemclose) + +;; definition for function nav-mesh-connect-from-ent +(defun nav-mesh-connect-from-ent ((arg0 process-drawable)) + "Connect this process to the nav-mesh associate with the entity that spawned the process" + (let ((s5-0 (nav-mesh-from-res-tag (-> arg0 entity) 'nav-mesh-actor 0))) + (cond + (s5-0 + (if (zero? (-> s5-0 user-list)) + (format 0 "nav-mesh-connect-from-ent: nav mesh not initialized!~%") + ) + (if (add-connection (-> s5-0 user-list) arg0 nothing arg0 #f (-> arg0 root)) + #t + ) + ) + (else + (if (-> arg0 entity) + (logior! (-> arg0 entity extra perm status) (entity-perm-status bit-1)) + ) + #f + ) + ) + ) + ) + +;; definition (debug) for function connection-validate +;; WARN: Return type mismatch int vs none. +(defun-debug connection-validate ((arg0 connection)) + (when (zero? arg0) + (break!) + 0 + ) + (when (zero? (-> arg0 next1)) + (break!) + 0 + ) + (when (zero? (-> arg0 prev1)) + (break!) + 0 + ) + (when (-> arg0 next1) + (when (!= arg0 (-> arg0 next1 prev1)) + (break!) + 0 + ) + ) + (when (-> arg0 prev1) + (when (!= arg0 (-> arg0 prev1 next1)) + (break!) + 0 + ) + ) + 0 + (none) + ) + +;; definition (debug) for function connection-list-validate +(defun-debug connection-list-validate ((arg0 (inline-array connection))) + (let ((gp-0 (the-as object (&-> arg0 3 prev1)))) + (while gp-0 + (connection-validate (the-as connection gp-0)) + (set! gp-0 (-> (the-as connection gp-0) next1)) + ) + ) + #f + ) + +;; definition (debug) for function nav-control-validate +;; WARN: Return type mismatch int vs none. +(defun-debug nav-control-validate ((arg0 process-drawable)) + (let ((s5-0 (the-as object (-> arg0 nav)))) + (when (and (-> arg0 nav) (!= arg0 (-> arg0 nav process))) + (format 0 "process pointing to wrong nav-control!~%") + (break!) + 0 + ) + (let ((s4-0 (-> arg0 nav state mesh))) + (when (or (not s4-0) (zero? s4-0)) + (format 0 "nav control has invalid mesh~%") + (break!) + 0 + ) + (let ((v1-12 (- (the-as int s5-0) (the-as uint (the-as int (-> s4-0 nav-control-array 0)))))) + (when (or (< (the-as uint v1-12) 0) + (< (the-as uint (* (the-as uint 288) (-> s4-0 nav-control-count))) (the-as uint v1-12)) + ) + (format 0 "nav control (~,,8x) is not in the mesh's nav-control-array!~%" (the-as nav-control s5-0)) + (inspect s4-0) + (break!) + 0 + ) + ) + ) + ) + (connection-list-validate (the-as (inline-array connection) arg0)) + 0 + (none) + ) + +;; definition (debug) for function debug-validate-nav-poly +;; WARN: Return type mismatch int vs none. +(defun-debug debug-validate-nav-poly ((arg0 nav-mesh-link) (arg1 nav-poly)) + (set! (-> *nav-mesh-work* poly1) (-> *nav-mesh-work* poly0)) + (set! (-> *nav-mesh-work* poly0) arg1) + (when arg1 + (let ((a2-1 arg1) + (a3-0 (+ (-> arg0 dest-mesh-id) 0)) + (t0-0 (+ (-> arg0 dest-mesh-id) (* (+ (-> arg0 src-switch-poly-id) -1) 64))) + ) + (when (or (< (the-as uint a2-1) a3-0) (< t0-0 (the-as uint a2-1))) + (format 0 "validate-nav-poly: bad poly pointer ~x range ~x ~x~%" a2-1 a3-0 t0-0) + (break!) + 0 + ) + ) + ) + 0 + (none) + ) + +;; definition for method 27 of type entity-nav-mesh +;; WARN: Return type mismatch int vs none. +(defmethod initialize-nav-mesh! entity-nav-mesh ((obj entity-nav-mesh)) + "Initialize the nav-mesh in this entity." + (let ((v1-0 (-> obj nav-mesh))) + (if (nonzero? v1-0) + (init-from-entity v1-0 obj) + ) + ) + 0 + (none) + ) + +;; definition for method 22 of type entity-nav-mesh +(defmethod birth! entity-nav-mesh ((obj entity-nav-mesh)) + (let ((a0-1 (-> obj nav-mesh))) + (if (nonzero? a0-1) + (handle-birth a0-1) + ) + ) + obj + ) + +;; definition for method 23 of type entity-nav-mesh +(defmethod kill! entity-nav-mesh ((obj entity-nav-mesh)) + (if (-> obj nav-mesh) + (handle-kill (-> obj nav-mesh)) + ) + obj + ) + +;; definition for method 28 of type entity-nav-mesh +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod debug-draw entity-nav-mesh ((obj entity-nav-mesh)) + (add-debug-x + #t + (bucket-id debug-no-zbuf1) + (-> obj nav-mesh bounds) + (new 'static 'rgba :r #x80 :g #xff :b #x80 :a #x80) + ) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (set! (-> s5-0 quad) (-> obj nav-mesh bounds quad)) + (let ((a0-6 (new 'stack 'random-generator))) + (set! (-> a0-6 seed) (-> obj aid)) + (let* ((v1-4 (rand-uint31-gen a0-6)) + (f30-0 (* 182.04445 (the float (logand v1-4 #xffff)))) + ) + (+! (-> s5-0 x) (* 4096.0 (cos f30-0))) + (+! (-> s5-0 z) (* 4096.0 (sin f30-0))) + ) + ) + (add-debug-text-3d + #t + (bucket-id debug-no-zbuf1) + (res-lump-struct obj 'name string) + s5-0 + (font-color #dadada) + (new 'static 'vector2h :data (new 'static 'array int16 2 0 8)) + ) + (let ((s4-1 add-debug-text-3d) + (s3-1 #t) + (s2-1 318) + ) + (format (clear *temp-string*) "aid ~D" (-> obj aid)) + (s4-1 + s3-1 + (the-as bucket-id s2-1) + *temp-string* + s5-0 + (font-color #dadada) + (new 'static 'vector2h :data (new 'static 'array int16 2 0 16)) + ) + ) + ) + (debug-draw (-> obj nav-mesh)) + 0 + (none) + ) + +;; definition for method 31 of type entity-actor +;; INFO: Used lq/sq +(defmethod get-simple-travel-vector entity-actor ((obj entity-actor) (arg0 vector) (arg1 vector) (arg2 vector) (arg3 object) (arg4 float)) + (local-vars (at-0 int) (at-1 int)) + (with-pp + (rlet ((vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (let ((gp-0 (nav-mesh-from-res-tag obj 'nav-mesh-actor 0))) + (cond + (gp-0 + (let ((v1-0 arg0)) + (.lvf vf1 (&-> arg2 quad)) + (let ((f0-0 (-> pp clock seconds-per-frame))) + (.mov at-0 f0-0) + ) + (.mov vf2 at-0) + (.mov.vf vf1 vf0 :mask #b1000) + (.mul.x.vf vf1 vf1 vf2 :mask #b111) + (.svf (&-> v1-0 quad) vf1) + ) + (let ((s3-1 (new 'stack-no-clear 'nav-find-poly-parms))) + (vector-! (-> s3-1 point) arg1 (-> gp-0 bounds)) + (set! (-> s3-1 y-threshold) 40960.0) + (set! (-> s3-1 ignore) (the-as uint 3)) + (let ((a2-2 (find-poly-containing-point-local gp-0 s3-1))) + (cond + (a2-2 + (clamp-vector-to-mesh-cross-gaps + gp-0 + (-> s3-1 point) + a2-2 + arg0 + 2048.0 + #f + (the-as clamp-travel-vector-to-mesh-return-info #f) + ) + (let ((v1-7 arg0)) + (.lvf vf1 (&-> arg0 quad)) + (let ((f0-2 (-> pp clock frames-per-second))) + (.mov at-1 f0-2) + ) + (.mov vf2 at-1) + (.mov.vf vf1 vf0 :mask #b1000) + (.mul.x.vf vf1 vf1 vf2 :mask #b111) + (.svf (&-> v1-7 quad) vf1) + ) + ) + (else + (set! (-> arg0 x) (* (-> arg0 x) (- arg4))) + (set! (-> arg0 y) (* (-> arg0 y) (-> pp clock frames-per-second))) + (set! (-> arg0 z) (* (-> arg0 z) (- arg4))) + ) + ) + ) + ) + gp-0 + ) + (else + (set! (-> arg0 quad) (-> arg2 quad)) + (the-as nav-mesh #f) + ) + ) + ) + ) + ) + ) + +;; definition for method 32 of type entity-actor +;; INFO: Used lq/sq +(defmethod project-point-to-nav-mesh entity-actor ((obj entity-actor) (arg0 vector) (arg1 vector) (arg2 nav-poly) (arg3 float)) + (local-vars (sv-16 vector)) + (let ((gp-0 (nav-mesh-from-res-tag obj 'nav-mesh-actor 0))) + (cond + (gp-0 + (set! sv-16 arg0) + (let ((s5-1 (new 'stack-no-clear 'nav-find-poly-parms))) + (set! (-> s5-1 poly) arg2) + (vector-! (-> s5-1 point) arg1 (-> gp-0 bounds)) + (when (or (not (-> s5-1 poly)) (not (point-in-poly? gp-0 (-> s5-1 poly) (-> s5-1 point)))) + (set! (-> s5-1 y-threshold) arg3) + (set! (-> s5-1 ignore) (the-as uint 3)) + (find-nearest-poly-to-point-local gp-0 s5-1) + (when (-> s5-1 poly) + (project-point-into-poly-2d gp-0 (-> s5-1 poly) sv-16 (-> s5-1 point)) + (vector+! sv-16 sv-16 (-> gp-0 bounds)) + ) + ) + (-> s5-1 poly) + ) + ) + (else + (set! (-> arg0 quad) (-> arg1 quad)) + (the-as nav-poly #f) + ) + ) + ) + ) + +;; definition for method 4 of type nav-mesh +;; WARN: Return type mismatch uint vs int. +(defmethod length nav-mesh ((obj nav-mesh)) + (the-as int (-> obj poly-count)) + ) + +;; definition for method 36 of type nav-mesh +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod debug-draw-poly nav-mesh ((obj nav-mesh) (arg0 nav-poly) (arg1 rgba)) + (let ((gp-0 (new 'stack-no-clear 'inline-array 'vector 3))) + (set! (-> gp-0 0 quad) (-> obj bounds quad)) + (if (logtest? (the-as int (-> arg0 pat)) 7) + (set! (-> gp-0 0 y) (+ 409.6 (-> gp-0 0 y))) + ) + (let ((v1-7 (the-as int (+ (-> arg0 vertex-count) -1)))) + (dotimes (s2-0 (the-as int (-> arg0 vertex-count))) + (add-debug-line + #t + (bucket-id debug-no-zbuf1) + (vector+! (-> gp-0 1) (-> gp-0 0) (-> arg0 vertex s2-0)) + (vector+! (-> gp-0 2) (-> gp-0 0) (-> arg0 vertex v1-7)) + arg1 + #f + (the-as rgba -1) + ) + (set! v1-7 s2-0) + ) + ) + (when (and (logtest? (the-as int (-> arg0 pat)) 4) (< (the-as uint (-> arg0 link)) (-> obj link-count))) + (poly-centroid obj arg0 (-> gp-0 1)) + (let ((s5-1 (-> obj link-array (-> arg0 link)))) + (add-debug-x #t (bucket-id debug-no-zbuf1) (-> gp-0 1) *color-magenta*) + (let ((s4-1 add-debug-text-3d) + (s3-1 #t) + (s2-1 318) + ) + (format (clear *temp-string*) "link ~D" (-> s5-1 id)) + (s4-1 + s3-1 + (the-as bucket-id s2-1) + *temp-string* + (-> gp-0 1) + (font-color magenta-#f87df8) + (new 'static 'vector2h :data (new 'static 'array int16 2 0 8)) + ) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 27 of type nav-mesh +(defmethod new-nav-control nav-mesh ((obj nav-mesh) (arg0 process-drawable) (arg1 int)) + (let ((gp-0 (the-as nav-control #f))) + (dotimes (v1-0 (the-as int (-> obj nav-control-count))) + (let ((a1-2 (-> obj nav-control-array v1-0))) + (b! (-> a1-2 process) cfg-3 :delay (empty-form)) + (set! gp-0 a1-2) + ) + (set! (-> gp-0 process) (the-as process 0)) + (set! (-> gp-0 state mesh) obj) + (b! #t cfg-8 :delay (nop!)) + (label cfg-3) + ) + (let ((v1-3 (-> obj nav-control-count))) + (cond + ((< v1-3 (-> obj max-nav-control-count)) + (+! (-> obj nav-control-count) 1) + (set! gp-0 (-> obj nav-control-array v1-3)) + (set! (-> gp-0 state mesh) obj) + ) + (else + (format + 0 + "nav-mesh::new-nav-control: too many users for nav-mesh ~s~%" + (res-lump-struct (-> obj entity) 'name structure) + ) + ) + ) + ) + (label cfg-8) + gp-0 + ) + ) + +;; definition for method 28 of type nav-mesh +;; WARN: Return type mismatch int vs none. +(defmethod remove-nav-control nav-mesh ((obj nav-mesh) (arg0 nav-control)) + (set! (-> arg0 process) #f) + (let ((v1-1 (+ (-> obj nav-control-count) -1))) + (while (and (>= v1-1 0) (not (-> obj nav-control-array v1-1 process))) + (+! v1-1 -1) + ) + (set! (-> obj nav-control-count) (+ v1-1 1)) + ) + 0 + (none) + ) + +;; definition for method 29 of type nav-mesh +;; WARN: Return type mismatch int vs none. +(defmethod add-process-drawable-to-navmesh nav-mesh ((obj nav-mesh) (arg0 process-drawable) (arg1 symbol)) + (if arg1 + (change-to obj arg0 arg1) + (add-connection (-> obj user-list) arg0 nothing arg0 #f (-> arg0 root)) + ) + 0 + (none) + ) + +;; definition for method 30 of type nav-mesh +;; WARN: Return type mismatch int vs none. +(defmethod remove-process-drawable nav-mesh ((obj nav-mesh) (arg0 process-drawable)) + (remove-from-process (-> obj user-list) arg0) + (let ((a1-2 (-> arg0 nav))) + (when (nonzero? a1-2) + (remove-nav-control obj a1-2) + (set! (-> arg0 nav) #f) + ) + ) + 0 + (none) + ) + +;; definition for method 31 of type nav-mesh +;; WARN: Return type mismatch int vs none. +(defmethod change-to nav-mesh ((obj nav-mesh) (arg0 process-drawable) (arg1 symbol)) + (local-vars (v1-5 symbol)) + (let ((gp-0 arg0)) + (b! (nonzero? (-> obj user-list)) cfg-2 :delay (empty-form)) + (go process-drawable-art-error "nav mesh not initialized") + (b! #t cfg-18 :delay (nop!)) + (label cfg-2) + (let ((s3-0 (-> gp-0 nav))) + (b! (nonzero? s3-0) cfg-4 :delay (empty-form)) + (set! s3-0 (the-as nav-control #f)) + (label cfg-4) + (b! (not s3-0) cfg-7 :likely-delay (set! v1-5 #t)) + (set! v1-5 (!= obj (-> s3-0 state mesh))) + (label cfg-7) + (b! (not v1-5) cfg-18 :delay (empty-form)) + (let ((s4-0 (new-nav-control obj arg0 (the-as int arg1)))) + (b! s4-0 cfg-12 :delay (empty-form)) + (b! (not *debug-segment*) cfg-11 :delay (empty-form)) + (format 0 "ERROR: nav-mesh::change-to: unable to allocate nav-mesh for ~s~%" gp-0) + (label cfg-11) + (b! #t cfg-18 :delay (nop!)) + (label cfg-12) + (cond + (s3-0 + (quad-copy! (the-as pointer s4-0) (the-as pointer s3-0) 18) + (set! (-> s4-0 state mesh) obj) + (set! (-> s4-0 state nav) s4-0) + (set! (-> s4-0 state current-poly) #f) + (set! (-> s4-0 state virtual-current-poly) #f) + (set! (-> s4-0 state next-poly) #f) + (set! (-> s4-0 state user-poly) #f) + (set! (-> s4-0 state target-poly) #f) + (let ((s2-0 (-> s3-0 state mesh))) + (remove-nav-control s2-0 s3-0) + (remove-from-process (-> s2-0 user-list) gp-0) + ) + ) + (else + (init! s4-0 (the-as collide-shape (-> gp-0 root))) + ) + ) + (set-nearest-y-thres! s4-0 (-> obj nearest-y-threshold)) + (set! (-> gp-0 nav) s4-0) + ) + ) + (add-connection (-> obj user-list) gp-0 nothing gp-0 #t (-> gp-0 root)) + (send-event gp-0 'nav-mesh-new :from gp-0) + ) + (label cfg-18) + 0 + (none) + ) + +;; definition for method 45 of type nav-mesh +(defmethod link-to-other-mesh nav-mesh ((obj nav-mesh) (arg0 nav-mesh-link)) + (when (not (-> arg0 dest-mesh)) + (let* ((s4-0 (entity-nav-mesh-by-aid (the-as actor-id (-> arg0 dest-mesh-id)))) + (v1-1 (if (type? s4-0 entity-nav-mesh) + s4-0 + ) + ) + ) + (when v1-1 + (let ((a0-3 (-> v1-1 nav-mesh)) + (v1-2 (the-as structure #f)) + ) + (dotimes (a1-2 (the-as int (-> a0-3 link-count))) + (let ((a2-1 (-> a0-3 link-array a1-2))) + (let ((a3-1 (-> arg0 id))) + (b! (!= (-> a2-1 id) a3-1) cfg-7 :delay (empty-form)) + ) + (set! v1-2 a2-1) + ) + (b! #t cfg-10 :delay (nop!)) + (label cfg-7) + ) + (label cfg-10) + (when (the-as nav-mesh-link v1-2) + (set! (-> arg0 dest-mesh) a0-3) + (set! (-> (the-as nav-mesh v1-2) route) (the-as (pointer nav-poly) obj)) + (set! (-> arg0 dest-link-poly-id) (-> (the-as nav-mesh v1-2) poly-count)) + (set! (-> arg0 dest-switch-poly-id) (-> (the-as nav-mesh v1-2) static-sphere-count)) + (set! (-> (the-as nav-mesh v1-2) nav-control-count) (-> arg0 src-switch-poly-id)) + (set! (-> (the-as nav-mesh v1-2) max-nav-control-count) (-> arg0 src-link-poly-id)) + #t + ) + ) + ) + ) + ) + ) + +;; definition for method 46 of type nav-mesh +;; WARN: Return type mismatch int vs none. +(defmethod unlink-mesh nav-mesh ((obj nav-mesh) (arg0 nav-mesh-link)) + (let ((a0-1 (-> arg0 dest-mesh))) + (when a0-1 + (let ((v1-0 (the-as nav-mesh-link #f))) + (dotimes (a2-1 (the-as int (-> a0-1 link-count))) + (let ((a3-1 (-> a0-1 link-array a2-1))) + (let ((t0-1 (-> arg0 id))) + (b! (!= (-> a3-1 id) t0-1) cfg-4 :delay (empty-form)) + ) + (set! v1-0 a3-1) + ) + (b! #t cfg-7 :delay (nop!)) + (label cfg-4) + ) + (label cfg-7) + (when v1-0 + (set! (-> arg0 dest-mesh) #f) + (set! (-> v1-0 dest-mesh) #f) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 32 of type nav-mesh +(defmethod link-by-id nav-mesh ((obj nav-mesh) (arg0 uint)) + "arg1 is a [[nav-mesh-link]] `id`" + (let ((v1-0 (the-as nav-mesh-link #f))) + (dotimes (a2-0 (the-as int (-> obj link-count))) + (let ((a3-1 (-> obj link-array a2-0))) + (b! (!= (-> a3-1 id) arg0) cfg-3 :delay (empty-form)) + (set! v1-0 a3-1) + ) + (b! #t cfg-6 :delay (nop!)) + (label cfg-3) + ) + (label cfg-6) + (if v1-0 + (link-to-other-mesh obj v1-0) + ) + ) + ) + +;; definition for method 33 of type nav-mesh +(defmethod unlink-by-id nav-mesh ((obj nav-mesh) (arg0 uint)) + "arg1 is a [[nav-mesh-link]] `id`" + (let ((v1-0 (the-as nav-mesh-link #f))) + (dotimes (a2-0 (the-as int (-> obj link-count))) + (let ((a3-1 (-> obj link-array a2-0))) + (b! (!= (-> a3-1 id) arg0) cfg-3 :delay (empty-form)) + (set! v1-0 a3-1) + ) + (b! #t cfg-6 :delay (nop!)) + (label cfg-3) + ) + (label cfg-6) + (when v1-0 + (unlink-mesh obj v1-0) + #t + ) + ) + ) + +;; definition for method 23 of type nav-mesh +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod init-from-entity nav-mesh ((obj nav-mesh) (arg0 entity-nav-mesh)) + "Initialize this mesh from an entity." + (local-vars (sv-16 res-tag)) + (set! (-> obj entity) arg0) + (set! (-> obj work) *nav-mesh-work*) + (set! sv-16 (new 'static 'res-tag)) + (let ((v1-2 (res-lump-data arg0 'nav-mesh-sphere pointer :tag-ptr (& sv-16)))) + (when v1-2 + (set! (-> obj static-sphere-count) (-> sv-16 elt-count)) + (set! (-> obj static-sphere) (the-as (inline-array sphere) v1-2)) + ) + ) + (set! (-> obj nearest-y-threshold) (res-lump-float arg0 'nearest-y-threshold :default 40960.0)) + (set! (-> obj flags) (nav-mesh-flag)) + (set! (-> obj water-max-height) (res-lump-float arg0 'water-max-height :default 8192.0)) + (let ((s5-1 (res-lump-value arg0 'nav-max-users uint128 :default (the-as uint128 64) :time -1000000000.0))) + (set! (-> obj user-list) (new 'loading-level 'engine 'nav-engine (the-as int s5-1) connection)) + (set! (-> obj nav-control-array) + (the-as (inline-array nav-control) (malloc 'loading-level (* 288 (the-as int s5-1)))) + ) + (set! (-> obj nav-control-count) (the-as uint 0)) + (set! (-> obj max-nav-control-count) (the-as uint s5-1)) + (set! (-> obj sphere-hash) + (new 'loading-level 'sphere-hash 4096 (the-as int (+ s5-1 (-> obj static-sphere-count)))) + ) + ) + (if (nonzero? (-> obj poly-hash)) + (set! (-> obj poly-hash work) *grid-hash-work*) + ) + (initialize-mesh! obj) + 0 + (none) + ) + +;; definition for method 24 of type nav-mesh +;; WARN: Return type mismatch int vs none. +(defmethod handle-birth nav-mesh ((obj nav-mesh)) + "Handle the parent nav-mesh-entity birth." + (dotimes (s5-0 (the-as int (-> obj link-count))) + (let ((a1-0 (-> obj link-array s5-0))) + (if (not (-> a1-0 dest-mesh)) + (link-to-other-mesh obj a1-0) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 25 of type nav-mesh +;; WARN: Return type mismatch int vs none. +(defmethod handle-kill nav-mesh ((obj nav-mesh)) + "Handle the parent nav-mesh-entity kill." + (when (nonzero? (-> obj user-list)) + (countdown (s5-0 (-> obj nav-control-count)) + (let* ((v1-3 (-> obj nav-control-array s5-0)) + (s4-0 (-> v1-3 process)) + ) + (when s4-0 + (if (not (send-event (-> v1-3 process) 'nav-mesh-kill)) + (format 0 "ERROR: object ~A did not accept nav-mesh kill~%" s4-0) + ) + ) + ) + ) + (remove-all (-> obj user-list)) + (dotimes (s5-1 (the-as int (-> obj link-count))) + (let ((a1-2 (-> obj link-array s5-1))) + (if (-> a1-2 dest-mesh) + (unlink-mesh obj a1-2) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition of type nav-engine-spr-buffer +(deftype nav-engine-spr-buffer (structure) + ((mem-addr (pointer nav-mesh) :offset-assert 0) + (mem-nav uint32 :offset 0) + (spr-addr (inline-array nav-control) :offset-assert 4) + (spr-nav uint32 :offset 4) + (q-size uint32 :offset-assert 8) + (i-nav uint8 :offset-assert 12) + (done int8 :offset-assert 13) + (nav-count int8 :offset-assert 14) + (i-pass int8 :offset-assert 15) + ) + :pack-me + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + +;; definition for method 3 of type nav-engine-spr-buffer +(defmethod inspect nav-engine-spr-buffer ((obj nav-engine-spr-buffer)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'nav-engine-spr-buffer) + (format #t "~1Tmem-addr: ~D~%" (-> obj mem-addr)) + (format #t "~1Tmem-nav: #x~X~%" (-> obj mem-addr)) + (format #t "~1Tspr-addr: ~D~%" (-> obj spr-addr)) + (format #t "~1Tspr-nav: #x~X~%" (-> obj spr-addr)) + (format #t "~1Tq-size: ~D~%" (-> obj q-size)) + (format #t "~1Ti-nav: ~D~%" (-> obj i-nav)) + (format #t "~1Tdone: ~D~%" (-> obj done)) + (format #t "~1Tnav-count: ~D~%" (-> obj nav-count)) + (format #t "~1Ti-pass: ~D~%" (-> obj i-pass)) + (label cfg-4) + obj + ) + +;; definition of type nav-engine +(deftype nav-engine (structure) + ((spr-addr uint32 :offset-assert 0) + (nav-work-addr uint32 :offset-assert 4) + (nav-mesh-addr nav-mesh :offset-assert 8) + (poly-array-addr uint32 :offset-assert 12) + (hash-sphere-addr uint32 :offset-assert 16) + (hash-buckets-addr uint32 :offset-assert 20) + (buf-nav-control-count int8 :offset-assert 24) + (max-pass-count int8 :offset-assert 25) + (output-sphere-hash uint8 :offset-assert 26) + (work-buf-array nav-engine-spr-buffer 3 :inline :offset-assert 28) + (spr-work nav-mesh-work :offset 4) + (mem-work nav-mesh-work :offset-assert 76) + (spr-mesh nav-mesh :offset 8) + (mem-mesh nav-mesh :offset-assert 80) + (spr-poly-array uint32 :offset 12) + (mem-poly-array (inline-array nav-poly) :offset-assert 84) + (hash-sphere-list uint32 :offset 16) + (hash-buckets uint32 :offset 20) + (to-spr-wait uint32 :offset-assert 88) + (from-spr-wait uint32 :offset-assert 92) + ) + :method-count-assert 22 + :size-assert #x60 + :flag-assert #x1600000060 + (:methods + (inc-spr-addr! (_type_ uint) uint 9) + (lay-out-spad-memory (_type_ nav-mesh) none 10) + (set-up-mem-work (_type_) none 11) + (add-spheres-from-mesh-user-list (_type_ sphere-hash nav-mesh) none 12) + (add-all-spheres (_type_) none 13) + (do-sphere-lookups (_type_) none 14) + (update-nav-controls-pipelined-in-spr (_type_) none 15) + (update-nav-controls-in-spr (_type_) none 16) + (upload-nav-to-spr (_type_ nav-engine-spr-buffer) none 17) + (download-nav-from-spr (_type_ nav-engine-spr-buffer) none 18) + (do-callbacks (_type_ nav-engine-spr-buffer) none 19) + (reloc-ptrs-to-spad (_type_ nav-engine-spr-buffer) none 20) + (reloc-ptrs-to-mem (_type_ nav-engine-spr-buffer) none 21) + ) + ) + +;; definition for method 3 of type nav-engine +(defmethod inspect nav-engine ((obj nav-engine)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'nav-engine) + (format #t "~1Tspr-addr: ~D~%" (-> obj spr-addr)) + (format #t "~1Tnav-work-addr: ~D~%" (-> obj nav-work-addr)) + (format #t "~1Tnav-mesh-addr: ~D~%" (-> obj nav-mesh-addr)) + (format #t "~1Tpoly-array-addr: ~D~%" (-> obj poly-array-addr)) + (format #t "~1Thash-sphere-addr: ~D~%" (-> obj hash-sphere-addr)) + (format #t "~1Thash-buckets-addr: ~D~%" (-> obj hash-buckets-addr)) + (format #t "~1Tbuf-nav-control-count: ~D~%" (-> obj buf-nav-control-count)) + (format #t "~1Tmax-pass-count: ~D~%" (-> obj max-pass-count)) + (format #t "~1Toutput-sphere-hash: ~D~%" (-> obj output-sphere-hash)) + (format #t "~1Twork-buf-array[3] @ #x~X~%" (-> obj work-buf-array)) + (format #t "~1Tspr-work: #~%" (-> obj nav-work-addr)) + (format #t "~1Tmem-work: #~%" (-> obj mem-work)) + (format #t "~1Tspr-mesh: ~A~%" (-> obj nav-mesh-addr)) + (format #t "~1Tmem-mesh: ~A~%" (-> obj mem-mesh)) + (format #t "~1Tspr-poly-array: #x~X~%" (-> obj poly-array-addr)) + (format #t "~1Tmem-poly-array: #x~X~%" (-> obj mem-poly-array)) + (format #t "~1Thash-sphere-list: #x~X~%" (-> obj hash-sphere-addr)) + (format #t "~1Thash-buckets: #x~X~%" (-> obj hash-buckets-addr)) + (format #t "~1Tto-spr-wait: ~D~%" (-> obj to-spr-wait)) + (format #t "~1Tfrom-spr-wait: ~D~%" (-> obj from-spr-wait)) + (label cfg-4) + obj + ) + +;; definition for method 9 of type nav-engine +(defmethod inc-spr-addr! nav-engine ((obj nav-engine) (arg0 uint)) + "Adds the given integer to `spr-addr` and returns it" + (let ((v0-0 (-> obj spr-addr))) + (+! (-> obj spr-addr) arg0) + v0-0 + ) + ) + +;; definition for method 10 of type nav-engine +;; WARN: Return type mismatch int vs none. +(defmethod lay-out-spad-memory nav-engine ((obj nav-engine) (arg0 nav-mesh)) + (let ((s5-0 0)) + (set! (-> obj spr-addr) (the-as uint #x70000060)) + (let* ((v1-1 obj) + (a1-1 320) + (a0-1 (-> v1-1 spr-addr)) + ) + (+! (-> v1-1 spr-addr) a1-1) + (set! (-> obj nav-work-addr) a0-1) + ) + (let* ((v1-2 obj) + (a1-3 112) + (a0-2 (-> v1-2 spr-addr)) + ) + (+! (-> v1-2 spr-addr) a1-3) + (set! (-> obj nav-mesh-addr) (the-as nav-mesh a0-2)) + ) + (if (and (= (-> *nav-mesh-work* polys-in-scratch) 1) (< (-> arg0 poly-count) (the-as uint 64))) + (set! s5-0 (the-as int (-> arg0 poly-count))) + ) + (let* ((v1-10 obj) + (a1-5 (* s5-0 64)) + (a0-4 (-> v1-10 spr-addr)) + ) + (+! (-> v1-10 spr-addr) a1-5) + (set! (-> obj poly-array-addr) a0-4) + ) + (let* ((v1-11 obj) + (a1-7 (* (-> arg0 sphere-hash max-object-count) 16)) + (a0-7 (-> v1-11 spr-addr)) + ) + (+! (-> v1-11 spr-addr) a1-7) + (set! (-> obj hash-sphere-addr) a0-7) + ) + (let* ((v1-12 obj) + (a1-9 0) + (a0-8 (-> v1-12 spr-addr)) + ) + (+! (-> v1-12 spr-addr) a1-9) + (set! (-> obj hash-buckets-addr) a0-8) + ) + (set! (-> obj buf-nav-control-count) 7) + (dotimes (v1-14 3) + (let ((a0-11 (-> obj work-buf-array v1-14))) + (let* ((a1-11 obj) + (a3-0 2048) + (a2-5 (-> a1-11 spr-addr)) + ) + (+! (-> a1-11 spr-addr) a3-0) + (set! (-> a0-11 spr-addr) (the-as (inline-array nav-control) a2-5)) + ) + (set! (-> a0-11 mem-addr) (the-as (pointer nav-mesh) 0)) + (set! (-> a0-11 q-size) (the-as uint 0)) + (set! (-> a0-11 nav-count) 0) + (set! (-> a0-11 i-pass) -1) + ) + ) + (set! (-> obj output-sphere-hash) (the-as uint 0)) + (set! (-> obj mem-mesh) arg0) + (cond + ((= (-> *nav-mesh-work* mesh-struct-in-scratch) 1) + (set! (-> obj nav-mesh-addr) (the-as nav-mesh (&-> (-> obj nav-mesh-addr) poly-array))) + (mem-copy! (&-> (-> obj nav-mesh-addr) type) (&-> arg0 type) 112) + ) + (else + (set! (-> obj nav-mesh-addr) arg0) + ) + ) + (set! (-> obj mem-work) (-> arg0 work)) + (if (= (-> *nav-mesh-work* work-struct-in-scratch) 1) + (quad-copy! (the-as pointer (-> obj nav-work-addr)) (the-as pointer (-> obj mem-work)) 20) + (set! (-> obj nav-work-addr) (the-as uint (-> arg0 work))) + ) + (set! (-> obj nav-mesh-addr work) (the-as nav-mesh-work (-> obj nav-work-addr))) + (set! (-> obj mem-poly-array) (-> arg0 poly-array)) + (when (> s5-0 0) + (quad-copy! (the-as pointer (-> obj poly-array-addr)) (the-as pointer (-> obj mem-poly-array)) (* s5-0 4)) + (set! (-> obj nav-mesh-addr poly-array) (the-as (inline-array nav-poly) (-> obj poly-array-addr))) + ) + ) + 0 + (none) + ) + +;; definition for method 11 of type nav-engine +;; WARN: Return type mismatch int vs none. +(defmethod set-up-mem-work nav-engine ((obj nav-engine)) + (let ((v1-0 (-> obj mem-mesh))) + (set! (-> v1-0 poly-array) (-> obj mem-poly-array)) + (set! (-> v1-0 work) (-> obj mem-work)) + ) + 0 + (none) + ) + +;; definition for method 12 of type nav-engine +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod add-spheres-from-mesh-user-list nav-engine ((obj nav-engine) (arg0 sphere-hash) (arg1 nav-mesh)) + (countdown (s3-0 (-> arg1 static-sphere-count)) + (add-a-sphere-with-flag arg0 (-> arg1 static-sphere s3-0) 64) + ) + (let* ((s4-1 (-> arg1 user-list)) + (v1-6 (-> s4-1 alive-list next0)) + (s3-1 (-> (the-as connection v1-6) next0)) + ) + (while (!= v1-6 (-> s4-1 alive-list-end)) + (let ((a0-4 (-> (the-as connection v1-6) param1)) + (s2-0 (the-as object (-> (the-as connection v1-6) param3))) + ) + (cond + ((-> (the-as connection v1-6) param2) + (let ((s1-0 (-> (the-as process-focusable a0-4) nav))) + (set! (-> s1-0 sec-per-frame) (-> (the-as process-focusable a0-4) clock seconds-per-frame)) + (set! (-> s1-0 root-nav-sphere quad) (-> (the-as collide-shape s2-0) trans quad)) + (set! (-> s1-0 root-nav-sphere w) (-> (the-as collide-shape s2-0) nav-radius)) + (if (logtest? (-> s1-0 flags) (nav-control-flag output-sphere-hash)) + (set! (-> obj output-sphere-hash) (the-as uint 1)) + ) + (if (logtest? (-> (the-as collide-shape s2-0) nav-flags) (nav-flags has-root-sphere)) + (set! (-> s1-0 root-sphere-id) + (the-as uint (add-a-sphere-with-flag + arg0 + (-> s1-0 root-nav-sphere) + (the-as int (-> (the-as collide-shape s2-0) backup-collide-as)) + ) + ) + ) + ) + (if (logtest? (-> (the-as collide-shape s2-0) nav-flags) (nav-flags has-extra-sphere)) + (add-a-sphere-with-flag + arg0 + (-> s1-0 extra-nav-sphere) + (the-as int (-> (the-as collide-shape s2-0) backup-collide-as)) + ) + ) + ) + ) + (else + (when (logtest? (-> (the-as collide-shape s2-0) nav-flags) (nav-flags has-root-sphere)) + (let ((a1-5 (new 'stack-no-clear 'vector))) + (set! (-> a1-5 quad) (-> (the-as collide-shape s2-0) trans quad)) + (set! (-> a1-5 w) (-> (the-as collide-shape s2-0) nav-radius)) + (add-a-sphere-with-flag arg0 a1-5 (the-as int (-> (the-as collide-shape s2-0) backup-collide-as))) + ) + ) + ) + ) + (when (logtest? (-> (the-as collide-shape s2-0) nav-flags) (nav-flags has-child-spheres)) + (let ((s2-1 (-> (the-as collide-shape s2-0) root-prim)) + (s1-1 1) + ) + (when (= (-> s2-1 prim-core prim-type) (prim-type group)) + (let ((v1-35 s2-1)) + (set! s2-1 (-> (the-as collide-shape-prim-group v1-35) child 0)) + (set! s1-1 (the-as int (-> v1-35 specific 0))) + ) + ) + (while (nonzero? s1-1) + (+! s1-1 -1) + (when (and (logtest? (collide-action nav-sphere) (-> s2-1 prim-core action)) + (= (-> s2-1 prim-core prim-type) (prim-type sphere)) + ) + (let ((a1-6 (new 'stack-no-clear 'vector))) + (set! (-> a1-6 quad) (-> s2-1 prim-core world-sphere quad)) + (set! (-> a1-6 w) (-> (the-as collide-shape-prim-sphere s2-1) nav-radius)) + (add-a-sphere-with-flag arg0 a1-6 (the-as int (-> s2-1 prim-core collide-as))) + ) + ) + (&+! s2-1 80) + ) + ) + ) + ) + (set! v1-6 s3-1) + (set! s3-1 (-> s3-1 next0)) + ) + ) + 0 + (none) + ) + +;; definition for method 13 of type nav-engine +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod add-all-spheres nav-engine ((obj nav-engine)) + (let ((s4-0 (-> obj nav-mesh-addr)) + (gp-0 (-> obj nav-mesh-addr sphere-hash)) + ) + (clear-objects! gp-0) + (set! (-> gp-0 bucket-array) (the-as (pointer grid-hash-word) (-> obj hash-buckets-addr))) + (set! (-> gp-0 sphere-array) (the-as (inline-array sphere) (-> obj hash-sphere-addr))) + (when *target* + (let ((a1-0 (new 'stack-no-clear 'nav-vertex))) + (let ((v1-8 (-> *target* control))) + (set! (-> a1-0 quad) (-> v1-8 trans quad)) + (set! (-> a1-0 w) (-> v1-8 nav-radius)) + ) + (add-a-sphere-with-flag gp-0 a1-0 2) + ) + ) + (add-spheres-from-mesh-user-list obj gp-0 s4-0) + (let ((s3-0 (the-as nav-mesh (-> s4-0 next-nav-mesh)))) + (while (and s3-0 (nonzero? s3-0)) + (add-spheres-from-mesh-user-list obj gp-0 s3-0) + (set! s3-0 (the-as nav-mesh (-> s3-0 next-nav-mesh))) + ) + ) + (let ((s4-1 (the-as nav-mesh (-> s4-0 prev-nav-mesh)))) + (while (and s4-1 (nonzero? s4-1)) + (add-spheres-from-mesh-user-list obj gp-0 s4-1) + (set! s4-1 (the-as nav-mesh (-> s4-1 prev-nav-mesh))) + ) + ) + (update-from-spheres gp-0) + ) + 0 + (none) + ) + +;; definition for method 14 of type nav-engine +;; WARN: Return type mismatch int vs none. +(defmethod do-sphere-lookups nav-engine ((obj nav-engine)) + (let ((s5-0 (-> obj nav-mesh-addr))) + (dotimes (s4-0 (the-as int (-> s5-0 nav-control-count))) + (let ((a0-3 (-> s5-0 nav-control-array s4-0))) + (when (-> a0-3 process) + (set! (-> a0-3 sphere-count) 0) + (set! (-> a0-3 state mesh) (-> obj nav-mesh-addr)) + (set! (-> obj mem-work nav) (the-as basic a0-3)) + (find-sphere-ids-from-sphere-hash a0-3 #f) + (set! (-> obj mem-work nav) #f) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition for function nav-dma-send-to-spr-no-flush +;; INFO: function output is handled by mips2c +(def-mips2c nav-dma-send-to-spr-no-flush (function pointer pointer int none)) + +;; definition for function nav-dma-send-from-spr-no-flush +;; INFO: function output is handled by mips2c +(def-mips2c nav-dma-send-from-spr-no-flush (function pointer pointer int none)) + +;; definition for function inc-mod3 +(defun inc-mod3 ((arg0 int)) + "Increments and returns the provided [[int]], if the value exceeds `2`, wrap back to `0`" + (local-vars (v0-1 int) (v1-1 int)) + (let ((v0-0 (+ arg0 1))) + (let ((v1-0 2)) + (set-on-less-than v1-1 v1-0 v0-0) + ) + (move-if-not-zero v0-1 0 v1-1 v0-0) + ) + v0-1 + ) + +;; definition for function nav-state-patch-pointers +;; INFO: function output is handled by mips2c +(def-mips2c nav-state-patch-pointers (function nav-state int none)) + +;; definition for method 17 of type nav-engine +;; INFO: function output is handled by mips2c +(defmethod-mips2c "(method 17 nav-engine)" 17 nav-engine) + +;; definition for method 18 of type nav-engine +;; INFO: function output is handled by mips2c +(defmethod-mips2c "(method 18 nav-engine)" 18 nav-engine) + +;; definition for method 19 of type nav-engine +;; WARN: Return type mismatch int vs none. +(defmethod do-callbacks nav-engine ((obj nav-engine) (arg0 nav-engine-spr-buffer)) + (local-vars (sv-16 nav-callback-info)) + (with-pp + (dotimes (s4-0 (-> arg0 nav-count)) + (let* ((a1-1 (-> arg0 spr-addr s4-0)) + (a0-3 (-> a1-1 process)) + ) + (set! sv-16 (-> a1-1 callback-info)) + (when a0-3 + (set! (-> a1-1 state nav) a1-1) + (when (and (logtest? (-> a1-1 flags) (nav-control-flag kernel-run)) sv-16) + (let ((s3-0 pp)) + (set! pp a0-3) + (set! (-> obj mem-mesh work nav) (the-as basic a1-1)) + (let ((v1-10 (-> sv-16 callback-count))) + (set! (-> obj max-pass-count) (max (-> obj max-pass-count) v1-10)) + (if (< (-> arg0 i-pass) v1-10) + ((-> sv-16 callback-array (-> arg0 i-pass)) a0-3 a1-1) + ) + ) + (set! pp s3-0) + ) + (set! (-> obj mem-mesh work nav) #f) + ) + ) + ) + ) + 0 + (none) + ) + ) + +;; definition for method 20 of type nav-engine +;; INFO: function output is handled by mips2c +(defmethod-mips2c "(method 20 nav-engine)" 20 nav-engine) + +;; definition for method 21 of type nav-engine +;; INFO: function output is handled by mips2c +(defmethod-mips2c "(method 21 nav-engine)" 21 nav-engine) + +;; definition for method 15 of type nav-engine +;; WARN: Return type mismatch int vs none. +(defmethod update-nav-controls-pipelined-in-spr nav-engine ((obj nav-engine)) + (local-vars + (v1-33 int) + (v1-45 int) + (v1-66 int) + (a0-14 int) + (a0-19 int) + (a0-26 int) + (sv-16 symbol) + (sv-24 int) + (sv-32 int) + (sv-40 uint) + (sv-44 (inline-array nav-control)) + (sv-48 nav-engine-spr-buffer) + ) + (flush-cache 0) + (set! (-> obj max-pass-count) 3) + (set! sv-16 (the-as symbol #f)) + (set! sv-24 0) + (set! sv-32 0) + (set! sv-40 (-> obj nav-mesh-addr nav-control-count)) + (set! sv-44 (-> obj nav-mesh-addr nav-control-array)) + (let ((s5-0 2) + (s3-0 1) + (s4-0 0) + ) + (while (not sv-16) + (let ((s2-0 (-> obj work-buf-array s5-0))) + (set! (-> s2-0 i-nav) (the-as uint sv-32)) + (set! (-> s2-0 nav-count) (min (-> obj buf-nav-control-count) (the-as int (- sv-40 (the-as uint sv-32))))) + (set! (-> s2-0 i-pass) sv-24) + (set! (-> s2-0 mem-addr) (the-as (pointer nav-mesh) (-> sv-44 sv-32))) + (set! (-> s2-0 q-size) (the-as uint (* 18 (-> s2-0 nav-count)))) + (set! (-> s2-0 done) 0) + (when (>= sv-24 (-> obj max-pass-count)) + (set! (-> s2-0 nav-count) 0) + 0 + ) + (if (> (-> s2-0 nav-count) 0) + (upload-nav-to-spr obj s2-0) + (dma-sync (the-as pointer #x1000d400) 0 0) + ) + (set! sv-32 (+ sv-32 (-> s2-0 nav-count))) + (when (>= sv-32 (the-as int sv-40)) + (set! sv-32 0) + (set! sv-24 (+ sv-24 1)) + (if (= sv-24 (-> obj max-pass-count)) + (set! (-> s2-0 done) 1) + ) + ) + ) + (let ((v1-32 (+ s5-0 1))) + (let ((a0-13 2)) + (set-on-less-than a0-14 a0-13 v1-32) + ) + (move-if-not-zero v1-33 0 a0-14 v1-32) + ) + (set! s5-0 v1-33) + (let ((s2-1 (-> obj work-buf-array s4-0))) + (when (> (-> s2-1 nav-count) 0) + (download-nav-from-spr obj s2-1) + (when (= (-> s2-1 done) 1) + (dma-sync (the-as pointer #x1000d000) 0 0) + (set! sv-16 #t) + ) + ) + ) + (let ((v1-44 (+ s4-0 1))) + (let ((a0-18 2)) + (set-on-less-than a0-19 a0-18 v1-44) + ) + (move-if-not-zero v1-45 0 a0-19 v1-44) + ) + (set! s4-0 v1-45) + (set! sv-48 (-> obj work-buf-array s3-0)) + (when (> (-> sv-48 nav-count) 0) + (if (zero? (-> sv-48 i-pass)) + (reloc-ptrs-to-spad obj sv-48) + ) + (do-callbacks obj sv-48) + (if (= (-> sv-48 i-pass) (+ (-> obj max-pass-count) -1)) + (reloc-ptrs-to-mem obj sv-48) + ) + ) + (let ((v1-65 (+ s3-0 1))) + (let ((a0-25 2)) + (set-on-less-than a0-26 a0-25 v1-65) + ) + (move-if-not-zero v1-66 0 a0-26 v1-65) + ) + (set! s3-0 v1-66) + ) + ) + 0 + (none) + ) + +;; definition for method 16 of type nav-engine +;; WARN: Return type mismatch int vs none. +(defmethod update-nav-controls-in-spr nav-engine ((obj nav-engine)) + (flush-cache 0) + (set! (-> obj max-pass-count) 1) + (let ((gp-0 (the-as object (-> obj work-buf-array)))) + (set! (-> (the-as (inline-array nav-engine-spr-buffer) gp-0) 0 i-nav) (the-as uint 0)) + (set! (-> (the-as (inline-array nav-engine-spr-buffer) gp-0) 0 nav-count) + (the-as int (-> obj nav-mesh-addr nav-control-count)) + ) + (set! (-> (the-as (inline-array nav-engine-spr-buffer) gp-0) 0 i-pass) 0) + (set! (-> (the-as (inline-array nav-engine-spr-buffer) gp-0) 0 mem-addr) + (the-as (pointer nav-mesh) (-> obj nav-mesh-addr nav-control-array)) + ) + (set! (-> (the-as (inline-array nav-engine-spr-buffer) gp-0) 0 q-size) + (the-as uint (* 18 (-> (the-as (inline-array nav-engine-spr-buffer) gp-0) 0 nav-count))) + ) + (set! (-> (the-as (inline-array nav-engine-spr-buffer) gp-0) 0 done) 0) + (when (> (-> (the-as (inline-array nav-engine-spr-buffer) gp-0) 0 nav-count) 0) + (upload-nav-to-spr obj (the-as nav-engine-spr-buffer gp-0)) + (dma-sync (the-as pointer #x1000d400) 0 0) + (reloc-ptrs-to-spad obj (the-as nav-engine-spr-buffer gp-0)) + (while (< (-> (the-as (inline-array nav-engine-spr-buffer) gp-0) 0 i-pass) (-> obj max-pass-count)) + (do-callbacks obj (the-as nav-engine-spr-buffer gp-0)) + (+! (-> (the-as (inline-array nav-engine-spr-buffer) gp-0) 0 i-pass) 1) + ) + (reloc-ptrs-to-mem obj (the-as nav-engine-spr-buffer gp-0)) + (dotimes (s4-0 (-> (the-as (inline-array nav-engine-spr-buffer) gp-0) 0 nav-count)) + (let ((a2-1 (-> (the-as (inline-array nav-engine-spr-buffer) gp-0) 0 spr-addr s4-0 state mesh))) + (when (>= (the-as uint a2-1) (the-as uint #x70000000)) + (format 0 "nav-engine::update-nav-controls-in-spr: (pre-dma) bad mesh pointer found (#x0~x)~%" a2-1) + (break!) + 0 + ) + ) + ) + (download-nav-from-spr obj (the-as nav-engine-spr-buffer gp-0)) + (dma-sync (the-as pointer #x1000d000) 0 0) + (dotimes (s5-1 (-> (the-as (inline-array nav-engine-spr-buffer) gp-0) 0 nav-count)) + (let ((a2-3 (-> (&+ (-> (the-as nav-engine-spr-buffer gp-0) mem-addr) (* 288 s5-1)) 31))) + (when (>= (the-as uint a2-3) (the-as uint #x70000000)) + (format 0 "nav-engine::update-nav-controls-in-spr: (post-dma) bad mesh pointer found (#x0~x)~%" a2-3) + (break!) + 0 + ) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 26 of type nav-mesh +;; WARN: Return type mismatch int vs none. +(defmethod update-navigation nav-mesh ((obj nav-mesh)) + (local-vars (sp-0 int)) + (when (zero? (-> obj next-nav-mesh)) + (set! (-> obj next-nav-mesh) (the-as surface (nav-mesh-from-res-tag (-> obj entity) 'next-actor 0))) + (set! (-> obj prev-nav-mesh) (the-as surface (nav-mesh-from-res-tag (-> obj entity) 'prev-actor 0))) + ) + (when (> (-> obj nav-control-count) 0) + (the-as none sp-0) + (set! sp-0 #x70003fc0) + (set! (-> obj work mesh) obj) + (let ((s4-0 (the-as nav-engine #x70000000))) + (lay-out-spad-memory s4-0 obj) + (add-all-spheres s4-0) + (do-sphere-lookups s4-0) + (when (nonzero? (-> s4-0 output-sphere-hash)) + (let ((s3-0 (-> s4-0 nav-mesh-addr sphere-hash))) + (quad-copy! (-> s3-0 mem-bucket-array) (-> s3-0 bucket-array) (/ (-> s3-0 bucket-memory-size) 16)) + (quad-copy! + (the-as pointer (-> s3-0 mem-sphere-array)) + (the-as pointer (-> s3-0 sphere-array)) + (-> s3-0 object-count) + ) + (set! (-> s3-0 bucket-array) (-> s3-0 mem-bucket-array)) + (set! (-> s3-0 sphere-array) (the-as (inline-array sphere) (-> s3-0 mem-sphere-array))) + ) + ) + (if (< (the-as uint (* 3 (-> s4-0 buf-nav-control-count))) (-> obj nav-control-count)) + (update-nav-controls-pipelined-in-spr s4-0) + (update-nav-controls-in-spr s4-0) + ) + (set-up-mem-work s4-0) + ) + ) + 0 + (none) + ) + +;; definition for method 9 of type nav-mesh +;; WARN: Return type mismatch int vs none. +(defmethod debug-draw nav-mesh ((obj nav-mesh)) + (local-vars (sv-32 vector) (sv-36 int)) + (set! sv-32 (new 'stack-no-clear 'vector)) + (set! sv-36 16) + (add-debug-sphere + (logtest? sv-36 4) + (bucket-id debug2) + (-> obj bounds) + (-> obj bounds w) + (new 'static 'rgba :r #xff :g #xff :a #x20) + ) + (add-debug-vector #t (bucket-id debug-no-zbuf1) (-> obj bounds) *x-vector* (meters 1) *color-red*) + (add-debug-vector #t (bucket-id debug-no-zbuf1) (-> obj bounds) *z-vector* (meters 1) *color-blue*) + (when (logtest? sv-36 16) + (dotimes (s5-0 (the-as int (-> obj static-sphere-count))) + (add-debug-sphere + #t + (bucket-id debug2) + (-> obj static-sphere s5-0) + (-> obj static-sphere s5-0 r) + *color-light-blue* + ) + (let ((s4-0 add-debug-text-3d) + (s3-0 #t) + (s2-0 318) + ) + (format (clear *temp-string*) "~D" s5-0) + (s4-0 + s3-0 + (the-as bucket-id s2-0) + *temp-string* + (-> obj static-sphere s5-0) + (font-color cyan-#00fefe) + (the-as vector2h #f) + ) + ) + ) + (dotimes (s5-1 (the-as int (-> obj poly-count))) + (let ((s4-1 (-> obj poly-array s5-1))) + (debug-draw-poly obj s4-1 (cond + ((logtest? (the-as int (-> s4-1 pat)) 1) + *color-black* + ) + ((logtest? (the-as int (-> s4-1 pat)) 2) + *color-gray* + ) + ((logtest? (the-as int (-> s4-1 pat)) 4) + (if (-> obj link-array (-> s4-1 link) dest-mesh) + *color-green* + *color-light-red* + ) + ) + (else + *color-cyan* + ) + ) + ) + (when (logtest? sv-36 32) + (let ((s3-1 add-debug-text-3d) + (s2-1 #t) + (s1-1 318) + ) + (format (clear *temp-string*) "~D" (-> s4-1 id)) + (s3-1 + s2-1 + (the-as bucket-id s1-1) + *temp-string* + (poly-centroid obj s4-1 sv-32) + (font-color cyan-#00fefe) + (the-as vector2h #f) + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 12 of type nav-mesh +(defmethod poly-centroid-local nav-mesh ((obj nav-mesh) (arg0 nav-poly) (arg1 vector)) + (rlet ((vf0 :class vf)) + (init-vf0-vector) + (let ((v1-0 (new 'stack-no-clear 'nav-vertex))) + (.svf (&-> v1-0 quad) vf0) + (dotimes (a0-2 (the-as int (-> arg0 vertex-count))) + (vector+! (the-as vector v1-0) (the-as vector v1-0) (-> arg0 vertex a0-2)) + ) + (vector-float*! arg1 (the-as vector v1-0) (/ 1.0 (the float (-> arg0 vertex-count)))) + ) + ) + ) + +;; definition for method 11 of type nav-mesh +(defmethod poly-centroid nav-mesh ((obj nav-mesh) (arg0 nav-poly) (arg1 vector)) + (poly-centroid-local obj arg0 arg1) + (vector+! arg1 arg1 (-> obj bounds)) + ) + +;; definition for function vu-point-triangle-intersection? +(defun vu-point-triangle-intersection? ((arg0 vector) (arg1 vector) (arg2 vector) (arg3 vector)) + (local-vars (v1-0 float) (v1-1 int) (v1-3 int) (a0-1 float) (a0-2 int) (a0-4 int) (a1-1 float) (a1-2 int)) + (rlet ((acc :class vf) + (vf1 :class vf) + (vf10 :class vf) + (vf11 :class vf) + (vf12 :class vf) + (vf13 :class vf) + (vf14 :class vf) + (vf15 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf9 :class vf) + ) + (.lvf vf1 (&-> arg1 quad)) + (.lvf vf2 (&-> arg2 quad)) + (.sub.vf vf1 vf1 vf1 :mask #b1010) + (.lvf vf3 (&-> arg3 quad)) + (.sub.vf vf2 vf2 vf2 :mask #b1010) + (.lvf vf12 (&-> arg0 quad)) + (.sub.vf vf3 vf3 vf3 :mask #b1010) + (.sub.vf vf4 vf2 vf1) + (.sub.vf vf9 vf1 vf12) + (.sub.vf vf5 vf3 vf2) + (.sub.vf vf10 vf2 vf12) + (.sub.vf vf6 vf1 vf3) + (.sub.vf vf11 vf3 vf12) + (.outer.product.a.vf acc vf9 vf4) + (.outer.product.b.vf vf13 vf4 vf9 acc) + (.outer.product.a.vf acc vf10 vf5) + (.outer.product.b.vf vf14 vf5 vf10 acc) + (.outer.product.a.vf acc vf11 vf6) + (.outer.product.b.vf vf15 vf6 vf11 acc) + (.mov v1-0 vf13) + (.mov a1-1 vf14) + (.mov a0-1 vf15) + (set-on-less-than v1-1 v1-0 0) + (set-on-less-than a1-2 a1-1 0) + (set-on-less-than a0-2 a0-1 0) + (let ((a0-3 (logxor a1-2 a0-2)) + (v1-2 (logxor v1-1 a1-2)) + ) + (set-on-less-than a0-4 a0-3 1) + (set-on-less-than v1-3 v1-2 1) + ) + (logtest? v1-3 a0-4) + ) + ) + +;; definition for function poly-in-height-range? +(defun poly-in-height-range? ((arg0 nav-poly) (arg1 float) (arg2 float)) + (and (>= (+ (-> arg0 vertex3 w) arg2) arg1) (>= arg1 (- (-> arg0 vertex2 w) arg2))) + ) + +;; definition for method 42 of type nav-mesh +(defmethod find-poly-containing-point-local nav-mesh ((obj nav-mesh) (arg0 nav-find-poly-parms)) + (local-vars (v1-6 symbol) (v1-15 int) (a0-3 symbol) (sv-16 nav-poly)) + (let ((s4-0 (search-for-point (-> obj poly-hash) (-> arg0 point))) + (s3-0 (-> obj poly-hash bucket-size)) + (s2-0 0) + ) + (until (zero? v1-15) + (let ((s1-0 (* s2-0 8)) + (s0-0 (-> s4-0 0)) + ) + (b! (zero? s0-0) cfg-17 :delay (nop!)) + (let ((v1-2 (logand s0-0 1))) + (nop!) + (b! (zero? v1-2) cfg-16 :delay (nop!)) + ) + (set! sv-16 (-> obj poly-array s1-0)) + (let ((v1-5 sv-16) + (f0-0 (-> arg0 point y)) + (f1-0 (-> arg0 y-threshold)) + ) + (b! (>= (+ (-> v1-5 vertex3 w) f1-0) f0-0) cfg-5 :delay (set! a0-3 #t)) + (set! a0-3 #f) + (label cfg-5) + (set! v1-6 (and a0-3 (begin (b! (>= f0-0 (- (-> v1-5 vertex2 w) f1-0)) cfg-9 :delay (set! v1-6 #t)) #f))) + ) + (label cfg-9) + (when (and v1-6 (zero? (logand (-> sv-16 pat) (-> arg0 ignore)))) + (if (point-in-poly? obj sv-16 (-> arg0 point)) + (return sv-16) + ) + ) + (label cfg-16) + (set! s0-0 (/ (the-as int s0-0) 2)) + (nop!) + (b! (nonzero? s0-0) cfg-2 :delay (set! s1-0 (+ s1-0 1))) + ) + (label cfg-17) + (+! s2-0 1) + (set! s4-0 (&-> s4-0 1)) + (set-on-less-than v1-15 s2-0 s3-0) + (nop!) + ) + ) + 0 + (the-as nav-poly #f) + ) + +;; definition for method 44 of type nav-mesh +;; INFO: Used lq/sq +;; WARN: Stack slot offset 24 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 24 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +(defmethod is-in-mesh-local? nav-mesh ((obj nav-mesh) (arg0 vector) (arg1 float) (arg2 float)) + (local-vars (v1-3 float) (sv-16 float) (sv-20 vector) (sv-24 float)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (set! sv-16 arg2) + (set! sv-20 arg0) + (set! sv-24 arg1) + (let* ((f0-3 (+ sv-24 (-> obj bounds w))) + (f0-5 (* f0-3 f0-3)) + ) + (.lvf vf1 (&-> sv-20 quad)) + (.add.w.vf vf2 vf0 vf0 :mask #b1) + (.mul.vf vf1 vf1 vf1) + (.mul.x.vf acc vf2 vf1 :mask #b1) + (.add.mul.y.vf acc vf2 vf1 acc :mask #b1) + (.add.mul.z.vf vf1 vf2 vf1 acc :mask #b1) + (.mov v1-3 vf1) + (when (>= f0-5 v1-3) + (let ((s5-0 (new 'stack-no-clear 'nav-find-poly-parms))) + (set! (-> s5-0 point quad) (-> sv-20 quad)) + (set! (-> s5-0 y-threshold) sv-16) + (set! (-> s5-0 ignore) (the-as uint 2)) + (find-nearest-poly-to-point-local obj s5-0) + (cond + ((-> s5-0 point-inside?) + #t + ) + (else + (let ((s4-0 (new 'stack-no-clear 'vector))) + (project-point-into-poly-2d obj (-> s5-0 poly) s4-0 sv-20) + (let ((f0-7 (vector-vector-xz-distance-squared s4-0 sv-20)) + (f1-2 sv-24) + ) + (< f0-7 (* f1-2 f1-2)) + ) + ) + ) + ) + ) + ) + ) + ) + ) + +;; definition for function init-ray-local +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defun init-ray-local ((arg0 nav-ray) (arg1 nav-poly) (arg2 vector) (arg3 vector)) + (rlet ((acc :class vf) + (Q :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + ) + (init-vf0-vector) + (set! (-> arg0 current-pos quad) (-> arg2 quad)) + (set! (-> arg0 dest-pos quad) (-> arg3 quad)) + (set! (-> arg0 current-poly) arg1) + (let ((v1-2 arg0)) + (vector-! (-> v1-2 dir) (-> v1-2 dest-pos) (-> v1-2 current-pos)) + (set! (-> v1-2 dir y) 0.0) + (let ((a0-2 (-> v1-2 dir))) + (let ((f0-1 1.0)) + (.lvf vf1 (&-> a0-2 quad)) + (.mul.vf vf2 vf1 vf1 :mask #b111) + (let ((a1-3 f0-1)) + (.mov vf3 a1-3) + ) + ) + (.mul.x.vf acc vf0 vf2 :mask #b1000) + (.add.mul.y.vf acc vf0 vf2 acc :mask #b1000) + (.add.mul.z.vf vf2 vf0 vf2 acc :mask #b1000) + (.isqrt.vf Q vf3 vf2 :fsf #b0 :ftf #b11) + (.wait.vf) + (.mul.vf vf1 vf1 Q :mask #b111) + (.nop.vf) + (.nop.vf) + (.nop.vf) + (.svf (&-> a0-2 quad) vf1) + ) + (set! (-> v1-2 next-poly) #f) + (set! (-> v1-2 len) 0.0) + (set! (-> v1-2 last-edge) -1) + (set! (-> v1-2 terminated) #f) + (set! (-> v1-2 reached-dest) #f) + (set! (-> v1-2 hit-boundary) #f) + (set! (-> v1-2 hit-gap) #f) + (set! (-> v1-2 ignore) (the-as uint 3)) + ) + 0 + (none) + ) + ) + +;; definition for function init-ray-dir-local +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defun init-ray-dir-local ((arg0 nav-ray) (arg1 nav-poly) (arg2 vector) (arg3 vector) (arg4 float)) + (rlet ((acc :class vf) + (Q :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (set! (-> arg0 current-poly) arg1) + (set! (-> arg0 current-pos quad) (-> arg2 quad)) + (let ((a1-3 (-> arg0 dest-pos))) + (let ((v1-1 (-> arg0 current-pos))) + (let ((a2-1 arg3)) + (let ((a3-1 arg4)) + (.mov vf7 a3-1) + ) + (.lvf vf5 (&-> a2-1 quad)) + ) + (.lvf vf4 (&-> v1-1 quad)) + ) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> a1-3 quad) vf6) + ) + (let ((v1-2 arg0)) + (vector-! (-> v1-2 dir) (-> v1-2 dest-pos) (-> v1-2 current-pos)) + (set! (-> v1-2 dir y) 0.0) + (let ((a0-2 (-> v1-2 dir))) + (let ((f0-2 1.0)) + (.lvf vf1 (&-> a0-2 quad)) + (.mul.vf vf2 vf1 vf1 :mask #b111) + (let ((a1-6 f0-2)) + (.mov vf3 a1-6) + ) + ) + (.mul.x.vf acc vf0 vf2 :mask #b1000) + (.add.mul.y.vf acc vf0 vf2 acc :mask #b1000) + (.add.mul.z.vf vf2 vf0 vf2 acc :mask #b1000) + (.isqrt.vf Q vf3 vf2 :fsf #b0 :ftf #b11) + (.wait.vf) + (.mul.vf vf1 vf1 Q :mask #b111) + (.nop.vf) + (.nop.vf) + (.nop.vf) + (.svf (&-> a0-2 quad) vf1) + ) + (set! (-> v1-2 next-poly) #f) + (set! (-> v1-2 len) 0.0) + (set! (-> v1-2 last-edge) -1) + (set! (-> v1-2 terminated) #f) + (set! (-> v1-2 reached-dest) #f) + (set! (-> v1-2 hit-boundary) #f) + (set! (-> v1-2 hit-gap) #f) + (set! (-> v1-2 ignore) (the-as uint 3)) + ) + 0 + (none) + ) + ) + +;; definition for method 17 of type nav-mesh +(defmethod try-move-along-ray nav-mesh ((obj nav-mesh) (arg0 nav-poly) (arg1 vector) (arg2 vector) (arg3 float)) + (local-vars (v1-2 symbol)) + (let ((gp-0 (new 'stack-no-clear 'nav-ray))) + (let ((s4-0 0)) + (init-ray-dir-local gp-0 arg0 arg1 arg2 arg3) + (until v1-2 + (+! s4-0 1) + (move-along-nav-ray! obj gp-0) + (set! v1-2 (or (>= s4-0 15) (-> gp-0 terminated))) + ) + ) + (-> gp-0 len) + ) + ) + +;; definition for function nav-ray-test +(defun nav-ray-test ((arg0 nav-mesh) (arg1 nav-poly) (arg2 vector) (arg3 vector)) + (let ((s4-1 (vector-! (new 'stack-no-clear 'vector) arg2 (-> arg0 bounds))) + (s3-1 (vector-! (new 'stack-no-clear 'vector) arg3 arg2)) + ) + 0.0 + (set! (-> s3-1 y) 0.0) + (let ((f30-0 (vector-vector-xz-distance arg2 arg3))) + (vector-xz-normalize! s3-1 1.0) + (try-move-along-ray arg0 arg1 s4-1 s3-1 f30-0) + ) + ) + ) + +;; definition for function point-poly-distance-min +(defun point-poly-distance-min ((arg0 nav-mesh-work) (arg1 nav-poly) (arg2 float) (arg3 nav-poly)) + (let ((t0-0 (-> arg3 vertex-count)) + (a3-1 (-> arg3 vertex)) + (f0-0 arg2) + ) + (let ((v1-0 0)) + (let ((f1-0 (-> arg1 vertex0 x)) + (f2-0 (-> arg1 vertex0 z)) + (a1-1 0) + ) + (b! #t cfg-10 :delay (nop!)) + (label cfg-1) + (let* ((t2-0 (-> a3-1 (-> arg0 vert0-table a1-1))) + (t1-6 (-> a3-1 (-> arg0 vert1-table a1-1))) + (f5-0 (- (-> t1-6 x) (-> t2-0 x))) + (f6-0 (- (-> t1-6 z) (-> t2-0 z))) + (f4-2 (- f1-0 (-> t2-0 x))) + (f3-4 (- f2-0 (-> t2-0 z))) + (f7-1 (- (* f5-0 f3-4) (* f6-0 f4-2))) + ) + (b! (>= 0.0 f7-1) cfg-9 :delay #f) + (+! v1-0 1) + (let* ((f8-2 f5-0) + (f8-4 (* f8-2 f8-2)) + (f9-0 f6-0) + (f8-5 (+ f8-4 (* f9-0 f9-0))) + ) + (let* ((f9-3 arg2) + (f9-6 (* f8-5 (* f9-3 f9-3))) + (f10-0 f7-1) + ) + (b! (< f9-6 (* f10-0 f10-0)) cfg-13) + ) + (let ((f5-2 (+ (* f5-0 f4-2) (* f6-0 f3-4)))) + arg2 + (b! (>= f5-2 0.0) cfg-5) + (let ((f3-8 (sqrtf (+ (* f4-2 f4-2) (* f3-4 f3-4))))) + (b! #t cfg-8 :delay (nop!)) + (label cfg-5) + (b! (>= f8-5 f5-2) cfg-7) + (let* ((f3-10 (- f1-0 (-> t1-6 x))) + (f3-12 (* f3-10 f3-10)) + (f4-6 (- f2-0 (-> t1-6 z))) + ) + (set! f3-8 (sqrtf (+ f3-12 (* f4-6 f4-6)))) + ) + (b! #t cfg-8 :delay (nop!)) + (label cfg-7) + (set! f0-0 (/ f7-1 (sqrtf f8-5))) + (b! #t cfg-13 :delay (nop!)) + (label cfg-8) + (set! f0-0 (fmin f0-0 f3-8)) + ) + ) + ) + ) + (label cfg-9) + (+! a1-1 1) + (label cfg-10) + (b! (< a1-1 (the-as int t0-0)) cfg-1) + ) + (b! (nonzero? v1-0) cfg-13 :delay (empty-form)) + ) + (set! f0-0 0.0) + (label cfg-13) + f0-0 + ) + ) + +;; definition for method 43 of type nav-mesh +;; WARN: Stack slot offset 28 signed mismatch +;; WARN: Stack slot offset 52 signed mismatch +;; WARN: Stack slot offset 28 signed mismatch +;; WARN: Stack slot offset 52 signed mismatch +;; WARN: Stack slot offset 28 signed mismatch +;; WARN: Stack slot offset 28 signed mismatch +;; WARN: Stack slot offset 52 signed mismatch +;; WARN: Stack slot offset 28 signed mismatch +;; WARN: Stack slot offset 52 signed mismatch +;; WARN: Stack slot offset 28 signed mismatch +;; WARN: Stack slot offset 28 signed mismatch +;; WARN: Stack slot offset 52 signed mismatch +;; WARN: Stack slot offset 28 signed mismatch +;; WARN: Stack slot offset 52 signed mismatch +;; WARN: Stack slot offset 28 signed mismatch +;; WARN: Stack slot offset 28 signed mismatch +;; WARN: Stack slot offset 52 signed mismatch +;; WARN: Stack slot offset 28 signed mismatch +;; WARN: Stack slot offset 52 signed mismatch +;; WARN: Stack slot offset 28 signed mismatch +(defmethod find-nearest-poly-to-point-local nav-mesh ((obj nav-mesh) (arg0 nav-find-poly-parms)) + (local-vars + (v1-16 int) + (v1-34 int) + (sv-16 nav-poly) + (sv-20 (pointer uint8)) + (sv-24 nav-poly) + (sv-28 float) + (sv-32 int) + (sv-40 int) + (sv-48 nav-poly) + (sv-52 float) + ) + (set! sv-16 (the-as nav-poly #f)) + (set! sv-20 (search-for-sphere (-> obj poly-hash) (-> arg0 point) 12288.0)) + (set! (-> arg0 point-inside?) #f) + (let ((s4-0 (-> obj poly-hash bucket-size)) + (s3-0 sv-20) + (s2-0 0) + ) + (nop!) + (label cfg-1) + (let ((s1-0 (* s2-0 8)) + (s0-0 (-> s3-0 0)) + ) + (b! (zero? s0-0) cfg-17 :delay (nop!)) + (let ((v1-3 (logand s0-0 1))) + (nop!) + (b! (zero? v1-3) cfg-16 :delay (nop!)) + ) + (set! sv-24 (-> obj poly-array s1-0)) + (let ((v1-6 sv-24) + (f0-0 (-> arg0 point y)) + (f1-0 (-> arg0 y-threshold)) + ) + (b! + (not (and (and (>= (+ (-> v1-6 vertex3 w) f1-0) f0-0) (>= f0-0 (- (-> v1-6 vertex2 w) f1-0))) + (zero? (logand (-> sv-24 pat) (-> arg0 ignore))) + ) + ) + cfg-16 + :delay (empty-form) + ) + ) + (b! (not (point-in-poly? obj sv-24 (-> arg0 point))) cfg-16 :delay (empty-form)) + (set! (-> arg0 point-inside?) #t) + (set! (-> arg0 dist) 0.0) + (set! sv-16 sv-24) + (b! #t cfg-38 :delay (nop!)) + (nop!) + (label cfg-16) + (set! s0-0 (/ (the-as int s0-0) 2)) + (nop!) + (b! (nonzero? s0-0) cfg-2 :delay (set! s1-0 (+ s1-0 1))) + ) + (label cfg-17) + (+! s2-0 1) + (set! s3-0 (&-> s3-0 1)) + (set-on-less-than v1-16 s2-0 s4-0) + ) + (nop!) + (b! (nonzero? v1-16) cfg-1 :delay (nop!)) + (set! sv-28 (the-as float 10000000000000000000000000000000000000.0)) + (set! sv-32 0) + (set! sv-40 0) + (let ((s4-1 (-> obj poly-hash bucket-size)) + (s3-1 sv-20) + (s2-1 0) + ) + (until (zero? v1-34) + (let ((s1-1 (* s2-1 8)) + (s0-1 (-> s3-1 0)) + ) + (b! (zero? s0-1) cfg-34 :delay (nop!)) + (let ((v1-19 (logand s0-1 1))) + (nop!) + (b! (zero? v1-19) cfg-33 :delay (nop!)) + ) + (set! sv-48 (-> obj poly-array s1-1)) + (let ((v1-22 sv-48) + (f0-3 (-> arg0 point y)) + (f1-2 (-> arg0 y-threshold)) + ) + (when (and (and (>= (+ (-> v1-22 vertex3 w) f1-2) f0-3) (>= f0-3 (- (-> v1-22 vertex2 w) f1-2))) + (zero? (logand (-> sv-48 pat) (-> arg0 ignore))) + ) + (set! sv-40 (+ sv-40 1)) + (set! sv-52 (point-poly-distance-min (-> obj work) (the-as nav-poly (-> arg0 point)) sv-28 sv-48)) + (when (< sv-52 sv-28) + (set! sv-28 sv-52) + (set! sv-16 sv-48) + (nop!) + ) + ) + ) + (label cfg-33) + (set! s0-1 (/ (the-as int s0-1) 2)) + (nop!) + (b! (nonzero? s0-1) cfg-20 :delay (set! s1-1 (+ s1-1 1))) + ) + (label cfg-34) + (+! s2-1 1) + (set! s3-1 (&-> s3-1 1)) + (set-on-less-than v1-34 s2-1 s4-1) + (nop!) + ) + ) + (if (not sv-16) + (set! sv-16 (-> obj poly-array 0)) + ) + (set! (-> arg0 dist) sv-28) + (label cfg-38) + (set! (-> arg0 poly) sv-16) + arg0 + ) + +;; definition for function nav-mesh-route-table-bit-index +(defun nav-mesh-route-table-bit-index ((arg0 nav-mesh) (arg1 uint) (arg2 int)) + (* (+ arg2 (* arg1 (-> arg0 poly-count))) 2) + ) + +;; definition for method 14 of type nav-mesh +;; INFO: Used lq/sq +(defmethod get-route-portal nav-mesh ((obj nav-mesh) (arg0 nav-poly) (arg1 nav-poly) (arg2 nav-route-portal)) + (set! (-> arg2 next-poly) #f) + (cond + ((and arg0 arg1 (!= arg0 arg1)) + (let* ((a1-1 obj) + (v1-1 (-> arg0 id)) + (v1-4 (* (+ (-> arg1 id) (* (the-as uint v1-1) (-> a1-1 poly-count))) 2)) + (s3-0 + (logand (ash (-> (the-as (pointer uint8) (&+ (-> obj route) (shr v1-4 3)))) (- (the-as int (logand v1-4 7)))) + 3 + ) + ) + ) + (set! (-> arg2 edge-index) -1) + (let ((s2-0 (-> arg0 adj-poly s3-0))) + (when (= s2-0 255) + (format 0 "nav-mesh::get-route-portal: data error in nav mesh~%") + (break!) + 0 + ) + (set! (-> arg2 edge-index) (the-as int s3-0)) + (set! (-> arg2 next-poly) (-> obj poly-array s2-0)) + ) + (let ((a0-7 s3-0) + (v1-16 (the-as int (+ s3-0 1))) + ) + (if (>= (the-as uint v1-16) (the-as uint (-> arg0 vertex-count))) + (set! v1-16 0) + ) + (set! (-> arg2 vertex 1 quad) (-> arg0 vertex a0-7 quad)) + (let ((v0-1 (-> arg2 vertex))) + (set! (-> v0-1 0 quad) (-> arg0 vertex v1-16 quad)) + v0-1 + ) + ) + ) + ) + (else + (the-as (inline-array nav-vertex) #f) + ) + ) + ) + +;; definition for method 13 of type nav-mesh +(defmethod lookup-poly-on-route-to-target nav-mesh ((obj nav-mesh) (arg0 nav-poly) (arg1 nav-poly)) + (cond + ((and arg0 arg1 (!= arg0 arg1)) + (let* ((a3-0 obj) + (v1-1 (-> arg0 id)) + (v1-4 (* (+ (-> arg1 id) (* (the-as uint v1-1) (-> a3-0 poly-count))) 2)) + (v1-9 + (logand (ash (-> (the-as (pointer uint8) (&+ (-> obj route) (shr v1-4 3)))) (- (the-as int (logand v1-4 7)))) + 3 + ) + ) + (a2-5 (new 'stack-no-clear 'array 'int8 4)) + ) + (set! (-> a2-5 0) (the-as int (-> arg0 adj-poly0))) + (set! (-> a2-5 1) (the-as int (-> arg0 adj-poly1))) + (set! (-> a2-5 2) (the-as int (-> arg0 adj-poly2))) + (set! (-> a2-5 3) (the-as int (-> arg0 adj-poly3))) + (let ((v1-11 (-> (the-as (pointer uint8) (&+ a2-5 v1-9))))) + (if (= v1-11 255) + (the-as nav-poly #f) + (-> obj poly-array v1-11) + ) + ) + ) + ) + (else + (the-as nav-poly #f) + ) + ) + ) + +;; definition for method 22 of type nav-mesh +;; WARN: Return type mismatch int vs none. +(defmethod compute-bounding-box-from-vertices nav-mesh ((obj nav-mesh) (arg0 vector) (arg1 vector)) + (let ((f0-0 10000000000000000000000000000000000000.0) + (f1-0 -10000000000000000000000000000000000000.0) + ) + (set! (-> arg0 x) f0-0) + (set! (-> arg0 y) f0-0) + (set! (-> arg0 z) f0-0) + (set! (-> arg1 x) f1-0) + (set! (-> arg1 y) f1-0) + (set! (-> arg1 z) f1-0) + ) + (dotimes (v1-3 (the-as int (-> obj poly-count))) + (let ((a3-1 (-> obj poly-array v1-3))) + (dotimes (t0-1 (the-as int (-> a3-1 vertex-count))) + (let ((t1-2 (-> a3-1 vertex t0-1))) + (set! (-> arg0 x) (fmin (-> arg0 x) (-> t1-2 x))) + (set! (-> arg0 y) (fmin (-> arg0 y) (-> t1-2 y))) + (set! (-> arg0 z) (fmin (-> arg0 z) (-> t1-2 z))) + (set! (-> arg1 x) (fmax (-> arg1 x) (-> t1-2 x))) + (set! (-> arg1 y) (fmax (-> arg1 y) (-> t1-2 y))) + (set! (-> arg1 z) (fmax (-> arg1 z) (-> t1-2 z))) + ) + ) + ) + ) + (vector+! arg0 arg0 (-> obj bounds)) + (vector+! arg1 arg1 (-> obj bounds)) + 0 + (none) + ) + +;; definition for method 15 of type nav-mesh +;; WARN: Return type mismatch int vs none. +(defmethod initialize-mesh! nav-mesh ((obj nav-mesh)) + (local-vars + (sv-32 vector) + (sv-36 uint) + (sv-40 int) + (sv-48 int) + (sv-56 int) + (sv-64 symbol) + (sv-68 (inline-array vector)) + (sv-72 vector) + (sv-76 vector) + ) + (with-pp + (rlet ((acc :class vf) + (Q :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + ) + (init-vf0-vector) + (set! sv-32 (new 'stack-no-clear 'vector)) + (set! sv-36 (-> obj poly-count)) + (set! sv-40 0) + (set! sv-48 0) + (set! sv-56 0) + (set! sv-64 (the-as symbol #f)) + (countdown (s5-0 sv-36) + (let ((v1-3 (-> obj poly-array s5-0))) + (if (logtest? (the-as int (-> v1-3 pat)) 1) + (set! sv-56 (+ sv-56 1)) + ) + (set! sv-68 (-> v1-3 vertex)) + (set! sv-72 (-> v1-3 vertex1)) + (set! sv-76 (-> v1-3 vertex2)) + ) + (vector-3pt-cross! sv-32 (the-as vector sv-68) sv-72 sv-76) + (cond + ((= (vector-length sv-32) 0.0) + (set! sv-40 (+ sv-40 1)) + ) + (else + (let ((v1-9 sv-32)) + (let ((f0-1 1.0)) + (.lvf vf1 (&-> v1-9 quad)) + (.mul.vf vf2 vf1 vf1 :mask #b111) + (let ((a0-11 f0-1)) + (.mov vf3 a0-11) + ) + ) + (.mul.x.vf acc vf0 vf2 :mask #b1000) + (.add.mul.y.vf acc vf0 vf2 acc :mask #b1000) + (.add.mul.z.vf vf2 vf0 vf2 acc :mask #b1000) + (.isqrt.vf Q vf3 vf2 :fsf #b0 :ftf #b11) + (.wait.vf) + (.mul.vf vf1 vf1 Q :mask #b111) + (.nop.vf) + (.nop.vf) + (.nop.vf) + (.svf (&-> v1-9 quad) vf1) + ) + (if (>= 0.0 (-> sv-32 y)) + (set! sv-48 (+ sv-48 1)) + ) + ) + ) + ) + (when (zero? sv-36) + (format #t "WARNING: nav-mesh has no triangles. ") + (set! sv-64 #t) + ) + (when (> sv-40 0) + (format #t "WARNING: nav-mesh has ~D triangles with zero area (out of ~D triangles). " sv-40 sv-36) + (set! sv-64 #t) + ) + (when (> sv-48 0) + (format #t "WARNING: nav-mesh has ~D triangles with inverted normals (out of ~D triangles). " sv-48 sv-36) + (set! sv-64 #t) + ) + (when (< (the-as uint 255) sv-36) + (format #t "WARNING: nav-mesh has ~D triangles (only up to ~D are allowed). " sv-36 255) + (set! sv-64 #t) + ) + (when (= sv-56 sv-36) + (format #t "WARNING: nav-mesh only contains gap triangles (~D triangles total). " sv-36) + (set! sv-64 #t) + ) + (when sv-64 + (if pp + (format #t "current process is ~A~%" (-> pp name)) + (format #t "(no current process).~%") + ) + ) + 0 + (none) + ) + ) + ) + +;; definition for function ray-ccw-line-segment-intersection? +(defun ray-ccw-line-segment-intersection? ((arg0 vector) (arg1 vector) (arg2 vector) (arg3 vector)) + (let ((f0-2 (- (* (-> arg2 x) (-> arg1 z)) (* (-> arg2 z) (-> arg1 x)))) + (f2-4 (- (* (-> arg3 x) (-> arg1 z)) (* (-> arg3 z) (-> arg1 x)))) + (f3-4 (- (* (-> arg0 x) (-> arg1 z)) (* (-> arg0 z) (-> arg1 x)))) + (v0-0 #f) + ) + (let ((f1-7 (- f2-4 f0-2)) + (f2-5 (- f2-4 f3-4)) + (f3-5 (- f3-4 f0-2)) + ) + (when (and (>= (fabs f1-7) (fmax (fabs f3-5) (fabs f2-5))) (!= f1-7 0.0)) + (let ((f0-7 (+ (* (-> arg1 x) (- (-> arg3 z) (-> arg2 z))) (* (-> arg1 z) (- (-> arg2 x) (-> arg3 x)))))) + (set! v0-0 (< 0.0 f0-7)) + ) + ) + ) + v0-0 + ) + ) + +;; definition for function ray-line-segment-intersection? +(defun ray-line-segment-intersection? ((arg0 vector) (arg1 vector) (arg2 vector) (arg3 vector)) + (let ((f1-3 (- (* (-> arg2 x) (-> arg1 z)) (* (-> arg2 z) (-> arg1 x)))) + (f0-4 (- (* (-> arg3 x) (-> arg1 z)) (* (-> arg3 z) (-> arg1 x)))) + (f2-6 (- (* (-> arg0 x) (-> arg1 z)) (* (-> arg0 z) (-> arg1 x)))) + (gp-0 #f) + ) + (let ((f30-0 (- f0-4 f1-3)) + (f0-5 (- f0-4 f2-6)) + (f1-4 (- f2-6 f1-3)) + ) + (when (and (>= (fabs f30-0) (fmax (fabs f1-4) (fabs f0-5))) (!= f30-0 0.0)) + (let ((f2-11 (+ (* (-> arg2 x) (-> arg1 x)) (* (-> arg2 z) (-> arg1 z)))) + (f3-11 (+ (* (-> arg3 x) (-> arg1 x)) (* (-> arg3 z) (-> arg1 z)))) + (f28-0 (+ (* (-> arg0 x) (-> arg1 x)) (* (-> arg0 z) (-> arg1 z)))) + ) + (if (>= (* (+ (* f2-11 f0-5) (* f3-11 f1-4)) (sign f30-0)) (* f28-0 (fabs f30-0))) + (set! gp-0 #t) + ) + ) + ) + ) + gp-0 + ) + ) + +;; definition for method 38 of type nav-mesh +;; INFO: Used lq/sq +(defmethod nav-mesh-method-38 nav-mesh ((obj nav-mesh) (arg0 nav-poly) (arg1 vector) (arg2 vector) (arg3 vector) (arg4 (pointer nav-poly))) + (local-vars + (s1-0 vector) + (sv-16 int) + (sv-24 nav-mesh-work) + (sv-28 uint8) + (sv-32 (pointer int8)) + (sv-36 (pointer int8)) + (sv-40 vector) + (sv-44 vector) + ) + (set! sv-16 -1) + (set! sv-24 (-> obj work)) + (set! sv-28 (-> arg0 vertex-count)) + (set! sv-32 (-> sv-24 vert0-table)) + (set! sv-36 (-> sv-24 vert1-table)) + (set! (-> arg2 quad) (-> arg3 quad)) + (dotimes (v1-8 (the-as int sv-28)) + (set! sv-40 (-> arg0 vertex (-> sv-32 v1-8))) + (set! sv-44 (-> arg0 vertex (-> sv-36 v1-8))) + (let* ((f0-1 (- (-> sv-40 z) (-> sv-44 z))) + (f1-2 (- (-> sv-44 x) (-> sv-40 x))) + (f2-4 (+ (* f0-1 (- (-> sv-40 x) (-> arg1 x))) (* f1-2 (- (-> sv-40 z) (-> arg1 z))))) + (f0-3 (+ (* (-> arg2 x) f0-1) (* (-> arg2 z) f1-2))) + ) + (when (< f2-4 f0-3) + (set! sv-16 v1-8) + (let ((f0-4 (/ f2-4 f0-3))) + (set! (-> arg2 x) (* (-> arg2 x) f0-4)) + (set! (-> arg2 z) (* (-> arg2 z) f0-4)) + ) + ) + ) + ) + (when arg4 + (cond + ((= sv-16 -1) + (set! (-> arg4 0) #f) + ) + (else + (while (!= sv-16 -1) + (let ((v1-16 (-> arg0 adj-poly sv-16))) + (cond + ((!= v1-16 255) + (set! (-> arg4 0) (-> obj poly-array v1-16)) + (set! sv-16 -1) + ) + ((let ((a1-1 (-> arg0 vertex (-> sv-32 sv-16)))) + (set! s1-0 (-> arg0 vertex (-> sv-36 sv-16))) + (< (vector-vector-xz-distance arg1 a1-1) (-> obj work nav-poly-min-dist)) + ) + (set! sv-16 (+ sv-16 -1)) + (if (< sv-16 0) + (set! sv-16 (the-as int (+ sv-28 -1))) + ) + ) + ((< (vector-vector-xz-distance arg1 s1-0) (-> obj work nav-poly-min-dist)) + (set! sv-16 (+ sv-16 1)) + (when (>= sv-16 (the-as int sv-28)) + (set! sv-16 0) + 0 + ) + ) + (else + (set! (-> arg4 0) #f) + (set! sv-16 -1) + ) + ) + ) + ) + ) + ) + ) + (set! (-> arg2 y) (-> arg1 y)) + arg2 + ) + +;; definition for function plane-height-at-xz-point +(defun plane-height-at-xz-point ((arg0 plane) (arg1 vector)) + (/ (- (+ (* (-> arg1 x) (-> arg0 x)) (* (-> arg1 z) (-> arg0 z)) (-> arg0 w))) (-> arg0 y)) + ) + +;; definition for function nav-normal-from-3-points +;; WARN: Return type mismatch int vs none. +(defun nav-normal-from-3-points ((arg0 vector) (arg1 vector) (arg2 vector) (arg3 vector)) + (rlet ((acc :class vf) + (Q :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + (vf5 :class vf) + ) + (init-vf0-vector) + (let ((v1-0 arg0)) + (let ((a0-1 arg1) + (a2-1 arg3) + ) + (.lvf vf3 (&-> arg2 quad)) + (.lvf vf1 (&-> a0-1 quad)) + (.lvf vf2 (&-> a2-1 quad)) + ) + (.sub.vf vf1 vf3 vf1) + (.sub.vf vf2 vf3 vf2) + (.outer.product.a.vf acc vf2 vf1) + (.outer.product.b.vf vf4 vf1 vf2 acc) + (.mul.vf vf5 vf4 vf4) + (.add.y.vf vf5 vf5 vf5 :mask #b1) + (.add.z.vf vf5 vf5 vf5 :mask #b1) + (.isqrt.vf Q vf0 vf5 :fsf #b11 :ftf #b0) + (.mov.vf vf4 vf0 :mask #b1000) + (.wait.vf) + (.mul.vf vf4 vf4 Q :mask #b111) + (.nop.vf) + (.nop.vf) + (.svf (&-> v1-0 quad) vf4) + ) + 0 + (none) + ) + ) + +;; definition for method 40 of type nav-mesh +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod project-point-onto-plane-of-poly-local nav-mesh ((obj nav-mesh) (arg0 nav-poly) (arg1 vector) (arg2 vector) (arg3 vector)) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (let ((s4-0 (new 'stack-no-clear 'vector))) + (cond + ((= (-> arg0 vertex-count) 3) + (nav-normal-from-3-points s4-0 (the-as vector (-> arg0 vertex)) (-> arg0 vertex1) (-> arg0 vertex2)) + ) + ((let* ((v1-2 (-> arg0 vertex2)) + (a0-3 (-> arg0 vertex)) + (f0-1 (- (-> a0-3 0 x) (-> v1-2 x))) + (f1-2 (- (-> a0-3 0 z) (-> v1-2 z))) + (f2-2 (- (-> arg3 x) (-> v1-2 x))) + (f0-3 (- (* f0-1 (- (-> arg3 z) (-> v1-2 z))) (* f1-2 f2-2))) + ) + (< 0.0 f0-3) + ) + (nav-normal-from-3-points s4-0 (the-as vector (-> arg0 vertex)) (-> arg0 vertex2) (-> arg0 vertex3)) + ) + (else + (nav-normal-from-3-points s4-0 (the-as vector (-> arg0 vertex)) (-> arg0 vertex1) (-> arg0 vertex2)) + ) + ) + (set! (-> arg2 quad) (-> s4-0 quad)) + (set! (-> s4-0 w) (- (vector-dot s4-0 (the-as vector (-> arg0 vertex))))) + (set! (-> s5-0 quad) (-> arg3 quad)) + (set! (-> s5-0 y) (/ (- (+ (* (-> arg3 x) (-> s4-0 x)) (* (-> arg3 z) (-> s4-0 z)) (-> s4-0 w))) (-> s4-0 y))) + ) + (set! (-> arg1 quad) (-> s5-0 quad)) + ) + 0 + (none) + ) + +;; definition for method 8 of type nav-mesh +;; WARN: Return type mismatch int vs nav-mesh. +(defmethod mem-usage nav-mesh ((obj nav-mesh) (arg0 memory-usage-block) (arg1 int)) + (set! (-> arg0 length) (max 46 (-> arg0 length))) + (set! (-> arg0 data 45 name) "nav-mesh") + (+! (-> arg0 data 45 count) 1) + (let ((v1-6 (asize-of obj))) + (+! (-> arg0 data 45 used) v1-6) + (+! (-> arg0 data 45 total) (logand -16 (+ v1-6 15))) + ) + (set! (-> arg0 length) (max 46 (-> arg0 length))) + (set! (-> arg0 data 45 name) "nav-mesh") + (+! (-> arg0 data 45 count) 1) + (let ((v1-16 (* (-> obj poly-count) 64))) + (+! (-> arg0 data 45 used) v1-16) + (+! (-> arg0 data 45 total) (logand -16 (+ v1-16 15))) + ) + (set! (-> arg0 length) (max 46 (-> arg0 length))) + (set! (-> arg0 data 45 name) "nav-mesh") + (+! (-> arg0 data 45 count) 1) + (let* ((v1-25 (-> obj poly-count)) + (v1-27 (shr (* v1-25 v1-25) 2)) + ) + (+! (-> arg0 data 45 used) v1-27) + (+! (-> arg0 data 45 total) (logand -16 (+ v1-27 15))) + ) + (the-as nav-mesh 0) + ) + +;; definition for function get-nav-mesh +(defun get-nav-mesh ((arg0 actor-id)) + (let ((gp-0 (the-as nav-mesh #f))) + (let* ((s5-0 (entity-nav-mesh-by-aid arg0)) + (v1-0 (if (type? s5-0 entity-nav-mesh) + s5-0 + ) + ) + ) + (if v1-0 + (set! gp-0 (-> v1-0 nav-mesh)) + ) + ) + gp-0 + ) + ) + +;; definition for function find-nearest-nav-mesh +;; WARN: Stack slot offset 72 signed mismatch +;; WARN: Stack slot offset 72 signed mismatch +;; WARN: Stack slot offset 72 signed mismatch +;; WARN: Stack slot offset 72 signed mismatch +(defun find-nearest-nav-mesh ((arg0 vector) (arg1 float)) + (local-vars (v1-15 float) (sv-64 nav-find-poly-parms) (sv-68 nav-mesh) (sv-72 float) (sv-76 vector)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (set! sv-64 (new 'stack-no-clear 'nav-find-poly-parms)) + (set! sv-68 (the-as nav-mesh #f)) + (set! sv-72 arg1) + (set! sv-76 arg0) + (set! (-> sv-64 ignore) (the-as uint 7)) + (dotimes (gp-0 (-> *level* length)) + (let ((v1-5 (-> *level* level gp-0))) + (when (= (-> v1-5 status) 'active) + (let ((s5-0 (-> v1-5 bsp nav-meshes))) + (when (nonzero? s5-0) + (dotimes (s4-0 (-> s5-0 length)) + (let ((s3-0 (-> s5-0 s4-0 nav-mesh))) + (when s3-0 + (vector-! (-> sv-64 point) sv-76 (-> s3-0 bounds)) + (.lvf vf1 (&-> (-> sv-64 point) quad)) + (.add.w.vf vf2 vf0 vf0 :mask #b1) + (.mul.vf vf1 vf1 vf1) + (.mul.x.vf acc vf2 vf1 :mask #b1) + (.add.mul.y.vf acc vf2 vf1 acc :mask #b1) + (.add.mul.z.vf vf1 vf2 vf1 acc :mask #b1) + (.mov v1-15 vf1) + (let ((f0-1 v1-15) + (f1-0 (-> s3-0 bounds w)) + ) + (when (< f0-1 (* f1-0 f1-0)) + (set! (-> sv-64 y-threshold) (-> s3-0 nearest-y-threshold)) + (find-nearest-poly-to-point-local s3-0 sv-64) + (when (>= sv-72 (-> sv-64 dist)) + (set! sv-72 (-> sv-64 dist)) + (set! sv-68 s3-0) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + sv-68 + ) + ) + +;; definition for method 10 of type nav-mesh +(defmethod nav-mesh-method-10 nav-mesh ((obj nav-mesh) (arg0 vector) (arg1 vector) (arg2 nav-poly)) + (local-vars (sv-16 vector)) + (set! sv-16 arg0) + (let ((gp-0 (new 'stack-no-clear 'nav-find-poly-parms))) + (set! (-> gp-0 poly) arg2) + (vector-! (-> gp-0 point) arg1 (-> obj bounds)) + (when (or (not (-> gp-0 poly)) (not (point-in-poly? obj (-> gp-0 poly) (-> gp-0 point)))) + (set! (-> gp-0 y-threshold) (-> obj nearest-y-threshold)) + (set! (-> gp-0 ignore) (the-as uint 3)) + (find-nearest-poly-to-point-local obj gp-0) + (when (-> gp-0 poly) + (project-point-into-poly-2d obj (-> gp-0 poly) sv-16 (-> gp-0 point)) + (vector+! sv-16 sv-16 (-> obj bounds)) + ) + ) + (-> gp-0 poly) + ) + ) + +;; definition for function point-to-poly-boundary +;; INFO: Used lq/sq +(defun point-to-poly-boundary ((arg0 nav-poly) (arg1 vector) (arg2 vector)) + (let ((gp-0 (new 'stack-no-clear 'inline-array 'vector 4))) + (set! (-> gp-0 4 x) (the-as float #x7f800000)) + (let* ((s2-0 (-> arg0 vertex-count)) + (v1-1 (the-as int (+ s2-0 -1))) + ) + (dotimes (s1-0 (the-as int s2-0)) + (when (= (-> arg0 adj-poly v1-1) 255) + (set! (-> gp-0 2 quad) (-> arg0 vertex v1-1 quad)) + (set! (-> gp-0 3 quad) (-> arg0 vertex s1-0 quad)) + (set! (-> gp-0 2 y) (-> arg2 y)) + (set! (-> gp-0 3 y) (-> arg2 y)) + (set! (-> gp-0 2 w) 1.0) + (set! (-> gp-0 3 w) 1.0) + (let ((f0-5 (vector-segment-distance-point! arg2 (-> gp-0 2) (-> gp-0 3) (-> gp-0 0)))) + (when (< f0-5 (-> gp-0 4 x)) + (set! (-> gp-0 4 x) f0-5) + (set! (-> gp-0 1 quad) (-> gp-0 0 quad)) + ) + ) + ) + (set! v1-1 s1-0) + ) + ) + (set! (-> arg1 quad) (-> gp-0 1 quad)) + (-> gp-0 4 x) + ) + ) + +;; definition for method 34 of type nav-mesh +;; INFO: Used lq/sq +(defmethod nav-mesh-method-34 nav-mesh ((obj nav-mesh) (arg0 vector) (arg1 vector) (arg2 float)) + (local-vars (v1-8 symbol) (v1-13 int) (a1-2 symbol) (sv-80 vector) (sv-84 (pointer uint8))) + (let ((gp-0 (new 'stack-no-clear 'nav-poly))) + (set! sv-80 arg0) + (set! (-> gp-0 vertex3 y) (the-as float #x7f800000)) + (set! (-> gp-0 vertex3 x) arg2) + (set! (-> gp-0 vertex1 quad) (-> arg1 quad)) + (set! sv-84 (search-for-sphere (-> obj poly-hash) (-> gp-0 vertex1) (-> gp-0 vertex3 x))) + (let ((s4-0 (-> obj poly-hash bucket-size)) + (s3-0 sv-84) + (s2-0 0) + ) + (until (zero? v1-13) + (let ((s1-0 (* s2-0 8)) + (s0-0 (-> s3-0 0)) + ) + (b! (zero? s0-0) cfg-14 :delay (nop!)) + (let ((v1-5 (logand s0-0 1))) + (nop!) + (b! (zero? v1-5) cfg-13 :delay (nop!)) + ) + (let ((a0-5 (-> obj poly-array s1-0))) + (let ((v1-7 a0-5) + (f0-3 (-> gp-0 vertex1 y)) + (f1-0 (-> obj nearest-y-threshold)) + ) + (b! (>= (+ (-> v1-7 vertex3 w) f1-0) f0-3) cfg-5 :delay (set! a1-2 #t)) + (set! a1-2 #f) + (label cfg-5) + (set! v1-8 (and a1-2 (begin (b! (>= f0-3 (- (-> v1-7 vertex2 w) f1-0)) cfg-9 :delay (set! v1-8 #t)) #f))) + ) + (label cfg-9) + (if v1-8 + (set! (-> gp-0 vertex3 z) (point-to-poly-boundary a0-5 (-> gp-0 vertex2) (-> gp-0 vertex1))) + ) + ) + (when (< (-> gp-0 vertex3 z) (-> gp-0 vertex3 y)) + (set! (-> gp-0 vertex3 y) (-> gp-0 vertex3 z)) + (set! (-> gp-0 vertex 0 quad) (-> gp-0 vertex2 quad)) + (nop!) + ) + (label cfg-13) + (set! s0-0 (/ (the-as int s0-0) 2)) + (nop!) + (b! (nonzero? s0-0) cfg-2 :delay (set! s1-0 (+ s1-0 1))) + ) + (label cfg-14) + (+! s2-0 1) + (set! s3-0 (&-> s3-0 1)) + (set-on-less-than v1-13 s2-0 s4-0) + (nop!) + ) + ) + 0 + (set! (-> sv-80 quad) (-> gp-0 vertex 0 quad)) + (-> gp-0 vertex3 y) + ) + ) + +;; definition for method 35 of type nav-mesh +;; INFO: Used lq/sq +;; WARN: Return type mismatch float vs none. +;; WARN: new jak 2 until loop case, check carefully +(defmethod nav-mesh-method-35 nav-mesh ((obj nav-mesh) (arg0 vector) (arg1 vector) (arg2 float)) + (let ((gp-0 (new 'stack-no-clear 'inline-array 'nav-poly 3))) + (set! (-> gp-0 2 vertex3 y) arg2) + (vector-! (the-as vector (-> gp-0 0)) arg0 (-> obj bounds)) + (vector-! (-> gp-0 0 vertex1) arg1 (-> obj bounds)) + (set! (-> gp-0 2 vertex1 quad) (-> gp-0 0 vertex0 quad)) + (set! (-> gp-0 2 vertex2 x) (-> obj nearest-y-threshold)) + (set! (-> gp-0 2 data 36) (the-as uint 3)) + (let ((a1-4 (find-poly-containing-point-local obj (the-as nav-find-poly-parms (-> gp-0 2 vertex1))))) + (cond + (a1-4 + (init-ray-local (the-as nav-ray (-> gp-0 1)) a1-4 (the-as vector (-> gp-0 0)) (-> gp-0 0 vertex1)) + (until #f + (set! (-> gp-0 2 vertex3 z) + (nav-mesh-method-34 obj (-> gp-0 0 vertex3) (the-as vector (-> gp-0 1)) (-> gp-0 2 vertex3 y)) + ) + (b! (>= (-> gp-0 2 vertex3 z) (-> gp-0 2 vertex3 y)) cfg-4 :delay #f) + (set! (-> gp-0 2 vertex3 y) (-> gp-0 2 vertex3 z)) + (set! (-> gp-0 0 vertex2 quad) (-> gp-0 0 vertex3 quad)) + (label cfg-4) + (b! (-> gp-0 2 vertex0 x) cfg-6 :delay (nop!)) + (move-along-nav-ray! obj (the-as nav-ray (-> gp-0 1))) + ) + #f + (label cfg-6) + (if (-> gp-0 2 vertex0 z) + (set! (-> gp-0 2 vertex3 y) (the-as float #xff800000)) + ) + ) + (else + (set! (-> gp-0 2 vertex3 y) (the-as float #xff800000)) + ) + ) + ) + (-> gp-0 2 vertex3 y) + ) + (none) + ) + +;; failed to figure out what this is: +(none) + +) diff --git a/test/decompiler/reference/jak2/engine/physics/trajectory_REF.gc b/test/decompiler/reference/jak2/engine/physics/trajectory_REF.gc index 9603c98ec6..3b271cb283 100644 --- a/test/decompiler/reference/jak2/engine/physics/trajectory_REF.gc +++ b/test/decompiler/reference/jak2/engine/physics/trajectory_REF.gc @@ -342,16 +342,16 @@ ) ) (when s4-1 - (let ((a2-3 ((method-of-type nav-control nav-control-method-11) (the-as nav-control s4-1) arg1))) + (let ((a2-3 ((method-of-type nav-control find-poly-containing-point-1) (the-as nav-control s4-1) arg1))) (if a2-3 - ((method-of-type nav-control nav-control-method-20) + ((method-of-type nav-control clamp-vector-to-mesh-cross-gaps) (the-as nav-control s4-1) arg1 - (the-as nav-poly a2-3) + a2-3 arg0 2048.0 #f - #f + (the-as clamp-travel-vector-to-mesh-return-info #f) ) (set! (-> arg0 quad) (the-as uint128 0)) ) diff --git a/test/decompiler/reference/jak2/engine/process-drawable/process-drawable_REF.gc b/test/decompiler/reference/jak2/engine/process-drawable/process-drawable_REF.gc index c5b6ce9467..a811a56804 100644 --- a/test/decompiler/reference/jak2/engine/process-drawable/process-drawable_REF.gc +++ b/test/decompiler/reference/jak2/engine/process-drawable/process-drawable_REF.gc @@ -533,7 +533,7 @@ ) (let ((a0-3 (-> obj nav))) (if (and a0-3 (nonzero? a0-3)) - (nav-control-method-41 a0-3) + (remove! a0-3) ) ) (let* ((s5-0 (-> obj root)) diff --git a/test/decompiler/reference/jak2/engine/process-drawable/simple-nav-sphere_REF.gc b/test/decompiler/reference/jak2/engine/process-drawable/simple-nav-sphere_REF.gc index 3867b9b8f5..6d6fc84e1b 100644 --- a/test/decompiler/reference/jak2/engine/process-drawable/simple-nav-sphere_REF.gc +++ b/test/decompiler/reference/jak2/engine/process-drawable/simple-nav-sphere_REF.gc @@ -152,8 +152,8 @@ (the-as (function process int symbol event-message-block object) simple-nav-sphere-event-handler) ) (if arg2 - (nav-mesh-method-29 arg2 self #f) - (nav-mesh-connect-from-ent (the-as entity-nav-mesh self)) + (add-process-drawable-to-navmesh arg2 self #f) + (nav-mesh-connect-from-ent self) ) (if (>= (-> self track-joint) 0) (go-virtual active) diff --git a/test/decompiler/reference/jak2/engine/spatial-hash/spatial-hash-h_REF.gc b/test/decompiler/reference/jak2/engine/spatial-hash/spatial-hash-h_REF.gc index 1b1ec17592..a0391fff00 100644 --- a/test/decompiler/reference/jak2/engine/spatial-hash/spatial-hash-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/spatial-hash/spatial-hash-h_REF.gc @@ -57,7 +57,7 @@ :size-assert #x58 :flag-assert #x1900000058 (:methods - (new (symbol type int int) _type_ 0) + (new (symbol type int) _type_ 0) (update-grid-for-objects-in-box (_type_ int vector vector) none 9) (clear-bucket-array (_type_) none 10) (setup-search-box (_type_ int vector vector vector) none 11) @@ -107,12 +107,12 @@ ;; definition of type find-nav-sphere-ids-params (deftype find-nav-sphere-ids-params (structure) - ((bsphere sphere :inline :offset-assert 0) - (y-threshold float :offset-assert 16) - (len int16 :offset-assert 20) - (max-len int16 :offset-assert 22) - (mask uint8 :offset-assert 24) - (array uint32 :offset-assert 28) + ((bsphere sphere :inline :offset-assert 0) + (y-threshold float :offset-assert 16) + (len int16 :offset-assert 20) + (max-len int16 :offset-assert 22) + (mask uint8 :offset-assert 24) + (array (pointer uint8) :offset-assert 28) ) :method-count-assert 9 :size-assert #x20 @@ -154,8 +154,8 @@ (add-a-sphere-with-flag (_type_ vector int) int 27) (update-from-spheres (_type_) none 28) (sphere-hash-method-29 (_type_ find-nav-sphere-ids-params int int int) none 29) - (sphere-hash-method-30 (_type_ find-nav-sphere-ids-params) none 30) - (sphere-hash-method-31 (_type_ vector int int) none 31) + (find-nav-sphere-ids (_type_ find-nav-sphere-ids-params) none 30) + (add-sphere-with-mask-and-id (_type_ vector int int) none 31) (sphere-hash-method-32 (_type_ vector vector float int) symbol 32) (remove-by-id (_type_ sphere int) none 33) ) diff --git a/test/decompiler/reference/jak2/engine/spatial-hash/spatial-hash_REF.gc b/test/decompiler/reference/jak2/engine/spatial-hash/spatial-hash_REF.gc index dbfa4b4c8b..9e479b6c71 100644 --- a/test/decompiler/reference/jak2/engine/spatial-hash/spatial-hash_REF.gc +++ b/test/decompiler/reference/jak2/engine/spatial-hash/spatial-hash_REF.gc @@ -47,7 +47,7 @@ ;; definition for method 0 of type grid-hash ;; WARN: Return type mismatch object vs grid-hash. -(defmethod new grid-hash ((allocation symbol) (type-to-make type) (arg0 int) (arg1 int)) +(defmethod new grid-hash ((allocation symbol) (type-to-make type) (arg0 int)) (let ((gp-0 (the-as object (object-new allocation type-to-make (the-as int (-> type-to-make size)))))) (when (zero? (the-as grid-hash gp-0)) (set! gp-0 0) diff --git a/test/decompiler/reference/jak2/levels/common/enemy/bouncer_REF.gc b/test/decompiler/reference/jak2/levels/common/enemy/bouncer_REF.gc index 1ff1f00891..276b8255f6 100644 --- a/test/decompiler/reference/jak2/levels/common/enemy/bouncer_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/enemy/bouncer_REF.gc @@ -254,7 +254,7 @@ (bouncer-method-24 obj) (process-drawable-from-entity! obj arg0) (init-skeleton! obj) - (nav-mesh-connect-from-ent (the-as entity-nav-mesh obj)) + (nav-mesh-connect-from-ent obj) (set! (-> obj spring-height) (res-lump-float arg0 'spring-height :default 45056.0)) (go (method-of-object obj idle)) (none) diff --git a/test/decompiler/reference/jak2/levels/common/enemy/hover/hover-nav-control-h_REF.gc b/test/decompiler/reference/jak2/levels/common/enemy/hover/hover-nav-control-h_REF.gc new file mode 100644 index 0000000000..ed4bcf0b3d --- /dev/null +++ b/test/decompiler/reference/jak2/levels/common/enemy/hover/hover-nav-control-h_REF.gc @@ -0,0 +1,493 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type nav-network-adjacency +(deftype nav-network-adjacency (structure) + ((index int32 :offset-assert 0) + (dist float :offset-assert 4) + ) + :method-count-assert 9 + :size-assert #x8 + :flag-assert #x900000008 + ) + +;; definition for method 3 of type nav-network-adjacency +(defmethod inspect nav-network-adjacency ((obj nav-network-adjacency)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'nav-network-adjacency) + (format #t "~1Tindex: ~D~%" (-> obj index)) + (format #t "~1Tdist: ~f~%" (-> obj dist)) + (label cfg-4) + obj + ) + +;; definition of type nav-network-adjacency-array +(deftype nav-network-adjacency-array (inline-array-class) + ((data nav-network-adjacency :inline :dynamic :offset-assert 16) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + +;; definition for method 3 of type nav-network-adjacency-array +(defmethod inspect nav-network-adjacency-array ((obj nav-network-adjacency-array)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tlength: ~D~%" (-> obj length)) + (format #t "~1Tallocated-length: ~D~%" (-> obj allocated-length)) + (format #t "~1Tdata[0] @ #x~X~%" (-> obj data)) + (label cfg-4) + obj + ) + +;; failed to figure out what this is: +(set! (-> nav-network-adjacency-array heap-base) (the-as uint 16)) + +;; definition of type list-node +(deftype list-node (structure) + ((next list-node :offset-assert 0) + (prev list-node :offset-assert 4) + ) + :method-count-assert 9 + :size-assert #x8 + :flag-assert #x900000008 + ) + +;; definition for method 3 of type list-node +(defmethod inspect list-node ((obj list-node)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'list-node) + (format #t "~1Tnext: #~%" (-> obj next)) + (format #t "~1Tprev: #~%" (-> obj prev)) + (label cfg-4) + obj + ) + +;; definition of type nav-network-path-node +(deftype nav-network-path-node (list-node) + ((row-index int32 :offset-assert 8) + (status net-path-node-status :offset-assert 12) + (parent nav-network-path-node :offset-assert 16) + (cost-to-start float :offset-assert 20) + (cost-to-end float :offset-assert 24) + ) + :method-count-assert 9 + :size-assert #x1c + :flag-assert #x90000001c + ) + +;; definition for method 3 of type nav-network-path-node +(defmethod inspect nav-network-path-node ((obj nav-network-path-node)) + (when (not obj) + (set! obj obj) + (goto cfg-8) + ) + (format #t "[~8x] ~A~%" obj 'nav-network-path-node) + (format #t "~1Tnext: #~%" (-> obj next)) + (format #t "~1Tprev: #~%" (-> obj prev)) + (format #t "~1Trow-index: ~D~%" (-> obj row-index)) + (format #t "~1Tstatus: #x~X : (net-path-node-status " (-> obj status)) + (let ((s5-0 (-> obj status))) + (if (= (logand s5-0 (net-path-node-status closed)) (net-path-node-status closed)) + (format #t "closed ") + ) + (if (= (logand s5-0 (net-path-node-status open)) (net-path-node-status open)) + (format #t "open ") + ) + ) + (format #t ")~%") + (format #t "~1Tparent: #~%" (-> obj parent)) + (format #t "~1Tcost-to-start: ~f~%" (-> obj cost-to-start)) + (format #t "~1Tcost-to-end: ~f~%" (-> obj cost-to-end)) + (label cfg-8) + obj + ) + +;; definition of type nav-network-info +(deftype nav-network-info (structure) + ((index int32 :offset-assert 0) + (pos vector :inline :offset-assert 16) + (path-node nav-network-path-node :inline :offset-assert 32) + (count int32 :offset-assert 60) + (adjacency (inline-array nav-network-adjacency) :offset-assert 64) + ) + :method-count-assert 9 + :size-assert #x44 + :flag-assert #x900000044 + ) + +;; definition for method 3 of type nav-network-info +(defmethod inspect nav-network-info ((obj nav-network-info)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'nav-network-info) + (format #t "~1Tindex: ~D~%" (-> obj index)) + (format #t "~1Tpos: #~%" (-> obj pos)) + (format #t "~1Tpath-node: #~%" (-> obj path-node)) + (format #t "~1Tcount: ~D~%" (-> obj count)) + (format #t "~1Tadjacency: #x~X~%" (-> obj adjacency)) + (label cfg-4) + obj + ) + +;; definition of type nav-network-info-array +(deftype nav-network-info-array (inline-array-class) + ((data nav-network-info :inline :dynamic :offset-assert 16) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + +;; definition for method 3 of type nav-network-info-array +(defmethod inspect nav-network-info-array ((obj nav-network-info-array)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tlength: ~D~%" (-> obj length)) + (format #t "~1Tallocated-length: ~D~%" (-> obj allocated-length)) + (format #t "~1Tdata[0] @ #x~X~%" (-> obj data)) + (label cfg-4) + obj + ) + +;; failed to figure out what this is: +(set! (-> nav-network-info-array heap-base) (the-as uint 80)) + +;; definition of type hover-nav-sphere +(deftype hover-nav-sphere (list-node) + ((sphere sphere :inline :offset-assert 16) + (handle uint64 :offset-assert 32) + (timer uint64 :offset-assert 40) + ) + :method-count-assert 9 + :size-assert #x30 + :flag-assert #x900000030 + ) + +;; definition for method 3 of type hover-nav-sphere +(defmethod inspect hover-nav-sphere ((obj hover-nav-sphere)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'hover-nav-sphere) + (format #t "~1Tnext: #~%" (-> obj next)) + (format #t "~1Tprev: #~%" (-> obj prev)) + (format #t "~1Tsphere: #~%" (-> obj sphere)) + (format #t "~1Thandle: ~D~%" (-> obj handle)) + (format #t "~1Ttimer: ~D~%" (-> obj timer)) + (label cfg-4) + obj + ) + +;; definition of type hover-nav-path-segment +(deftype hover-nav-path-segment (list-node) + ((curve-matrix matrix :inline :offset-assert 16) + (pos-index int32 2 :offset-assert 80) + (dist float :offset-assert 88) + (du float :offset-assert 92) + ) + :method-count-assert 10 + :size-assert #x60 + :flag-assert #xa00000060 + (:methods + (hover-nav-path-segment-method-9 (_type_ float) none 9) + ) + ) + +;; definition for method 3 of type hover-nav-path-segment +(defmethod inspect hover-nav-path-segment ((obj hover-nav-path-segment)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'hover-nav-path-segment) + (format #t "~1Tnext: #~%" (-> obj next)) + (format #t "~1Tprev: #~%" (-> obj prev)) + (format #t "~1Tcurve-matrix: #~%" (-> obj curve-matrix)) + (format #t "~1Tpos-index[2] @ #x~X~%" (-> obj pos-index)) + (format #t "~1Tdist: ~f~%" (-> obj dist)) + (format #t "~1Tdu: ~f~%" (-> obj du)) + (label cfg-4) + obj + ) + +;; definition for method 9 of type hover-nav-path-segment +;; WARN: Return type mismatch int vs none. +(defmethod hover-nav-path-segment-method-9 hover-nav-path-segment ((obj hover-nav-path-segment) (arg0 float)) + (set! (-> obj du) (/ arg0 (-> obj dist))) + 0 + (none) + ) + +;; definition of type hover-nav-path-info +(deftype hover-nav-path-info (structure) + ((segment-list hover-nav-path-segment :offset-assert 0) + (tail-segment hover-nav-path-segment :offset-assert 4) + (curr-segment hover-nav-path-segment :offset-assert 8) + (curr-u float :offset-assert 12) + ) + :method-count-assert 10 + :size-assert #x10 + :flag-assert #xa00000010 + (:methods + (hover-nav-path-info-method-9 () none 9) + ) + ) + +;; definition for method 3 of type hover-nav-path-info +(defmethod inspect hover-nav-path-info ((obj hover-nav-path-info)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'hover-nav-path-info) + (format #t "~1Tsegment-list: #~%" (-> obj segment-list)) + (format #t "~1Ttail-segment: #~%" (-> obj tail-segment)) + (format #t "~1Tcurr-segment: #~%" (-> obj curr-segment)) + (format #t "~1Tcurr-u: ~f~%" (-> obj curr-u)) + (label cfg-4) + obj + ) + +;; definition of type path-index-array +(deftype path-index-array (inline-array-class) + ((data hover-nav-path-info :inline :dynamic :offset-assert 16) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + +;; definition for method 3 of type path-index-array +(defmethod inspect path-index-array ((obj path-index-array)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tlength: ~D~%" (-> obj length)) + (format #t "~1Tallocated-length: ~D~%" (-> obj allocated-length)) + (format #t "~1Tdata[0] @ #x~X~%" (-> obj data)) + (label cfg-4) + obj + ) + +;; failed to figure out what this is: +(set! (-> path-index-array heap-base) (the-as uint 4)) + +;; definition of type nav-network +(deftype nav-network (basic) + ((network basic :offset-assert 4) + (dummy nav-network-info :inline :offset-assert 16) + (control-handle handle :offset-assert 88) + (list-table list-node 5 :offset-assert 96) + (open-list nav-network-path-node :offset 96) + (closed-list nav-network-path-node :offset 100) + (sphere-list hover-nav-sphere :offset 108) + (free-segment-list hover-nav-path-segment :offset 104) + (free-sphere-list hover-nav-sphere :offset 112) + (segment-pool uint32 :offset-assert 116) + (sphere-pool uint32 :offset-assert 120) + ) + :method-count-assert 33 + :size-assert #x7c + :flag-assert #x210000007c + (:methods + (nav-network-method-9 (_type_) none 9) + (nav-network-method-10 (_type_ level (array nav-network-info)) none 10) + (nav-network-method-11 (_type_) none 11) + (nav-network-method-12 (_type_) none 12) + (nav-network-method-13 (_type_) none 13) + (nav-network-method-14 (_type_ int) none 14) + (nav-network-method-15 (_type_) none 15) + (nav-network-method-16 (_type_) none 16) + (nav-network-method-17 (_type_) nav-network-path-node 17) + (nav-network-method-18 (_type_) none 18) + (nav-network-method-19 (_type_) none 19) + (nav-network-method-20 (_type_) none 20) + (nav-network-method-21 (_type_) none 21) + (nav-network-method-22 (_type_) none 22) + (nav-network-method-23 (_type_) none 23) + (nav-network-method-24 (_type_) none 24) + (nav-network-method-25 (_type_) none 25) + (nav-network-method-26 (_type_) none 26) + (nav-network-method-27 (_type_) none 27) + (nav-network-method-28 (_type_) none 28) + (nav-network-method-29 (_type_) symbol 29) + (get-network (_type_) basic 30) + (nav-network-method-31 () none 31) + (nav-network-method-32 () none 32) + ) + ) + +;; definition for method 3 of type nav-network +(defmethod inspect nav-network ((obj nav-network)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tnetwork: ~A~%" (-> obj network)) + (format #t "~1Tdummy: #~%" (-> obj dummy)) + (format #t "~1Tcontrol-handle: ~D~%" (-> obj control-handle)) + (format #t "~1Tlist-table[5] @ #x~X~%" (-> obj list-table)) + (format #t "~1Topen-list: #~%" (-> obj open-list)) + (format #t "~1Tclosed-list: #~%" (-> obj closed-list)) + (format #t "~1Tsphere-list: #~%" (-> obj sphere-list)) + (format #t "~1Tfree-segment-list: #~%" (-> obj free-segment-list)) + (format #t "~1Tfree-sphere-list: #~%" (-> obj free-sphere-list)) + (format #t "~1Tsegment-pool: #x~X~%" (-> obj segment-pool)) + (format #t "~1Tsphere-pool: #x~X~%" (-> obj sphere-pool)) + (label cfg-4) + obj + ) + +;; definition for method 30 of type nav-network +(defmethod get-network nav-network ((obj nav-network)) + (-> obj network) + ) + +;; definition of type hover-nav-params +(deftype hover-nav-params (structure) + ((max-speed float :offset-assert 0) + (max-acceleration float :offset-assert 4) + (friction float :offset-assert 8) + (nav-collide-prim-index int32 :offset-assert 12) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + +;; definition for method 3 of type hover-nav-params +(defmethod inspect hover-nav-params ((obj hover-nav-params)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'hover-nav-params) + (format #t "~1Tmax-speed: ~f~%" (-> obj max-speed)) + (format #t "~1Tmax-acceleration: ~f~%" (-> obj max-acceleration)) + (format #t "~1Tfriction: ~f~%" (-> obj friction)) + (format #t "~1Tnav-collide-prim-index: ~D~%" (-> obj nav-collide-prim-index)) + (label cfg-4) + obj + ) + +;; definition of type hover-nav-control +(deftype hover-nav-control (basic) + ((root basic :offset-assert 4) + (nav basic :offset-assert 8) + (flags uint16 :offset-assert 12) + (params hover-nav-params :offset-assert 16) + (path-timer uint64 :offset-assert 24) + (transvv vector :inline :offset-assert 32) + (dest-pos vector :inline :offset-assert 48) + (dest-vel vector :inline :offset-assert 64) + (dest-move-dir vector :inline :offset-assert 80) + (dest-offset vector :inline :offset-assert 96) + (move-dir vector :inline :offset-assert 112) + (nav-collide-impulse vector :inline :offset-assert 128) + (nav-collide-impulse-len float :offset-assert 144) + (dest-speed float :offset-assert 148) + (local-dist float :offset-assert 152) + (speed float :offset-assert 156) + (max-los-speed float :offset-assert 160) + (target-speed float :offset-assert 164) + (target-acceleration float :offset-assert 168) + (speed-dest float :offset-assert 172) + (path-info hover-nav-path-info :inline :offset-assert 176) + (curr-dest-pt int32 :offset-assert 192) + (los-obstruction-distance float :offset-assert 196) + (los-last-clear-time time-frame :offset-assert 200) + (max-speed-multiplier float :offset-assert 208) + (max-acceleration-multiplier float :offset-assert 212) + ) + :method-count-assert 32 + :size-assert #xd8 + :flag-assert #x20000000d8 + (:methods + (hover-nav-control-method-9 (_type_) none 9) + (hover-nav-control-method-10 (_type_) none 10) + (hover-nav-control-method-11 (_type_) none 11) + (hover-nav-control-method-12 (_type_) none 12) + (hover-nav-control-method-13 (_type_) none 13) + (hover-nav-control-method-14 (_type_ float float) none 14) + (hover-nav-control-method-15 (_type_) none 15) + (hover-nav-control-method-16 (_type_) none 16) + (hover-nav-control-method-17 (_type_) none 17) + (hover-nav-control-method-18 (_type_) none 18) + (hover-nav-control-method-19 (_type_) none 19) + (hover-nav-control-method-20 (_type_) none 20) + (hover-nav-control-method-21 (_type_) none 21) + (hover-nav-control-method-22 (_type_) hover-nav-path-segment 22) + (hover-nav-control-method-23 (_type_) object 23) + (hover-nav-control-method-24 (_type_) none 24) + (hover-nav-control-method-25 (_type_) none 25) + (hover-nav-control-method-26 (_type_) none 26) + (hover-nav-control-method-27 (_type_) none 27) + (hover-nav-control-method-28 (_type_) none 28) + (hover-nav-control-method-29 (_type_) none 29) + (hover-nav-control-method-30 (_type_) float 30) + (hover-nav-control-method-31 (_type_) float 31) + ) + ) + +;; definition for method 3 of type hover-nav-control +(defmethod inspect hover-nav-control ((obj hover-nav-control)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Troot: ~A~%" (-> obj root)) + (format #t "~1Tnav: ~A~%" (-> obj nav)) + (format #t "~1Tflags: ~D~%" (-> obj flags)) + (format #t "~1Tparams: #~%" (-> obj params)) + (format #t "~1Tpath-timer: ~D~%" (-> obj path-timer)) + (format #t "~1Ttransvv: #~%" (-> obj transvv)) + (format #t "~1Tdest-pos: #~%" (-> obj dest-pos)) + (format #t "~1Tdest-vel: #~%" (-> obj dest-vel)) + (format #t "~1Tdest-move-dir: #~%" (-> obj dest-move-dir)) + (format #t "~1Tdest-offset: #~%" (-> obj dest-offset)) + (format #t "~1Tmove-dir: #~%" (-> obj move-dir)) + (format #t "~1Tnav-collide-impulse: #~%" (-> obj nav-collide-impulse)) + (format #t "~1Tnav-collide-impulse-len: ~f~%" (-> obj nav-collide-impulse-len)) + (format #t "~1Tdest-speed: ~f~%" (-> obj dest-speed)) + (format #t "~1Tlocal-dist: ~f~%" (-> obj local-dist)) + (format #t "~1Tspeed: ~f~%" (-> obj speed)) + (format #t "~1Tmax-los-speed: ~f~%" (-> obj max-los-speed)) + (format #t "~1Ttarget-speed: ~f~%" (-> obj target-speed)) + (format #t "~1Ttarget-acceleration: ~f~%" (-> obj target-acceleration)) + (format #t "~1Tspeed-dest: ~f~%" (-> obj speed-dest)) + (format #t "~1Tpath-info: #~%" (-> obj path-info)) + (format #t "~1Tcurr-dest-pt: ~D~%" (-> obj curr-dest-pt)) + (format #t "~1Tlos-obstruction-distance: ~f~%" (-> obj los-obstruction-distance)) + (format #t "~1Tlos-last-clear-time: ~D~%" (-> obj los-last-clear-time)) + (format #t "~1Tmax-speed-multiplier: ~f~%" (-> obj max-speed-multiplier)) + (format #t "~1Tmax-acceleration-multiplier: ~f~%" (-> obj max-acceleration-multiplier)) + (label cfg-4) + obj + ) + +;; definition for symbol *hover-nav-time-offset*, type int +(define *hover-nav-time-offset* 0) + +;; failed to figure out what this is: +0 diff --git a/test/decompiler/reference/jak2/levels/common/enemy/hover/hover-nav-network_REF.gc b/test/decompiler/reference/jak2/levels/common/enemy/hover/hover-nav-network_REF.gc new file mode 100644 index 0000000000..e5b7675462 --- /dev/null +++ b/test/decompiler/reference/jak2/levels/common/enemy/hover/hover-nav-network_REF.gc @@ -0,0 +1,3134 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition for symbol *drill-adjacency*, type (array nav-network-info) +(define *drill-adjacency* (new 'static 'boxed-array :type nav-network-info + (new 'static 'nav-network-info + :pos (new 'static 'vector :x -617373.3 :y 75837.03 :z 750747.25 :w 1.0) + :path-node (new 'static 'nav-network-path-node :parent #f) + :count 4 + :adjacency (new 'static 'inline-array nav-network-adjacency 4 + (new 'static 'nav-network-adjacency :index 1 :dist 37136.793) + (new 'static 'nav-network-adjacency :index 80 :dist 36590.797) + (new 'static 'nav-network-adjacency :index 4 :dist 78889.78) + (new 'static 'nav-network-adjacency :index #x8f :dist 228475.7) + ) + ) + (new 'static 'nav-network-info + :index 1 + :pos (new 'static 'vector :x -603446.9 :y 75837.03 :z 785174.1 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 1 :parent #f) + :count 4 + :adjacency (new 'static 'inline-array nav-network-adjacency 4 + (new 'static 'nav-network-adjacency :index 2 :dist 66392.06) + (new 'static 'nav-network-adjacency :dist 37136.793) + (new 'static 'nav-network-adjacency :index 4 :dist 87117.01) + (new 'static 'nav-network-adjacency :index 3 :dist 93914.32) + ) + ) + (new 'static 'nav-network-info + :index 2 + :pos (new 'static 'vector :x -613150.3 :y 75837.03 :z 850853.5 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 2 :parent #f) + :count 2 + :adjacency (new 'static 'inline-array nav-network-adjacency 2 + (new 'static 'nav-network-adjacency :index 1 :dist 66392.06) + (new 'static 'nav-network-adjacency :index 3 :dist 78238.516) + ) + ) + (new 'static 'nav-network-info + :index 3 + :pos (new 'static 'vector :x -589946.5 :y 1735.4752 :z 841268.8 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 3 :parent #f) + :count 3 + :adjacency (new 'static 'inline-array nav-network-adjacency 3 + (new 'static 'nav-network-adjacency :index 4 :dist 100528.945) + (new 'static 'nav-network-adjacency :index 2 :dist 78238.516) + (new 'static 'nav-network-adjacency :index 1 :dist 93914.32) + ) + ) + (new 'static 'nav-network-info + :index 4 + :pos (new 'static 'vector :x -592215.6 :y 1735.0656 :z 740765.3 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 4 :parent #f) + :count 5 + :adjacency (new 'static 'inline-array nav-network-adjacency 5 + (new 'static 'nav-network-adjacency :index 5 :dist 112524.086) + (new 'static 'nav-network-adjacency :index 3 :dist 100528.945) + (new 'static 'nav-network-adjacency :dist 78889.78) + (new 'static 'nav-network-adjacency :index 1 :dist 87117.01) + (new 'static 'nav-network-adjacency :index 80 :dist 96502.99) + ) + ) + (new 'static 'nav-network-info + :index 5 + :pos (new 'static 'vector :x -704736.9 :y 1735.0656 :z 739950.2 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 5 :parent #f) + :count 4 + :adjacency (new 'static 'inline-array nav-network-adjacency 4 + (new 'static 'nav-network-adjacency :index 4 :dist 112524.086) + (new 'static 'nav-network-adjacency :index 81 :dist 75498.29) + (new 'static 'nav-network-adjacency :index 80 :dist 90207.84) + (new 'static 'nav-network-adjacency :index #x87 :dist 30534.041) + ) + ) + (new 'static 'nav-network-info + :index 6 + :pos (new 'static 'vector :x 350307.94 :y 120944.64 :z 412311.16 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 6 :parent #f) + :count 2 + :adjacency (new 'static 'inline-array nav-network-adjacency 2 + (new 'static 'nav-network-adjacency :index 8 :dist 62174.414) + (new 'static 'nav-network-adjacency :index 10 :dist 25806.848) + ) + ) + (new 'static 'nav-network-info + :index 7 + :pos (new 'static 'vector :x 280446.97 :y 120945.05 :z 477728.34 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 7 :parent #f) + :count 4 + :adjacency (new 'static 'inline-array nav-network-adjacency 4 + (new 'static 'nav-network-adjacency :index 8 :dist 56979.867) + (new 'static 'nav-network-adjacency :index 9 :dist 39251.15) + (new 'static 'nav-network-adjacency :index 79 :dist 50894.027) + (new 'static 'nav-network-adjacency :index 84 :dist 75572.016) + ) + ) + (new 'static 'nav-network-info + :index 8 + :pos (new 'static 'vector :x 288795.84 :y 120944.64 :z 421363.3 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 8 :parent #f) + :count 4 + :adjacency (new 'static 'inline-array nav-network-adjacency 4 + (new 'static 'nav-network-adjacency :index 7 :dist 56979.867) + (new 'static 'nav-network-adjacency :index 6 :dist 62174.414) + (new 'static 'nav-network-adjacency :index 79 :dist 25042.943) + (new 'static 'nav-network-adjacency :index 10 :dist 56014.438) + ) + ) + (new 'static 'nav-network-info + :index 9 + :pos (new 'static 'vector :x 279275.53 :y 99127.7 :z 510336.62 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 9 :parent #f) + :count 3 + :adjacency (new 'static 'inline-array nav-network-adjacency 3 + (new 'static 'nav-network-adjacency :index 79 :dist 78610.02) + (new 'static 'nav-network-adjacency :index 7 :dist 39251.15) + (new 'static 'nav-network-adjacency :index 84 :dist 70526.16) + ) + ) + (new 'static 'nav-network-info + :index 10 + :pos (new 'static 'vector :x 340384.56 :y 99127.7 :z 421879.4 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 10 :parent #f) + :count 5 + :adjacency (new 'static 'inline-array nav-network-adjacency 5 + (new 'static 'nav-network-adjacency :index 43 :dist 60114.125) + (new 'static 'nav-network-adjacency :index 79 :dist 58953.727) + (new 'static 'nav-network-adjacency :index 8 :dist 56014.438) + (new 'static 'nav-network-adjacency :index 6 :dist 25806.848) + (new 'static 'nav-network-adjacency :index #x8e :dist 124076.445) + ) + ) + (new 'static 'nav-network-info + :index 11 + :pos (new 'static 'vector :x 521543.28 :y 84158.055 :z -8242.381 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 11 :parent #f) + :count 2 + :adjacency (new 'static 'inline-array nav-network-adjacency 2 + (new 'static 'nav-network-adjacency :index 66 :dist 64063.49) + (new 'static 'nav-network-adjacency :index 65 :dist 44519.426) + ) + ) + (new 'static 'nav-network-info + :index 12 + :pos (new 'static 'vector :x 640851.56 :y 99127.7 :z -7164.723 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 12 :parent #f) + :count 2 + :adjacency (new 'static 'inline-array nav-network-adjacency 2 + (new 'static 'nav-network-adjacency :index 63 :dist 52689.305) + (new 'static 'nav-network-adjacency :index 64 :dist 49721.754) + ) + ) + (new 'static 'nav-network-info + :index 13 + :pos (new 'static 'vector :x 740183.6 :y 99127.7 :z -17426.021 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 13 :parent #f) + :count 2 + :adjacency (new 'static 'inline-array nav-network-adjacency 2 + (new 'static 'nav-network-adjacency :index 63 :dist 65961.984) + (new 'static 'nav-network-adjacency :index 62 :dist 24192.205) + ) + ) + (new 'static 'nav-network-info + :index 14 + :pos (new 'static 'vector :x 814292.56 :y 6454.886 :z -95446.22 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 14 :parent #f) + :count 14 + :adjacency (new 'static 'inline-array nav-network-adjacency 14 + (new 'static 'nav-network-adjacency :index 15 :dist 56748.03) + (new 'static 'nav-network-adjacency :index 72 :dist 107959.5) + (new 'static 'nav-network-adjacency :index 31 :dist 52362.035) + (new 'static 'nav-network-adjacency :index 32 :dist 58683.39) + (new 'static 'nav-network-adjacency :index 61 :dist 107154.64) + (new 'static 'nav-network-adjacency :index 50 :dist 112492.13) + (new 'static 'nav-network-adjacency :index 49 :dist 69916.266) + (new 'static 'nav-network-adjacency :index 48 :dist 99997.695) + (new 'static 'nav-network-adjacency :index 36 :dist 97927.17) + (new 'static 'nav-network-adjacency :index 35 :dist 66838.53) + (new 'static 'nav-network-adjacency :index 34 :dist 72425.88) + (new 'static 'nav-network-adjacency :index 33 :dist 108125.39) + (new 'static 'nav-network-adjacency :index 29 :dist 88945.05) + (new 'static 'nav-network-adjacency :index 16 :dist 91750.81) + ) + ) + (new 'static 'nav-network-info + :index 15 + :pos (new 'static 'vector :x 812215.94 :y 6455.296 :z -152156.56 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 15 :parent #f) + :count 17 + :adjacency (new 'static 'inline-array nav-network-adjacency 17 + (new 'static 'nav-network-adjacency :index 73 :dist 103833.6) + (new 'static 'nav-network-adjacency :index 72 :dist 92699.445) + (new 'static 'nav-network-adjacency :index 71 :dist 114826.85) + (new 'static 'nav-network-adjacency :index 59 :dist 108125.39) + (new 'static 'nav-network-adjacency :index 53 :dist 108389.99) + (new 'static 'nav-network-adjacency :index 50 :dist 65329.152) + (new 'static 'nav-network-adjacency :index 49 :dist 41456.844) + (new 'static 'nav-network-adjacency :index 14 :dist 56748.03) + (new 'static 'nav-network-adjacency :index 16 :dist 68193.08) + (new 'static 'nav-network-adjacency :index 48 :dist 79577.5) + (new 'static 'nav-network-adjacency :index 35 :dist 116751.98) + (new 'static 'nav-network-adjacency :index 34 :dist 93113.14) + (new 'static 'nav-network-adjacency :index 31 :dist 109091.63) + (new 'static 'nav-network-adjacency :index 30 :dist 92576.16) + (new 'static 'nav-network-adjacency :index 32 :dist 83090.64) + (new 'static 'nav-network-adjacency :index 33 :dist 56782.027) + (new 'static 'nav-network-adjacency :index 33 :dist 56782.027) + ) + ) + (new 'static 'nav-network-info + :index 16 + :pos (new 'static 'vector :x 744062.56 :y 6454.886 :z -154488.83 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 16 :parent #f) + :count 14 + :adjacency (new 'static 'inline-array nav-network-adjacency 14 + (new 'static 'nav-network-adjacency :index 71 :dist 92695.34) + (new 'static 'nav-network-adjacency :index 29 :dist 113749.195) + (new 'static 'nav-network-adjacency :index 70 :dist 113509.58) + (new 'static 'nav-network-adjacency :index 58 :dist 111597.98) + (new 'static 'nav-network-adjacency :index 50 :dist 74192.484) + (new 'static 'nav-network-adjacency :index 49 :dist 79215.82) + (new 'static 'nav-network-adjacency :index 48 :dist 41458.484) + (new 'static 'nav-network-adjacency :index 47 :dist 78019.79) + (new 'static 'nav-network-adjacency :index 33 :dist 107866.11) + (new 'static 'nav-network-adjacency :index 28 :dist 91670.12) + (new 'static 'nav-network-adjacency :index 15 :dist 68193.08) + (new 'static 'nav-network-adjacency :index 14 :dist 91750.81) + (new 'static 'nav-network-adjacency :index 72 :dist 114094.49) + (new 'static 'nav-network-adjacency :index 73 :dist 109972.69) + ) + ) + (new 'static 'nav-network-info + :index 17 + :pos (new 'static 'vector :x 678174.3 :y 6454.886 :z -153542.66 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 17 :parent #f) + :count 12 + :adjacency (new 'static 'inline-array nav-network-adjacency 12 + (new 'static 'nav-network-adjacency :index 18 :dist 67195.695) + (new 'static 'nav-network-adjacency :index 28 :dist 61837.723) + (new 'static 'nav-network-adjacency :index 25 :dist 91088.484) + (new 'static 'nav-network-adjacency :index 27 :dist 114158.8) + (new 'static 'nav-network-adjacency :index 30 :dist 89952.26) + (new 'static 'nav-network-adjacency :index 46 :dist 79854.8) + (new 'static 'nav-network-adjacency :index 47 :dist 41470.363) + (new 'static 'nav-network-adjacency :index 48 :dist 78042.32) + (new 'static 'nav-network-adjacency :index 57 :dist 111126.53) + (new 'static 'nav-network-adjacency :index 69 :dist 115740.266) + (new 'static 'nav-network-adjacency :index 70 :dist 92718.28) + (new 'static 'nav-network-adjacency :index 71 :dist 113917.13) + ) + ) + (new 'static 'nav-network-info + :index 18 + :pos (new 'static 'vector :x 610979.44 :y 6455.296 :z -153138.8 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 18 :parent #f) + :count 11 + :adjacency (new 'static 'inline-array nav-network-adjacency 11 + (new 'static 'nav-network-adjacency :index 17 :dist 67195.695) + (new 'static 'nav-network-adjacency :index 24 :dist 87894.42) + (new 'static 'nav-network-adjacency :index 26 :dist 113124.97) + (new 'static 'nav-network-adjacency :index 28 :dist 90368.82) + (new 'static 'nav-network-adjacency :index 45 :dist 74518.12) + (new 'static 'nav-network-adjacency :index 46 :dist 41462.99) + (new 'static 'nav-network-adjacency :index 47 :dist 78809.086) + (new 'static 'nav-network-adjacency :index 56 :dist 108632.88) + (new 'static 'nav-network-adjacency :index 68 :dist 111651.63) + (new 'static 'nav-network-adjacency :index 69 :dist 92714.6) + (new 'static 'nav-network-adjacency :index 70 :dist 114763.77) + ) + ) + (new 'static 'nav-network-info + :index 19 + :pos (new 'static 'vector :x 550506.06 :y 6454.886 :z -154057.52 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 19 :parent #f) + :count 12 + :adjacency (new 'static 'inline-array nav-network-adjacency 12 + (new 'static 'nav-network-adjacency :index 20 :dist 70718.26) + (new 'static 'nav-network-adjacency :index 24 :dist 60732.62) + (new 'static 'nav-network-adjacency :index 21 :dist 103704.164) + (new 'static 'nav-network-adjacency :index 23 :dist 113165.93) + (new 'static 'nav-network-adjacency :index 25 :dist 83781.63) + (new 'static 'nav-network-adjacency :index 44 :dist 81785.24) + (new 'static 'nav-network-adjacency :index 45 :dist 41484.29) + (new 'static 'nav-network-adjacency :index 46 :dist 72456.195) + (new 'static 'nav-network-adjacency :index 55 :dist 109923.53) + (new 'static 'nav-network-adjacency :index 67 :dist 116360.4) + (new 'static 'nav-network-adjacency :index 68 :dist 92707.23) + (new 'static 'nav-network-adjacency :index 69 :dist 109556.94) + ) + ) + (new 'static 'nav-network-info + :index 20 + :pos (new 'static 'vector :x 479788.66 :y 6454.886 :z -154471.62 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 20 :parent #f) + :count 8 + :adjacency (new 'static 'inline-array nav-network-adjacency 8 + (new 'static 'nav-network-adjacency :index 19 :dist 70718.26) + (new 'static 'nav-network-adjacency :index 21 :dist 63099.29) + (new 'static 'nav-network-adjacency :index 22 :dist 114034.28) + (new 'static 'nav-network-adjacency :index 24 :dist 90367.18) + (new 'static 'nav-network-adjacency :index 44 :dist 41451.52) + (new 'static 'nav-network-adjacency :index 45 :dist 80728.88) + (new 'static 'nav-network-adjacency :index 67 :dist 92678.96) + (new 'static 'nav-network-adjacency :index 68 :dist 115514.164) + ) + ) + (new 'static 'nav-network-info + :index 21 + :pos (new 'static 'vector :x 466898.53 :y 6454.886 :z -92702.72 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 21 :parent #f) + :count 8 + :adjacency (new 'static 'inline-array nav-network-adjacency 8 + (new 'static 'nav-network-adjacency :index 20 :dist 63099.29) + (new 'static 'nav-network-adjacency :index 22 :dist 51818.906) + (new 'static 'nav-network-adjacency :index 19 :dist 103704.164) + (new 'static 'nav-network-adjacency :index 23 :dist 95258.625) + (new 'static 'nav-network-adjacency :index 39 :dist 101316.61) + (new 'static 'nav-network-adjacency :index 40 :dist 63092.33) + (new 'static 'nav-network-adjacency :index 44 :dist 75171.84) + (new 'static 'nav-network-adjacency :index 45 :dist 110089.42) + ) + ) + (new 'static 'nav-network-info + :index 22 + :pos (new 'static 'vector :x 469163.62 :y 6455.296 :z -40932.965 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 22 :parent #f) + :count 8 + :adjacency (new 'static 'inline-array nav-network-adjacency 8 + (new 'static 'nav-network-adjacency :index 21 :dist 51818.906) + (new 'static 'nav-network-adjacency :index 23 :dist 77708.91) + (new 'static 'nav-network-adjacency :index 20 :dist 114034.28) + (new 'static 'nav-network-adjacency :index 39 :dist 88131.586) + (new 'static 'nav-network-adjacency :index 40 :dist 41667.79) + (new 'static 'nav-network-adjacency :index 41 :dist 107427.84) + (new 'static 'nav-network-adjacency :index 65 :dist 120061.54) + (new 'static 'nav-network-adjacency :index 66 :dist 92678.555) + ) + ) + (new 'static 'nav-network-info + :index 23 + :pos (new 'static 'vector :x 546872.94 :y 6455.296 :z -40949.76 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 23 :parent #f) + :count 12 + :adjacency (new 'static 'inline-array nav-network-adjacency 12 + (new 'static 'nav-network-adjacency :index 22 :dist 77708.91) + (new 'static 'nav-network-adjacency :index 24 :dist 52511.95) + (new 'static 'nav-network-adjacency :index 19 :dist 113165.93) + (new 'static 'nav-network-adjacency :index 21 :dist 95258.625) + (new 'static 'nav-network-adjacency :index 25 :dist 81876.99) + (new 'static 'nav-network-adjacency :index 38 :dist 74582.42) + (new 'static 'nav-network-adjacency :index 39 :dist 41771.83) + (new 'static 'nav-network-adjacency :index 40 :dist 88718.13) + (new 'static 'nav-network-adjacency :index 55 :dist 107287.34) + (new 'static 'nav-network-adjacency :index 64 :dist 110069.35) + (new 'static 'nav-network-adjacency :index 65 :dist 92698.625) + (new 'static 'nav-network-adjacency :index 66 :dist 121558.22) + ) + ) + (new 'static 'nav-network-info + :index 24 + :pos (new 'static 'vector :x 546451.06 :y 6455.296 :z -93460.07 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 24 :parent #f) + :count 13 + :adjacency (new 'static 'inline-array nav-network-adjacency 13 + (new 'static 'nav-network-adjacency :index 23 :dist 52511.95) + (new 'static 'nav-network-adjacency :index 19 :dist 60732.62) + (new 'static 'nav-network-adjacency :index 18 :dist 87894.42) + (new 'static 'nav-network-adjacency :index 20 :dist 90367.18) + (new 'static 'nav-network-adjacency :index 25 :dist 62647.91) + (new 'static 'nav-network-adjacency :index 26 :dist 82173.95) + (new 'static 'nav-network-adjacency :index 38 :dist 90498.25) + (new 'static 'nav-network-adjacency :index 39 :dist 62907.598) + (new 'static 'nav-network-adjacency :index 40 :dist 100596.94) + (new 'static 'nav-network-adjacency :index 44 :dist 99006.46) + (new 'static 'nav-network-adjacency :index 45 :dist 72706.87) + (new 'static 'nav-network-adjacency :index 46 :dist 96258.87) + (new 'static 'nav-network-adjacency :index 68 :dist 109776.9) + ) + ) + (new 'static 'nav-network-info + :index 25 + :pos (new 'static 'vector :x 609095.25 :y 6455.296 :z -94168.68 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 25 :parent #f) + :count 13 + :adjacency (new 'static 'inline-array nav-network-adjacency 13 + (new 'static 'nav-network-adjacency :index 26 :dist 54135.6) + (new 'static 'nav-network-adjacency :index 17 :dist 91088.484) + (new 'static 'nav-network-adjacency :index 19 :dist 83781.63) + (new 'static 'nav-network-adjacency :index 23 :dist 81876.99) + (new 'static 'nav-network-adjacency :index 24 :dist 62647.91) + (new 'static 'nav-network-adjacency :index 27 :dist 88021.81) + (new 'static 'nav-network-adjacency :index 37 :dist 95564.19) + (new 'static 'nav-network-adjacency :index 38 :dist 66093.875) + (new 'static 'nav-network-adjacency :index 39 :dist 88936.445) + (new 'static 'nav-network-adjacency :index 45 :dist 93811.51) + (new 'static 'nav-network-adjacency :index 46 :dist 71793.46) + (new 'static 'nav-network-adjacency :index 47 :dist 99170.305) + (new 'static 'nav-network-adjacency :index 69 :dist 108857.34) + ) + ) + (new 'static 'nav-network-info + :index 26 + :pos (new 'static 'vector :x 608886.4 :y 6455.296 :z -40033.074 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 26 :parent #f) + :count 12 + :adjacency (new 'static 'inline-array nav-network-adjacency 12 + (new 'static 'nav-network-adjacency :index 25 :dist 54135.6) + (new 'static 'nav-network-adjacency :index 27 :dist 69106.484) + (new 'static 'nav-network-adjacency :index 18 :dist 113124.97) + (new 'static 'nav-network-adjacency :index 24 :dist 82173.95) + (new 'static 'nav-network-adjacency :index 28 :dist 85707.164) + (new 'static 'nav-network-adjacency :index 37 :dist 81247.02) + (new 'static 'nav-network-adjacency :index 38 :dist 41533.03) + (new 'static 'nav-network-adjacency :index 39 :dist 74927.31) + (new 'static 'nav-network-adjacency :index 56 :dist 108815.16) + (new 'static 'nav-network-adjacency :index 63 :dist 116495.16) + (new 'static 'nav-network-adjacency :index 64 :dist 92753.1) + (new 'static 'nav-network-adjacency :index 65 :dist 112320.516) + ) + ) + (new 'static 'nav-network-info + :index 27 + :pos (new 'static 'vector :x 677990.0 :y 6454.886 :z -39383.86 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 27 :parent #f) + :count 12 + :adjacency (new 'static 'inline-array nav-network-adjacency 12 + (new 'static 'nav-network-adjacency :index 26 :dist 69106.484) + (new 'static 'nav-network-adjacency :index 29 :dist 66184.4) + (new 'static 'nav-network-adjacency :index 17 :dist 114158.8) + (new 'static 'nav-network-adjacency :index 25 :dist 88021.81) + (new 'static 'nav-network-adjacency :index 30 :dist 82790.4) + (new 'static 'nav-network-adjacency :index 36 :dist 77680.23) + (new 'static 'nav-network-adjacency :index 37 :dist 41653.453) + (new 'static 'nav-network-adjacency :index 38 :dist 80676.45) + (new 'static 'nav-network-adjacency :index 57 :dist 106679.914) + (new 'static 'nav-network-adjacency :index 62 :dist 112348.77) + (new 'static 'nav-network-adjacency :index 63 :dist 92756.79) + (new 'static 'nav-network-adjacency :index 64 :dist 117257.83) + ) + ) + (new 'static 'nav-network-info + :index 28 + :pos (new 'static 'vector :x 677260.9 :y 6454.886 :z -91711.484 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 28 :parent #f) + :count 12 + :adjacency (new 'static 'inline-array nav-network-adjacency 12 + (new 'static 'nav-network-adjacency :index 16 :dist 91670.12) + (new 'static 'nav-network-adjacency :index 17 :dist 61837.723) + (new 'static 'nav-network-adjacency :index 18 :dist 90368.82) + (new 'static 'nav-network-adjacency :index 26 :dist 85707.164) + (new 'static 'nav-network-adjacency :index 29 :dist 84105.22) + (new 'static 'nav-network-adjacency :index 36 :dist 92835.84) + (new 'static 'nav-network-adjacency :index 37 :dist 63632.18) + (new 'static 'nav-network-adjacency :index 38 :dist 93813.555) + (new 'static 'nav-network-adjacency :index 46 :dist 99910.45) + (new 'static 'nav-network-adjacency :index 47 :dist 73337.65) + (new 'static 'nav-network-adjacency :index 48 :dist 100216.016) + (new 'static 'nav-network-adjacency :index 70 :dist 109841.61) + ) + ) + (new 'static 'nav-network-info + :index 29 + :pos (new 'static 'vector :x 744160.9 :y 6454.886 :z -40739.637 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 29 :parent #f) + :count 13 + :adjacency (new 'static 'inline-array nav-network-adjacency 13 + (new 'static 'nav-network-adjacency :index 16 :dist 113749.195) + (new 'static 'nav-network-adjacency :index 27 :dist 66184.4) + (new 'static 'nav-network-adjacency :index 30 :dist 50219.83) + (new 'static 'nav-network-adjacency :index 31 :dist 70137.86) + (new 'static 'nav-network-adjacency :index 14 :dist 88945.05) + (new 'static 'nav-network-adjacency :index 28 :dist 84105.22) + (new 'static 'nav-network-adjacency :index 35 :dist 80823.914) + (new 'static 'nav-network-adjacency :index 36 :dist 41464.63) + (new 'static 'nav-network-adjacency :index 37 :dist 77542.195) + (new 'static 'nav-network-adjacency :index 58 :dist 106080.664) + (new 'static 'nav-network-adjacency :index 61 :dist 116108.086) + (new 'static 'nav-network-adjacency :index 62 :dist 92715.414) + (new 'static 'nav-network-adjacency :index 63 :dist 113075.81) + ) + ) + (new 'static 'nav-network-info + :index 30 + :pos (new 'static 'vector :x 742768.25 :y 6454.886 :z -90940.21 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 30 :parent #f) + :count 14 + :adjacency (new 'static 'inline-array nav-network-adjacency 14 + (new 'static 'nav-network-adjacency :index 15 :dist 92576.16) + (new 'static 'nav-network-adjacency :index 29 :dist 50219.83) + (new 'static 'nav-network-adjacency :index 17 :dist 89952.26) + (new 'static 'nav-network-adjacency :index 27 :dist 82790.4) + (new 'static 'nav-network-adjacency :index 31 :dist 86030.336) + (new 'static 'nav-network-adjacency :index 35 :dist 94968.625) + (new 'static 'nav-network-adjacency :index 36 :dist 64311.707) + (new 'static 'nav-network-adjacency :index 37 :dist 89890.0) + (new 'static 'nav-network-adjacency :index 47 :dist 98317.93) + (new 'static 'nav-network-adjacency :index 48 :dist 75149.31) + (new 'static 'nav-network-adjacency :index 49 :dist 100664.12) + (new 'static 'nav-network-adjacency :index 50 :dist 122651.445) + (new 'static 'nav-network-adjacency :index 62 :dist 105004.234) + (new 'static 'nav-network-adjacency :index 71 :dist 111251.45) + ) + ) + (new 'static 'nav-network-info + :index 31 + :pos (new 'static 'vector :x 814259.8 :y 6455.296 :z -43083.777 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 31 :parent #f) + :count 13 + :adjacency (new 'static 'inline-array nav-network-adjacency 13 + (new 'static 'nav-network-adjacency :index 15 :dist 109091.63) + (new 'static 'nav-network-adjacency :index 29 :dist 70137.86) + (new 'static 'nav-network-adjacency :index 14 :dist 52362.035) + (new 'static 'nav-network-adjacency :index 32 :dist 78694.81) + (new 'static 'nav-network-adjacency :index 30 :dist 86030.336) + (new 'static 'nav-network-adjacency :index 34 :dist 89612.29) + (new 'static 'nav-network-adjacency :index 35 :dist 41454.797) + (new 'static 'nav-network-adjacency :index 36 :dist 81890.92) + (new 'static 'nav-network-adjacency :index 49 :dist 116272.336) + (new 'static 'nav-network-adjacency :index 59 :dist 106962.945) + (new 'static 'nav-network-adjacency :index 61 :dist 92683.47) + (new 'static 'nav-network-adjacency :index 62 :dist 117852.98) + (new 'static 'nav-network-adjacency :index #x6a :dist 134927.97) + ) + ) + (new 'static 'nav-network-info + :index 32 + :pos (new 'static 'vector :x 872976.0 :y 6455.296 :z -95479.4 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 32 :parent #f) + :count 9 + :adjacency (new 'static 'inline-array nav-network-adjacency 9 + (new 'static 'nav-network-adjacency :index 31 :dist 78694.81) + (new 'static 'nav-network-adjacency :index 14 :dist 58683.39) + (new 'static 'nav-network-adjacency :index 15 :dist 83090.64) + (new 'static 'nav-network-adjacency :index 33 :dist 109286.6) + (new 'static 'nav-network-adjacency :index 34 :dist 41455.617) + (new 'static 'nav-network-adjacency :index 35 :dist 89478.35) + (new 'static 'nav-network-adjacency :index 51 :dist 109783.86) + (new 'static 'nav-network-adjacency :index 60 :dist 92716.234) + (new 'static 'nav-network-adjacency :index 61 :dist 122276.25) + ) + ) + (new 'static 'nav-network-info + :index 33 + :pos (new 'static 'vector :x 841424.5 :y -5001.216 :z -199483.39 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 33 :parent #f) + :count 13 + :adjacency (new 'static 'inline-array nav-network-adjacency 13 + (new 'static 'nav-network-adjacency :index 16 :dist 107866.11) + (new 'static 'nav-network-adjacency :index 15 :dist 56782.027) + (new 'static 'nav-network-adjacency :index 15 :dist 56782.027) + (new 'static 'nav-network-adjacency :index 32 :dist 109286.6) + (new 'static 'nav-network-adjacency :index 14 :dist 108125.39) + (new 'static 'nav-network-adjacency :index 34 :dist 120770.97) + (new 'static 'nav-network-adjacency :index 48 :dist 119735.914) + (new 'static 'nav-network-adjacency :index 49 :dist 77321.42) + (new 'static 'nav-network-adjacency :index 50 :dist 74737.664) + (new 'static 'nav-network-adjacency :index 51 :dist 63254.938) + (new 'static 'nav-network-adjacency :index 52 :dist 99625.78) + (new 'static 'nav-network-adjacency :index 53 :dist 79921.97) + (new 'static 'nav-network-adjacency :index #x6f :dist 97601.125) + ) + ) + (new 'static 'nav-network-info + :index 34 + :pos (new 'static 'vector :x 873684.56 :y 47903.54 :z -95820.59 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 34 :parent #f) + :count 13 + :adjacency (new 'static 'inline-array nav-network-adjacency 13 + (new 'static 'nav-network-adjacency :index 15 :dist 93113.14) + (new 'static 'nav-network-adjacency :index 35 :dist 80057.14) + (new 'static 'nav-network-adjacency :index 14 :dist 72425.88) + (new 'static 'nav-network-adjacency :index 31 :dist 89612.29) + (new 'static 'nav-network-adjacency :index 32 :dist 41455.617) + (new 'static 'nav-network-adjacency :index 33 :dist 120770.97) + (new 'static 'nav-network-adjacency :index 59 :dist 80117.35) + (new 'static 'nav-network-adjacency :index 60 :dist 51272.5) + (new 'static 'nav-network-adjacency :index 61 :dist 95435.984) + (new 'static 'nav-network-adjacency :index 72 :dist 98115.586) + (new 'static 'nav-network-adjacency :index 74 :dist 110533.836) + (new 'static 'nav-network-adjacency :index #x6b :dist 70520.83) + (new 'static 'nav-network-adjacency :index #x6a :dist 92629.81) + ) + ) + (new 'static 'nav-network-info + :index 35 + :pos (new 'static 'vector :x 813510.25 :y 47903.54 :z -43017.01 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 35 :parent #f) + :count 15 + :adjacency (new 'static 'inline-array nav-network-adjacency 15 + (new 'static 'nav-network-adjacency :index 15 :dist 116751.98) + (new 'static 'nav-network-adjacency :index 34 :dist 80057.14) + (new 'static 'nav-network-adjacency :index 36 :dist 69876.53) + (new 'static 'nav-network-adjacency :index 14 :dist 66838.53) + (new 'static 'nav-network-adjacency :index 29 :dist 80823.914) + (new 'static 'nav-network-adjacency :index 30 :dist 94968.625) + (new 'static 'nav-network-adjacency :index 31 :dist 41454.797) + (new 'static 'nav-network-adjacency :index 32 :dist 89478.35) + (new 'static 'nav-network-adjacency :index 58 :dist 100538.78) + (new 'static 'nav-network-adjacency :index 59 :dist 74035.61) + (new 'static 'nav-network-adjacency :index 60 :dist 96717.62) + (new 'static 'nav-network-adjacency :index 61 :dist 51245.465) + (new 'static 'nav-network-adjacency :index 62 :dist 88410.11) + (new 'static 'nav-network-adjacency :index 72 :dist 119281.26) + (new 'static 'nav-network-adjacency :index #x6a :dist 118780.73) + ) + ) + (new 'static 'nav-network-info + :index 36 + :pos (new 'static 'vector :x 743644.75 :y 47903.54 :z -41774.285 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 36 :parent #f) + :count 15 + :adjacency (new 'static 'inline-array nav-network-adjacency 15 + (new 'static 'nav-network-adjacency :index 35 :dist 69876.53) + (new 'static 'nav-network-adjacency :index 37 :dist 64983.86) + (new 'static 'nav-network-adjacency :index 14 :dist 97927.17) + (new 'static 'nav-network-adjacency :index 27 :dist 77680.23) + (new 'static 'nav-network-adjacency :index 28 :dist 92835.84) + (new 'static 'nav-network-adjacency :index 29 :dist 41464.63) + (new 'static 'nav-network-adjacency :index 30 :dist 64311.707) + (new 'static 'nav-network-adjacency :index 31 :dist 81890.92) + (new 'static 'nav-network-adjacency :index 57 :dist 96780.695) + (new 'static 'nav-network-adjacency :index 58 :dist 71983.516) + (new 'static 'nav-network-adjacency :index 59 :dist 101477.17) + (new 'static 'nav-network-adjacency :index 61 :dist 87111.68) + (new 'static 'nav-network-adjacency :index 62 :dist 51270.453) + (new 'static 'nav-network-adjacency :index 63 :dist 82167.4) + (new 'static 'nav-network-adjacency :index 71 :dist 121976.016) + ) + ) + (new 'static 'nav-network-info + :index 37 + :pos (new 'static 'vector :x 678682.2 :y 47903.54 :z -43451.188 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 37 :parent #f) + :count 15 + :adjacency (new 'static 'inline-array nav-network-adjacency 15 + (new 'static 'nav-network-adjacency :index 36 :dist 64983.86) + (new 'static 'nav-network-adjacency :index 38 :dist 69832.7) + (new 'static 'nav-network-adjacency :index 25 :dist 95564.19) + (new 'static 'nav-network-adjacency :index 26 :dist 81247.02) + (new 'static 'nav-network-adjacency :index 27 :dist 41653.453) + (new 'static 'nav-network-adjacency :index 28 :dist 63632.18) + (new 'static 'nav-network-adjacency :index 29 :dist 77542.195) + (new 'static 'nav-network-adjacency :index 30 :dist 89890.0) + (new 'static 'nav-network-adjacency :index 56 :dist 97050.625) + (new 'static 'nav-network-adjacency :index 57 :dist 70727.27) + (new 'static 'nav-network-adjacency :index 58 :dist 95275.83) + (new 'static 'nav-network-adjacency :index 62 :dist 81050.01) + (new 'static 'nav-network-adjacency :index 63 :dist 51230.72) + (new 'static 'nav-network-adjacency :index 64 :dist 88731.24) + (new 'static 'nav-network-adjacency :index 70 :dist 118818.81) + ) + ) + (new 'static 'nav-network-info + :index 38 + :pos (new 'static 'vector :x 608853.6 :y 47903.54 :z -42686.465 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 38 :parent #f) + :count 15 + :adjacency (new 'static 'inline-array nav-network-adjacency 15 + (new 'static 'nav-network-adjacency :index 37 :dist 69832.7) + (new 'static 'nav-network-adjacency :index 39 :dist 62183.016) + (new 'static 'nav-network-adjacency :index 23 :dist 74582.42) + (new 'static 'nav-network-adjacency :index 24 :dist 90498.25) + (new 'static 'nav-network-adjacency :index 25 :dist 66093.875) + (new 'static 'nav-network-adjacency :index 26 :dist 41533.03) + (new 'static 'nav-network-adjacency :index 27 :dist 80676.45) + (new 'static 'nav-network-adjacency :index 28 :dist 93813.555) + (new 'static 'nav-network-adjacency :index 55 :dist 95340.95) + (new 'static 'nav-network-adjacency :index 56 :dist 74722.51) + (new 'static 'nav-network-adjacency :index 57 :dist 99887.516) + (new 'static 'nav-network-adjacency :index 63 :dist 87191.96) + (new 'static 'nav-network-adjacency :index 64 :dist 51291.34) + (new 'static 'nav-network-adjacency :index 65 :dist 81489.92) + (new 'static 'nav-network-adjacency :index 69 :dist 120068.51) + ) + ) + (new 'static 'nav-network-info + :index 39 + :pos (new 'static 'vector :x 546766.44 :y 47903.54 :z -46138.164 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 39 :parent #f) + :count 15 + :adjacency (new 'static 'inline-array nav-network-adjacency 15 + (new 'static 'nav-network-adjacency :index 38 :dist 62183.016) + (new 'static 'nav-network-adjacency :index 40 :dist 78227.05) + (new 'static 'nav-network-adjacency :index 21 :dist 101316.61) + (new 'static 'nav-network-adjacency :index 22 :dist 88131.586) + (new 'static 'nav-network-adjacency :index 23 :dist 41771.83) + (new 'static 'nav-network-adjacency :index 24 :dist 62907.598) + (new 'static 'nav-network-adjacency :index 25 :dist 88936.445) + (new 'static 'nav-network-adjacency :index 26 :dist 74927.31) + (new 'static 'nav-network-adjacency :index 54 :dist 106085.58) + (new 'static 'nav-network-adjacency :index 55 :dist 70799.36) + (new 'static 'nav-network-adjacency :index 56 :dist 99649.945) + (new 'static 'nav-network-adjacency :index 64 :dist 78554.73) + (new 'static 'nav-network-adjacency :index 65 :dist 51357.695) + (new 'static 'nav-network-adjacency :index 66 :dist 93956.09) + (new 'static 'nav-network-adjacency :index 68 :dist 117856.26) + ) + ) + (new 'static 'nav-network-info + :index 40 + :pos (new 'static 'vector :x 468545.12 :y 47903.54 :z -45163.727 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 40 :parent #f) + :count 11 + :adjacency (new 'static 'inline-array nav-network-adjacency 11 + (new 'static 'nav-network-adjacency :index 39 :dist 78227.05) + (new 'static 'nav-network-adjacency :index 41 :dist 101895.78) + (new 'static 'nav-network-adjacency :index 21 :dist 63092.33) + (new 'static 'nav-network-adjacency :index 22 :dist 41667.79) + (new 'static 'nav-network-adjacency :index 23 :dist 88718.13) + (new 'static 'nav-network-adjacency :index 24 :dist 100596.94) + (new 'static 'nav-network-adjacency :index 54 :dist 70855.06) + (new 'static 'nav-network-adjacency :index 55 :dist 106708.99) + (new 'static 'nav-network-adjacency :index 65 :dist 92458.19) + (new 'static 'nav-network-adjacency :index 66 :dist 51444.12) + (new 'static 'nav-network-adjacency :index 67 :dist 122187.37) + ) + ) + (new 'static 'nav-network-info + :index 41 + :pos (new 'static 'vector :x 402899.75 :y 47903.54 :z 32768.0 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 41 :parent #f) + :count 5 + :adjacency (new 'static 'inline-array nav-network-adjacency 5 + (new 'static 'nav-network-adjacency :index 40 :dist 101895.78) + (new 'static 'nav-network-adjacency :index 42 :dist 191261.9) + (new 'static 'nav-network-adjacency :index 22 :dist 107427.84) + (new 'static 'nav-network-adjacency :index 66 :dist 110662.04) + (new 'static 'nav-network-adjacency :index 77 :dist 60767.027) + ) + ) + (new 'static 'nav-network-info + :index 42 + :pos (new 'static 'vector :x 334944.25 :y 47903.54 :z 211550.62 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 42 :parent #f) + :count 3 + :adjacency (new 'static 'inline-array nav-network-adjacency 3 + (new 'static 'nav-network-adjacency :index 41 :dist 191261.9) + (new 'static 'nav-network-adjacency :index 43 :dist 179790.23) + (new 'static 'nav-network-adjacency :index 78 :dist 59670.527) + ) + ) + (new 'static 'nav-network-info + :index 43 + :pos (new 'static 'vector :x 332870.03 :y 47903.54 :z 391328.97 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 43 :parent #f) + :count 4 + :adjacency (new 'static 'inline-array nav-network-adjacency 4 + (new 'static 'nav-network-adjacency :index 42 :dist 179790.23) + (new 'static 'nav-network-adjacency :index 10 :dist 60114.125) + (new 'static 'nav-network-adjacency :index 79 :dist 82589.29) + (new 'static 'nav-network-adjacency :index #x8e :dist 124878.44) + ) + ) + (new 'static 'nav-network-info + :index 44 + :pos (new 'static 'vector :x 480001.62 :y 47903.54 :z -154030.9 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 44 :parent #f) + :count 9 + :adjacency (new 'static 'inline-array nav-network-adjacency 9 + (new 'static 'nav-network-adjacency :index 45 :dist 69055.695) + (new 'static 'nav-network-adjacency :index 19 :dist 81785.24) + (new 'static 'nav-network-adjacency :index 20 :dist 41451.52) + (new 'static 'nav-network-adjacency :index 21 :dist 75171.84) + (new 'static 'nav-network-adjacency :index 24 :dist 99006.46) + (new 'static 'nav-network-adjacency :index 54 :dist 79870.36) + (new 'static 'nav-network-adjacency :index 55 :dist 103455.945) + (new 'static 'nav-network-adjacency :index 67 :dist 51244.645) + (new 'static 'nav-network-adjacency :index 68 :dist 85721.086) + ) + ) + (new 'static 'nav-network-info + :index 45 + :pos (new 'static 'vector :x 549052.0 :y 47903.54 :z -153139.2 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 45 :parent #f) + :count 15 + :adjacency (new 'static 'inline-array nav-network-adjacency 15 + (new 'static 'nav-network-adjacency :index 44 :dist 69055.695) + (new 'static 'nav-network-adjacency :index 46 :dist 60871.477) + (new 'static 'nav-network-adjacency :index 18 :dist 74518.12) + (new 'static 'nav-network-adjacency :index 19 :dist 41484.29) + (new 'static 'nav-network-adjacency :index 20 :dist 80728.88) + (new 'static 'nav-network-adjacency :index 21 :dist 110089.42) + (new 'static 'nav-network-adjacency :index 24 :dist 72706.87) + (new 'static 'nav-network-adjacency :index 25 :dist 93811.51) + (new 'static 'nav-network-adjacency :index 54 :dist 113173.71) + (new 'static 'nav-network-adjacency :index 55 :dist 77495.09) + (new 'static 'nav-network-adjacency :index 56 :dist 101286.3) + (new 'static 'nav-network-adjacency :index 65 :dist 121821.59) + (new 'static 'nav-network-adjacency :index 67 :dist 85886.16) + (new 'static 'nav-network-adjacency :index 68 :dist 51232.77) + (new 'static 'nav-network-adjacency :index 69 :dist 78778.37) + ) + ) + (new 'static 'nav-network-info + :index 46 + :pos (new 'static 'vector :x 609922.7 :y 47903.54 :z -152783.25 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 46 :parent #f) + :count 15 + :adjacency (new 'static 'inline-array nav-network-adjacency 15 + (new 'static 'nav-network-adjacency :index 45 :dist 60871.477) + (new 'static 'nav-network-adjacency :index 47 :dist 68081.664) + (new 'static 'nav-network-adjacency :index 17 :dist 79854.8) + (new 'static 'nav-network-adjacency :index 18 :dist 41462.99) + (new 'static 'nav-network-adjacency :index 19 :dist 72456.195) + (new 'static 'nav-network-adjacency :index 24 :dist 96258.87) + (new 'static 'nav-network-adjacency :index 25 :dist 71793.46) + (new 'static 'nav-network-adjacency :index 28 :dist 99910.45) + (new 'static 'nav-network-adjacency :index 55 :dist 99113.78) + (new 'static 'nav-network-adjacency :index 56 :dist 76210.18) + (new 'static 'nav-network-adjacency :index 57 :dist 105086.98) + (new 'static 'nav-network-adjacency :index 64 :dist 121333.35) + (new 'static 'nav-network-adjacency :index 68 :dist 79817.93) + (new 'static 'nav-network-adjacency :index 69 :dist 51256.523) + (new 'static 'nav-network-adjacency :index 70 :dist 85726.0) + ) + ) + (new 'static 'nav-network-info + :index 47 + :pos (new 'static 'vector :x 678002.25 :y 47903.54 :z -152208.6 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 47 :parent #f) + :count 16 + :adjacency (new 'static 'inline-array nav-network-adjacency 16 + (new 'static 'nav-network-adjacency :index 16 :dist 78019.79) + (new 'static 'nav-network-adjacency :index 46 :dist 68081.664) + (new 'static 'nav-network-adjacency :index 48 :dist 66312.195) + (new 'static 'nav-network-adjacency :index 17 :dist 41470.363) + (new 'static 'nav-network-adjacency :index 18 :dist 78809.086) + (new 'static 'nav-network-adjacency :index 25 :dist 99170.305) + (new 'static 'nav-network-adjacency :index 28 :dist 73337.65) + (new 'static 'nav-network-adjacency :index 30 :dist 98317.93) + (new 'static 'nav-network-adjacency :index 50 :dist 119358.26) + (new 'static 'nav-network-adjacency :index 56 :dist 97925.94) + (new 'static 'nav-network-adjacency :index 57 :dist 78887.32) + (new 'static 'nav-network-adjacency :index 58 :dist 101784.78) + (new 'static 'nav-network-adjacency :index 63 :dist 120568.22) + (new 'static 'nav-network-adjacency :index 69 :dist 86043.445) + (new 'static 'nav-network-adjacency :index 70 :dist 51251.2) + (new 'static 'nav-network-adjacency :index 71 :dist 83872.16) + ) + ) + (new 'static 'nav-network-info + :index 48 + :pos (new 'static 'vector :x 744300.1 :y 47903.54 :z -153606.97 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 48 :parent #f) + :count 18 + :adjacency (new 'static 'inline-array nav-network-adjacency 18 + (new 'static 'nav-network-adjacency :index 16 :dist 41458.484) + (new 'static 'nav-network-adjacency :index 15 :dist 79577.5) + (new 'static 'nav-network-adjacency :index 47 :dist 66312.195) + (new 'static 'nav-network-adjacency :index 49 :dist 67238.71) + (new 'static 'nav-network-adjacency :index 50 :dist 61974.527) + (new 'static 'nav-network-adjacency :index 14 :dist 99997.695) + (new 'static 'nav-network-adjacency :index 17 :dist 78042.32) + (new 'static 'nav-network-adjacency :index 28 :dist 100216.016) + (new 'static 'nav-network-adjacency :index 30 :dist 75149.31) + (new 'static 'nav-network-adjacency :index 33 :dist 119735.914) + (new 'static 'nav-network-adjacency :index 53 :dist 120347.85) + (new 'static 'nav-network-adjacency :index 57 :dist 103321.6) + (new 'static 'nav-network-adjacency :index 58 :dist 79885.93) + (new 'static 'nav-network-adjacency :index 59 :dist 102397.54) + (new 'static 'nav-network-adjacency :index 70 :dist 83338.04) + (new 'static 'nav-network-adjacency :index 71 :dist 51236.863) + (new 'static 'nav-network-adjacency :index 72 :dist 83760.336) + (new 'static 'nav-network-adjacency :index 73 :dist 78592.82) + ) + ) + (new 'static 'nav-network-info + :index 49 + :pos (new 'static 'vector :x 811511.4 :y 47903.54 :z -151683.08 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 49 :parent #f) + :count 16 + :adjacency (new 'static 'inline-array nav-network-adjacency 16 + (new 'static 'nav-network-adjacency :index 16 :dist 79215.82) + (new 'static 'nav-network-adjacency :index 15 :dist 41456.844) + (new 'static 'nav-network-adjacency :index 48 :dist 67238.71) + (new 'static 'nav-network-adjacency :index 50 :dist 50595.02) + (new 'static 'nav-network-adjacency :index 53 :dist 100634.625) + (new 'static 'nav-network-adjacency :index 14 :dist 69916.266) + (new 'static 'nav-network-adjacency :index 30 :dist 100664.12) + (new 'static 'nav-network-adjacency :index 31 :dist 116272.336) + (new 'static 'nav-network-adjacency :index 33 :dist 77321.42) + (new 'static 'nav-network-adjacency :index 58 :dist 104489.78) + (new 'static 'nav-network-adjacency :index 59 :dist 75329.945) + (new 'static 'nav-network-adjacency :index 61 :dist 121398.48) + (new 'static 'nav-network-adjacency :index 71 :dist 84418.15) + (new 'static 'nav-network-adjacency :index 72 :dist 51243.418) + (new 'static 'nav-network-adjacency :index 73 :dist 69454.64) + (new 'static 'nav-network-adjacency :index 76 :dist 115332.71) + ) + ) + (new 'static 'nav-network-info + :index 50 + :pos (new 'static 'vector :x 788700.75 :y 47903.54 :z -196844.34 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 50 :parent #f) + :count 14 + :adjacency (new 'static 'inline-array nav-network-adjacency 14 + (new 'static 'nav-network-adjacency :index 16 :dist 74192.484) + (new 'static 'nav-network-adjacency :index 15 :dist 65329.152) + (new 'static 'nav-network-adjacency :index 49 :dist 50595.02) + (new 'static 'nav-network-adjacency :index 48 :dist 61974.527) + (new 'static 'nav-network-adjacency :index 53 :dist 60616.293) + (new 'static 'nav-network-adjacency :index 14 :dist 112492.13) + (new 'static 'nav-network-adjacency :index 30 :dist 122651.445) + (new 'static 'nav-network-adjacency :index 33 :dist 74737.664) + (new 'static 'nav-network-adjacency :index 47 :dist 119358.26) + (new 'static 'nav-network-adjacency :index 59 :dist 115104.98) + (new 'static 'nav-network-adjacency :index 71 :dist 80957.44) + (new 'static 'nav-network-adjacency :index 72 :dist 72311.195) + (new 'static 'nav-network-adjacency :index 73 :dist 51377.355) + (new 'static 'nav-network-adjacency :index 76 :dist 80449.125) + ) + ) + (new 'static 'nav-network-info + :index 51 + :pos (new 'static 'vector :x 876015.2 :y 47903.54 :z -197092.97 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 51 :parent #f) + :count 8 + :adjacency (new 'static 'inline-array nav-network-adjacency 8 + (new 'static 'nav-network-adjacency :index 52 :dist 79925.25) + (new 'static 'nav-network-adjacency :index 32 :dist 109783.86) + (new 'static 'nav-network-adjacency :index 33 :dist 63254.938) + (new 'static 'nav-network-adjacency :index 60 :dist 111644.266) + (new 'static 'nav-network-adjacency :index 74 :dist 51335.99) + (new 'static 'nav-network-adjacency :index 75 :dist 93351.12) + (new 'static 'nav-network-adjacency :index #x6c :dist 79119.56) + (new 'static 'nav-network-adjacency :index #x6b :dist 89692.98) + ) + ) + (new 'static 'nav-network-info + :index 52 + :pos (new 'static 'vector :x 874831.44 :y 47903.54 :z -277009.62 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 52 :parent #f) + :count 6 + :adjacency (new 'static 'inline-array nav-network-adjacency 6 + (new 'static 'nav-network-adjacency :index 51 :dist 79925.25) + (new 'static 'nav-network-adjacency :index 33 :dist 99625.78) + (new 'static 'nav-network-adjacency :index 74 :dist 97754.32) + (new 'static 'nav-network-adjacency :index 75 :dist 51265.945) + (new 'static 'nav-network-adjacency :index #x6c :dist 83596.49) + (new 'static 'nav-network-adjacency :index #x6f :dist 65859.586) + ) + ) + (new 'static 'nav-network-info + :index 53 + :pos (new 'static 'vector :x 813166.2 :y 47903.54 :z -252304.17 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 53 :parent #f) + :count 9 + :adjacency (new 'static 'inline-array nav-network-adjacency 9 + (new 'static 'nav-network-adjacency :index 15 :dist 108389.99) + (new 'static 'nav-network-adjacency :index 50 :dist 60616.293) + (new 'static 'nav-network-adjacency :index 49 :dist 100634.625) + (new 'static 'nav-network-adjacency :index 33 :dist 79921.97) + (new 'static 'nav-network-adjacency :index 48 :dist 120347.85) + (new 'static 'nav-network-adjacency :index 72 :dist 113818.83) + (new 'static 'nav-network-adjacency :index 73 :dist 82042.06) + (new 'static 'nav-network-adjacency :index 76 :dist 51377.355) + (new 'static 'nav-network-adjacency :index #x6f :dist 74742.58) + ) + ) + (new 'static 'nav-network-info + :index 54 + :pos (new 'static 'vector :x 467205.75 :y 99127.7 :z -94100.27 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 54 :parent #f) + :count 7 + :adjacency (new 'static 'inline-array nav-network-adjacency 7 + (new 'static 'nav-network-adjacency :index 66 :dist 53687.09) + (new 'static 'nav-network-adjacency :index 39 :dist 106085.58) + (new 'static 'nav-network-adjacency :index 40 :dist 70855.06) + (new 'static 'nav-network-adjacency :index 44 :dist 79870.36) + (new 'static 'nav-network-adjacency :index 45 :dist 113173.71) + (new 'static 'nav-network-adjacency :index 65 :dist 93656.266) + (new 'static 'nav-network-adjacency :index 68 :dist 100130.41) + ) + ) + (new 'static 'nav-network-info + :index 55 + :pos (new 'static 'vector :x 547786.3 :y 99127.7 :z -95001.4 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 55 :parent #f) + :count 15 + :adjacency (new 'static 'inline-array nav-network-adjacency 15 + (new 'static 'nav-network-adjacency :index 56 :dist 67951.82) + (new 'static 'nav-network-adjacency :index 65 :dist 52384.152) + (new 'static 'nav-network-adjacency :index 68 :dist 57268.633) + (new 'static 'nav-network-adjacency :index 19 :dist 109923.53) + (new 'static 'nav-network-adjacency :index 23 :dist 107287.34) + (new 'static 'nav-network-adjacency :index 38 :dist 95340.95) + (new 'static 'nav-network-adjacency :index 39 :dist 70799.36) + (new 'static 'nav-network-adjacency :index 40 :dist 106708.99) + (new 'static 'nav-network-adjacency :index 44 :dist 103455.945) + (new 'static 'nav-network-adjacency :index 45 :dist 77495.09) + (new 'static 'nav-network-adjacency :index 46 :dist 99113.78) + (new 'static 'nav-network-adjacency :index 64 :dist 78327.4) + (new 'static 'nav-network-adjacency :index 66 :dist 96495.2) + (new 'static 'nav-network-adjacency :index 67 :dist 90734.18) + (new 'static 'nav-network-adjacency :index 69 :dist 83059.914) + ) + ) + (new 'static 'nav-network-info + :index 56 + :pos (new 'static 'vector :x 615718.5 :y 99127.7 :z -96653.72 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 56 :parent #f) + :count 15 + :adjacency (new 'static 'inline-array nav-network-adjacency 15 + (new 'static 'nav-network-adjacency :index 55 :dist 67951.82) + (new 'static 'nav-network-adjacency :index 69 :dist 55053.105) + (new 'static 'nav-network-adjacency :index 64 :dist 54629.17) + (new 'static 'nav-network-adjacency :index 18 :dist 108632.88) + (new 'static 'nav-network-adjacency :index 26 :dist 108815.16) + (new 'static 'nav-network-adjacency :index 37 :dist 97050.625) + (new 'static 'nav-network-adjacency :index 38 :dist 74722.51) + (new 'static 'nav-network-adjacency :index 39 :dist 99649.945) + (new 'static 'nav-network-adjacency :index 45 :dist 101286.3) + (new 'static 'nav-network-adjacency :index 46 :dist 76210.18) + (new 'static 'nav-network-adjacency :index 47 :dist 97925.94) + (new 'static 'nav-network-adjacency :index 63 :dist 83233.18) + (new 'static 'nav-network-adjacency :index 65 :dist 88591.16) + (new 'static 'nav-network-adjacency :index 68 :dist 87075.63) + (new 'static 'nav-network-adjacency :index 70 :dist 82912.87) + ) + ) + (new 'static 'nav-network-info + :index 57 + :pos (new 'static 'vector :x 678854.25 :y 99127.7 :z -92220.21 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 57 :parent #f) + :count 15 + :adjacency (new 'static 'inline-array nav-network-adjacency 15 + (new 'static 'nav-network-adjacency :index 58 :dist 63578.113) + (new 'static 'nav-network-adjacency :index 63 :dist 49151.18) + (new 'static 'nav-network-adjacency :index 70 :dist 58441.727) + (new 'static 'nav-network-adjacency :index 17 :dist 111126.53) + (new 'static 'nav-network-adjacency :index 27 :dist 106679.914) + (new 'static 'nav-network-adjacency :index 36 :dist 96780.695) + (new 'static 'nav-network-adjacency :index 37 :dist 70727.27) + (new 'static 'nav-network-adjacency :index 38 :dist 99887.516) + (new 'static 'nav-network-adjacency :index 46 :dist 105086.98) + (new 'static 'nav-network-adjacency :index 47 :dist 78887.32) + (new 'static 'nav-network-adjacency :index 48 :dist 103321.6) + (new 'static 'nav-network-adjacency :index 62 :dist 80524.086) + (new 'static 'nav-network-adjacency :index 64 :dist 87811.69) + (new 'static 'nav-network-adjacency :index 69 :dist 91570.99) + (new 'static 'nav-network-adjacency :index 71 :dist 89040.9) + ) + ) + (new 'static 'nav-network-info + :index 58 + :pos (new 'static 'vector :x 742432.4 :y 99127.7 :z -92333.67 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 58 :parent #f) + :count 17 + :adjacency (new 'static 'inline-array nav-network-adjacency 17 + (new 'static 'nav-network-adjacency :index 16 :dist 111597.98) + (new 'static 'nav-network-adjacency :index 57 :dist 63578.113) + (new 'static 'nav-network-adjacency :index 59 :dist 69773.72) + (new 'static 'nav-network-adjacency :index 71 :dist 60169.42) + (new 'static 'nav-network-adjacency :index 62 :dist 50758.043) + (new 'static 'nav-network-adjacency :index 29 :dist 106080.664) + (new 'static 'nav-network-adjacency :index 35 :dist 100538.78) + (new 'static 'nav-network-adjacency :index 36 :dist 71983.516) + (new 'static 'nav-network-adjacency :index 37 :dist 95275.83) + (new 'static 'nav-network-adjacency :index 47 :dist 101784.78) + (new 'static 'nav-network-adjacency :index 48 :dist 79885.93) + (new 'static 'nav-network-adjacency :index 49 :dist 104489.78) + (new 'static 'nav-network-adjacency :index 61 :dist 87780.97) + (new 'static 'nav-network-adjacency :index 63 :dist 79989.555) + (new 'static 'nav-network-adjacency :index 70 :dist 86446.49) + (new 'static 'nav-network-adjacency :index 72 :dist 89669.63) + (new 'static 'nav-network-adjacency :index 73 :dist 110875.85) + ) + ) + (new 'static 'nav-network-info + :index 59 + :pos (new 'static 'vector :x 812084.8 :y 99127.7 :z -96452.61 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 59 :parent #f) + :count 16 + :adjacency (new 'static 'inline-array nav-network-adjacency 16 + (new 'static 'nav-network-adjacency :index 15 :dist 108125.39) + (new 'static 'nav-network-adjacency :index 58 :dist 69773.72) + (new 'static 'nav-network-adjacency :index 60 :dist 62415.258) + (new 'static 'nav-network-adjacency :index 61 :dist 54838.066) + (new 'static 'nav-network-adjacency :index 72 :dist 54267.902) + (new 'static 'nav-network-adjacency :index 31 :dist 106962.945) + (new 'static 'nav-network-adjacency :index 34 :dist 80117.35) + (new 'static 'nav-network-adjacency :index 35 :dist 74035.61) + (new 'static 'nav-network-adjacency :index 36 :dist 101477.17) + (new 'static 'nav-network-adjacency :index 48 :dist 102397.54) + (new 'static 'nav-network-adjacency :index 49 :dist 75329.945) + (new 'static 'nav-network-adjacency :index 50 :dist 115104.98) + (new 'static 'nav-network-adjacency :index 62 :dist 89428.79) + (new 'static 'nav-network-adjacency :index 71 :dist 87847.734) + (new 'static 'nav-network-adjacency :index 73 :dist 99142.45) + (new 'static 'nav-network-adjacency :index 74 :dist 116111.77) + ) + ) + (new 'static 'nav-network-info + :index 60 + :pos (new 'static 'vector :x 874483.3 :y 99127.7 :z -97905.05 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 60 :parent #f) + :count 10 + :adjacency (new 'static 'inline-array nav-network-adjacency 10 + (new 'static 'nav-network-adjacency :index 59 :dist 62415.258) + (new 'static 'nav-network-adjacency :index 61 :dist 82523.34) + (new 'static 'nav-network-adjacency :index 32 :dist 92716.234) + (new 'static 'nav-network-adjacency :index 34 :dist 51272.5) + (new 'static 'nav-network-adjacency :index 35 :dist 96717.62) + (new 'static 'nav-network-adjacency :index 51 :dist 111644.266) + (new 'static 'nav-network-adjacency :index 74 :dist 95852.55) + (new 'static 'nav-network-adjacency :index 72 :dist 82945.23) + (new 'static 'nav-network-adjacency :index #x6b :dist 65015.81) + (new 'static 'nav-network-adjacency :index #x6a :dist 90914.41) + ) + ) + (new 'static 'nav-network-info + :index 61 + :pos (new 'static 'vector :x 814104.2 :y 99127.7 :z -41651.406 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 61 :parent #f) + :count 14 + :adjacency (new 'static 'inline-array nav-network-adjacency 14 + (new 'static 'nav-network-adjacency :index 14 :dist 107154.64) + (new 'static 'nav-network-adjacency :index 60 :dist 82523.34) + (new 'static 'nav-network-adjacency :index 62 :dist 72638.46) + (new 'static 'nav-network-adjacency :index 59 :dist 54838.066) + (new 'static 'nav-network-adjacency :index 29 :dist 116108.086) + (new 'static 'nav-network-adjacency :index 31 :dist 92683.47) + (new 'static 'nav-network-adjacency :index 32 :dist 122276.25) + (new 'static 'nav-network-adjacency :index 34 :dist 95435.984) + (new 'static 'nav-network-adjacency :index 35 :dist 51245.465) + (new 'static 'nav-network-adjacency :index 36 :dist 87111.68) + (new 'static 'nav-network-adjacency :index 49 :dist 121398.48) + (new 'static 'nav-network-adjacency :index 58 :dist 87780.97) + (new 'static 'nav-network-adjacency :index 72 :dist 109105.56) + (new 'static 'nav-network-adjacency :index #x6a :dist 115795.15) + ) + ) + (new 'static 'nav-network-info + :index 62 + :pos (new 'static 'vector :x 741465.7 :y 99127.7 :z -41584.64 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 62 :parent #f) + :count 14 + :adjacency (new 'static 'inline-array nav-network-adjacency 14 + (new 'static 'nav-network-adjacency :index 61 :dist 72638.46) + (new 'static 'nav-network-adjacency :index 58 :dist 50758.043) + (new 'static 'nav-network-adjacency :index 27 :dist 112348.77) + (new 'static 'nav-network-adjacency :index 29 :dist 92715.414) + (new 'static 'nav-network-adjacency :index 30 :dist 105004.234) + (new 'static 'nav-network-adjacency :index 31 :dist 117852.98) + (new 'static 'nav-network-adjacency :index 35 :dist 88410.11) + (new 'static 'nav-network-adjacency :index 36 :dist 51270.453) + (new 'static 'nav-network-adjacency :index 37 :dist 81050.01) + (new 'static 'nav-network-adjacency :index 63 :dist 62072.01) + (new 'static 'nav-network-adjacency :index 13 :dist 24192.205) + (new 'static 'nav-network-adjacency :index 57 :dist 80524.086) + (new 'static 'nav-network-adjacency :index 59 :dist 89428.79) + (new 'static 'nav-network-adjacency :index 71 :dist 110925.01) + ) + ) + (new 'static 'nav-network-info + :index 63 + :pos (new 'static 'vector :x 679411.3 :y 99127.7 :z -43071.9 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 63 :parent #f) + :count 15 + :adjacency (new 'static 'inline-array nav-network-adjacency 15 + (new 'static 'nav-network-adjacency :index 64 :dist 73179.13) + (new 'static 'nav-network-adjacency :index 57 :dist 49151.18) + (new 'static 'nav-network-adjacency :index 26 :dist 116495.16) + (new 'static 'nav-network-adjacency :index 27 :dist 92756.79) + (new 'static 'nav-network-adjacency :index 29 :dist 113075.81) + (new 'static 'nav-network-adjacency :index 36 :dist 82167.4) + (new 'static 'nav-network-adjacency :index 37 :dist 51230.72) + (new 'static 'nav-network-adjacency :index 38 :dist 87191.96) + (new 'static 'nav-network-adjacency :index 47 :dist 120568.22) + (new 'static 'nav-network-adjacency :index 13 :dist 65961.984) + (new 'static 'nav-network-adjacency :index 12 :dist 52689.305) + (new 'static 'nav-network-adjacency :index 62 :dist 62072.01) + (new 'static 'nav-network-adjacency :index 56 :dist 83233.18) + (new 'static 'nav-network-adjacency :index 58 :dist 79989.555) + (new 'static 'nav-network-adjacency :index 70 :dist 107592.086) + ) + ) + (new 'static 'nav-network-info + :index 64 + :pos (new 'static 'vector :x 606232.2 :y 99127.7 :z -42854.4 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 64 :parent #f) + :count 13 + :adjacency (new 'static 'inline-array nav-network-adjacency 13 + (new 'static 'nav-network-adjacency :index 63 :dist 73179.13) + (new 'static 'nav-network-adjacency :index 56 :dist 54629.17) + (new 'static 'nav-network-adjacency :index 23 :dist 110069.35) + (new 'static 'nav-network-adjacency :index 26 :dist 92753.1) + (new 'static 'nav-network-adjacency :index 27 :dist 117257.83) + (new 'static 'nav-network-adjacency :index 37 :dist 88731.24) + (new 'static 'nav-network-adjacency :index 38 :dist 51291.34) + (new 'static 'nav-network-adjacency :index 39 :dist 78554.73) + (new 'static 'nav-network-adjacency :index 46 :dist 121333.35) + (new 'static 'nav-network-adjacency :index 12 :dist 49721.754) + (new 'static 'nav-network-adjacency :index 55 :dist 78327.4) + (new 'static 'nav-network-adjacency :index 57 :dist 87811.69) + (new 'static 'nav-network-adjacency :index 69 :dist 108457.58) + ) + ) + (new 'static 'nav-network-info + :index 65 + :pos (new 'static 'vector :x 545476.2 :y 99127.7 :z -42668.03 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 65 :parent #f) + :count 13 + :adjacency (new 'static 'inline-array nav-network-adjacency 13 + (new 'static 'nav-network-adjacency :index 66 :dist 77299.305) + (new 'static 'nav-network-adjacency :index 55 :dist 52384.152) + (new 'static 'nav-network-adjacency :index 22 :dist 120061.54) + (new 'static 'nav-network-adjacency :index 23 :dist 92698.625) + (new 'static 'nav-network-adjacency :index 26 :dist 112320.516) + (new 'static 'nav-network-adjacency :index 38 :dist 81489.92) + (new 'static 'nav-network-adjacency :index 39 :dist 51357.695) + (new 'static 'nav-network-adjacency :index 40 :dist 92458.19) + (new 'static 'nav-network-adjacency :index 45 :dist 121821.59) + (new 'static 'nav-network-adjacency :index 11 :dist 44519.426) + (new 'static 'nav-network-adjacency :index 54 :dist 93656.266) + (new 'static 'nav-network-adjacency :index 56 :dist 88591.16) + (new 'static 'nav-network-adjacency :index 68 :dist 109642.14) + ) + ) + (new 'static 'nav-network-info + :index 66 + :pos (new 'static 'vector :x 468209.25 :y 99127.7 :z -40422.195 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 66 :parent #f) + :count 11 + :adjacency (new 'static 'inline-array nav-network-adjacency 11 + (new 'static 'nav-network-adjacency :index 65 :dist 77299.305) + (new 'static 'nav-network-adjacency :index 54 :dist 53687.09) + (new 'static 'nav-network-adjacency :index 77 :dist 127860.734) + (new 'static 'nav-network-adjacency :index 22 :dist 92678.555) + (new 'static 'nav-network-adjacency :index 23 :dist 121558.22) + (new 'static 'nav-network-adjacency :index 39 :dist 93956.09) + (new 'static 'nav-network-adjacency :index 40 :dist 51444.12) + (new 'static 'nav-network-adjacency :index 41 :dist 110662.04) + (new 'static 'nav-network-adjacency :index 11 :dist 64063.49) + (new 'static 'nav-network-adjacency :index 55 :dist 96495.2) + (new 'static 'nav-network-adjacency :index 67 :dist 115682.51) + ) + ) + (new 'static 'nav-network-info + :index 67 + :pos (new 'static 'vector :x 480153.2 :y 99127.7 :z -155486.62 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 67 :parent #f) + :count 9 + :adjacency (new 'static 'inline-array nav-network-adjacency 9 + (new 'static 'nav-network-adjacency :index 68 :dist 68634.21) + (new 'static 'nav-network-adjacency :index 68 :dist 68634.21) + (new 'static 'nav-network-adjacency :index 19 :dist 116360.4) + (new 'static 'nav-network-adjacency :index 20 :dist 92678.96) + (new 'static 'nav-network-adjacency :index 40 :dist 122187.37) + (new 'static 'nav-network-adjacency :index 44 :dist 51244.645) + (new 'static 'nav-network-adjacency :index 45 :dist 85886.16) + (new 'static 'nav-network-adjacency :index 55 :dist 90734.18) + (new 'static 'nav-network-adjacency :index 66 :dist 115682.51) + ) + ) + (new 'static 'nav-network-info + :index 68 + :pos (new 'static 'vector :x 548712.06 :y 99127.7 :z -152262.66 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 68 :parent #f) + :count 14 + :adjacency (new 'static 'inline-array nav-network-adjacency 14 + (new 'static 'nav-network-adjacency :index 67 :dist 68634.21) + (new 'static 'nav-network-adjacency :index 55 :dist 57268.633) + (new 'static 'nav-network-adjacency :index 67 :dist 68634.21) + (new 'static 'nav-network-adjacency :index 18 :dist 111651.63) + (new 'static 'nav-network-adjacency :index 19 :dist 92707.23) + (new 'static 'nav-network-adjacency :index 20 :dist 115514.164) + (new 'static 'nav-network-adjacency :index 24 :dist 109776.9) + (new 'static 'nav-network-adjacency :index 39 :dist 117856.26) + (new 'static 'nav-network-adjacency :index 44 :dist 85721.086) + (new 'static 'nav-network-adjacency :index 45 :dist 51232.77) + (new 'static 'nav-network-adjacency :index 46 :dist 79817.93) + (new 'static 'nav-network-adjacency :index 54 :dist 100130.41) + (new 'static 'nav-network-adjacency :index 56 :dist 87075.63) + (new 'static 'nav-network-adjacency :index 65 :dist 109642.14) + ) + ) + (new 'static 'nav-network-info + :index 69 + :pos (new 'static 'vector :x 608874.06 :y 99127.7 :z -151280.03 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 69 :parent #f) + :count 14 + :adjacency (new 'static 'inline-array nav-network-adjacency 14 + (new 'static 'nav-network-adjacency :index 70 :dist 69757.336) + (new 'static 'nav-network-adjacency :index 70 :dist 69757.336) + (new 'static 'nav-network-adjacency :index 56 :dist 55053.105) + (new 'static 'nav-network-adjacency :index 17 :dist 115740.266) + (new 'static 'nav-network-adjacency :index 18 :dist 92714.6) + (new 'static 'nav-network-adjacency :index 19 :dist 109556.94) + (new 'static 'nav-network-adjacency :index 25 :dist 108857.34) + (new 'static 'nav-network-adjacency :index 38 :dist 120068.51) + (new 'static 'nav-network-adjacency :index 45 :dist 78778.37) + (new 'static 'nav-network-adjacency :index 46 :dist 51256.523) + (new 'static 'nav-network-adjacency :index 47 :dist 86043.445) + (new 'static 'nav-network-adjacency :index 55 :dist 83059.914) + (new 'static 'nav-network-adjacency :index 57 :dist 91570.99) + (new 'static 'nav-network-adjacency :index 64 :dist 108457.58) + ) + ) + (new 'static 'nav-network-info + :index 70 + :pos (new 'static 'vector :x 678628.94 :y 99127.7 :z -150661.53 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 70 :parent #f) + :count 15 + :adjacency (new 'static 'inline-array nav-network-adjacency 15 + (new 'static 'nav-network-adjacency :index 16 :dist 113509.58) + (new 'static 'nav-network-adjacency :index 69 :dist 69757.336) + (new 'static 'nav-network-adjacency :index 57 :dist 58441.727) + (new 'static 'nav-network-adjacency :index 69 :dist 69757.336) + (new 'static 'nav-network-adjacency :index 17 :dist 92718.28) + (new 'static 'nav-network-adjacency :index 18 :dist 114763.77) + (new 'static 'nav-network-adjacency :index 28 :dist 109841.61) + (new 'static 'nav-network-adjacency :index 37 :dist 118818.81) + (new 'static 'nav-network-adjacency :index 46 :dist 85726.0) + (new 'static 'nav-network-adjacency :index 47 :dist 51251.2) + (new 'static 'nav-network-adjacency :index 48 :dist 83338.04) + (new 'static 'nav-network-adjacency :index 56 :dist 82912.87) + (new 'static 'nav-network-adjacency :index 58 :dist 86446.49) + (new 'static 'nav-network-adjacency :index 63 :dist 107592.086) + (new 'static 'nav-network-adjacency :index 73 :dist 118291.25) + ) + ) + (new 'static 'nav-network-info + :index 71 + :pos (new 'static 'vector :x 744414.8 :y 99127.7 :z -152470.73 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 71 :parent #f) + :count 17 + :adjacency (new 'static 'inline-array nav-network-adjacency 17 + (new 'static 'nav-network-adjacency :index 16 :dist 92695.34) + (new 'static 'nav-network-adjacency :index 15 :dist 114826.85) + (new 'static 'nav-network-adjacency :index 72 :dist 66116.41) + (new 'static 'nav-network-adjacency :index 72 :dist 66116.41) + (new 'static 'nav-network-adjacency :index 58 :dist 60169.42) + (new 'static 'nav-network-adjacency :index 17 :dist 113917.13) + (new 'static 'nav-network-adjacency :index 30 :dist 111251.45) + (new 'static 'nav-network-adjacency :index 36 :dist 121976.016) + (new 'static 'nav-network-adjacency :index 47 :dist 83872.16) + (new 'static 'nav-network-adjacency :index 48 :dist 51236.863) + (new 'static 'nav-network-adjacency :index 49 :dist 84418.15) + (new 'static 'nav-network-adjacency :index 50 :dist 80957.44) + (new 'static 'nav-network-adjacency :index 57 :dist 89040.9) + (new 'static 'nav-network-adjacency :index 59 :dist 87847.734) + (new 'static 'nav-network-adjacency :index 62 :dist 110925.01) + (new 'static 'nav-network-adjacency :index 73 :dist 60276.33) + (new 'static 'nav-network-adjacency :index 76 :dist 121862.14) + ) + ) + (new 'static 'nav-network-info + :index 72 + :pos (new 'static 'vector :x 810507.9 :y 99127.7 :z -150697.98 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 72 :parent #f) + :count 18 + :adjacency (new 'static 'inline-array nav-network-adjacency 18 + (new 'static 'nav-network-adjacency :index 15 :dist 92699.445) + (new 'static 'nav-network-adjacency :index 14 :dist 107959.5) + (new 'static 'nav-network-adjacency :index 71 :dist 66116.41) + (new 'static 'nav-network-adjacency :index 73 :dist 47310.438) + (new 'static 'nav-network-adjacency :index 76 :dist 104310.78) + (new 'static 'nav-network-adjacency :index 74 :dist 77914.52) + (new 'static 'nav-network-adjacency :index 59 :dist 54267.902) + (new 'static 'nav-network-adjacency :index 71 :dist 66116.41) + (new 'static 'nav-network-adjacency :index 16 :dist 114094.49) + (new 'static 'nav-network-adjacency :index 34 :dist 98115.586) + (new 'static 'nav-network-adjacency :index 35 :dist 119281.26) + (new 'static 'nav-network-adjacency :index 48 :dist 83760.336) + (new 'static 'nav-network-adjacency :index 49 :dist 51243.418) + (new 'static 'nav-network-adjacency :index 50 :dist 72311.195) + (new 'static 'nav-network-adjacency :index 53 :dist 113818.83) + (new 'static 'nav-network-adjacency :index 58 :dist 89669.63) + (new 'static 'nav-network-adjacency :index 60 :dist 82945.23) + (new 'static 'nav-network-adjacency :index 61 :dist 109105.56) + ) + ) + (new 'static 'nav-network-info + :index 73 + :pos (new 'static 'vector :x 789122.7 :y 99127.7 :z -192899.48 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 73 :parent #f) + :count 14 + :adjacency (new 'static 'inline-array nav-network-adjacency 14 + (new 'static 'nav-network-adjacency :index 15 :dist 103833.6) + (new 'static 'nav-network-adjacency :index 72 :dist 47310.438) + (new 'static 'nav-network-adjacency :index 74 :dist 86327.3) + (new 'static 'nav-network-adjacency :index 16 :dist 109972.69) + (new 'static 'nav-network-adjacency :index 48 :dist 78592.82) + (new 'static 'nav-network-adjacency :index 49 :dist 69454.64) + (new 'static 'nav-network-adjacency :index 50 :dist 51377.355) + (new 'static 'nav-network-adjacency :index 53 :dist 82042.06) + (new 'static 'nav-network-adjacency :index 58 :dist 110875.85) + (new 'static 'nav-network-adjacency :index 59 :dist 99142.45) + (new 'static 'nav-network-adjacency :index 70 :dist 118291.25) + (new 'static 'nav-network-adjacency :index 71 :dist 60276.33) + (new 'static 'nav-network-adjacency :index 75 :dist 118156.91) + (new 'static 'nav-network-adjacency :index 76 :dist 65609.32) + ) + ) + (new 'static 'nav-network-info + :index 74 + :pos (new 'static 'vector :x 875445.9 :y 99127.7 :z -193753.1 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 74 :parent #f) + :count 15 + :adjacency (new 'static 'inline-array nav-network-adjacency 15 + (new 'static 'nav-network-adjacency :index 73 :dist 86327.3) + (new 'static 'nav-network-adjacency :index 75 :dist 81368.266) + (new 'static 'nav-network-adjacency :index 76 :dist 89445.99) + (new 'static 'nav-network-adjacency :index 72 :dist 77914.52) + (new 'static 'nav-network-adjacency :index 34 :dist 110533.836) + (new 'static 'nav-network-adjacency :index 51 :dist 51335.99) + (new 'static 'nav-network-adjacency :index 52 :dist 97754.32) + (new 'static 'nav-network-adjacency :index 60 :dist 95852.55) + (new 'static 'nav-network-adjacency :index 59 :dist 116111.77) + (new 'static 'nav-network-adjacency :index #x68 :dist 113408.82) + (new 'static 'nav-network-adjacency :index #x66 :dist 127257.805) + (new 'static 'nav-network-adjacency :index #x6c :dist 77866.6) + (new 'static 'nav-network-adjacency :index #x6b :dist 84522.19) + (new 'static 'nav-network-adjacency :index #x6e :dist 95304.5) + (new 'static 'nav-network-adjacency :index #x77 :dist 191884.08) + ) + ) + (new 'static 'nav-network-info + :index 75 + :pos (new 'static 'vector :x 873991.8 :y 99127.7 :z -275108.66 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 75 :parent #f) + :count 9 + :adjacency (new 'static 'inline-array nav-network-adjacency 9 + (new 'static 'nav-network-adjacency :index 74 :dist 81368.266) + (new 'static 'nav-network-adjacency :index 76 :dist 66820.09) + (new 'static 'nav-network-adjacency :index 51 :dist 93351.12) + (new 'static 'nav-network-adjacency :index 52 :dist 51265.945) + (new 'static 'nav-network-adjacency :index 73 :dist 118156.91) + (new 'static 'nav-network-adjacency :index #x66 :dist 77753.55) + (new 'static 'nav-network-adjacency :index #x68 :dist 58659.637) + (new 'static 'nav-network-adjacency :index #x6c :dist 80076.39) + (new 'static 'nav-network-adjacency :index #x6e :dist 92846.49) + ) + ) + (new 'static 'nav-network-info + :index 76 + :pos (new 'static 'vector :x 810266.2 :y 99127.7 :z -255008.77 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 76 :parent #f) + :count 13 + :adjacency (new 'static 'inline-array nav-network-adjacency 13 + (new 'static 'nav-network-adjacency :index 74 :dist 89445.99) + (new 'static 'nav-network-adjacency :index 75 :dist 66820.09) + (new 'static 'nav-network-adjacency :index 72 :dist 104310.78) + (new 'static 'nav-network-adjacency :index #x77 :dist 174482.23) + (new 'static 'nav-network-adjacency :index 49 :dist 115332.71) + (new 'static 'nav-network-adjacency :index 50 :dist 80449.125) + (new 'static 'nav-network-adjacency :index 53 :dist 51377.355) + (new 'static 'nav-network-adjacency :index 71 :dist 121862.14) + (new 'static 'nav-network-adjacency :index 73 :dist 65609.32) + (new 'static 'nav-network-adjacency :index #x68 :dist 85007.98) + (new 'static 'nav-network-adjacency :index #x6e :dist 141093.69) + (new 'static 'nav-network-adjacency :index #x78 :dist 120880.336) + (new 'static 'nav-network-adjacency :index #x79 :dist 135041.84) + ) + ) + (new 'static 'nav-network-info + :index 77 + :pos (new 'static 'vector :x 372208.84 :y 99127.7 :z 44029.953 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 77 :parent #f) + :count 3 + :adjacency (new 'static 'inline-array nav-network-adjacency 3 + (new 'static 'nav-network-adjacency :index 66 :dist 127860.734) + (new 'static 'nav-network-adjacency :index 78 :dist 180409.95) + (new 'static 'nav-network-adjacency :index 41 :dist 60767.027) + ) + ) + (new 'static 'nav-network-info + :index 78 + :pos (new 'static 'vector :x 304341.4 :y 99127.7 :z 211188.12 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 78 :parent #f) + :count 3 + :adjacency (new 'static 'inline-array nav-network-adjacency 3 + (new 'static 'nav-network-adjacency :index 77 :dist 180409.95) + (new 'static 'nav-network-adjacency :index 79 :dist 221696.81) + (new 'static 'nav-network-adjacency :index 42 :dist 59670.527) + ) + ) + (new 'static 'nav-network-info + :index 79 + :pos (new 'static 'vector :x 282268.47 :y 99127.7 :z 431783.53 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 79 :parent #f) + :count 8 + :adjacency (new 'static 'inline-array nav-network-adjacency 8 + (new 'static 'nav-network-adjacency :index 78 :dist 221696.81) + (new 'static 'nav-network-adjacency :index 9 :dist 78610.02) + (new 'static 'nav-network-adjacency :index 10 :dist 58953.727) + (new 'static 'nav-network-adjacency :index 43 :dist 82589.29) + (new 'static 'nav-network-adjacency :index 7 :dist 50894.027) + (new 'static 'nav-network-adjacency :index 8 :dist 25042.943) + (new 'static 'nav-network-adjacency :index 84 :dist 114955.875) + (new 'static 'nav-network-adjacency :index #x8c :dist 85034.19) + ) + ) + (new 'static 'nav-network-info + :index 80 + :pos (new 'static 'vector :x -653745.75 :y 75837.03 :z 746753.6 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 80 :parent #f) + :count 4 + :adjacency (new 'static 'inline-array nav-network-adjacency 4 + (new 'static 'nav-network-adjacency :dist 36590.797) + (new 'static 'nav-network-adjacency :index 81 :dist 65050.625) + (new 'static 'nav-network-adjacency :index 4 :dist 96502.99) + (new 'static 'nav-network-adjacency :index 5 :dist 90207.84) + ) + ) + (new 'static 'nav-network-info + :index 81 + :pos (new 'static 'vector :x -718720.6 :y 75837.03 :z 743612.0 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 81 :parent #f) + :count 4 + :adjacency (new 'static 'inline-array nav-network-adjacency 4 + (new 'static 'nav-network-adjacency :index 80 :dist 65050.625) + (new 'static 'nav-network-adjacency :index 5 :dist 75498.29) + (new 'static 'nav-network-adjacency :index #x85 :dist 82185.83) + (new 'static 'nav-network-adjacency :index #x96 :dist 171794.84) + ) + ) + (new 'static 'nav-network-info + :index 82 + :pos (new 'static 'vector :x -276695.44 :y 75837.03 :z 487050.84 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 82 :parent #f) + :count 4 + :adjacency (new 'static 'inline-array nav-network-adjacency 4 + (new 'static 'nav-network-adjacency :index #x7e :dist 136234.19) + (new 'static 'nav-network-adjacency :index #x7d :dist 236107.36) + (new 'static 'nav-network-adjacency :index #x7b :dist 190530.36) + (new 'static 'nav-network-adjacency :index #x8f :dist 202334.2) + ) + ) + (new 'static 'nav-network-info + :index 83 + :pos (new 'static 'vector :x 97074.79 :y 136962.05 :z 547810.94 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 83 :parent #f) + :count 2 + :adjacency (new 'static 'inline-array nav-network-adjacency 2 + (new 'static 'nav-network-adjacency :index 84 :dist 126510.695) + (new 'static 'nav-network-adjacency :index #x80 :dist 186160.33) + ) + ) + (new 'static 'nav-network-info + :index 84 + :pos (new 'static 'vector :x 220761.3 :y 136962.05 :z 521227.88 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 84 :parent #f) + :count 4 + :adjacency (new 'static 'inline-array nav-network-adjacency 4 + (new 'static 'nav-network-adjacency :index 83 :dist 126510.695) + (new 'static 'nav-network-adjacency :index 7 :dist 75572.016) + (new 'static 'nav-network-adjacency :index 9 :dist 70526.16) + (new 'static 'nav-network-adjacency :index 79 :dist 114955.875) + ) + ) + (new 'static 'nav-network-info + :index 85 + :pos (new 'static 'vector :x 962240.1 :y 90338.51 :z -655990.4 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 85 :parent #f) + :count 5 + :adjacency (new 'static 'inline-array nav-network-adjacency 5 + (new 'static 'nav-network-adjacency :index 86 :dist 147715.69) + (new 'static 'nav-network-adjacency :index 87 :dist 147601.81) + (new 'static 'nav-network-adjacency :index #x69 :dist 317704.2) + (new 'static 'nav-network-adjacency :index #x6d :dist 269643.78) + (new 'static 'nav-network-adjacency :index #x94 :dist 75964.01) + ) + ) + (new 'static 'nav-network-info + :index 86 + :pos (new 'static 'vector :x 874675.8 :y 90338.51 :z -774954.6 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 86 :parent #f) + :count 3 + :adjacency (new 'static 'inline-array nav-network-adjacency 3 + (new 'static 'nav-network-adjacency :index 85 :dist 147715.69) + (new 'static 'nav-network-adjacency :index 87 :dist 63136.152) + (new 'static 'nav-network-adjacency :index 88 :dist 159591.22) + ) + ) + (new 'static 'nav-network-info + :index 87 + :pos (new 'static 'vector :x 833089.1 :y 90338.51 :z -727449.2 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 87 :parent #f) + :count 3 + :adjacency (new 'static 'inline-array nav-network-adjacency 3 + (new 'static 'nav-network-adjacency :index 86 :dist 63136.152) + (new 'static 'nav-network-adjacency :index 85 :dist 147601.81) + (new 'static 'nav-network-adjacency :index 88 :dist 166670.34) + ) + ) + (new 'static 'nav-network-info + :index 88 + :pos (new 'static 'vector :x 746266.2 :y 90338.51 :z -869719.6 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 88 :parent #f) + :count 3 + :adjacency (new 'static 'inline-array nav-network-adjacency 3 + (new 'static 'nav-network-adjacency :index 86 :dist 159591.22) + (new 'static 'nav-network-adjacency :index 87 :dist 166670.34) + (new 'static 'nav-network-adjacency :index 89 :dist 78556.77) + ) + ) + (new 'static 'nav-network-info + :index 89 + :pos (new 'static 'vector :x 669011.56 :y 90338.51 :z -883965.56 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 89 :parent #f) + :count 3 + :adjacency (new 'static 'inline-array nav-network-adjacency 3 + (new 'static 'nav-network-adjacency :index 88 :dist 78556.77) + (new 'static 'nav-network-adjacency :index 90 :dist 92180.89) + (new 'static 'nav-network-adjacency :index 93 :dist 121282.97) + ) + ) + (new 'static 'nav-network-info + :index 90 + :pos (new 'static 'vector :x 576851.56 :y 90338.51 :z -885943.94 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 90 :parent #f) + :count 4 + :adjacency (new 'static 'inline-array nav-network-adjacency 4 + (new 'static 'nav-network-adjacency :index 89 :dist 92180.89) + (new 'static 'nav-network-adjacency :index 91 :dist 66548.125) + (new 'static 'nav-network-adjacency :index 93 :dist 82037.15) + (new 'static 'nav-network-adjacency :index 92 :dist 107153.82) + ) + ) + (new 'static 'nav-network-info + :index 91 + :pos (new 'static 'vector :x 510307.94 :y 90338.51 :z -885153.4 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 91 :parent #f) + :count 4 + :adjacency (new 'static 'inline-array nav-network-adjacency 4 + (new 'static 'nav-network-adjacency :index 90 :dist 66548.125) + (new 'static 'nav-network-adjacency :index 92 :dist 76811.47) + (new 'static 'nav-network-adjacency :index 93 :dist 105681.72) + (new 'static 'nav-network-adjacency :index #x74 :dist 85297.15) + ) + ) + (new 'static 'nav-network-info + :index 92 + :pos (new 'static 'vector :x 502550.12 :y 90338.51 :z -808734.3 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 92 :parent #f) + :count 5 + :adjacency (new 'static 'inline-array nav-network-adjacency 5 + (new 'static 'nav-network-adjacency :index 91 :dist 76811.47) + (new 'static 'nav-network-adjacency :index 93 :dist 75503.62) + (new 'static 'nav-network-adjacency :index 90 :dist 107153.82) + (new 'static 'nav-network-adjacency :index #x74 :dist 87248.08) + (new 'static 'nav-network-adjacency :index #x92 :dist 90930.38) + ) + ) + (new 'static 'nav-network-info + :index 93 + :pos (new 'static 'vector :x 577900.1 :y 90338.51 :z -803913.3 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 93 :parent #f) + :count 5 + :adjacency (new 'static 'inline-array nav-network-adjacency 5 + (new 'static 'nav-network-adjacency :index 92 :dist 75503.62) + (new 'static 'nav-network-adjacency :index 89 :dist 121282.97) + (new 'static 'nav-network-adjacency :index 90 :dist 82037.15) + (new 'static 'nav-network-adjacency :index 91 :dist 105681.72) + (new 'static 'nav-network-adjacency :index #x93 :dist 98365.03) + ) + ) + (new 'static 'nav-network-info + :index 94 + :pos (new 'static 'vector :x -547847.8 :y 126901.45 :z -708370.0 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 94 :parent #f) + :count 4 + :adjacency (new 'static 'inline-array nav-network-adjacency 4 + (new 'static 'nav-network-adjacency :index 95 :dist 52300.594) + (new 'static 'nav-network-adjacency :index #x65 :dist 116690.945) + (new 'static 'nav-network-adjacency :index 100 :dist 138880.2) + (new 'static 'nav-network-adjacency :index #x91 :dist 106824.91) + ) + ) + (new 'static 'nav-network-info + :index 95 + :pos (new 'static 'vector :x -495832.7 :y 126901.45 :z -702910.06 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 95 :parent #f) + :count 5 + :adjacency (new 'static 'inline-array nav-network-adjacency 5 + (new 'static 'nav-network-adjacency :index 94 :dist 52300.594) + (new 'static 'nav-network-adjacency :index 96 :dist 48793.19) + (new 'static 'nav-network-adjacency :index 100 :dist 123212.19) + (new 'static 'nav-network-adjacency :index 99 :dist 129486.44) + (new 'static 'nav-network-adjacency :index #x91 :dist 99453.336) + ) + ) + (new 'static 'nav-network-info + :index 96 + :pos (new 'static 'vector :x -452738.66 :y 126901.05 :z -680025.7 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 96 :parent #f) + :count 7 + :adjacency (new 'static 'inline-array nav-network-adjacency 7 + (new 'static 'nav-network-adjacency :index 95 :dist 48793.19) + (new 'static 'nav-network-adjacency :index 97 :dist 85125.12) + (new 'static 'nav-network-adjacency :index 100 :dist 144396.28) + (new 'static 'nav-network-adjacency :index 98 :dist 144957.03) + (new 'static 'nav-network-adjacency :index 99 :dist 130075.85) + (new 'static 'nav-network-adjacency :index #x90 :dist 108793.04) + (new 'static 'nav-network-adjacency :index #x91 :dist 124317.29) + ) + ) + (new 'static 'nav-network-info + :index 97 + :pos (new 'static 'vector :x -367634.44 :y 126901.45 :z -681913.94 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 97 :parent #f) + :count 4 + :adjacency (new 'static 'inline-array nav-network-adjacency 4 + (new 'static 'nav-network-adjacency :index 96 :dist 85125.12) + (new 'static 'nav-network-adjacency :index 98 :dist 106795.01) + (new 'static 'nav-network-adjacency :index 99 :dist 131996.47) + (new 'static 'nav-network-adjacency :index #x90 :dist 103850.805) + ) + ) + (new 'static 'nav-network-info + :index 98 + :pos (new 'static 'vector :x -356118.12 :y 126901.45 :z -788086.4 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 98 :parent #f) + :count 5 + :adjacency (new 'static 'inline-array nav-network-adjacency 5 + (new 'static 'nav-network-adjacency :index 97 :dist 106795.01) + (new 'static 'nav-network-adjacency :index 99 :dist 62058.496) + (new 'static 'nav-network-adjacency :index 96 :dist 144957.03) + (new 'static 'nav-network-adjacency :index #x70 :dist 93704.195) + (new 'static 'nav-network-adjacency :index #x90 :dist 106693.836) + ) + ) + (new 'static 'nav-network-info + :index 99 + :pos (new 'static 'vector :x -415891.03 :y 126901.45 :z -804773.5 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 99 :parent #f) + :count 7 + :adjacency (new 'static 'inline-array nav-network-adjacency 7 + (new 'static 'nav-network-adjacency :index 98 :dist 62058.496) + (new 'static 'nav-network-adjacency :index 100 :dist 57227.266) + (new 'static 'nav-network-adjacency :index 97 :dist 131996.47) + (new 'static 'nav-network-adjacency :index 96 :dist 130075.85) + (new 'static 'nav-network-adjacency :index 95 :dist 129486.44) + (new 'static 'nav-network-adjacency :index #x90 :dist 105213.13) + (new 'static 'nav-network-adjacency :index #x91 :dist 124316.47) + ) + ) + (new 'static 'nav-network-info + :index 100 + :pos (new 'static 'vector :x -470007.4 :y 126901.45 :z -823385.7 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 100 :parent #f) + :count 6 + :adjacency (new 'static 'inline-array nav-network-adjacency 6 + (new 'static 'nav-network-adjacency :index 99 :dist 57227.266) + (new 'static 'nav-network-adjacency :index #x65 :dist 72413.19) + (new 'static 'nav-network-adjacency :index 95 :dist 123212.19) + (new 'static 'nav-network-adjacency :index 96 :dist 144396.28) + (new 'static 'nav-network-adjacency :index 94 :dist 138880.2) + (new 'static 'nav-network-adjacency :index #x91 :dist 105224.195) + ) + ) + (new 'static 'nav-network-info + :index #x65 + :pos (new 'static 'vector :x -542404.2 :y 126901.45 :z -824934.0 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index #x65 :parent #f) + :count 3 + :adjacency (new 'static 'inline-array nav-network-adjacency 3 + (new 'static 'nav-network-adjacency :index 100 :dist 72413.19) + (new 'static 'nav-network-adjacency :index 94 :dist 116690.945) + (new 'static 'nav-network-adjacency :index #x91 :dist 109435.29) + ) + ) + (new 'static 'nav-network-info + :index #x66 + :pos (new 'static 'vector :x 947064.44 :y 85802.6 :z -298097.88 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index #x66 :parent #f) + :count 7 + :adjacency (new 'static 'inline-array nav-network-adjacency 7 + (new 'static 'nav-network-adjacency :index 75 :dist 77753.55) + (new 'static 'nav-network-adjacency :index #x67 :dist 52563.56) + (new 'static 'nav-network-adjacency :index #x68 :dist 108335.1) + (new 'static 'nav-network-adjacency :index 74 :dist 127257.805) + (new 'static 'nav-network-adjacency :index #x6c :dist 65527.4) + (new 'static 'nav-network-adjacency :index #x6d :dist 118421.914) + (new 'static 'nav-network-adjacency :index #x6e :dist 91147.06) + ) + ) + (new 'static 'nav-network-info + :index #x67 + :pos (new 'static 'vector :x 940830.3 :y 85802.6 :z -350290.75 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index #x67 :parent #f) + :count 4 + :adjacency (new 'static 'inline-array nav-network-adjacency 4 + (new 'static 'nav-network-adjacency :index #x66 :dist 52563.56) + (new 'static 'nav-network-adjacency :index #x69 :dist 104151.45) + (new 'static 'nav-network-adjacency :index #x6d :dist 81621.81) + (new 'static 'nav-network-adjacency :index #x6e :dist 131150.23) + ) + ) + (new 'static 'nav-network-info + :index #x68 + :pos (new 'static 'vector :x 863293.0 :y 154236.52 :z -292124.7 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index #x68 :parent #f) + :count 9 + :adjacency (new 'static 'inline-array nav-network-adjacency 9 + (new 'static 'nav-network-adjacency :index #x77 :dist 134208.31) + (new 'static 'nav-network-adjacency :index #x76 :dist 133167.11) + (new 'static 'nav-network-adjacency :index #x69 :dist 68882.84) + (new 'static 'nav-network-adjacency :index 75 :dist 58659.637) + (new 'static 'nav-network-adjacency :index 76 :dist 85007.98) + (new 'static 'nav-network-adjacency :index #x66 :dist 108335.1) + (new 'static 'nav-network-adjacency :index 74 :dist 113408.82) + (new 'static 'nav-network-adjacency :index #x6d :dist 130308.09) + (new 'static 'nav-network-adjacency :index #x6e :dist 92891.55) + ) + ) + (new 'static 'nav-network-info + :index #x69 + :pos (new 'static 'vector :x 863051.4 :y 154236.52 :z -361007.5 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index #x69 :parent #f) + :count 6 + :adjacency (new 'static 'inline-array nav-network-adjacency 6 + (new 'static 'nav-network-adjacency :index #x76 :dist 130905.7) + (new 'static 'nav-network-adjacency :index #x68 :dist 68882.84) + (new 'static 'nav-network-adjacency :index #x67 :dist 104151.45) + (new 'static 'nav-network-adjacency :index 85 :dist 317704.2) + (new 'static 'nav-network-adjacency :index #x6d :dist 87376.69) + (new 'static 'nav-network-adjacency :index #x6e :dist 144251.7) + ) + ) + (new 'static 'nav-network-info + :index #x6a + :pos (new 'static 'vector :x 927075.94 :y 78619.85 :z -26638.336 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index #x6a :parent #f) + :count 6 + :adjacency (new 'static 'inline-array nav-network-adjacency 6 + (new 'static 'nav-network-adjacency :index #x6b :dist 103449.805) + (new 'static 'nav-network-adjacency :index 60 :dist 90914.41) + (new 'static 'nav-network-adjacency :index 34 :dist 92629.81) + (new 'static 'nav-network-adjacency :index 35 :dist 118780.73) + (new 'static 'nav-network-adjacency :index 31 :dist 134927.97) + (new 'static 'nav-network-adjacency :index 61 :dist 115795.15) + ) + ) + (new 'static 'nav-network-info + :index #x6b + :pos (new 'static 'vector :x 927121.0 :y 78619.85 :z -130088.55 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index #x6b :parent #f) + :count 7 + :adjacency (new 'static 'inline-array nav-network-adjacency 7 + (new 'static 'nav-network-adjacency :index #x6a :dist 103449.805) + (new 'static 'nav-network-adjacency :index #x6c :dist 104056.42) + (new 'static 'nav-network-adjacency :index 74 :dist 84522.19) + (new 'static 'nav-network-adjacency :index 60 :dist 65015.81) + (new 'static 'nav-network-adjacency :index 51 :dist 89692.98) + (new 'static 'nav-network-adjacency :index 34 :dist 70520.83) + (new 'static 'nav-network-adjacency :index #x6e :dist 132655.92) + ) + ) + (new 'static 'nav-network-info + :index #x6c + :pos (new 'static 'vector :x 939224.7 :y 78619.85 :z -233438.83 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index #x6c :parent #f) + :count 7 + :adjacency (new 'static 'inline-array nav-network-adjacency 7 + (new 'static 'nav-network-adjacency :index #x6b :dist 104056.42) + (new 'static 'nav-network-adjacency :index #x66 :dist 65527.4) + (new 'static 'nav-network-adjacency :index 74 :dist 77866.6) + (new 'static 'nav-network-adjacency :index 51 :dist 79119.56) + (new 'static 'nav-network-adjacency :index 75 :dist 80076.39) + (new 'static 'nav-network-adjacency :index 52 :dist 83596.49) + (new 'static 'nav-network-adjacency :index #x6e :dist 75780.51) + ) + ) + (new 'static 'nav-network-info + :index #x6d + :pos (new 'static 'vector :x 943677.0 :y 154236.52 :z -394685.25 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index #x6d :parent #f) + :count 7 + :adjacency (new 'static 'inline-array nav-network-adjacency 7 + (new 'static 'nav-network-adjacency :index #x76 :dist 184588.28) + (new 'static 'nav-network-adjacency :index #x69 :dist 87376.69) + (new 'static 'nav-network-adjacency :index #x67 :dist 81621.81) + (new 'static 'nav-network-adjacency :index #x66 :dist 118421.914) + (new 'static 'nav-network-adjacency :index #x68 :dist 130308.09) + (new 'static 'nav-network-adjacency :index 85 :dist 269643.78) + (new 'static 'nav-network-adjacency :index #x6e :dist 156328.75) + ) + ) + (new 'static 'nav-network-info + :index #x6e + :pos (new 'static 'vector :x 939089.5 :y 154236.52 :z -238423.66 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index #x6e :parent #f) + :count 12 + :adjacency (new 'static 'inline-array nav-network-adjacency 12 + (new 'static 'nav-network-adjacency :index #x77 :dist 170229.34) + (new 'static 'nav-network-adjacency :index #x76 :dist 193325.88) + (new 'static 'nav-network-adjacency :index #x6d :dist 156328.75) + (new 'static 'nav-network-adjacency :index #x68 :dist 92891.55) + (new 'static 'nav-network-adjacency :index #x6c :dist 75780.51) + (new 'static 'nav-network-adjacency :index #x66 :dist 91147.06) + (new 'static 'nav-network-adjacency :index #x67 :dist 131150.23) + (new 'static 'nav-network-adjacency :index #x69 :dist 144251.7) + (new 'static 'nav-network-adjacency :index 74 :dist 95304.5) + (new 'static 'nav-network-adjacency :index 75 :dist 92846.49) + (new 'static 'nav-network-adjacency :index 76 :dist 141093.69) + (new 'static 'nav-network-adjacency :index #x6b :dist 132655.92) + ) + ) + (new 'static 'nav-network-info + :index #x6f + :pos (new 'static 'vector :x 841133.7 :y -5001.216 :z -297084.53 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index #x6f :parent #f) + :count 3 + :adjacency (new 'static 'inline-array nav-network-adjacency 3 + (new 'static 'nav-network-adjacency :index 33 :dist 97601.125) + (new 'static 'nav-network-adjacency :index 52 :dist 65859.586) + (new 'static 'nav-network-adjacency :index 53 :dist 74742.58) + ) + ) + (new 'static 'nav-network-info + :index #x70 + :pos (new 'static 'vector :x -270393.34 :y 90338.51 :z -797830.75 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index #x70 :parent #f) + :count 2 + :adjacency (new 'static 'inline-array nav-network-adjacency 2 + (new 'static 'nav-network-adjacency :index 98 :dist 93704.195) + (new 'static 'nav-network-adjacency :index #x71 :dist 188886.22) + ) + ) + (new 'static 'nav-network-info + :index #x71 + :pos (new 'static 'vector :x -83141.016 :y 90338.51 :z -822623.9 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index #x71 :parent #f) + :count 2 + :adjacency (new 'static 'inline-array nav-network-adjacency 2 + (new 'static 'nav-network-adjacency :index #x72 :dist 153460.33) + (new 'static 'nav-network-adjacency :index #x70 :dist 188886.22) + ) + ) + (new 'static 'nav-network-info + :index #x72 + :pos (new 'static 'vector :x 64994.918 :y 90338.51 :z -862695.0 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index #x72 :parent #f) + :count 2 + :adjacency (new 'static 'inline-array nav-network-adjacency 2 + (new 'static 'nav-network-adjacency :index #x71 :dist 153460.33) + (new 'static 'nav-network-adjacency :index #x73 :dist 186826.34) + ) + ) + (new 'static 'nav-network-info + :index #x73 + :pos (new 'static 'vector :x 251817.58 :y 90338.51 :z -861499.0 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index #x73 :parent #f) + :count 2 + :adjacency (new 'static 'inline-array nav-network-adjacency 2 + (new 'static 'nav-network-adjacency :index #x72 :dist 186826.34) + (new 'static 'nav-network-adjacency :index #x74 :dist 178058.44) + ) + ) + (new 'static 'nav-network-info + :index #x74 + :pos (new 'static 'vector :x 429817.44 :y 90338.51 :z -856923.75 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index #x74 :parent #f) + :count 3 + :adjacency (new 'static 'inline-array nav-network-adjacency 3 + (new 'static 'nav-network-adjacency :index #x73 :dist 178058.44) + (new 'static 'nav-network-adjacency :index 92 :dist 87248.08) + (new 'static 'nav-network-adjacency :index 91 :dist 85297.15) + ) + ) + (new 'static 'nav-network-info + :index #x75 + :pos (new 'static 'vector :x 742071.94 :y 273364.6 :z -340396.84 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index #x75 :parent #f) + :count 2 + :adjacency (new 'static 'inline-array nav-network-adjacency 2 + (new 'static 'nav-network-adjacency :index #x77 :dist 118066.79) + (new 'static 'nav-network-adjacency :index #x76 :dist 76546.87) + ) + ) + (new 'static 'nav-network-info + :index #x76 + :pos (new 'static 'vector :x 818007.6 :y 273364.6 :z -330742.16 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index #x76 :parent #f) + :count 6 + :adjacency (new 'static 'inline-array nav-network-adjacency 6 + (new 'static 'nav-network-adjacency :index #x6d :dist 184588.28) + (new 'static 'nav-network-adjacency :index #x6e :dist 193325.88) + (new 'static 'nav-network-adjacency :index #x69 :dist 130905.7) + (new 'static 'nav-network-adjacency :index #x68 :dist 133167.11) + (new 'static 'nav-network-adjacency :index #x75 :dist 76546.87) + (new 'static 'nav-network-adjacency :index #x77 :dist 80721.92) + ) + ) + (new 'static 'nav-network-info + :index #x77 + :pos (new 'static 'vector :x 818044.5 :y 273365.4 :z -250019.84 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index #x77 :parent #f) + :count 7 + :adjacency (new 'static 'inline-array nav-network-adjacency 7 + (new 'static 'nav-network-adjacency :index #x6e :dist 170229.34) + (new 'static 'nav-network-adjacency :index #x68 :dist 134208.31) + (new 'static 'nav-network-adjacency :index 76 :dist 174482.23) + (new 'static 'nav-network-adjacency :index #x75 :dist 118066.79) + (new 'static 'nav-network-adjacency :index #x76 :dist 80721.92) + (new 'static 'nav-network-adjacency :index 74 :dist 191884.08) + (new 'static 'nav-network-adjacency :index #x79 :dist 84281.75) + ) + ) + (new 'static 'nav-network-info + :index #x78 + :pos (new 'static 'vector :x 732270.2 :y 189093.89 :z -234155.62 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index #x78 :parent #f) + :count 2 + :adjacency (new 'static 'inline-array nav-network-adjacency 2 + (new 'static 'nav-network-adjacency :index 76 :dist 120880.336) + (new 'static 'nav-network-adjacency :index #x79 :dist 39580.06) + ) + ) + (new 'static 'nav-network-info + :index #x79 + :pos (new 'static 'vector :x 752238.2 :y 220797.75 :z -246912.61 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index #x79 :parent #f) + :count 3 + :adjacency (new 'static 'inline-array nav-network-adjacency 3 + (new 'static 'nav-network-adjacency :index #x78 :dist 39580.06) + (new 'static 'nav-network-adjacency :index 76 :dist 135041.84) + (new 'static 'nav-network-adjacency :index #x77 :dist 84281.75) + ) + ) + (new 'static 'nav-network-info + :index #x7a + :pos (new 'static 'vector :x -122299.59 :y 60971.418 :z 303426.34 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index #x7a :parent #f) + :count 4 + :adjacency (new 'static 'inline-array nav-network-adjacency 4 + (new 'static 'nav-network-adjacency :index #x7b :dist 81986.766) + (new 'static 'nav-network-adjacency :index #x7f :dist 87802.67) + (new 'static 'nav-network-adjacency :index #x81 :dist 122315.57) + (new 'static 'nav-network-adjacency :index #x88 :dist 79717.58) + ) + ) + (new 'static 'nav-network-info + :index #x7b + :pos (new 'static 'vector :x -116361.625 :y 60971.83 :z 385198.1 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index #x7b :parent #f) + :count 7 + :adjacency (new 'static 'inline-array nav-network-adjacency 7 + (new 'static 'nav-network-adjacency :index #x7c :dist 80790.32) + (new 'static 'nav-network-adjacency :index #x7a :dist 81986.766) + (new 'static 'nav-network-adjacency :index #x82 :dist 115136.1) + (new 'static 'nav-network-adjacency :index #x7f :dist 113602.15) + (new 'static 'nav-network-adjacency :index #x81 :dist 87455.74) + (new 'static 'nav-network-adjacency :index #x7e :dist 124467.61) + (new 'static 'nav-network-adjacency :index 82 :dist 190530.36) + ) + ) + (new 'static 'nav-network-info + :index #x7c + :pos (new 'static 'vector :x -36131.637 :y 60971.418 :z 394699.16 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index #x7c :parent #f) + :count 4 + :adjacency (new 'static 'inline-array nav-network-adjacency 4 + (new 'static 'nav-network-adjacency :index #x7b :dist 80790.32) + (new 'static 'nav-network-adjacency :index #x81 :dist 121117.9) + (new 'static 'nav-network-adjacency :index #x82 :dist 87498.75) + (new 'static 'nav-network-adjacency :index #x88 :dist 84309.61) + ) + ) + (new 'static 'nav-network-info + :index #x7d + :pos (new 'static 'vector :x -236235.98 :y 99601.61 :z 255652.66 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index #x7d :parent #f) + :count 6 + :adjacency (new 'static 'inline-array nav-network-adjacency 6 + (new 'static 'nav-network-adjacency :index #x7e :dist 251659.06) + (new 'static 'nav-network-adjacency :index 82 :dist 236107.36) + (new 'static 'nav-network-adjacency :index #x83 :dist 103381.4) + (new 'static 'nav-network-adjacency :index #x7f :dist 135940.1) + (new 'static 'nav-network-adjacency :index #x81 :dist 183582.31) + (new 'static 'nav-network-adjacency :index #x89 :dist 92015.82) + ) + ) + (new 'static 'nav-network-info + :index #x7e + :pos (new 'static 'vector :x -147741.48 :y 119650.71 :z 490385.0 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index #x7e :parent #f) + :count 5 + :adjacency (new 'static 'inline-array nav-network-adjacency 5 + (new 'static 'nav-network-adjacency :index #x7d :dist 251659.06) + (new 'static 'nav-network-adjacency :index 82 :dist 136234.19) + (new 'static 'nav-network-adjacency :index #x80 :dist 72550.81) + (new 'static 'nav-network-adjacency :index #x81 :dist 108902.81) + (new 'static 'nav-network-adjacency :index #x7b :dist 124467.61) + ) + ) + (new 'static 'nav-network-info + :index #x7f + :pos (new 'static 'vector :x -122898.43 :y 148270.69 :z 312798.8 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index #x7f :parent #f) + :count 4 + :adjacency (new 'static 'inline-array nav-network-adjacency 4 + (new 'static 'nav-network-adjacency :index #x81 :dist 76326.5) + (new 'static 'nav-network-adjacency :index #x7d :dist 135940.1) + (new 'static 'nav-network-adjacency :index #x7a :dist 87802.67) + (new 'static 'nav-network-adjacency :index #x7b :dist 113602.15) + ) + ) + (new 'static 'nav-network-info + :index #x80 + :pos (new 'static 'vector :x -82639.26 :y 149863.62 :z 500993.62 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index #x80 :parent #f) + :count 4 + :adjacency (new 'static 'inline-array nav-network-adjacency 4 + (new 'static 'nav-network-adjacency :index #x7e :dist 72550.81) + (new 'static 'nav-network-adjacency :index 83 :dist 186160.33) + (new 'static 'nav-network-adjacency :index #x82 :dist 115866.42) + (new 'static 'nav-network-adjacency :index #x8a :dist 161826.81) + ) + ) + (new 'static 'nav-network-info + :index #x81 + :pos (new 'static 'vector :x -119897.29 :y 148270.69 :z 389066.34 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index #x81 :parent #f) + :count 7 + :adjacency (new 'static 'inline-array nav-network-adjacency 7 + (new 'static 'nav-network-adjacency :index #x82 :dist 78316.336) + (new 'static 'nav-network-adjacency :index #x7f :dist 76326.5) + (new 'static 'nav-network-adjacency :index #x7e :dist 108902.81) + (new 'static 'nav-network-adjacency :index #x7d :dist 183582.31) + (new 'static 'nav-network-adjacency :index #x7a :dist 122315.57) + (new 'static 'nav-network-adjacency :index #x7c :dist 121117.9) + (new 'static 'nav-network-adjacency :index #x7b :dist 87455.74) + ) + ) + (new 'static 'nav-network-info + :index #x82 + :pos (new 'static 'vector :x -41661.645 :y 148270.69 :z 392626.6 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index #x82 :parent #f) + :count 4 + :adjacency (new 'static 'inline-array nav-network-adjacency 4 + (new 'static 'nav-network-adjacency :index #x81 :dist 78316.336) + (new 'static 'nav-network-adjacency :index #x80 :dist 115866.42) + (new 'static 'nav-network-adjacency :index #x7c :dist 87498.75) + (new 'static 'nav-network-adjacency :index #x7b :dist 115136.1) + ) + ) + (new 'static 'nav-network-info + :index #x83 + :pos (new 'static 'vector :x -136882.17 :y 99601.61 :z 227077.33 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index #x83 :parent #f) + :count 1 + :adjacency (new 'static 'inline-array nav-network-adjacency 1 + (new 'static 'nav-network-adjacency :index #x7d :dist 103381.4) + ) + ) + (new 'static 'nav-network-info + :index #x84 + :pos (new 'static 'vector :x -794795.6 :y 15622.963 :z 839790.2 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index #x84 :parent #f) + :count 1 + :adjacency (new 'static 'inline-array nav-network-adjacency 1 + (new 'static 'nav-network-adjacency :index #x85 :dist 90690.35) + ) + ) + (new 'static 'nav-network-info + :index #x85 + :pos (new 'static 'vector :x -774098.56 :y 15622.963 :z 751492.7 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index #x85 :parent #f) + :count 3 + :adjacency (new 'static 'inline-array nav-network-adjacency 3 + (new 'static 'nav-network-adjacency :index #x84 :dist 90690.35) + (new 'static 'nav-network-adjacency :index 81 :dist 82185.83) + (new 'static 'nav-network-adjacency :index #x96 :dist 131120.75) + ) + ) + (new 'static 'nav-network-info + :index #x86 + :pos (new 'static 'vector :x -689217.1 :y -23266.918 :z 822394.5 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index #x86 :parent #f) + :count 1 + :adjacency (new 'static 'inline-array nav-network-adjacency 1 + (new 'static 'nav-network-adjacency :index #x87 :dist 60431.156) + ) + ) + (new 'static 'nav-network-info + :index #x87 + :pos (new 'static 'vector :x -704372.3 :y -16737.076 :z 764259.94 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index #x87 :parent #f) + :count 2 + :adjacency (new 'static 'inline-array nav-network-adjacency 2 + (new 'static 'nav-network-adjacency :index #x86 :dist 60431.156) + (new 'static 'nav-network-adjacency :index 5 :dist 30534.041) + ) + ) + (new 'static 'nav-network-info + :index #x88 + :pos (new 'static 'vector :x -42910.926 :y 60971.418 :z 310662.34 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index #x88 :parent #f) + :count 2 + :adjacency (new 'static 'inline-array nav-network-adjacency 2 + (new 'static 'nav-network-adjacency :index #x7a :dist 79717.58) + (new 'static 'nav-network-adjacency :index #x7c :dist 84309.61) + ) + ) + (new 'static 'nav-network-info + :index #x89 + :pos (new 'static 'vector :x -214346.14 :y 48071.066 :z 182629.58 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index #x89 :parent #f) + :count 1 + :adjacency (new 'static 'inline-array nav-network-adjacency 1 + (new 'static 'nav-network-adjacency :index #x7d :dist 92015.82) + ) + ) + (new 'static 'nav-network-info + :index #x8a + :pos (new 'static 'vector :x 46803.76 :y 52765.082 :z 503025.25 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index #x8a :parent #f) + :count 1 + :adjacency (new 'static 'inline-array nav-network-adjacency 1 + (new 'static 'nav-network-adjacency :index #x80 :dist 161826.81) + ) + ) + (new 'static 'nav-network-info + :index #x8b + :pos (new 'static 'vector :x 387128.53 :y 27469.824 :z 513494.62 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index #x8b :parent #f) + :count 1 + :adjacency (new 'static 'inline-array nav-network-adjacency 1 + (new 'static 'nav-network-adjacency :index #x8c :dist 91539.05) + ) + ) + (new 'static 'nav-network-info + :index #x8c + :pos (new 'static 'vector :x 306124.38 :y 27469.824 :z 470859.38 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index #x8c :parent #f) + :count 2 + :adjacency (new 'static 'inline-array nav-network-adjacency 2 + (new 'static 'nav-network-adjacency :index #x8b :dist 91539.05) + (new 'static 'nav-network-adjacency :index 79 :dist 85034.19) + ) + ) + (new 'static 'nav-network-info + :index #x8d + :pos (new 'static 'vector :x 457399.9 :y 54504.242 :z 499547.75 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index #x8d :parent #f) + :count 1 + :adjacency (new 'static 'inline-array nav-network-adjacency 1 + (new 'static 'nav-network-adjacency :index #x8e :dist 87120.69) + ) + ) + (new 'static 'nav-network-info + :index #x8e + :pos (new 'static 'vector :x 455773.8 :y 54504.242 :z 412442.22 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index #x8e :parent #f) + :count 3 + :adjacency (new 'static 'inline-array nav-network-adjacency 3 + (new 'static 'nav-network-adjacency :index #x8d :dist 87120.69) + (new 'static 'nav-network-adjacency :index 43 :dist 124878.44) + (new 'static 'nav-network-adjacency :index 10 :dist 124076.445) + ) + ) + (new 'static 'nav-network-info + :index #x8f + :pos (new 'static 'vector :x -436924.0 :y 75837.03 :z 610606.7 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index #x8f :parent #f) + :count 2 + :adjacency (new 'static 'inline-array nav-network-adjacency 2 + (new 'static 'nav-network-adjacency :index 82 :dist 202334.2) + (new 'static 'nav-network-adjacency :dist 228475.7) + ) + ) + (new 'static 'nav-network-info + :index #x90 + :pos (new 'static 'vector :x -405252.5 :y 47227.29 :z -736886.4 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index #x90 :parent #f) + :count 5 + :adjacency (new 'static 'inline-array nav-network-adjacency 5 + (new 'static 'nav-network-adjacency :index 99 :dist 105213.13) + (new 'static 'nav-network-adjacency :index 96 :dist 108793.04) + (new 'static 'nav-network-adjacency :index 98 :dist 106693.836) + (new 'static 'nav-network-adjacency :index 97 :dist 103850.805) + (new 'static 'nav-network-adjacency :index #x91 :dist 99311.62) + ) + ) + (new 'static 'nav-network-info + :index #x91 + :pos (new 'static 'vector :x -501288.56 :y 47227.29 :z -762183.25 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index #x91 :parent #f) + :count 7 + :adjacency (new 'static 'inline-array nav-network-adjacency 7 + (new 'static 'nav-network-adjacency :index 95 :dist 99453.336) + (new 'static 'nav-network-adjacency :index 100 :dist 105224.195) + (new 'static 'nav-network-adjacency :index 99 :dist 124316.47) + (new 'static 'nav-network-adjacency :index 96 :dist 124317.29) + (new 'static 'nav-network-adjacency :index #x90 :dist 99311.62) + (new 'static 'nav-network-adjacency :index #x65 :dist 109435.29) + (new 'static 'nav-network-adjacency :index 94 :dist 106824.91) + ) + ) + (new 'static 'nav-network-info + :index #x92 + :pos (new 'static 'vector :x 528760.44 :y 5666.816 :z -788434.56 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index #x92 :parent #f) + :count 1 + :adjacency (new 'static 'inline-array nav-network-adjacency 1 + (new 'static 'nav-network-adjacency :index 92 :dist 90930.38) + ) + ) + (new 'static 'nav-network-info + :index #x93 + :pos (new 'static 'vector :x 529837.7 :y 5666.816 :z -789896.8 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index #x93 :parent #f) + :count 1 + :adjacency (new 'static 'inline-array nav-network-adjacency 1 + (new 'static 'nav-network-adjacency :index 93 :dist 98365.03) + ) + ) + (new 'static 'nav-network-info + :index #x94 + :pos (new 'static 'vector :x 972832.4 :y 15529.574 :z -663862.9 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index #x94 :parent #f) + :count 1 + :adjacency (new 'static 'inline-array nav-network-adjacency 1 + (new 'static 'nav-network-adjacency :index 85 :dist 75964.01) + ) + ) + (new 'static 'nav-network-info + :index #x95 + :pos (new 'static 'vector :x -921939.56 :y 65672.805 :z 577024.0 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index #x95 :parent #f) + :count 1 + :adjacency (new 'static 'inline-array nav-network-adjacency 1 + (new 'static 'nav-network-adjacency :index #x96 :dist 131980.5) + ) + ) + (new 'static 'nav-network-info + :index #x96 + :pos (new 'static 'vector :x -885550.7 :y 65672.805 :z 703889.0 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index #x96 :parent #f) + :count 3 + :adjacency (new 'static 'inline-array nav-network-adjacency 3 + (new 'static 'nav-network-adjacency :index #x95 :dist 131980.5) + (new 'static 'nav-network-adjacency :index 81 :dist 171794.84) + (new 'static 'nav-network-adjacency :index #x85 :dist 131120.75) + ) + ) + ) + ) + +;; definition for symbol *fortress-adjacency*, type (array nav-network-info) +(define *fortress-adjacency* (new 'static 'boxed-array :type nav-network-info + (new 'static 'nav-network-info + :pos (new 'static 'vector :x 2337074.5 :y 81567.74 :z 911146.6 :w 1.0) + :path-node (new 'static 'nav-network-path-node :parent #f) + :count 5 + :adjacency (new 'static 'inline-array nav-network-adjacency 5 + (new 'static 'nav-network-adjacency :index 4 :dist 51954.074) + (new 'static 'nav-network-adjacency :index 7 :dist 70445.47) + (new 'static 'nav-network-adjacency :index 5 :dist 104932.555) + (new 'static 'nav-network-adjacency :index 6 :dist 130163.914) + (new 'static 'nav-network-adjacency :index 8 :dist 59898.266) + ) + ) + (new 'static 'nav-network-info + :index 1 + :pos (new 'static 'vector :x 2519514.8 :y 71680.0 :z 885993.06 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 1 :parent #f) + :count 3 + :adjacency (new 'static 'inline-array nav-network-adjacency 3 + (new 'static 'nav-network-adjacency :index 2 :dist 88945.46) + (new 'static 'nav-network-adjacency :index 5 :dist 79895.34) + (new 'static 'nav-network-adjacency :index 22 :dist 60069.887) + ) + ) + (new 'static 'nav-network-info + :index 2 + :pos (new 'static 'vector :x 2597932.8 :y 71680.0 :z 927968.9 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 2 :parent #f) + :count 7 + :adjacency (new 'static 'inline-array nav-network-adjacency 7 + (new 'static 'nav-network-adjacency :index 3 :dist 71611.59) + (new 'static 'nav-network-adjacency :index 1 :dist 88945.46) + (new 'static 'nav-network-adjacency :index 9 :dist 53971.355) + (new 'static 'nav-network-adjacency :index 11 :dist 66837.71) + (new 'static 'nav-network-adjacency :index 20 :dist 43391.387) + (new 'static 'nav-network-adjacency :index 21 :dist 26702.234) + (new 'static 'nav-network-adjacency :index 22 :dist 77070.336) + ) + ) + (new 'static 'nav-network-info + :index 3 + :pos (new 'static 'vector :x 2542255.8 :y 81567.74 :z 971906.7 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 3 :parent #f) + :count 4 + :adjacency (new 'static 'inline-array nav-network-adjacency 4 + (new 'static 'nav-network-adjacency :index 2 :dist 71611.59) + (new 'static 'nav-network-adjacency :index 6 :dist 89853.13) + (new 'static 'nav-network-adjacency :index 9 :dist 62548.79) + (new 'static 'nav-network-adjacency :index 22 :dist 33792.41) + ) + ) + (new 'static 'nav-network-info + :index 4 + :pos (new 'static 'vector :x 2381270.8 :y 81567.74 :z 883834.5 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 4 :parent #f) + :count 4 + :adjacency (new 'static 'inline-array nav-network-adjacency 4 + (new 'static 'nav-network-adjacency :dist 51954.074) + (new 'static 'nav-network-adjacency :index 5 :dist 62992.383) + (new 'static 'nav-network-adjacency :index 7 :dist 87042.05) + (new 'static 'nav-network-adjacency :index 6 :dist 112192.72) + ) + ) + (new 'static 'nav-network-info + :index 5 + :pos (new 'static 'vector :x 2441051.2 :y 71680.0 :z 901054.06 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 5 :parent #f) + :count 5 + :adjacency (new 'static 'inline-array nav-network-adjacency 5 + (new 'static 'nav-network-adjacency :index 4 :dist 62992.383) + (new 'static 'nav-network-adjacency :index 6 :dist 69527.96) + (new 'static 'nav-network-adjacency :dist 104932.555) + (new 'static 'nav-network-adjacency :index 7 :dist 95899.65) + (new 'static 'nav-network-adjacency :index 1 :dist 79895.34) + ) + ) + (new 'static 'nav-network-info + :index 6 + :pos (new 'static 'vector :x 2452979.0 :y 71680.0 :z 969551.44 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 6 :parent #f) + :count 6 + :adjacency (new 'static 'inline-array nav-network-adjacency 6 + (new 'static 'nav-network-adjacency :index 5 :dist 69527.96) + (new 'static 'nav-network-adjacency :index 7 :dist 78542.03) + (new 'static 'nav-network-adjacency :index 4 :dist 112192.72) + (new 'static 'nav-network-adjacency :dist 130163.914) + (new 'static 'nav-network-adjacency :index 3 :dist 89853.13) + (new 'static 'nav-network-adjacency :index 22 :dist 73879.96) + ) + ) + (new 'static 'nav-network-info + :index 7 + :pos (new 'static 'vector :x 2374438.0 :y 71680.0 :z 970043.0 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 7 :parent #f) + :count 5 + :adjacency (new 'static 'inline-array nav-network-adjacency 5 + (new 'static 'nav-network-adjacency :index 6 :dist 78542.03) + (new 'static 'nav-network-adjacency :dist 70445.47) + (new 'static 'nav-network-adjacency :index 5 :dist 95899.65) + (new 'static 'nav-network-adjacency :index 4 :dist 87042.05) + (new 'static 'nav-network-adjacency :index 8 :dist 43008.0) + ) + ) + (new 'static 'nav-network-info + :index 8 + :pos (new 'static 'vector :x 2331430.0 :y 71679.18 :z 969952.9 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 8 :parent #f) + :count 2 + :adjacency (new 'static 'inline-array nav-network-adjacency 2 + (new 'static 'nav-network-adjacency :index 7 :dist 43008.0) + (new 'static 'nav-network-adjacency :dist 59898.266) + ) + ) + (new 'static 'nav-network-info + :index 9 + :pos (new 'static 'vector :x 2604145.8 :y 80344.266 :z 980876.9 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 9 :parent #f) + :count 4 + :adjacency (new 'static 'inline-array nav-network-adjacency 4 + (new 'static 'nav-network-adjacency :index 2 :dist 53971.355) + (new 'static 'nav-network-adjacency :index 3 :dist 62548.79) + (new 'static 'nav-network-adjacency :index 10 :dist 51110.297) + (new 'static 'nav-network-adjacency :index 20 :dist 33129.266) + ) + ) + (new 'static 'nav-network-info + :index 10 + :pos (new 'static 'vector :x 2655117.0 :y 80344.266 :z 984653.44 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 10 :parent #f) + :count 2 + :adjacency (new 'static 'inline-array nav-network-adjacency 2 + (new 'static 'nav-network-adjacency :index 9 :dist 51110.297) + (new 'static 'nav-network-adjacency :index 20 :dist 38163.25) + ) + ) + (new 'static 'nav-network-info + :index 11 + :pos (new 'static 'vector :x 2647498.2 :y 71678.77 :z 883129.94 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 11 :parent #f) + :count 5 + :adjacency (new 'static 'inline-array nav-network-adjacency 5 + (new 'static 'nav-network-adjacency :index 19 :dist 41889.793) + (new 'static 'nav-network-adjacency :index 2 :dist 66837.71) + (new 'static 'nav-network-adjacency :index 12 :dist 45715.457) + (new 'static 'nav-network-adjacency :index 21 :dist 51198.363) + (new 'static 'nav-network-adjacency :index 13 :dist 71453.49) + ) + ) + (new 'static 'nav-network-info + :index 12 + :pos (new 'static 'vector :x 2650853.0 :y 71680.0 :z 837537.4 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 12 :parent #f) + :count 4 + :adjacency (new 'static 'inline-array nav-network-adjacency 4 + (new 'static 'nav-network-adjacency :index 11 :dist 45715.457) + (new 'static 'nav-network-adjacency :index 13 :dist 52642.61) + (new 'static 'nav-network-adjacency :index 18 :dist 70539.67) + (new 'static 'nav-network-adjacency :index 19 :dist 30808.473) + ) + ) + (new 'static 'nav-network-info + :index 13 + :pos (new 'static 'vector :x 2703482.5 :y 71680.0 :z 838729.3 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 13 :parent #f) + :count 3 + :adjacency (new 'static 'inline-array nav-network-adjacency 3 + (new 'static 'nav-network-adjacency :index 12 :dist 52642.61) + (new 'static 'nav-network-adjacency :index 14 :dist 62040.062) + (new 'static 'nav-network-adjacency :index 11 :dist 71453.49) + ) + ) + (new 'static 'nav-network-info + :index 14 + :pos (new 'static 'vector :x 2761653.8 :y 71680.0 :z 860294.75 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 14 :parent #f) + :count 3 + :adjacency (new 'static 'inline-array nav-network-adjacency 3 + (new 'static 'nav-network-adjacency :index 13 :dist 62040.062) + (new 'static 'nav-network-adjacency :index 15 :dist 100182.836) + (new 'static 'nav-network-adjacency :index 17 :dist 43101.39) + ) + ) + (new 'static 'nav-network-info + :index 15 + :pos (new 'static 'vector :x 2772868.8 :y 71680.0 :z 959848.06 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 15 :parent #f) + :count 3 + :adjacency (new 'static 'inline-array nav-network-adjacency 3 + (new 'static 'nav-network-adjacency :index 14 :dist 100182.836) + (new 'static 'nav-network-adjacency :index 16 :dist 45114.164) + (new 'static 'nav-network-adjacency :index 17 :dist 68985.65) + ) + ) + (new 'static 'nav-network-info + :index 16 + :pos (new 'static 'vector :x 2812550.2 :y 71679.18 :z 981311.06 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 16 :parent #f) + :count 1 + :adjacency (new 'static 'inline-array nav-network-adjacency 1 + (new 'static 'nav-network-adjacency :index 15 :dist 45114.164) + ) + ) + (new 'static 'nav-network-info + :index 17 + :pos (new 'static 'vector :x 2789768.5 :y 71680.0 :z 892964.44 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 17 :parent #f) + :count 2 + :adjacency (new 'static 'inline-array nav-network-adjacency 2 + (new 'static 'nav-network-adjacency :index 15 :dist 68985.65) + (new 'static 'nav-network-adjacency :index 14 :dist 43101.39) + ) + ) + (new 'static 'nav-network-info + :index 18 + :pos (new 'static 'vector :x 2582265.5 :y 80344.266 :z 823516.75 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 18 :parent #f) + :count 2 + :adjacency (new 'static 'inline-array nav-network-adjacency 2 + (new 'static 'nav-network-adjacency :index 12 :dist 70539.67) + (new 'static 'nav-network-adjacency :index 19 :dist 48671.13) + ) + ) + (new 'static 'nav-network-info + :index 19 + :pos (new 'static 'vector :x 2622476.0 :y 71680.0 :z 849534.56 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 19 :parent #f) + :count 3 + :adjacency (new 'static 'inline-array nav-network-adjacency 3 + (new 'static 'nav-network-adjacency :index 11 :dist 41889.793) + (new 'static 'nav-network-adjacency :index 12 :dist 30808.473) + (new 'static 'nav-network-adjacency :index 18 :dist 48671.13) + ) + ) + (new 'static 'nav-network-info + :index 20 + :pos (new 'static 'vector :x 2627841.8 :y 71680.0 :z 959405.7 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 20 :parent #f) + :count 4 + :adjacency (new 'static 'inline-array nav-network-adjacency 4 + (new 'static 'nav-network-adjacency :index 10 :dist 38163.25) + (new 'static 'nav-network-adjacency :index 9 :dist 33129.266) + (new 'static 'nav-network-adjacency :index 2 :dist 43391.387) + (new 'static 'nav-network-adjacency :index 21 :dist 30644.225) + ) + ) + (new 'static 'nav-network-info + :index 21 + :pos (new 'static 'vector :x 2624617.8 :y 71679.18 :z 928931.44 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 21 :parent #f) + :count 3 + :adjacency (new 'static 'inline-array nav-network-adjacency 3 + (new 'static 'nav-network-adjacency :index 11 :dist 51198.363) + (new 'static 'nav-network-adjacency :index 2 :dist 26702.234) + (new 'static 'nav-network-adjacency :index 20 :dist 30644.225) + ) + ) + (new 'static 'nav-network-info + :index 22 + :pos (new 'static 'vector :x 2522992.2 :y 71680.0 :z 945962.6 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 22 :parent #f) + :count 4 + :adjacency (new 'static 'inline-array nav-network-adjacency 4 + (new 'static 'nav-network-adjacency :index 3 :dist 33792.41) + (new 'static 'nav-network-adjacency :index 1 :dist 60069.887) + (new 'static 'nav-network-adjacency :index 2 :dist 77070.336) + (new 'static 'nav-network-adjacency :index 6 :dist 73879.96) + ) + ) + ) + ) + +;; definition for symbol *forest-adjacency*, type (array nav-network-info) +(define *forest-adjacency* (new 'static 'boxed-array :type nav-network-info + (new 'static 'nav-network-info + :pos (new 'static 'vector :x -2368880.2 :y 122140.67 :z 3622034.8 :w 1.0) + :path-node (new 'static 'nav-network-path-node :parent #f) + :count 12 + :adjacency (new 'static 'inline-array nav-network-adjacency 12 + (new 'static 'nav-network-adjacency :index 1 :dist 129781.35) + (new 'static 'nav-network-adjacency :index 3 :dist 85524.48) + (new 'static 'nav-network-adjacency :index 4 :dist 111945.73) + (new 'static 'nav-network-adjacency :index 10 :dist 123697.97) + (new 'static 'nav-network-adjacency :index 9 :dist 118688.98) + (new 'static 'nav-network-adjacency :index 20 :dist 84649.984) + (new 'static 'nav-network-adjacency :index 17 :dist 78633.37) + (new 'static 'nav-network-adjacency :index 15 :dist 125326.54) + (new 'static 'nav-network-adjacency :index 16 :dist 130749.65) + (new 'static 'nav-network-adjacency :index 32 :dist 219675.03) + (new 'static 'nav-network-adjacency :index 23 :dist 107214.85) + (new 'static 'nav-network-adjacency :index 38 :dist 112257.84) + ) + ) + (new 'static 'nav-network-info + :index 1 + :pos (new 'static 'vector :x -2384215.8 :y 122140.67 :z 3750907.5 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 1 :parent #f) + :count 11 + :adjacency (new 'static 'inline-array nav-network-adjacency 11 + (new 'static 'nav-network-adjacency :dist 129781.35) + (new 'static 'nav-network-adjacency :index 3 :dist 164965.98) + (new 'static 'nav-network-adjacency :index 4 :dist 97910.78) + (new 'static 'nav-network-adjacency :index 9 :dist 178428.72) + (new 'static 'nav-network-adjacency :index 8 :dist 127346.69) + (new 'static 'nav-network-adjacency :index 5 :dist 95617.44) + (new 'static 'nav-network-adjacency :index 15 :dist 83521.54) + (new 'static 'nav-network-adjacency :index 16 :dist 79391.13) + (new 'static 'nav-network-adjacency :index 20 :dist 144876.34) + (new 'static 'nav-network-adjacency :index 17 :dist 154862.39) + (new 'static 'nav-network-adjacency :index 32 :dist 111190.016) + ) + ) + (new 'static 'nav-network-info + :index 2 + :pos (new 'static 'vector :x -2427690.5 :y 203764.12 :z 3530059.2 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 2 :parent #f) + :count 5 + :adjacency (new 'static 'inline-array nav-network-adjacency 5 + (new 'static 'nav-network-adjacency :index 3 :dist 86278.96) + (new 'static 'nav-network-adjacency :index 10 :dist 115770.57) + (new 'static 'nav-network-adjacency :index 9 :dist 175158.48) + (new 'static 'nav-network-adjacency :index 24 :dist 112130.87) + (new 'static 'nav-network-adjacency :index 25 :dist 125953.64) + ) + ) + (new 'static 'nav-network-info + :index 3 + :pos (new 'static 'vector :x -2389990.5 :y 203764.12 :z 3607665.8 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 3 :parent #f) + :count 7 + :adjacency (new 'static 'inline-array nav-network-adjacency 7 + (new 'static 'nav-network-adjacency :index 2 :dist 86278.96) + (new 'static 'nav-network-adjacency :index 4 :dist 89296.08) + (new 'static 'nav-network-adjacency :index 9 :dist 109071.16) + (new 'static 'nav-network-adjacency :index 10 :dist 97467.19) + (new 'static 'nav-network-adjacency :index 8 :dist 176226.3) + (new 'static 'nav-network-adjacency :dist 85524.48) + (new 'static 'nav-network-adjacency :index 1 :dist 164965.98) + ) + ) + (new 'static 'nav-network-info + :index 4 + :pos (new 'static 'vector :x -2385403.5 :y 203764.12 :z 3696844.5 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 4 :parent #f) + :count 9 + :adjacency (new 'static 'inline-array nav-network-adjacency 9 + (new 'static 'nav-network-adjacency :index 3 :dist 89296.08) + (new 'static 'nav-network-adjacency :index 5 :dist 95870.98) + (new 'static 'nav-network-adjacency :index 8 :dist 112442.984) + (new 'static 'nav-network-adjacency :index 9 :dist 123003.29) + (new 'static 'nav-network-adjacency :index 7 :dist 186659.22) + (new 'static 'nav-network-adjacency :index 1 :dist 97910.78) + (new 'static 'nav-network-adjacency :dist 111945.73) + (new 'static 'nav-network-adjacency :index 12 :dist 180434.12) + (new 'static 'nav-network-adjacency :index 16 :dist 155761.45) + ) + ) + (new 'static 'nav-network-info + :index 5 + :pos (new 'static 'vector :x -2418855.0 :y 203764.12 :z 3786690.2 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 5 :parent #f) + :count 4 + :adjacency (new 'static 'inline-array nav-network-adjacency 4 + (new 'static 'nav-network-adjacency :index 4 :dist 95870.98) + (new 'static 'nav-network-adjacency :index 6 :dist 68017.766) + (new 'static 'nav-network-adjacency :index 7 :dist 139329.95) + (new 'static 'nav-network-adjacency :index 1 :dist 95617.44) + ) + ) + (new 'static 'nav-network-info + :index 6 + :pos (new 'static 'vector :x -2475081.0 :y 203764.12 :z 3824966.8 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 6 :parent #f) + :count 3 + :adjacency (new 'static 'inline-array nav-network-adjacency 3 + (new 'static 'nav-network-adjacency :index 5 :dist 68017.766) + (new 'static 'nav-network-adjacency :index 29 :dist 113601.74) + (new 'static 'nav-network-adjacency :index 34 :dist 70013.336) + ) + ) + (new 'static 'nav-network-info + :index 7 + :pos (new 'static 'vector :x -2303241.5 :y 203764.12 :z 3864448.5 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 7 :parent #f) + :count 4 + :adjacency (new 'static 'inline-array nav-network-adjacency 4 + (new 'static 'nav-network-adjacency :index 8 :dist 115393.33) + (new 'static 'nav-network-adjacency :index 4 :dist 186659.22) + (new 'static 'nav-network-adjacency :index 5 :dist 139329.95) + (new 'static 'nav-network-adjacency :index 30 :dist 109565.54) + ) + ) + (new 'static 'nav-network-info + :index 8 + :pos (new 'static 'vector :x -2286468.8 :y 203764.12 :z 3750280.5 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 8 :parent #f) + :count 9 + :adjacency (new 'static 'inline-array nav-network-adjacency 9 + (new 'static 'nav-network-adjacency :index 7 :dist 115393.33) + (new 'static 'nav-network-adjacency :index 9 :dist 121590.58) + (new 'static 'nav-network-adjacency :index 3 :dist 176226.3) + (new 'static 'nav-network-adjacency :index 4 :dist 112442.984) + (new 'static 'nav-network-adjacency :index 1 :dist 127346.69) + (new 'static 'nav-network-adjacency :index 12 :dist 103250.33) + (new 'static 'nav-network-adjacency :index 22 :dist 110587.086) + (new 'static 'nav-network-adjacency :index 30 :dist 119299.69) + (new 'static 'nav-network-adjacency :index 13 :dist 180773.69) + ) + ) + (new 'static 'nav-network-info + :index 9 + :pos (new 'static 'vector :x -2282974.5 :y 203764.12 :z 3628740.2 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 9 :parent #f) + :count 9 + :adjacency (new 'static 'inline-array nav-network-adjacency 9 + (new 'static 'nav-network-adjacency :index 8 :dist 121590.58) + (new 'static 'nav-network-adjacency :index 10 :dist 86629.58) + (new 'static 'nav-network-adjacency :index 2 :dist 175158.48) + (new 'static 'nav-network-adjacency :index 3 :dist 109071.16) + (new 'static 'nav-network-adjacency :index 4 :dist 123003.29) + (new 'static 'nav-network-adjacency :dist 118688.98) + (new 'static 'nav-network-adjacency :index 1 :dist 178428.72) + (new 'static 'nav-network-adjacency :index 12 :dist 96829.85) + (new 'static 'nav-network-adjacency :index 22 :dist 105110.734) + ) + ) + (new 'static 'nav-network-info + :index 10 + :pos (new 'static 'vector :x -2313252.5 :y 203764.12 :z 3547573.8 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 10 :parent #f) + :count 6 + :adjacency (new 'static 'inline-array nav-network-adjacency 6 + (new 'static 'nav-network-adjacency :index 9 :dist 86629.58) + (new 'static 'nav-network-adjacency :index 2 :dist 115770.57) + (new 'static 'nav-network-adjacency :index 3 :dist 97467.19) + (new 'static 'nav-network-adjacency :dist 123697.97) + (new 'static 'nav-network-adjacency :index 24 :dist 141944.02) + (new 'static 'nav-network-adjacency :index 23 :dist 91214.234) + ) + ) + (new 'static 'nav-network-info + :index 11 + :pos (new 'static 'vector :x -2199191.2 :y 52720.434 :z 3684564.2 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 11 :parent #f) + :count 3 + :adjacency (new 'static 'inline-array nav-network-adjacency 3 + (new 'static 'nav-network-adjacency :index 13 :dist 86080.72) + (new 'static 'nav-network-adjacency :index 18 :dist 79022.08) + (new 'static 'nav-network-adjacency :index 21 :dist 64492.34) + ) + ) + (new 'static 'nav-network-info + :index 12 + :pos (new 'static 'vector :x -2205265.0 :y 203764.12 :z 3686510.2 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 12 :parent #f) + :count 7 + :adjacency (new 'static 'inline-array nav-network-adjacency 7 + (new 'static 'nav-network-adjacency :index 8 :dist 103250.33) + (new 'static 'nav-network-adjacency :index 9 :dist 96829.85) + (new 'static 'nav-network-adjacency :index 4 :dist 180434.12) + (new 'static 'nav-network-adjacency :index 21 :dist 90400.766) + (new 'static 'nav-network-adjacency :index 22 :dist 125247.08) + (new 'static 'nav-network-adjacency :index 30 :dist 170006.12) + (new 'static 'nav-network-adjacency :index 13 :dist 173362.38) + ) + ) + (new 'static 'nav-network-info + :index 13 + :pos (new 'static 'vector :x -2189135.5 :y 52719.617 :z 3770056.0 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 13 :parent #f) + :count 6 + :adjacency (new 'static 'inline-array nav-network-adjacency 6 + (new 'static 'nav-network-adjacency :index 11 :dist 86080.72) + (new 'static 'nav-network-adjacency :index 14 :dist 89017.14) + (new 'static 'nav-network-adjacency :index 30 :dist 104423.016) + (new 'static 'nav-network-adjacency :index 12 :dist 173362.38) + (new 'static 'nav-network-adjacency :index 8 :dist 180773.69) + (new 'static 'nav-network-adjacency :index 21 :dist 119484.83) + ) + ) + (new 'static 'nav-network-info + :index 14 + :pos (new 'static 'vector :x -2276785.2 :y 39343.72 :z 3762142.5 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 14 :parent #f) + :count 2 + :adjacency (new 'static 'inline-array nav-network-adjacency 2 + (new 'static 'nav-network-adjacency :index 13 :dist 89017.14) + (new 'static 'nav-network-adjacency :index 15 :dist 80542.516) + ) + ) + (new 'static 'nav-network-info + :index 15 + :pos (new 'static 'vector :x -2346413.8 :y 52720.434 :z 3723931.2 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 15 :parent #f) + :count 7 + :adjacency (new 'static 'inline-array nav-network-adjacency 7 + (new 'static 'nav-network-adjacency :index 14 :dist 80542.516) + (new 'static 'nav-network-adjacency :index 16 :dist 65499.137) + (new 'static 'nav-network-adjacency :index 17 :dist 124506.93) + (new 'static 'nav-network-adjacency :index 20 :dist 87812.51) + (new 'static 'nav-network-adjacency :index 1 :dist 83521.54) + (new 'static 'nav-network-adjacency :dist 125326.54) + (new 'static 'nav-network-adjacency :index 22 :dist 90754.664) + ) + ) + (new 'static 'nav-network-info + :index 16 + :pos (new 'static 'vector :x -2411912.5 :y 52720.434 :z 3724135.8 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 16 :parent #f) + :count 7 + :adjacency (new 'static 'inline-array nav-network-adjacency 7 + (new 'static 'nav-network-adjacency :index 15 :dist 65499.137) + (new 'static 'nav-network-adjacency :index 4 :dist 155761.45) + (new 'static 'nav-network-adjacency :index 17 :dist 110320.84) + (new 'static 'nav-network-adjacency :index 20 :dist 122594.51) + (new 'static 'nav-network-adjacency :index 1 :dist 79391.13) + (new 'static 'nav-network-adjacency :dist 130749.65) + (new 'static 'nav-network-adjacency :index 36 :dist 135989.25) + ) + ) + (new 'static 'nav-network-info + :index 17 + :pos (new 'static 'vector :x -2404937.0 :y 52720.434 :z 3614035.2 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 17 :parent #f) + :count 7 + :adjacency (new 'static 'inline-array nav-network-adjacency 7 + (new 'static 'nav-network-adjacency :index 16 :dist 110320.84) + (new 'static 'nav-network-adjacency :index 15 :dist 124506.93) + (new 'static 'nav-network-adjacency :index 20 :dist 85160.76) + (new 'static 'nav-network-adjacency :dist 78633.37) + (new 'static 'nav-network-adjacency :index 1 :dist 154862.39) + (new 'static 'nav-network-adjacency :index 23 :dist 139519.19) + (new 'static 'nav-network-adjacency :index 38 :dist 52616.4) + ) + ) + (new 'static 'nav-network-info + :index 18 + :pos (new 'static 'vector :x -2190974.2 :y 52720.027 :z 3605970.0 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 18 :parent #f) + :count 3 + :adjacency (new 'static 'inline-array nav-network-adjacency 3 + (new 'static 'nav-network-adjacency :index 11 :dist 79022.08) + (new 'static 'nav-network-adjacency :index 19 :dist 69116.31) + (new 'static 'nav-network-adjacency :index 21 :dist 89141.25) + ) + ) + (new 'static 'nav-network-info + :index 19 + :pos (new 'static 'vector :x -2257919.5 :y 39343.72 :z 3595177.2 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 19 :parent #f) + :count 2 + :adjacency (new 'static 'inline-array nav-network-adjacency 2 + (new 'static 'nav-network-adjacency :index 18 :dist 69116.31) + (new 'static 'nav-network-adjacency :index 20 :dist 80130.05) + ) + ) + (new 'static 'nav-network-info + :index 20 + :pos (new 'static 'vector :x -2323561.8 :y 52720.027 :z 3639143.8 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 20 :parent #f) + :count 8 + :adjacency (new 'static 'inline-array nav-network-adjacency 8 + (new 'static 'nav-network-adjacency :index 19 :dist 80130.05) + (new 'static 'nav-network-adjacency :index 15 :dist 87812.51) + (new 'static 'nav-network-adjacency :index 17 :dist 85160.76) + (new 'static 'nav-network-adjacency :index 16 :dist 122594.51) + (new 'static 'nav-network-adjacency :dist 84649.984) + (new 'static 'nav-network-adjacency :index 1 :dist 144876.34) + (new 'static 'nav-network-adjacency :index 22 :dist 82706.02) + (new 'static 'nav-network-adjacency :index 23 :dist 122530.61) + ) + ) + (new 'static 'nav-network-info + :index 21 + :pos (new 'static 'vector :x -2200083.8 :y 115259.39 :z 3668836.0 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 21 :parent #f) + :count 7 + :adjacency (new 'static 'inline-array nav-network-adjacency 7 + (new 'static 'nav-network-adjacency :index 22 :dist 95058.74) + (new 'static 'nav-network-adjacency :index 11 :dist 64492.34) + (new 'static 'nav-network-adjacency :index 12 :dist 90400.766) + (new 'static 'nav-network-adjacency :index 32 :dist 198217.31) + (new 'static 'nav-network-adjacency :index 30 :dist 163425.89) + (new 'static 'nav-network-adjacency :index 13 :dist 119484.83) + (new 'static 'nav-network-adjacency :index 18 :dist 89141.25) + ) + ) + (new 'static 'nav-network-info + :index 22 + :pos (new 'static 'vector :x -2293862.0 :y 115259.39 :z 3684388.5 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 22 :parent #f) + :count 7 + :adjacency (new 'static 'inline-array nav-network-adjacency 7 + (new 'static 'nav-network-adjacency :index 21 :dist 95058.74) + (new 'static 'nav-network-adjacency :index 15 :dist 90754.664) + (new 'static 'nav-network-adjacency :index 20 :dist 82706.02) + (new 'static 'nav-network-adjacency :index 9 :dist 105110.734) + (new 'static 'nav-network-adjacency :index 8 :dist 110587.086) + (new 'static 'nav-network-adjacency :index 12 :dist 125247.08) + (new 'static 'nav-network-adjacency :index 32 :dist 150130.28) + ) + ) + (new 'static 'nav-network-info + :index 23 + :pos (new 'static 'vector :x -2308316.2 :y 113705.37 :z 3533967.0 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 23 :parent #f) + :count 6 + :adjacency (new 'static 'inline-array nav-network-adjacency 6 + (new 'static 'nav-network-adjacency :index 24 :dist 104885.86) + (new 'static 'nav-network-adjacency :index 17 :dist 139519.19) + (new 'static 'nav-network-adjacency :index 32 :dist 299664.2) + (new 'static 'nav-network-adjacency :index 10 :dist 91214.234) + (new 'static 'nav-network-adjacency :dist 107214.85) + (new 'static 'nav-network-adjacency :index 20 :dist 122530.61) + ) + ) + (new 'static 'nav-network-info + :index 24 + :pos (new 'static 'vector :x -2393447.8 :y 113705.37 :z 3472699.0 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 24 :parent #f) + :count 4 + :adjacency (new 'static 'inline-array nav-network-adjacency 4 + (new 'static 'nav-network-adjacency :index 23 :dist 104885.86) + (new 'static 'nav-network-adjacency :index 25 :dist 174672.28) + (new 'static 'nav-network-adjacency :index 2 :dist 112130.87) + (new 'static 'nav-network-adjacency :index 10 :dist 141944.02) + ) + ) + (new 'static 'nav-network-info + :index 25 + :pos (new 'static 'vector :x -2549890.8 :y 174656.72 :z 3520876.2 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 25 :parent #f) + :count 3 + :adjacency (new 'static 'inline-array nav-network-adjacency 3 + (new 'static 'nav-network-adjacency :index 26 :dist 39926.58) + (new 'static 'nav-network-adjacency :index 24 :dist 174672.28) + (new 'static 'nav-network-adjacency :index 2 :dist 125953.64) + ) + ) + (new 'static 'nav-network-info + :index 26 + :pos (new 'static 'vector :x -2563202.8 :y 174657.12 :z 3558518.2 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 26 :parent #f) + :count 2 + :adjacency (new 'static 'inline-array nav-network-adjacency 2 + (new 'static 'nav-network-adjacency :index 25 :dist 39926.58) + (new 'static 'nav-network-adjacency :index 27 :dist 80087.04) + ) + ) + (new 'static 'nav-network-info + :index 27 + :pos (new 'static 'vector :x -2534080.0 :y 174657.12 :z 3633123.0 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 27 :parent #f) + :count 2 + :adjacency (new 'static 'inline-array nav-network-adjacency 2 + (new 'static 'nav-network-adjacency :index 26 :dist 80087.04) + (new 'static 'nav-network-adjacency :index 28 :dist 96868.35) + ) + ) + (new 'static 'nav-network-info + :index 28 + :pos (new 'static 'vector :x -2535996.5 :y 174656.72 :z 3729972.5 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 28 :parent #f) + :count 2 + :adjacency (new 'static 'inline-array nav-network-adjacency 2 + (new 'static 'nav-network-adjacency :index 27 :dist 96868.35) + (new 'static 'nav-network-adjacency :index 29 :dist 106853.58) + ) + ) + (new 'static 'nav-network-info + :index 29 + :pos (new 'static 'vector :x -2584891.0 :y 174656.72 :z 3824983.8 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 29 :parent #f) + :count 4 + :adjacency (new 'static 'inline-array nav-network-adjacency 4 + (new 'static 'nav-network-adjacency :index 28 :dist 106853.58) + (new 'static 'nav-network-adjacency :index 31 :dist 211829.14) + (new 'static 'nav-network-adjacency :index 6 :dist 113601.74) + (new 'static 'nav-network-adjacency :index 34 :dist 119784.66) + ) + ) + (new 'static 'nav-network-info + :index 30 + :pos (new 'static 'vector :x -2253942.2 :y 115066.88 :z 3823131.8 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 30 :parent #f) + :count 7 + :adjacency (new 'static 'inline-array nav-network-adjacency 7 + (new 'static 'nav-network-adjacency :index 31 :dist 166265.23) + (new 'static 'nav-network-adjacency :index 32 :dist 57272.32) + (new 'static 'nav-network-adjacency :index 13 :dist 104423.016) + (new 'static 'nav-network-adjacency :index 21 :dist 163425.89) + (new 'static 'nav-network-adjacency :index 12 :dist 170006.12) + (new 'static 'nav-network-adjacency :index 8 :dist 119299.69) + (new 'static 'nav-network-adjacency :index 7 :dist 109565.54) + ) + ) + (new 'static 'nav-network-info + :index 31 + :pos (new 'static 'vector :x -2398297.8 :y 115067.29 :z 3905629.5 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 31 :parent #f) + :count 3 + :adjacency (new 'static 'inline-array nav-network-adjacency 3 + (new 'static 'nav-network-adjacency :index 30 :dist 166265.23) + (new 'static 'nav-network-adjacency :index 29 :dist 211829.14) + (new 'static 'nav-network-adjacency :index 32 :dist 113745.92) + ) + ) + (new 'static 'nav-network-info + :index 32 + :pos (new 'static 'vector :x -2310246.0 :y 115066.88 :z 3833622.0 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 32 :parent #f) + :count 7 + :adjacency (new 'static 'inline-array nav-network-adjacency 7 + (new 'static 'nav-network-adjacency :index 30 :dist 57272.32) + (new 'static 'nav-network-adjacency :index 1 :dist 111190.016) + (new 'static 'nav-network-adjacency :index 22 :dist 150130.28) + (new 'static 'nav-network-adjacency :index 21 :dist 198217.31) + (new 'static 'nav-network-adjacency :dist 219675.03) + (new 'static 'nav-network-adjacency :index 23 :dist 299664.2) + (new 'static 'nav-network-adjacency :index 31 :dist 113745.92) + ) + ) + (new 'static 'nav-network-info + :index 33 + :pos (new 'static 'vector :x -2528517.8 :y 174656.72 :z 3931729.0 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 33 :parent #f) + :count 2 + :adjacency (new 'static 'inline-array nav-network-adjacency 2 + (new 'static 'nav-network-adjacency :index 34 :dist 62949.785) + (new 'static 'nav-network-adjacency :index 35 :dist 128975.26) + ) + ) + (new 'static 'nav-network-info + :index 34 + :pos (new 'static 'vector :x -2483105.5 :y 174656.72 :z 3888135.2 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 34 :parent #f) + :count 3 + :adjacency (new 'static 'inline-array nav-network-adjacency 3 + (new 'static 'nav-network-adjacency :index 33 :dist 62949.785) + (new 'static 'nav-network-adjacency :index 29 :dist 119784.66) + (new 'static 'nav-network-adjacency :index 6 :dist 70013.336) + ) + ) + (new 'static 'nav-network-info + :index 35 + :pos (new 'static 'vector :x -2570424.0 :y 52720.434 :z 3928555.0 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 35 :parent #f) + :count 2 + :adjacency (new 'static 'inline-array nav-network-adjacency 2 + (new 'static 'nav-network-adjacency :index 36 :dist 129879.66) + (new 'static 'nav-network-adjacency :index 33 :dist 128975.26) + ) + ) + (new 'static 'nav-network-info + :index 36 + :pos (new 'static 'vector :x -2468826.8 :y 52720.027 :z 3847642.8 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 36 :parent #f) + :count 2 + :adjacency (new 'static 'inline-array nav-network-adjacency 2 + (new 'static 'nav-network-adjacency :index 35 :dist 129879.66) + (new 'static 'nav-network-adjacency :index 16 :dist 135989.25) + ) + ) + (new 'static 'nav-network-info + :index 37 + :pos (new 'static 'vector :x -2461089.5 :y 52720.434 :z 3515432.2 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 37 :parent #f) + :count 1 + :adjacency (new 'static 'inline-array nav-network-adjacency 1 + (new 'static 'nav-network-adjacency :index 38 :dist 71242.95) + ) + ) + (new 'static 'nav-network-info + :index 38 + :pos (new 'static 'vector :x -2449264.2 :y 52720.434 :z 3585687.2 :w 1.0) + :path-node (new 'static 'nav-network-path-node :row-index 38 :parent #f) + :count 3 + :adjacency (new 'static 'inline-array nav-network-adjacency 3 + (new 'static 'nav-network-adjacency :index 37 :dist 71242.95) + (new 'static 'nav-network-adjacency :index 17 :dist 52616.4) + (new 'static 'nav-network-adjacency :dist 112257.84) + ) + ) + ) + ) + +;; definition for symbol *under-adjacency*, type (array nav-network-info) +(define *under-adjacency* (new 'static 'boxed-array :type nav-network-info)) + +;; definition for symbol *nestb-adjacency*, type (array nav-network-info) +(define *nestb-adjacency* (new 'static 'boxed-array :type nav-network-info)) diff --git a/test/decompiler/reference/jak2/levels/common/flitter_REF.gc b/test/decompiler/reference/jak2/levels/common/flitter_REF.gc index ec67574dbd..dcd89be02a 100644 --- a/test/decompiler/reference/jak2/levels/common/flitter_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/flitter_REF.gc @@ -941,7 +941,7 @@ (vector-normalize! s3-2 f28-1) (vector+! s3-2 s3-2 s4-2) ) - (nav-state-method-41 (-> obj nav state) s3-2) + (clamp-vector-to-mesh-cross-gaps (-> obj nav state) s3-2) (vector+! s2-0 s5-1 s3-2) (set! (-> obj target-pos quad) (-> s2-0 quad)) ) @@ -1509,7 +1509,3 @@ ) (none) ) - - - - diff --git a/test/decompiler/reference/jak2/levels/nest/boss/nestb-scenes_REF.gc b/test/decompiler/reference/jak2/levels/nest/boss/nestb-scenes_REF.gc new file mode 100644 index 0000000000..f6409894ba --- /dev/null +++ b/test/decompiler/reference/jak2/levels/nest/boss/nestb-scenes_REF.gc @@ -0,0 +1,1847 @@ +;;-*-Lisp-*- +(in-package goal) + +;; failed to figure out what this is: +(set-subtask-hook! *game-info* 245 0 (lambda :behavior scene-player + () + 0.0 + (let ((a1-0 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-0 from) (process->ppointer self)) + (set! (-> a1-0 num-params) 1) + (set! (-> a1-0 message) 'test-pickup) + (set! (-> a1-0 param 0) (the-as uint 7)) + (let ((f30-0 (send-event-function *target* a1-0))) + (let ((gp-0 (-> self clock frame-counter))) + (until (>= (- (-> self clock frame-counter) gp-0) (seconds 0.1)) + (suspend) + ) + ) + (send-event *target* 'change-mode 'darkjak #f 64) + (let ((gp-1 (-> self clock frame-counter))) + (until (>= (- (-> self clock frame-counter) gp-1) (seconds 0.1)) + (suspend) + ) + ) + (send-event *target* 'get-pickup 7 f30-0) + ) + ) + (send-event *target* 'end-mode) + (none) + ) + ) + +;; failed to figure out what this is: +(defskelgroup skel-metalkor-fma-spinner metalkor-fma-spinner 0 2 + ((1 (meters 999999))) + :bounds (static-spherem 0 0 0 20) + :origin-joint-index 3 + ) + +;; failed to figure out what this is: +(defpartgroup group-nest-break-precipice-explosion + :id 1239 + :linger-duration (seconds 3) + :flags (use-local-clock) + :bounds (static-bspherem 0 0 0 64) + :parts ((sp-item 5290) (sp-item 5291) (sp-item 5292) (sp-item 5293)) + ) + +;; failed to figure out what this is: +(defpart 5290 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #xc)) + (sp-flt spt-num 10.0) + (sp-rnd-flt spt-x (meters 0) (meters 0.6) 1.0) + (sp-flt spt-y (meters 4)) + (sp-rnd-flt spt-scale-x (meters 9) (meters 5) 1.0) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 3600.0) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 128.0) + (sp-rnd-flt spt-g 96.0 32.0 1.0) + (sp-rnd-flt spt-b 64.0 32.0 1.0) + (sp-rnd-flt spt-a 16.0 32.0 1.0) + (sp-rnd-flt spt-vel-y (meters 0.033333335) (meters 0.04) 1.0) + (sp-rnd-flt spt-scalevel-x (meters 0.016666668) (meters 0.016666668) 1.0) + (sp-rnd-flt spt-rotvel-z (degrees -0.12) (degrees 0.24) 1.0) + (sp-copy-from-other spt-scalevel-y -4) + (sp-rnd-flt spt-fade-a 0.32 0.32 1.0) + (sp-rnd-flt spt-friction 0.94 0.04 1.0) + (sp-int spt-timer 2400) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-12) + (sp-int-plain-rnd spt-next-time 70 29 1) + (sp-launcher-by-id spt-next-launcher 5294) + (sp-rnd-flt spt-conerot-x (degrees 0.0) (degrees 3600.0) 1.0) + (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 3600.0) 1.0) + (sp-flt spt-rotate-y (degrees 0.0)) + ) + ) + +;; failed to figure out what this is: +(defpart 5294 + :init-specs ((sp-flt spt-scalevel-x (meters 0.008333334)) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-a 0.0) + (sp-int-plain-rnd spt-next-time 100 149 1) + (sp-launcher-by-id spt-next-launcher 5295) + ) + ) + +;; failed to figure out what this is: +(defpart 5295 + :init-specs ((sp-flt spt-scalevel-x (meters 0.0033333334)) + (sp-copy-from-other spt-scalevel-y -4) + (sp-rnd-flt spt-fade-a -0.21333334 -0.10666667 1.0) + ) + ) + +;; failed to figure out what this is: +(defpart 5291 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x32 :page #xc)) + (sp-rnd-flt spt-num 10.0 20.0 1.0) + (sp-flt spt-x (meters 0.25)) + (sp-flt spt-y (meters 4)) + (sp-rnd-flt spt-scale-x (meters 1) (meters 2) 1.0) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 128.0) + (sp-rnd-flt spt-g 96.0 32.0 1.0) + (sp-rnd-flt spt-b 64.0 32.0 1.0) + (sp-rnd-flt spt-a 16.0 32.0 1.0) + (sp-rnd-flt spt-vel-y (meters 0) (meters 0.13333334) 1.0) + (sp-rnd-flt spt-scalevel-x (meters 0.006666667) (meters 0.0033333334) 1.0) + (sp-rnd-flt spt-rotvel-z (degrees -0.12) (degrees 0.24) 1.0) + (sp-copy-from-other spt-scalevel-y -4) + (sp-rnd-flt spt-accel-y -0.68266666 -2.7306666 1.0) + (sp-rnd-flt spt-friction 0.88 0.02 1.0) + (sp-int spt-timer 6000) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-12) + (sp-int-plain-rnd spt-next-time 70 29 1) + (sp-launcher-by-id spt-next-launcher 5296) + (sp-rnd-flt spt-conerot-x (degrees 0.0) (degrees 3600.0) 1.0) + (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 3600.0) 1.0) + (sp-flt spt-rotate-y (degrees 0.0)) + (sp-rnd-flt spt-conerot-radius (meters 0) (meters 3) 1.0) + ) + ) + +;; failed to figure out what this is: +(defpart 5296 + :init-specs ((sp-flt spt-scalevel-x (meters 0.01)) + (sp-copy-from-other spt-scalevel-y -4) + (sp-int-plain-rnd spt-next-time 90 29 1) + (sp-launcher-by-id spt-next-launcher 5297) + ) + ) + +;; failed to figure out what this is: +(defpart 5297 + :init-specs ((sp-flt spt-scalevel-x (meters 0.0033333334)) + (sp-copy-from-other spt-scalevel-y -4) + (sp-rnd-flt spt-fade-a -0.053333335 -0.053333335 1.0) + ) + ) + +;; failed to figure out what this is: +(defpart 5292 + :init-specs ((sp-func spt-birth-func 'birth-func-texture-group) + (sp-rnd-flt spt-num 10.0 20.0 1.0) + (sp-flt spt-y (meters 4)) + (sp-rnd-flt spt-scale-x (meters 6) (meters 3) 1.0) + (new 'static 'sp-field-init-spec + :field (sp-field-id spt-rot-z) + :flags (sp-flag spflag7) + :random-rangef 655360.0 + :random-multf 1.0 + ) + (sp-rnd-flt spt-scale-y (meters 8) (meters 3.5) 1.0) + (sp-flt spt-r 128.0) + (sp-rnd-flt spt-g 96.0 32.0 1.0) + (sp-rnd-flt spt-b 64.0 32.0 1.0) + (sp-rnd-flt spt-a 16.0 32.0 1.0) + (sp-rnd-flt spt-vel-y (meters 0.05) (meters 0.1) 1.0) + (sp-rnd-flt spt-scalevel-x (meters 0.033333335) (meters 0.033333335) 1.0) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-a -0.13333334) + (sp-rnd-flt spt-friction 0.92 0.02 1.0) + (sp-int spt-timer 2000) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-12) + (new 'static 'sp-field-init-spec + :field (sp-field-id spt-userdata) + :flags (sp-flag plain-v2) + :object (new 'static 'boxed-array :type int32 80 1 0 #xc00000 #xc03300) + ) + (sp-int spt-next-time 50) + (sp-launcher-by-id spt-next-launcher 5298) + (new 'static 'sp-field-init-spec + :field (sp-field-id spt-conerot-x) + :flags (sp-flag from-pointer) + :func '*sp-temp* + ) + (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 3600.0) 1.0) + (sp-flt spt-rotate-y (degrees 0.0)) + (sp-rnd-flt spt-conerot-radius (meters 0) (meters 2) 1.0) + ) + ) + +;; failed to figure out what this is: +(defpart 5293 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x34 :page #xc)) + (sp-rnd-flt spt-num 10.0 20.0 1.0) + (sp-flt spt-y (meters 4)) + (sp-rnd-flt spt-scale-x (meters 6) (meters 3) 1.0) + (sp-int spt-rot-x 4) + (new 'static 'sp-field-init-spec + :field (sp-field-id spt-rot-z) + :flags (sp-flag spflag7) + :random-rangef 65536.0 + :random-multf 1.0 + ) + (sp-rnd-flt spt-scale-y (meters 8) (meters 3.5) 1.0) + (sp-flt spt-r 128.0) + (sp-rnd-flt spt-g 96.0 32.0 1.0) + (sp-rnd-flt spt-b 64.0 32.0 1.0) + (sp-rnd-flt spt-a 16.0 32.0 1.0) + (sp-rnd-flt spt-vel-y (meters 0.05) (meters 0.1) 1.0) + (sp-rnd-flt spt-scalevel-x (meters 0.033333335) (meters 0.033333335) 1.0) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-a -0.13333334) + (sp-rnd-flt spt-friction 0.92 0.02 1.0) + (sp-int spt-timer 2000) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-12) + (sp-func spt-func 'sparticle-motion-blur) + (sp-int spt-next-time 50) + (sp-launcher-by-id spt-next-launcher 5298) + (new 'static 'sp-field-init-spec + :field (sp-field-id spt-conerot-x) + :flags (sp-flag from-pointer) + :func '*sp-temp* + ) + (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 3600.0) 1.0) + (sp-flt spt-rotate-y (degrees 0.0)) + (sp-rnd-flt spt-conerot-radius (meters 0) (meters -5) 1.0) + ) + ) + +;; failed to figure out what this is: +(defpart 5298 + :init-specs ((sp-rnd-flt spt-scalevel-x (meters 0.033333335) (meters 0.033333335) 1.0) + (sp-copy-from-other spt-scalevel-y -4) + (sp-int-plain-rnd spt-next-time 60 19 1) + (sp-launcher-by-id spt-next-launcher 5299) + ) + ) + +;; failed to figure out what this is: +(defpart 5299 + :init-specs ((sp-rnd-flt spt-scalevel-x (meters 0.016666668) (meters 0.016666668) 1.0) + (sp-copy-from-other spt-scalevel-y -4) + (sp-rnd-flt spt-fade-a -0.18 -0.12 1.0) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-nest-break-precipice-trailer + :id 1240 + :bounds (static-bspherem 0 0 0 15) + :parts ((sp-item 5300)) + ) + +;; failed to figure out what this is: +(defpart 5300 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #xc)) + (sp-flt spt-num 1.0) + (sp-rnd-flt spt-x (meters -0.25) (meters 1) 1.0) + (sp-rnd-flt spt-scale-x (meters 1) (meters 2) 1.0) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 3600.0) 1.0) + (sp-rnd-flt spt-scale-y (meters 1) (meters 2) 1.0) + (sp-flt spt-r 128.0) + (sp-rnd-flt spt-g 96.0 32.0 1.0) + (sp-rnd-flt spt-b 64.0 32.0 1.0) + (sp-rnd-flt spt-a 16.0 32.0 1.0) + (sp-rnd-flt spt-vel-y (meters -0.013333334) (meters -0.013333334) 1.0) + (sp-rnd-flt spt-scalevel-x (meters 0.006666667) (meters 0.006666667) 1.0) + (sp-rnd-flt spt-rotvel-z (degrees -0.3) (degrees 0.6) 1.0) + (sp-copy-from-other spt-scalevel-y -4) + (sp-rnd-flt spt-fade-a -0.08 -0.08 1.0) + (sp-rnd-flt spt-friction 0.95 0.03 1.0) + (sp-int spt-timer 1200) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-12) + (sp-rnd-flt spt-rotate-y (degrees 0.0) (degrees 3600.0) 1.0) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-nest-break-precipice-billow + :id 1241 + :flags (always-draw) + :bounds (static-bspherem 0 0 0 15) + :parts ((sp-item 5301)) + ) + +;; failed to figure out what this is: +(defpart 5301 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #xc)) + (sp-rnd-flt spt-num 1.0 0.5 1.0) + (sp-rnd-flt spt-x (meters -6) (meters 12) 1.0) + (sp-rnd-flt spt-scale-x (meters 1) (meters 2) 1.0) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 3600.0) 1.0) + (sp-rnd-flt spt-scale-y (meters 1) (meters 2) 1.0) + (sp-flt spt-r 128.0) + (sp-rnd-flt spt-g 96.0 32.0 1.0) + (sp-rnd-flt spt-b 64.0 32.0 1.0) + (sp-rnd-flt spt-a 16.0 32.0 1.0) + (sp-rnd-flt spt-vel-x (meters 0.02) (meters 0.02) 1.0) + (sp-rnd-flt spt-scalevel-x (meters 0.033333335) (meters 0.006666667) 1.0) + (sp-rnd-flt spt-rotvel-z (degrees -0.3) (degrees 0.6) 1.0) + (sp-copy-from-other spt-scalevel-y -4) + (sp-rnd-flt spt-fade-a -0.04 -0.08 1.0) + (sp-flt spt-accel-y 2.7306666) + (sp-rnd-flt spt-friction 0.95 0.03 1.0) + (sp-int spt-timer 1300) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-12) + (sp-rnd-flt spt-rotate-y (degrees 0.0) (degrees 3600.0) 1.0) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-nestb-precursor-stone-glow + :id 1242 + :bounds (static-bspherem 0 0 0 3) + :parts ((sp-item 5302 :flags (bit6))) + ) + +;; failed to figure out what this is: +(defpart 5302 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xca :page #xc)) + (sp-flt spt-num 1.0) + (sp-flt spt-scale-x (meters 3.5)) + (sp-flt spt-rot-x 8192.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 16.0) + (sp-flt spt-g 192.0) + (sp-flt spt-b 16.0) + (sp-flt spt-a 24.0) + (sp-int spt-timer 5) + (sp-cpuinfo-flags glow) + (sp-flt spt-userdata 4096.0) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-nest-metalkor-shot-anticipate + :id 1243 + :bounds (static-bspherem 0 0 0 160) + :parts ((sp-item 5303 :fade-after (meters 80) :falloff-to (meters 80)) + (sp-item 5304 :fade-after (meters 220) :flags (bit6)) + ) + ) + +;; failed to figure out what this is: +(defpart 5303 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xc9 :page #xc)) + (sp-flt spt-num 8.0) + (sp-flt spt-scale-x (meters 0)) + (sp-flt spt-rot-z (degrees 90.0)) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 255.0) + (sp-flt spt-g 255.0) + (sp-flt spt-b 255.0) + (sp-flt spt-a 32.0) + (sp-flt spt-vel-y (meters -0.02)) + (sp-rnd-flt spt-scalevel-x (meters 0.005) (meters 0.005) 1.0) + (sp-rnd-flt spt-rotvel-z (degrees -1.2) (degrees 2.4) 1.0) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-r -0.98) + (sp-flt spt-fade-g -0.98) + (sp-flt spt-fade-a 0.19393939) + (sp-int spt-timer 250) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3) + (sp-int spt-next-time 165) + (sp-launcher-by-id spt-next-launcher 5305) + (sp-rnd-flt spt-conerot-x (degrees 0.0) (degrees 3600.0) 1.0) + (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 3600.0) 1.0) + (sp-flt spt-conerot-radius (meters 4)) + ) + ) + +;; failed to figure out what this is: +(defpart 5305 + :init-specs ((sp-flt spt-fade-a -0.7529412) (sp-flt spt-friction 0.1)) + ) + +;; failed to figure out what this is: +(defpart 5304 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xca :page #xc)) + (sp-flt spt-num 1.0) + (sp-flt spt-scale-x (meters 8)) + (sp-flt spt-rot-x 1228.8) + (sp-copy-from-other spt-scale-y -4) + (sp-rnd-flt spt-r 128.0 16.0 1.0) + (sp-rnd-flt spt-g 146.0 16.0 1.0) + (sp-rnd-flt spt-b 128.0 16.0 1.0) + (sp-flt spt-a 32.0) + (sp-flt spt-omega 822476.8) + (sp-int spt-timer 5) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow) + (sp-flt spt-userdata 8192.0) + ) + ) + +;; definition for function movie-nest-metalkor-shot-draw-fire +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defun movie-nest-metalkor-shot-draw-fire ((arg0 vector) (arg1 vector)) + (let ((s5-1 (vector-! (new 'stack-no-clear 'vector) arg1 arg0))) + (draw-beam (-> *part-id-table* 624) arg0 s5-1 #f #t) + (let* ((a0-4 (vector-normalize-copy! (new 'stack-no-clear 'vector) s5-1 8192.0)) + (v1-3 (vector+! (new 'stack-no-clear 'vector) arg0 a0-4)) + (t9-2 sp-launch-particles-var) + (a0-5 *sp-particle-system-2d*) + (a1-4 (-> *part-id-table* 625)) + (a2-2 *launch-matrix*) + ) + (set! (-> a2-2 trans quad) (-> v1-3 quad)) + (t9-2 a0-5 a1-4 a2-2 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) + ) + ) + 0 + (none) + ) + +;; definition for function movie-nest-metalkor-shot-draw-moving +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defun movie-nest-metalkor-shot-draw-moving ((arg0 vector) (arg1 vector) (arg2 float)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (let ((s4-0 (new 'stack-no-clear 'vector))) + (set! (-> s4-0 quad) (-> arg0 quad)) + (let ((gp-0 (new 'stack-no-clear 'vector))) + (set! (-> gp-0 quad) (-> arg1 quad)) + (let ((s5-1 (vector-! (new 'stack-no-clear 'vector) gp-0 s4-0))) + (let ((s1-0 s4-0)) + (let ((s3-0 s4-0)) + (let ((s2-0 s5-1)) + (let ((v1-5 (lerp-scale -0.5 0.5 arg2 2475.0 2499.0))) + (.mov vf7 v1-5) + ) + (.lvf vf5 (&-> s2-0 quad)) + ) + (.lvf vf4 (&-> s3-0 quad)) + ) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> s1-0 quad) vf6) + ) + (vector+! gp-0 s4-0 (vector-normalize-copy! (new 'stack-no-clear 'vector) s5-1 49152.0)) + (vector-! s5-1 gp-0 s4-0) + (let ((f30-0 (vector-length s5-1))) + (let ((s3-2 (new 'stack-no-clear 'vector))) + (let ((v1-10 s4-0)) + (let ((a0-5 s5-1)) + (let ((a1-6 0.8)) + (.mov vf7 a1-6) + ) + (.lvf vf5 (&-> a0-5 quad)) + ) + (.lvf vf4 (&-> v1-10 quad)) + ) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> s3-2 quad) vf6) + (let ((f28-0 (-> *part-id-table* 621 init-specs 4 initial-valuef))) + (set! (-> *part-id-table* 621 init-specs 4 initial-valuef) (fmin f28-0 f30-0)) + (draw-beam (-> *part-id-table* 621) s4-0 s5-1 #f #t) + (set! (-> *part-id-table* 621 init-specs 4 initial-valuef) f28-0) + ) + (vector-normalize! s5-1 1.0) + (let ((t9-4 sp-launch-particles-var) + (a0-8 *sp-particle-system-2d*) + (a1-9 (-> *part-id-table* 622)) + (a2-3 *launch-matrix*) + ) + (set! (-> a2-3 trans quad) (-> s3-2 quad)) + (t9-4 a0-8 a1-9 a2-3 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) + ) + ) + (let ((s4-1 (new 'stack-no-clear 'matrix)) + (f26-0 (* 0.000020345053 f30-0)) + (f30-1 (-> *part-id-table* 623 init-specs 3 initial-valuef)) + (f28-1 (-> *part-id-table* 623 init-specs 5 initial-valuef)) + ) + (forward-up->inv-matrix s4-1 s5-1 *up-vector*) + (set! (-> s4-1 trans quad) (-> gp-0 quad)) + (set! (-> *part-id-table* 623 init-specs 3 initial-valuef) (* f26-0 f30-1)) + (set! (-> *part-id-table* 623 init-specs 5 initial-valuef) (* f26-0 f28-1)) + (sp-launch-particles-var + *sp-particle-system-2d* + (-> *part-id-table* 623) + s4-1 + (the-as sparticle-launch-state #f) + (the-as sparticle-launch-control #f) + 1.0 + ) + (set! (-> *part-id-table* 623 init-specs 3 initial-valuef) f30-1) + (set! (-> *part-id-table* 623 init-specs 5 initial-valuef) f28-1) + ) + ) + ) + ) + ) + 0 + (none) + ) + ) + +;; definition for function movie-nest-metalkor-shot-draw-impact +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defun movie-nest-metalkor-shot-draw-impact ((arg0 scene-player) (arg1 vector) (arg2 vector)) + (local-vars + (sv-240 (function vector entity-actor skeleton-group vector object none :behavior manipy)) + (sv-256 vector) + (sv-272 entity-actor) + ) + (let ((v0-0 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) arg2 arg1) 2048.0)) + (gp-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> gp-0 quad) (-> arg1 quad)) + (vector+! gp-0 gp-0 v0-0) + (let ((s4-0 (get-process *default-dead-pool* part-tracker #x4000))) + (when s4-0 + (let ((t9-2 (method-of-type part-tracker activate))) + (t9-2 + (the-as part-tracker s4-0) + *entity-pool* + (symbol->string (-> part-tracker symbol)) + (the-as pointer #x70004000) + ) + ) + (let ((t9-3 run-function-in-process) + (a0-7 s4-0) + (a1-6 part-tracker-init) + (a2-5 (-> *part-group-id-table* 141)) + (a3-1 0) + (t0-0 #f) + (t1-0 #f) + (t2-0 #f) + (t3-0 *launch-matrix*) + ) + (set! (-> t3-0 trans quad) (-> gp-0 quad)) + ((the-as (function object object object object object object object object none) t9-3) + a0-7 + a1-6 + a2-5 + a3-1 + t0-0 + t1-0 + t2-0 + t3-0 + ) + ) + (-> s4-0 ppointer) + ) + ) + ) + (let ((s4-1 (new 'stack-no-clear 'vector))) + (set! (-> s4-1 quad) (-> arg1 quad)) + (let ((gp-1 (new 'stack-no-clear 'quaternion))) + (let ((s3-0 (lambda :behavior scene-player + () + (set-vector! (-> self draw color-mult) 0.0 0.0 0.0 1.0) + (cond + ((>= 10.0 (ja-aframe-num 0)) + (let ((v0-1 (the-as vector (-> self draw color-emissive)))) + (set! (-> (the-as rgbaf v0-1) x) 1.0) + (set! (-> (the-as rgbaf v0-1) y) 1.0) + (set! (-> (the-as rgbaf v0-1) z) 1.0) + (set! (-> (the-as rgbaf v0-1) w) 1.0) + v0-1 + ) + ) + ((>= 20.0 (ja-aframe-num 0)) + (vector-lerp! + (-> self draw color-emissive) + (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + (new 'static 'vector :x 0.5 :z 0.5 :w 1.0) + (lerp-scale 0.0 1.0 (ja-aframe-num 0) 10.0 20.0) + ) + ) + (else + (vector-lerp! + (-> self draw color-emissive) + (new 'static 'vector :x 0.5 :z 0.5 :w 1.0) + (new 'static 'vector :w 1.0) + (lerp-scale 0.0 1.0 (ja-aframe-num 0) 20.0 30.0) + ) + ) + ) + ) + ) + ) + (let ((s2-0 (new 'stack-no-clear 'matrix))) + (vector-normalize-copy! (-> s2-0 vector 1) (vector-! (new 'stack-no-clear 'vector) arg2 arg1) -1.0) + (cond + ((and (< (fabs (-> s2-0 vector 1 y)) (fabs (-> s2-0 vector 1 x))) + (< (fabs (-> s2-0 vector 1 y)) (fabs (-> s2-0 vector 1 z))) + ) + (set-vector! (-> s2-0 vector 2) (-> s2-0 vector 1 z) 0.0 (- (-> s2-0 vector 1 x)) 1.0) + ) + ((< (fabs (-> s2-0 vector 1 z)) (fabs (-> s2-0 vector 1 x))) + (set-vector! (-> s2-0 vector 2) (-> s2-0 vector 1 y) (- (-> s2-0 vector 1 x)) 0.0 1.0) + ) + (else + (set-vector! (-> s2-0 vector 2) 0.0 (-> s2-0 vector 1 z) (- (-> s2-0 vector 1 y)) 0.0) + ) + ) + (vector-normalize! (-> s2-0 vector 2) 1.0) + (vector-cross! (the-as vector (-> s2-0 vector)) (-> s2-0 vector 1) (-> s2-0 vector 2)) + (matrix->quaternion gp-1 s2-0) + ) + (sound-play "nboss-shoot-hit") + (let* ((s1-2 (get-process *default-dead-pool* manipy #x4000)) + (s2-2 (when s1-2 + (let ((t9-10 (method-of-type manipy activate))) + (t9-10 (the-as manipy s1-2) arg0 (symbol->string (-> manipy symbol)) (the-as pointer #x70004000)) + ) + (let ((s2-3 run-function-in-process) + (s0-1 s1-2) + ) + (set! sv-240 manipy-init) + (set! sv-256 s4-1) + (set! sv-272 (-> arg0 entity)) + (let ((t0-2 (art-group-get-by-name *level* "skel-bomb-blast" (the-as (pointer uint32) #f))) + (t1-2 #f) + (t2-2 0) + ) + ((the-as (function object object object object object object object none) s2-3) + s0-1 + sv-240 + sv-256 + sv-272 + t0-2 + t1-2 + t2-2 + ) + ) + ) + (-> s1-2 ppointer) + ) + ) + ) + (when s2-2 + (send-event (ppointer->process s2-2) 'anim-mode 'play1) + (send-event (ppointer->process s2-2) 'anim "idle") + (set-vector! (-> (the-as process-drawable (-> s2-2 0)) root scale) 1.0 1.0 1.0 1.0) + (send-event (ppointer->process s2-2) 'trans-hook s3-0) + (send-event (ppointer->process s2-2) 'rot-quat gp-1) + ) + ) + ) + (let ((s3-1 (process-spawn + manipy + :init manipy-init + s4-1 + (-> arg0 entity) + (art-group-get-by-name *level* "skel-generic-blast" (the-as (pointer uint32) #f)) + #f + 0 + :to arg0 + ) + ) + ) + (when s3-1 + (send-event (ppointer->process s3-1) 'anim-mode 'play1) + (send-event (ppointer->process s3-1) 'anim "idle") + (set-vector! (-> (the-as process-drawable (-> s3-1 0)) root scale) 1.0 1.0 1.0 1.0) + (send-event (ppointer->process s3-1) 'rot-quat gp-1) + ) + ) + ) + ) + 0 + (none) + ) + +;; failed to figure out what this is: +(scene-method-16 + (new 'static 'scene + :name "nest-kor-boss-fight-intro-b" + :extra #f + :info #f + :mask-to-clear #x1282000 + :entity "scene-stage-91" + :art-group "scenecamera" + :anim "nest-kor-boss-fight-intro-b" + :parts 49 + :command-list '((0 + (kill "metalkor-1") + (kill "nest-break-precipice-1") + (kill "crate-942") + (kill "crate-943") + (kill "crate-944") + (kill "crate-945") + (kill "crate-946") + (kill "crate-947") + (kill "crate-948") + (kill "crate-949") + (setting-reset gem mode #t) + (setting-reset music mode 'danger4) + (send-event + "darkjak-highres" + 'trans-hook + ,(lambda :behavior scene-player () (set-darkjak-highres-nest-texture-morph! 0) (none)) + ) + (fadein (frame-time-30 5)) + (part-tracker + "group-nestb-precursor-stone-glow" + entity + "precursor-stone" + joint + "main" + track + #t + duration + (frame-range 0 2555) + ) + ) + (78 + (setting-reset gem mode #f) + (part-tracker + "group-nestb-force-field" + entity + "kid-highres" + joint + "main" + track + #t + duration + (frame-range 78 276) + ) + ) + (204 (setting-reset gem mode #t)) + (276 + (setting-reset gem mode #f) + (part-tracker + "group-nestb-force-field-upclose" + entity + "kid-highres" + joint + "main" + track + #t + duration + (frame-range 276 321) + ) + ) + (376 + (setting-reset gem mode #t) + (part-tracker + "group-nestb-force-field" + entity + "kid-highres" + joint + "main" + track + #t + duration + (frame-range 376 506) + ) + ) + (559 + (setting-reset gem mode #f) + (part-tracker + "group-nestb-force-field-upclose" + entity + "kid-highres" + joint + "main" + track + #t + duration + (frame-range 559 611) + ) + ) + (611 (setting-reset gem mode #t)) + (1223 + (part-tracker + "group-nestb-force-field-upclose-2" + entity + "kid-highres" + joint + "main" + track + #t + duration + (frame-range 1223 1417) + ) + ) + (2412 + (part-tracker + "group-nest-metalkor-shot-anticipate" + entity + "metalkor-highres" + joint + "head" + track + #t + duration + (frame-range 2412 2475) + ) + ) + (2475 + (send-event + "metalkor-highres" + 'trans-hook + ,(lambda :behavior scene-player + () + (let ((f30-0 (ja-aframe-num 0)) + (gp-0 (the-as target (command-get-process "metalkor-highres" *target*))) + (v1-0 (the-as target (command-get-process "nest-break-precipice" *target*))) + ) + (when (and gp-0 v1-0) + (let ((gp-1 (-> gp-0 node-list data 6 bone transform trans)) + (s5-0 (-> v1-0 node-list data 9 bone transform trans)) + ) + (if (and (>= f30-0 2475.0) (< f30-0 2476.0)) + (movie-nest-metalkor-shot-draw-fire gp-1 s5-0) + ) + (if (and (>= f30-0 2476.0) (< f30-0 2499.0)) + (movie-nest-metalkor-shot-draw-moving gp-1 s5-0 f30-0) + ) + ) + ) + ) + (none) + ) + ) + ) + (2499 + (part-tracker + "group-target-hit" + entity + "darkjak-highres" + joint + "Lball" + track + #f + duration + (frame-range 2499 2514) + ) + (send-event + "nest-break-precipice" + 'eval + ,(lambda :behavior scene-player + () + (ja-aframe-num 0) + (let ((gp-0 (the-as target (command-get-process "metalkor-highres" *target*))) + (v1-0 (the-as target (command-get-process "nest-break-precipice" *target*))) + ) + (when (and gp-0 v1-0) + (let ((a2-0 (-> gp-0 node-list data 6 bone transform trans)) + (a1-2 (-> v1-0 node-list data 9 bone transform trans)) + ) + (movie-nest-metalkor-shot-draw-impact self a1-2 a2-0) + ) + ) + ) + (none) + ) + ) + ) + (2500 + (part-tracker + "group-nest-break-precipice-explosion" + entity + "nest-break-precipice" + joint + "ah" + track + #t + duration + (frame-range 2500 2502) + ) + (part-tracker + "group-nest-break-precipice-trailer" + entity + "nest-break-precipice" + joint + "bf" + track + #t + duration + (frame-range 2500 2512) + ) + (part-tracker + "group-nest-break-precipice-trailer" + entity + "nest-break-precipice" + joint + "bg" + track + #t + duration + (frame-range 2500 2512) + ) + (part-tracker + "group-nest-break-precipice-trailer" + entity + "nest-break-precipice" + joint + "d" + track + #t + duration + (frame-range 2500 2512) + ) + (part-tracker + "group-nest-break-precipice-trailer" + entity + "nest-break-precipice" + joint + "t" + track + #t + duration + (frame-range 2500 2512) + ) + (part-tracker + "group-nest-break-precipice-trailer" + entity + "nest-break-precipice" + joint + "bi" + track + #t + duration + (frame-range 2500 2512) + ) + (part-tracker + "group-nest-break-precipice-trailer" + entity + "nest-break-precipice" + joint + "u" + track + #t + duration + (frame-range 2500 2512) + ) + ) + (2502 + (part-tracker + "group-nest-break-precipice-trailer" + entity + "nest-break-precipice" + joint + "c" + track + #t + duration + (frame-range 2502 2512) + ) + (part-tracker + "group-nest-break-precipice-trailer" + entity + "nest-break-precipice" + joint + "v" + track + #t + duration + (frame-range 2502 2512) + ) + (part-tracker + "group-nest-break-precipice-trailer" + entity + "nest-break-precipice" + joint + "i" + track + #t + duration + (frame-range 2502 2512) + ) + (part-tracker + "group-nest-break-precipice-trailer" + entity + "nest-break-precipice" + joint + "al" + track + #t + duration + (frame-range 2502 2512) + ) + (part-tracker + "group-nest-break-precipice-trailer" + entity + "nest-break-precipice" + joint + "e" + track + #t + duration + (frame-range 2502 2512) + ) + (part-tracker + "group-nest-break-precipice-trailer" + entity + "nest-break-precipice" + joint + "f" + track + #t + duration + (frame-range 2502 2512) + ) + ) + (2503 + (part-tracker + "group-nest-break-precipice-trailer" + entity + "nest-break-precipice" + joint + "an" + track + #t + duration + (frame-range 2503 2512) + ) + (part-tracker + "group-nest-break-precipice-trailer" + entity + "nest-break-precipice" + joint + "ax" + track + #t + duration + (frame-range 2503 2512) + ) + ) + (2502 + (part-tracker + "group-nest-break-precipice-trailer" + entity + "nest-break-precipice" + joint + "r" + track + #t + duration + (frame-range 2502 2511) + ) + (part-tracker + "group-nest-break-precipice-trailer" + entity + "nest-break-precipice" + joint + "bd" + track + #t + duration + (frame-range 2502 2511) + ) + (part-tracker + "group-nest-break-precipice-trailer" + entity + "nest-break-precipice" + joint + "bm" + track + #t + duration + (frame-range 2502 2511) + ) + (part-tracker + "group-nest-break-precipice-trailer" + entity + "nest-break-precipice" + joint + "p" + track + #t + duration + (frame-range 2502 2511) + ) + (part-tracker + "group-nest-break-precipice-trailer" + entity + "nest-break-precipice" + joint + "bb" + track + #t + duration + (frame-range 2502 2511) + ) + (part-tracker + "group-nest-break-precipice-trailer" + entity + "nest-break-precipice" + joint + "f" + track + #t + duration + (frame-range 2502 2511) + ) + (part-tracker + "group-nest-break-precipice-trailer" + entity + "nest-break-precipice" + joint + "bo" + track + #t + duration + (frame-range 2502 2511) + ) + ) + (2507 + (part-tracker + "group-nest-break-precipice-trailer" + entity + "nest-break-precipice" + joint + "bn" + track + #t + duration + (frame-range 2507 2514) + ) + (part-tracker + "group-nest-break-precipice-trailer" + entity + "nest-break-precipice" + joint + "ac" + track + #t + duration + (frame-range 2507 2514) + ) + ) + (2532 + (part-tracker + "group-nest-break-precipice-trailer" + entity + "nest-break-precipice" + joint + "bf" + track + #t + duration + (frame-range 2532 2542) + ) + (part-tracker + "group-nest-break-precipice-trailer" + entity + "nest-break-precipice" + joint + "aj" + track + #t + duration + (frame-range 2532 2542) + ) + ) + (2530 + (part-tracker + "group-nest-break-precipice-billow" + entity + "nest-break-precipice" + joint + "bk" + track + #t + duration + (frame-range 2530 2570) + ) + ) + (2635 (setting-reset gem mode #t)) + (2700 + (send-event + "darkjak-highres" + 'trans-hook + ,(lambda :behavior scene-player + () + (let ((f30-0 (ja-aframe-num 0))) + (when (and (< 2715.0 f30-0) (< f30-0 2800.0)) + (if (zero? (rand-vu-int-count 4)) + (process-drawable-shock-effect + self + (-> *lightning-spec-id-table* 8) + lightning-probe-callback + (-> *part-id-table* 179) + 0 + 0 + 40960.0 + ) + ) + ) + (if (>= f30-0 2700.0) + (set-darkjak-highres-nest-texture-morph! #x3f800000) + (set-darkjak-highres-nest-texture-morph! 0) + ) + ) + (none) + ) + ) + ) + (10000 + (task-close! "nest-boss-introduction") + (apply ,(lambda :behavior scene-player () (set-darkjak-highres-nest-texture-morph! 0) (none))) + (setting-pers music mode 'danger4 time (seconds 5)) + ) + ) + :cut-list '(78 + 143 + 204 + 276 + 321 + 376 + 506 + 559 + 611 + 633 + 692 + 824 + 861 + 969 + 1084 + 1139 + 1223 + 1417 + 1531 + 1588 + 1660 + 2075 + 2255 + 2350 + 2412 + 2489 + 2510 + 2555 + 2612 + 2671 + 2814 + ) + :wait-ground-time (seconds 1) + :draw-target #f + :abort #t + :actor (new 'static 'boxed-array :type scene-actor + (new 'static 'scene-actor + :name "scenecamera" + :level #f + :art-group "skel-scenecamera" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :camera 4 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "sidekick-highres" + :level 'nestb + :art-group "skel-sidekick-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "darkjak-highres" + :level 'nestb + :art-group "skel-darkjak-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "metalkor-highres" + :level 'nestb + :art-group "skel-metalkor-highres" + :prefix "" + :draw-frames '((min 2671) (2800 max)) + :scissor-frames '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "metalkor-highres-lowtorso" + :level 'nestb + :art-group "skel-metalkor-highres-lowtorso" + :prefix "lowtorso-" + :draw-frames '((min 2671) (2800 max)) + :scissor-frames '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "metalkor-highres-legs" + :level 'nestb + :art-group "skel-metalkor-highres-legs" + :prefix "legs-" + :draw-frames '((min 2671) (2800 max)) + :scissor-frames '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "metalkor-highres-wings" + :level 'nestb + :art-group "skel-metalkor-highres-wings" + :prefix "wings-" + :draw-frames '((min 2671) (2800 max)) + :scissor-frames '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "metalkor-fma-spinner" + :level 'nestb + :art-group "skel-metalkor-fma-spinner" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "metalkor-fma-spinner" + :level 'nestb + :art-group "skel-metalkor-fma-spinner" + :prefix "b-" + :draw-frames '((min max)) + :scissor-frames '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "metalkor-fma-spinner" + :level 'nestb + :art-group "skel-metalkor-fma-spinner" + :prefix "c-" + :draw-frames '((min max)) + :scissor-frames '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "metalkor-fma-spinner" + :level 'nestb + :art-group "skel-metalkor-fma-spinner" + :prefix "d-" + :draw-frames '((min max)) + :scissor-frames '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "metalkor-fma-spinner" + :level 'nestb + :art-group "skel-metalkor-fma-spinner" + :prefix "e-" + :draw-frames '((min max)) + :scissor-frames '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "metalkor-fma-spinner" + :level 'nestb + :art-group "skel-metalkor-fma-spinner" + :prefix "f-" + :draw-frames '((min max)) + :scissor-frames '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "metalkor-fma-spinner" + :level 'nestb + :art-group "skel-metalkor-fma-spinner" + :prefix "g-" + :draw-frames '((min max)) + :scissor-frames '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "metalkor-fma-spinner" + :level 'nestb + :art-group "skel-metalkor-fma-spinner" + :prefix "h-" + :draw-frames '((min max)) + :scissor-frames '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "kid-highres" + :level 'nestb + :art-group "skel-kid-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "nest-break-precipice" + :level 'nestb + :art-group "skel-nest-break-precipice" + :prefix "" + :draw-frames '((min (new 'static 'bfloat :data 558.99)) (1660 (new 'static 'bfloat :data 2074.99)) (2474 2611) (2671 2814)) + :scissor-frames '() + :light-index #x11 + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "precursor-stone" + :level 'nestb + :art-group "skel-precursor-stone" + :prefix "" + :draw-frames '((min 2671)) + :scissor-frames '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "particleman" + :level 'nestb + :art-group "skel-particleman" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-flags -1 + :shadow-volume-joint #f + ) + ) + :load-point-obj "nestb-boss" + :end-point-obj "nestb-boss-pit" + :borrow '() + :sfx-volume -1.0 + :ambient-volume -1.0 + :music-volume -1.0 + :blackout-end #t + :peaceful #t + :save #t + ) + ) + +;; failed to figure out what this is: +(scene-method-16 + (new 'static 'scene + :name "nest-kor-boss-fight-mid" + :extra #f + :info #f + :mask-to-clear #x1282000 + :entity "scene-stage-91" + :art-group "scenecamera" + :anim "nest-kor-boss-fight-mid" + :parts 2 + :command-list '((0 + (kill "metalkor-1") + (kill "crate-942") + (kill "crate-943") + (kill "crate-944") + (kill "crate-945") + (kill "crate-946") + (kill "crate-947") + (kill "crate-948") + (kill "crate-949") + (setting-reset music mode 'danger4) + (setting-reset gem mode #t) + (send-event + "darkjak-highres" + 'trans-hook + ,(lambda :behavior scene-player () (set-darkjak-highres-nest-texture-morph! 0) (none)) + ) + ) + (10000 (setting-pers music mode 'danger4 time (seconds 5))) + ) + :cut-list '(82) + :wait-ground-time (seconds 1) + :draw-target #f + :abort #t + :actor (new 'static 'boxed-array :type scene-actor + (new 'static 'scene-actor + :name "scenecamera" + :level #f + :art-group "skel-scenecamera" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :camera 4 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "sidekick-highres" + :level 'nestb + :art-group "skel-sidekick-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "darkjak-highres" + :level 'nestb + :art-group "skel-darkjak-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "metalkor-highres" + :level 'nestb + :art-group "skel-metalkor-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "metalkor-highres-lowtorso" + :level 'nestb + :art-group "skel-metalkor-highres-lowtorso" + :prefix "lowtorso-" + :draw-frames '((min max)) + :scissor-frames '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "metalkor-highres-legs" + :level 'nestb + :art-group "skel-metalkor-highres-legs" + :prefix "legs-" + :draw-frames '((min max)) + :scissor-frames '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "metalkor-highres-wings" + :level 'nestb + :art-group "skel-metalkor-highres-wings" + :prefix "wings-" + :draw-frames '((min max)) + :scissor-frames '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "metalkor-fma-spinner" + :level 'nestb + :art-group "skel-metalkor-fma-spinner" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "metalkor-fma-spinner" + :level 'nestb + :art-group "skel-metalkor-fma-spinner" + :prefix "b-" + :draw-frames '((min max)) + :scissor-frames '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "metalkor-fma-spinner" + :level 'nestb + :art-group "skel-metalkor-fma-spinner" + :prefix "c-" + :draw-frames '((min max)) + :scissor-frames '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "metalkor-fma-spinner" + :level 'nestb + :art-group "skel-metalkor-fma-spinner" + :prefix "d-" + :draw-frames '((min max)) + :scissor-frames '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "metalkor-fma-spinner" + :level 'nestb + :art-group "skel-metalkor-fma-spinner" + :prefix "e-" + :draw-frames '((min max)) + :scissor-frames '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "metalkor-fma-spinner" + :level 'nestb + :art-group "skel-metalkor-fma-spinner" + :prefix "f-" + :draw-frames '((min max)) + :scissor-frames '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "metalkor-fma-spinner" + :level 'nestb + :art-group "skel-metalkor-fma-spinner" + :prefix "g-" + :draw-frames '((min max)) + :scissor-frames '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "metalkor-fma-spinner" + :level 'nestb + :art-group "skel-metalkor-fma-spinner" + :prefix "h-" + :draw-frames '((min max)) + :scissor-frames '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + ) + :load-point-obj "nestb-boss-pit" + :end-point-obj #f + :borrow '() + :sfx-volume -1.0 + :ambient-volume -1.0 + :music-volume -1.0 + :blackout-end #t + :peaceful #t + :save #t + ) + ) + +;; definition of type nest-gun-parts +(deftype nest-gun-parts (process-drawable) + () + :heap-base #x50 + :method-count-assert 21 + :size-assert #xc8 + :flag-assert #x15005000c8 + (:methods + (idle () _type_ :state 20) + ) + ) + +;; definition for method 3 of type nest-gun-parts +(defmethod inspect nest-gun-parts ((obj nest-gun-parts)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 obj) + ) + (label cfg-4) + obj + ) + +;; failed to figure out what this is: +(defskelgroup skel-nest-gun-parts nest-gun-parts 0 2 + ((1 (meters 999999))) + :bounds (static-spherem 0 0 25 40) + :origin-joint-index 3 + ) + +;; failed to figure out what this is: +(defstate idle (nest-gun-parts) + :virtual #t + :code (behavior () + (until #f + (ja-no-eval :group! (ja-group) + :num! (seek! (the float (+ (-> (ja-group) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + #f + (none) + ) + :post (the-as (function none :behavior nest-gun-parts) ja-post) + ) + +;; definition for method 11 of type nest-gun-parts +;; WARN: Return type mismatch object vs none. +(defmethod init-from-entity! nest-gun-parts ((obj nest-gun-parts) (arg0 entity-actor)) + (set! (-> obj root) (new 'process 'trsqv)) + (process-drawable-from-entity! obj arg0) + (initialize-skeleton + obj + (the-as skeleton-group (art-group-get-by-name *level* "skel-nest-gun-parts" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (set! (-> obj draw light-index) (the-as uint 11)) + (go (method-of-object obj idle)) + (none) + ) + +;; definition of type nest-unbroken-rocks +(deftype nest-unbroken-rocks (process-drawable) + () + :heap-base #x50 + :method-count-assert 21 + :size-assert #xc8 + :flag-assert #x15005000c8 + (:methods + (idle () _type_ :state 20) + ) + ) + +;; definition for method 3 of type nest-unbroken-rocks +(defmethod inspect nest-unbroken-rocks ((obj nest-unbroken-rocks)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 obj) + ) + (label cfg-4) + obj + ) + +;; failed to figure out what this is: +(defskelgroup skel-nest-unbroken-rocks nest-unbroken-rocks 0 2 + ((1 (meters 999999))) + :bounds (static-spherem 75 0 -75 55) + :origin-joint-index 3 + ) + +;; failed to figure out what this is: +(defstate idle (nest-unbroken-rocks) + :virtual #t + :code (behavior () + (until #f + (ja-no-eval :group! (ja-group) + :num! (seek! (the float (+ (-> (ja-group) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + #f + (none) + ) + :post (the-as (function none :behavior nest-unbroken-rocks) ja-post) + ) + +;; definition for method 11 of type nest-unbroken-rocks +(defmethod init-from-entity! nest-unbroken-rocks ((obj nest-unbroken-rocks) (arg0 entity-actor)) + (set! (-> obj root) (new 'process 'trsqv)) + (process-drawable-from-entity! obj arg0) + (initialize-skeleton + obj + (the-as + skeleton-group + (art-group-get-by-name *level* "skel-nest-unbroken-rocks" (the-as (pointer uint32) #f)) + ) + (the-as pair 0) + ) + (set! (-> obj draw light-index) (the-as uint 1)) + (if (task-node-closed? (game-task-node nest-get-to-gun-resolution)) + (cleanup-for-death obj) + (go (method-of-object obj idle)) + ) + (none) + ) + +;; definition for function nestb-login +;; WARN: Return type mismatch int vs none. +(defun nestb-login () + (set! *nav-network* (new 'loading-level 'nav-network)) + (nav-network-method-9 *nav-network*) + 0 + (none) + ) + +;; definition for function nestb-deactivate +;; WARN: Return type mismatch int vs none. +(defun nestb-deactivate () + (if (not (level-get *level* 'nest)) + (set-time-for-random-weather! *mood-control* 0.0 0.0) + ) + (set! *nav-network* (the-as nav-network 0)) + 0 + (none) + ) + +;; definition for function nestb-activate +;; WARN: Return type mismatch int vs none. +(defun nestb-activate ((arg0 level)) + (nav-network-method-10 *nav-network* arg0 *nestb-adjacency*) + 0 + (none) + ) + + + + diff --git a/test/offline/config/jak2/config.jsonc b/test/offline/config/jak2/config.jsonc index 5380ef6c94..980f4015f4 100644 --- a/test/offline/config/jak2/config.jsonc +++ b/test/offline/config/jak2/config.jsonc @@ -258,7 +258,11 @@ "target-board-handler", // very strange control flow "(method 11 memory-usage-block)", "vis-cull", "vis-cull-debug", "dma-add-process-drawable", "foreground-engine-execute", - "test-closest-pt-in-triangle", "on" + "test-closest-pt-in-triangle", "on", + "(method 42 nav-mesh)", + "(method 43 nav-mesh)", + "(method 34 nav-mesh)", + "(method 18 nav-control)" ], "skip_compile_states": {