View Source Exray.Shapes.Spline (Exray v0.6.0)

Like lines, but curve and stuff based on control points

Summary

Functions

Draw spline: B-Spline, minimum 4 points

Draw spline: Cubic Bezier, minimum 4 points (2 control points): [p1, c2, c3, p4, c5, c6...]

Draw spline: Quadratic Bezier, minimum 3 points (1 control point): [p1, c2, p3, c4...]

Draw spline: Catmull-Rom, minimum 4 points

Draw spline: Linear, minimum 2 points

Draw spline segment: B-Spline, 4 points

Draw spline segment: Cubic Bezier, 2 points, 2 control points

Draw spline segment: Quadratic Bezier, 2 points, 1 control point

Draw spline segment: Catmull-Rom, 4 points

Draw spline segment: Linear, 2 points

Get (evaluate) spline point: B-Spline

Get (evaluate) spline point: Cubic Bezier

Get (evaluate) spline point: Quadratic Bezier

Get (evaluate) spline point: Catmull-Rom

Get (evaluate) spline point: Linear

Functions

Link to this function

draw_spline_basis(points, thick, color)

View Source
@spec draw_spline_basis(
  points :: [Exray.Structs.Vector2.t()],
  thick :: float(),
  color :: Exray.Structs.Color.t()
) :: :ok

Draw spline: B-Spline, minimum 4 points

Link to this function

draw_spline_bezier_cubic(points, thick, color)

View Source
@spec draw_spline_bezier_cubic(
  points :: [Exray.Structs.Vector2.t()],
  thick :: float(),
  color :: Exray.Structs.Color.t()
) :: :ok

Draw spline: Cubic Bezier, minimum 4 points (2 control points): [p1, c2, c3, p4, c5, c6...]

Link to this function

draw_spline_bezier_quadratic(points, thick, color)

View Source
@spec draw_spline_bezier_quadratic(
  points :: [Exray.Structs.Vector2.t()],
  thick :: float(),
  color :: Exray.Structs.Color.t()
) :: :ok

Draw spline: Quadratic Bezier, minimum 3 points (1 control point): [p1, c2, p3, c4...]

Link to this function

draw_spline_catmull_rom(points, thick, color)

View Source
@spec draw_spline_catmull_rom(
  points :: [Exray.Structs.Vector2.t()],
  thick :: float(),
  color :: Exray.Structs.Color.t()
) :: :ok

Draw spline: Catmull-Rom, minimum 4 points

Link to this function

draw_spline_linear(points, thick, color)

View Source
@spec draw_spline_linear(
  points :: [Exray.Structs.Vector2.t()],
  thick :: float(),
  color :: Exray.Structs.Color.t()
) :: :ok

Draw spline: Linear, minimum 2 points

Link to this function

draw_spline_segment_basis(p1, p2, p3, p4, thick, color)

View Source
@spec draw_spline_segment_basis(
  p1 :: Exray.Structs.Vector2.t(),
  p2 :: Exray.Structs.Vector2.t(),
  p3 :: Exray.Structs.Vector2.t(),
  p4 :: Exray.Structs.Vector2.t(),
  thick :: float(),
  color :: Exray.Structs.Color.t()
) :: :ok

Draw spline segment: B-Spline, 4 points

Link to this function

draw_spline_segment_bezier_cubic(p1, c2, c3, p4, thick, color)

View Source
@spec draw_spline_segment_bezier_cubic(
  p1 :: Exray.Structs.Vector2.t(),
  c2 :: Exray.Structs.Vector2.t(),
  c3 :: Exray.Structs.Vector2.t(),
  p4 :: Exray.Structs.Vector2.t(),
  thick :: float(),
  color :: Exray.Structs.Color.t()
) :: :ok

Draw spline segment: Cubic Bezier, 2 points, 2 control points

Link to this function

draw_spline_segment_bezier_quadratic(p1, c2, p3, thick, color)

View Source
@spec draw_spline_segment_bezier_quadratic(
  p1 :: Exray.Structs.Vector2.t(),
  c2 :: Exray.Structs.Vector2.t(),
  p3 :: Exray.Structs.Vector2.t(),
  thick :: float(),
  color :: Exray.Structs.Color.t()
) :: :ok

Draw spline segment: Quadratic Bezier, 2 points, 1 control point

Link to this function

draw_spline_segment_catmull_rom(p1, p2, p3, p4, thick, color)

View Source
@spec draw_spline_segment_catmull_rom(
  p1 :: Exray.Structs.Vector2.t(),
  p2 :: Exray.Structs.Vector2.t(),
  p3 :: Exray.Structs.Vector2.t(),
  p4 :: Exray.Structs.Vector2.t(),
  thick :: float(),
  color :: Exray.Structs.Color.t()
) :: :ok

Draw spline segment: Catmull-Rom, 4 points

Link to this function

draw_spline_segment_linear(p1, p2, thick, color)

View Source
@spec draw_spline_segment_linear(
  p1 :: Exray.Structs.Vector2.t(),
  p2 :: Exray.Structs.Vector2.t(),
  thick :: float(),
  color :: Exray.Structs.Color.t()
) :: :ok

Draw spline segment: Linear, 2 points

Link to this function

get_spline_point_basis(p1, p2, p3, p4, t)

View Source
@spec get_spline_point_basis(
  p1 :: Exray.Structs.Vector2.t(),
  p2 :: Exray.Structs.Vector2.t(),
  p3 :: Exray.Structs.Vector2.t(),
  p4 :: Exray.Structs.Vector2.t(),
  t :: float()
) :: point :: Exray.Structs.Vector2.t()

Get (evaluate) spline point: B-Spline

Link to this function

get_spline_point_bezier_cubic(p1, c2, c3, p4, t)

View Source
@spec get_spline_point_bezier_cubic(
  p1 :: Exray.Structs.Vector2.t(),
  c2 :: Exray.Structs.Vector2.t(),
  c3 :: Exray.Structs.Vector2.t(),
  p4 :: Exray.Structs.Vector2.t(),
  t :: float()
) :: point :: Exray.Structs.Vector2.t()

Get (evaluate) spline point: Cubic Bezier

Link to this function

get_spline_point_bezier_quad(p1, c2, p3, t)

View Source
@spec get_spline_point_bezier_quad(
  p1 :: Exray.Structs.Vector2.t(),
  c2 :: Exray.Structs.Vector2.t(),
  p3 :: Exray.Structs.Vector2.t(),
  t :: float()
) :: point :: Exray.Structs.Vector2.t()

Get (evaluate) spline point: Quadratic Bezier

Link to this function

get_spline_point_catmull_rom(p1, p2, p3, p4, t)

View Source
@spec get_spline_point_catmull_rom(
  p1 :: Exray.Structs.Vector2.t(),
  p2 :: Exray.Structs.Vector2.t(),
  p3 :: Exray.Structs.Vector2.t(),
  p4 :: Exray.Structs.Vector2.t(),
  t :: float()
) :: point :: Exray.Structs.Vector2.t()

Get (evaluate) spline point: Catmull-Rom

Link to this function

get_spline_point_linear(start_pos, end_pos, t)

View Source
@spec get_spline_point_linear(
  start_pos :: Exray.Structs.Vector2.t(),
  end_pos :: Exray.Structs.Vector2.t(),
  t :: float()
) :: point :: Exray.Structs.Vector2.t()

Get (evaluate) spline point: Linear