SomeRanDev / Godot-Trail3D

A native Godot addon that adds a Trail3D node to Godot.
MIT License
3 stars 1 forks source link

General question #3

Closed sweden-moose closed 3 months ago

sweden-moose commented 3 months ago

Hi, i'm using v4.2.2.stable, can't make this addon to work, game window just crashing when i'm adding node with Trail3D. I'm not familiar with .gdextension, but i think there must be some kind of exception handlers implemented by yourself, otherwise it will just crash without throwing any exception in debugger. And i don't know what is causing it, maybe i'm doing something wrong. So, it will be cool to have detailed instruction how to add this node to scene correctly, what properties it must have to work. Thanks in advance!

SomeRanDev commented 3 months ago

Oh, sorry for the trouble! If you run the Godot editor executable that opens a separate console window, does that window say anything when you crash? That's the only place Rust error messages will appear unfortunately.

I tried having all potential error messages appear normally in Godot, but I guess I missed a hidden Rust error somewhere..

sweden-moose commented 3 months ago
thread '<unnamed>' panicked at /home/skufidon/.cargo/git/checkouts/gdext-76630c89719e160c/7eec09c/godot-core/src/builtin/vectors/vector3.rs:49:1:
assertion `left != right` failed: normalized() called on zero vector
  left: Vector3 { x: 0.0, y: 0.0, z: 0.0 }
 right: Vector3 { x: 0.0, y: 0.0, z: 0.0 }
stack backtrace:
   0: rust_begin_unwind
             at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/std/src/panicking.rs:645:5
   1: core::panicking::panic_fmt
             at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/core/src/panicking.rs:72:14
   2: core::panicking::assert_failed_inner
             at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/core/src/panicking.rs:338:23
   3: core::panicking::assert_failed
             at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/core/src/panicking.rs:298:5
   4: godot_core::builtin::vectors::vector3::Vector3::normalized
             at /home/skufidon/.cargo/git/checkouts/gdext-76630c89719e160c/7eec09c/godot-core/src/builtin/vectors/vector_macros.rs:585:17
   5: godot_trail_3d::trail_3d::Trail3D::prepare_geometry
             at /home/skufidon/Documents/godot-projects/Godot-Trail3D-main/src/trail_3d.rs:168:27
   6: godot_trail_3d::trail_3d::Trail3D::render_geometry
             at /home/skufidon/Documents/godot-projects/Godot-Trail3D-main/src/trail_3d.rs:268:19
   7: godot_trail_3d::trail_3d::Trail3D::render_realtime
             at /home/skufidon/Documents/godot-projects/Godot-Trail3D-main/src/trail_3d.rs:208:3
   8: godot_trail_3d::trail_3d::Trail3D::update_emit
             at /home/skufidon/Documents/godot-projects/Godot-Trail3D-main/src/trail_3d.rs:442:3
   9: <godot_trail_3d::trail_3d::Trail3D as godot_core::gen::classes::mesh_instance_3d::re_export::IMeshInstance3D>::process
             at /home/skufidon/Documents/godot-projects/Godot-Trail3D-main/src/trail_3d.rs:546:7
  10: <godot_trail_3d::trail_3d::Trail3D as godot_core::obj::traits::cap::ImplementsGodotVirtual>::__virtual_call::virtual_fn::{{closure}}
             at /home/skufidon/Documents/godot-projects/Godot-Trail3D-main/src/trail_3d.rs:492:1
  11: core::ops::function::FnOnce::call_once
             at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/core/src/ops/function.rs:250:5
  12: <(R,P0) as godot_core::meta::signature::PtrcallSignatureTuple>::in_ptrcall
             at /home/skufidon/.cargo/git/checkouts/gdext-76630c89719e160c/7eec09c/godot-core/src/meta/signature.rs:369:38
  13: <godot_trail_3d::trail_3d::Trail3D as godot_core::obj::traits::cap::ImplementsGodotVirtual>::__virtual_call::virtual_fn
             at /home/skufidon/Documents/godot-projects/Godot-Trail3D-main/src/trail_3d.rs:492:1
  14: <unknown>
  15: <unknown>
  16: <unknown>
  17: <unknown>
  18: <unknown>
  19: <unknown>
  20: <unknown>
  21: <unknown>
  22: __libc_start_call_main
             at ./csu/../sysdeps/nptl/libc_start_call_main.h:58:16
  23: __libc_start_main_impl
             at ./csu/../csu/libc-start.c:392:3
  24: <unknown>

I dont think that can help you, maybe it's just linux issues.

SomeRanDev commented 3 months ago

Don't worry, this is definitely not a Linux issue, this is an issue with my code! I'll fix asap!

SomeRanDev commented 3 months ago

Wow, a week ago, right after I posted this library, gdext did a big refactor with Vector3 which made it crash when normalizing a ZERO vector. So that explains that.

I have updated the repo to use a version of gdext that I created this project with. Could you can re-download this repo and try again?

I'll update the code to work with the latest commit of gdext once I have more free time.

SomeRanDev commented 3 months ago

(Just realized I pushed the wrong commit with the fix. It should work now for certain.)

ZetaDaemon commented 3 months ago

Can report this update has now also fixed the crash issue I was having, thankyou!!

sweden-moose commented 3 months ago

Just tested, now everything works just like intended. Thanks!