Refactor Bezier splines drawing and editing to property evaluate value and match curve evaluation

#3051
This commit is contained in:
Wojtek Figat
2024-12-02 19:10:28 +01:00
parent 0a4a431f74
commit 57628c3d5f
12 changed files with 129 additions and 93 deletions

View File

@@ -214,9 +214,9 @@ void SplineCollider::GetGeometry(CollisionShape& collision)
auto offsetIndices = segment * collisionIndices.Count();
const auto& start = keyframes[segment];
const auto& end = keyframes[segment + 1];
const float length = end.Time - start.Time;
AnimationUtils::GetTangent(start.Value, start.TangentOut, length, leftTangent);
AnimationUtils::GetTangent(end.Value, end.TangentIn, length, rightTangent);
const float tangentScale = (end.Time - start.Time) / 3.0f;
AnimationUtils::GetTangent(start.Value, start.TangentOut, tangentScale, leftTangent);
AnimationUtils::GetTangent(end.Value, end.TangentIn, tangentScale, rightTangent);
// Vertex buffer is deformed along the spline
auto srcVertices = collisionVertices.Get();