Hi there! Is there an efficient way to translate SplinePath?
At the moment I have to create a new function inside SplinePath for this.
void SplinePath::TranslatePath(const Vector3 &v)
{
for (unsigned i = 0; i < controlPoints_.Size(); ++i)
{
Vector3 pos = controlPoints_[i]->GetWorldPosition() + v;
controlPoints_[i]->SetWorldPosition(pos);
}
}
Why don’t we make controlpoints the child of the node where this component is added to.
This way we just need to move the parent node and everything moves with it.
Also, I have tested translate 50 ControlPoints of the SplinePath and I found that it is very slow to update. In my test I can translate 5000 none spline controlpoint nodes faster than that of 50 ControlPoints in the SplinePath.
regards