Example with SplinePath

#1

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());

2 Likes
#2

Hi,

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

HTH

#3

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.

#4

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

#5

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

1 Like
#6

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)

#7

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?

#8

Glad you got it sorted.

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