Hey all. I think I found a bug with the Catmull-Rom algorithm used in FastMath. I’ll post some code tonight to illustrate the issue but I think just me explaining what’s going on should be easy enough to understand.
I have 4 vectors that link together in a straight line along the Z axis beginning at 1,1,0 and increasing the Z position by 1 unit, like so:
I apply Catmull-Rom to the entire thing going long the plotted curve between B and C increasing the U value by 0.1f each time. This should create a point at B and then 10 others with the last one on C.
And that’s where the bug is.
The last point ends up back at the origin of the scene 0,0,0 not at the end of the curve at C.
Edit: Essentially what the issue is is that while u=0 returns the B vector a u=1 doesn’t return the C vector but one at 0,0,0.
Ok. I know I have nothing NEW to add to this one but Holy smokes I’m having a mentally off day on this one.
I have a check in my code for null vertices being created (this is only for testing stuff).
But instead of putting it all around the entire chunk of code that’d render a sphere on at that vertice (or lack thereof) I only put it around the part that moves it to the location of the vertice. So ya. I was busy rendering spheres onto at 0,0,0 because there was no vertice to move it.