Ejemplo n.º 1
0
 /// <summary>
 /// Get point on helix at around radian.
 /// </summary>
 /// <param name="topEllipse">Top ellipse args of curve.</param>
 /// <param name="bottomEllipse">Bottom ellipse args of curve.</param>
 /// <param name="maxRadian">Max around radian of helix.</param>
 /// <param name="radian">Around radian of helix.</param>
 /// <returns>The point on helix at around radian.</returns>
 public static Vector3 GetPointAt(EllipseArgs topEllipse, EllipseArgs bottomEllipse, float maxRadian, float radian)
 {
     if (maxRadian == 0)
     {
         maxRadian = Mathf.Epsilon;
     }
     return(Vector3.Lerp(EllipseCurve.GetPointAt(bottomEllipse, radian), EllipseCurve.GetPointAt(topEllipse, radian), radian / maxRadian));
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Constructor.
 /// </summary>
 /// <param name="topEllipse">Top ellipse args of curve.</param>
 /// <param name="bottomEllipse">Bottom ellipse args of curve.</param>
 public HelixCurve(EllipseArgs topEllipse, EllipseArgs bottomEllipse)
 {
     this.topEllipse    = topEllipse;
     this.bottomEllipse = bottomEllipse;
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Constructor.
 /// </summary>
 public HelixCurve()
 {
     topEllipse    = new EllipseArgs();
     bottomEllipse = new EllipseArgs();
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Constructor.
 /// </summary>
 public EllipseCurve()
 {
     args = new EllipseArgs();
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Get point on ellipse at around radian.
 /// </summary>
 /// <param name="args">Args of ellipse curve.</param>
 /// <param name="radian">Around radian of ellipse.</param>
 /// <returns>The point on ellipse at around radian.</returns>
 public static Vector3 GetPointAt(EllipseArgs args, float radian)
 {
     return(args.center + new Vector3(args.semiMinorAxis * Mathf.Cos(radian), 0, args.semiMajorAxis * Mathf.Sin(radian)));
 }
Ejemplo n.º 6
0
 /// <summary>
 /// Constructor.
 /// </summary>
 /// <param name="args">Args of ellipse curve.</param>
 public EllipseCurve(EllipseArgs args)
 {
     this.args = args;
 }