本文整理汇总了C#中Curve.CalculateValueByTime方法的典型用法代码示例。如果您正苦于以下问题:C# Curve.CalculateValueByTime方法的具体用法?C# Curve.CalculateValueByTime怎么用?C# Curve.CalculateValueByTime使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Curve
的用法示例。
在下文中一共展示了Curve.CalculateValueByTime方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GenerateTrianglesFromCurve
public static GuiRenderer.TriangleVertex[] GenerateTrianglesFromCurve(GuiRenderer renderer, Curve curve, float step, Vec2 thickness, ColorValue color)
{
float maxTime = curve.Times[curve.Times.Count - 1];
float end = maxTime + step;
List<Vec2> points = new List<Vec2>();
for (float time = 0; time < end; time += step)
{
points.Add(curve.CalculateValueByTime(time).ToVec2());
}
#if DebugDraw
Vec2 xHalf = new Vec2(thickness.X / 16, 0f);
Vec2 yHalf = new Vec2(0f, thickness.Y / 16);
float g = 1f;
// The green progression here is so we can tell which
// direction the curve was heading.
foreach (Vec2 point in points)
{
renderer.AddQuad(new Rect(point - xHalf, point + yHalf), new ColorValue(1f, g, 0f));
g -= 0.05f;
}
#endif
return GenerateTriangles(points, thickness, color);
}