Archive 17/01/2023.

Example with SplinePath

capelenglish

Can anyone point me to an example that uses the SplinePath component? I’m trying to get one to work, but having trouble including this component in my code. I’ve included SplinePath.h and SplinePath.cpp in my main directory, but it crashes when I try to move.

splinePath->Move(eventData[P_TIMESTEP].GetFloat());

jmiller

Hi,

While SplinePath is not demonstrated in Urho samples, there are a few informative posts on SplinePath like How to use Logic: SplinePath?

HTH

capelenglish

Thanks for the reply jmiller. I read many of these posts before I asked the question. Maybe I’m missing something more basic, like how to include components. What I’ve done is include SplinePath.h in my main.cpp file.

When I go to compile main.cpp it can’t find SplinePath.h. So I copied SplinePath.h and .cpp to my main directory from the Scene directory in Urho3D source code. Now it will compile, but when I call Move in my HandleUpdate function, I get a seg fault.

jmiller

This include directive should work:
#include <Urho3D/Scene/SplinePath.h>

To see the specific error might need more information or code.

Perhaps SplinePath::Move() might fail if passed a bad node pointer in SplinePath::SetControlledNode(Node* controlled), but this is only a guess.

Running your program in a debugger should expose more detailed information about the crash… unless it’s a Heisenbug. :bug: :slight_smile:

And just found: our very own @sirop has a SplinePath repo. :slight_smile: https://github.com/sirop/Urho3d_SplinePath

capelenglish

Thank you! I think I’ve figured out my problem…

dertom

Thank you! I think I’ve figured out my problem…

So, what was it, @capelenglish ? I personally ‘do like’ posts with an dead end like this, especially when you have the same problem…(I hope you heard the irony)

capelenglish

Sorry, didn’t mean to leave anyone hanging…

jmiller pointed me to an example, which was my original question. My problem was that I was passing a bad node pointer when setting the controlled node. After reviewing the sample code I was able to determine where my problem was.

BTW, I don’t see where or how to mark the issue resolved. How do I do that?

jmiller

Glad you got it sorted.

The ‘mark solution’ button is revealed with the ellipsis ‘...’ button by ‘Reply’.