コード例 #1
0
ファイル: Grapher.cs プロジェクト: imclab/MetaGlassesUW
    public void ReadEquation(string eqn, string type)
    {
        if (type == "linear")
        {
            function = FunctionOption.Linear;
        }
        if (type == "parabolic")
        {
            function = FunctionOption.Parabola;
        }
        if (type == "sine")
        {
            function = FunctionOption.Sine;
        }
        else
        {
            //Do nothing

        }

        functionReader.EqnReader(eqn, type);

        verticalStretch_a = functionReader.a;
        horizontalStretch_b = functionReader.b;
        verticalShift_c = functionReader.c; ;
        horizontalShift_d = functionReader.d;

        Debug.Log("a: " + verticalStretch_a + "b: " + horizontalStretch_b + "c: " + verticalShift_c + "d: " + horizontalShift_d);
    }
コード例 #2
0
 //find way to get bottom half too
 //ellipsoid 3d surface, variable dimensions// r = radius, xr = x rad stretch, zr = z rad stretch, yr = y rad stretch
 private float Ellipsoid(Vector3 p, float t, float r, float xr, float zr, float yr, float c)
 {
     function = FunctionOption.Ellipsoid;
     p.x      = 2f * p.x - 1f;
     p.z      = 2f * p.z - 1f;
     return(Mathf.Sqrt(r * r - ((p.x * p.x) / (xr * xr)) - ((p.z * p.z) / (zr * zr))) * yr + c);
 }
コード例 #3
0
ファイル: Grapher2.cs プロジェクト: imclab/MetaGlassesUW
 //find way to get bottom half
 //cone, variable dimensions//  xr = x rad stretch, zr = z rad stretch, yr = y rad stretch
 private float Cone(Vector3 p, float t, float yr, float xr, float zr , float c)
 {
     function = FunctionOption.Cone;
     p.x = 2f * p.x - 1f;
     p.z = 2f * p.z - 1f;
     return Mathf.Sqrt(((p.x * p.x) / (xr * xr)) + ((p.z * p.z) / (zr * zr))) * yr + c;
 }
コード例 #4
0
ファイル: UIButton.cs プロジェクト: KitchenGun/RadioGame
    private void FunctionDial()
    {
        switch (funcOption)
        {//현재 상태에서 버튼 입력시 다음단계로 전환
        case FunctionOption.Normal:
            DialParent.transform.rotation = Quaternion.Euler(0, 0, 60);
            funcOption++;
            OfficerSpeak.text = ("중대장 : \n방식은 도약!");
            break;

        case FunctionOption.Signal:
            DialParent.transform.rotation = Quaternion.Euler(0, 0, 30);
            funcOption++;
            OfficerSpeak.text = ("중대장 : \n정상으로 맞추라고 정상!");
            break;

        case FunctionOption.Input:
            DialParent.transform.rotation = Quaternion.Euler(0, 0, 0);
            funcOption        = FunctionOption.Normal;
            OfficerSpeak.text = ("중대장 : \n정상으로 맞추라고 정상!");
            break;

        default:
            break;
        }
    }
コード例 #5
0
 //complicated multi sine plane, anim
 private float CSine(Vector3 p, float t, float c)
 {
     function = FunctionOption.CSine;
     return(0.50f +
            0.25f * Mathf.Sin(4 * Mathf.PI * p.x + 4 * t) * Mathf.Sin(2 * Mathf.PI * p.z + t) +
            0.10f * Mathf.Cos(3 * Mathf.PI * p.x + 5 * t) * Mathf.Cos(5 * Mathf.PI * p.z + 3 * t) +
            0.15f * Mathf.Sin(Mathf.PI * p.x + 0.6f * t) + c);
 }
コード例 #6
0
    //paraboloid, variable dim, xr is x radius modifyer, zr is z radius modifier, c is vertical shift,yr is vertical stretch
    private float Parabola(Vector3 p, float t, float xr, float zr, float yr, float c)
    {
        function = FunctionOption.Parabola;
        p.x      = 2f * p.x - 1f;
        p.z      = 2f * p.z - 1f;

        return(c + ((p.x * p.x) / (xr * xr)) + ((p.z * p.z) / (zr * zr)));
    }
コード例 #7
0
 public GetEntityFunc(FunctionOption option)
     : base(string.Format("Get{0}", option.EntityClass), option.ReturnType, null)
 {
     _option    = option;
     Parameters = new List <FunctionParameter>();
     Parameters.Add(new FunctionParameter(_option.IdColumn.Name.ToFirstLower(), string.Format("{0}", _option.IdColumn.CSTypeName)));
     Parameters.Add(new FunctionParameter("cacheable", "bool"));
 }
コード例 #8
0
ファイル: Grapher2.cs プロジェクト: imclab/MetaGlassesUW
 //complicated multi sine plane, anim
 private float CSine(Vector3 p, float t, float c)
 {
     function = FunctionOption.CSine;
     return 0.50f +
         0.25f * Mathf.Sin(4 * Mathf.PI * p.x + 4 * t) * Mathf.Sin(2 * Mathf.PI * p.z + t) +
             0.10f * Mathf.Cos(3 * Mathf.PI * p.x + 5 * t) * Mathf.Cos(5 * Mathf.PI * p.z + 3 * t) +
             0.15f * Mathf.Sin(Mathf.PI * p.x + 0.6f * t) + c;
 }
コード例 #9
0
 public GetEntitiesFunc(FunctionOption option, string FunName)
     : base(string.Format("Get{0}", FunName.ToPlural()), option.ReturnType, null)
 {
     _option    = option;
     Parameters = new List <FunctionParameter>();
     Parameters.Add(new FunctionParameter(_option.IdColumn.Name.ToFirstLower().ToPlural(), string.Format("{0}[]", _option.IdColumn.CSTypeName)));
     Parameters.Add(new FunctionParameter(string.Format("{0}Cacheable", _option.EntityClass.ToFirstLower().ToPlural()), "bool"));
 }
コード例 #10
0
    //cool ripple plane, anim
    private float Ripple(Vector3 p, float t, float c)
    {
        function = FunctionOption.Ripple;
        p.x     -= 0.5f;
        p.z     -= 0.5f;
        float squareRadius = p.x * p.x + p.z * p.z;

        return(0.5f + Mathf.Sin(15f * Mathf.PI * squareRadius - 2f * t) / (2f + 100f * squareRadius) + c);
    }
コード例 #11
0
 public GetEntitySetFunc(FunctionOption option)
     : base(string.Format("Get{0}Set", option.EntityClass), option.ReturnType, null)
 {
     _option    = option;
     Parameters = new List <FunctionParameter>();
     Parameters.Add(new FunctionParameter("pageIndex", "int"));
     Parameters.Add(new FunctionParameter("pageSize", "int"));
     Parameters.Add(new FunctionParameter("idsCacheable", "bool"));
     Parameters.Add(new FunctionParameter("entitiesCacheable", "bool"));
 }
コード例 #12
0
    //complicated multi sine plane, anim
    private float CSine(Vector3 p, float t, float c)
    {
        function = FunctionOption.CSine;
        //return  (0.50f +
        //  10*(  0.25f * Mathf.Sin(8 * 5 * Mathf.PI * p.x + 4 * t) * Mathf.Sin(4 * 5 * Mathf.PI * p.z + t) +
        //        0.10f * Mathf.Cos(6 * 5 * Mathf.PI * p.x + 5 * t) * Mathf.Cos(10 * 5 * Mathf.PI * p.z + 3 * t) +
        //        0.15f * Mathf.Sin(10 * Mathf.PI * p.x + 0.6f * t) + c) );

        return(0.50f +
               (0.25f * Mathf.Sin(4 * Mathf.PI * p.x + 4 * t) * Mathf.Sin(2 * Mathf.PI * p.z + t) +
                0.10f * Mathf.Cos(4 * Mathf.PI * p.x + 5 * t) * Mathf.Cos(5 * Mathf.PI * p.z + 3 * t) +
                0.15f * Mathf.Sin(Mathf.PI * p.x + 0.6f * t) + c));
    }
コード例 #13
0
        public DeleteEntityFunc(FunctionOption option)
            : base(
                string.Format("Delete{0}", option.EntityClass)
                , option.ReturnType
                , null)
        {
            this.Option = option;

            Parameters = new List <FunctionParameter>();

            Parameters.Add(new FunctionParameter(option.IdColumn.Name.ToFirstLower(), option.IdColumn.CSTypeName));

            if (option.WithTran)
            {
                Parameters.Add(new FunctionParameter("tran", "TransactionManager"));
            }
        }
コード例 #14
0
        public UpdateEntityFunc(FunctionOption option)
            : base(string.Format("Update{0}", option.EntityClass), option.ReturnType, null)
        {
            _option    = option;
            Parameters = new List <FunctionParameter>();

            if (_option.IsBat)
            {
                Parameters.Add(new FunctionParameter(_option.EntityClass.ToFirstLower() + "s", string.Format("List<{0}>", _option.EntityClass)));
            }
            else
            {
                Parameters.Add(new FunctionParameter(_option.EntityClass.ToFirstLower(), _option.EntityClass));
            }
            if (_option.WithTran)
            {
                Parameters.Add(new FunctionParameter("tran", "TransactionManager"));
            }
        }
コード例 #15
0
 public override void ExplicitVisit(FunctionOption fragment)
 {
     _fragments.Add(fragment);
 }
コード例 #16
0
 public static string ToDescriptionString(this FunctionOption options)
 {
     DescriptionAttribute[] attributes = (DescriptionAttribute[])options.GetType().GetField(options.ToString()).GetCustomAttributes(typeof(DescriptionAttribute), false);
     return(attributes.Length > 0 ? attributes[0].Description : string.Empty);
 }
コード例 #17
0
ファイル: Grapher2.cs プロジェクト: imclab/MetaGlassesUW
 //find way to get bottom half too
 //ellipsoid 3d surface, variable dimensions// r = radius, xr = x rad stretch, zr = z rad stretch, yr = y rad stretch
 private float Ellipsoid(Vector3 p, float t, float r, float xr, float zr, float yr, float c)
 {
     function = FunctionOption.Ellipsoid;
     p.x = 2f * p.x - 1f;
     p.z = 2f * p.z - 1f;
     return Mathf.Sqrt(r * r - ((p.x * p.x) / (xr * xr)) - ((p.z * p.z) / (zr * zr))) * yr + c;
 }
コード例 #18
0
ファイル: Grapher2.cs プロジェクト: imclab/MetaGlassesUW
 /////////animated graphs are below:
 //1 variable sine plane, anim
 private float Sine(Vector3 p, float t , float c)
 {
     function = FunctionOption.Sine;
     return 0.5f + 0.5f * Mathf.Sin(2 * Mathf.PI * p.x + t) + c;
 }
コード例 #19
0
ファイル: Grapher2.cs プロジェクト: imclab/MetaGlassesUW
    //complicated multi sine plane, anim
    private float CSine(Vector3 p, float t, float c)
    {
        function = FunctionOption.CSine;
        //return  (0.50f +
        //  10*(  0.25f * Mathf.Sin(8 * 5 * Mathf.PI * p.x + 4 * t) * Mathf.Sin(4 * 5 * Mathf.PI * p.z + t) +
        //        0.10f * Mathf.Cos(6 * 5 * Mathf.PI * p.x + 5 * t) * Mathf.Cos(10 * 5 * Mathf.PI * p.z + 3 * t) +
        //        0.15f * Mathf.Sin(10 * Mathf.PI * p.x + 0.6f * t) + c) );

        return (0.50f +
               (0.25f * Mathf.Sin(4 * Mathf.PI * p.x + 4 * t) * Mathf.Sin(2 * Mathf.PI * p.z + t) +
                0.10f * Mathf.Cos(4 * Mathf.PI * p.x + 5 * t) * Mathf.Cos(5 * Mathf.PI * p.z + 3 * t) +
                0.15f * Mathf.Sin(Mathf.PI * p.x + 0.6f * t) + c));
    }
コード例 #20
0
ファイル: Grapher2.cs プロジェクト: imclab/MetaGlassesUW
 //cool ripple plane, anim
 private float Ripple(Vector3 p, float t, float c)
 {
     function = FunctionOption.Ripple;
     p.x -= 0.5f;
     p.z -= 0.5f;
     float squareRadius = p.x * p.x + p.z * p.z;
     return 0.5f + Mathf.Sin(15f * Mathf.PI * squareRadius - 2f * t) / (2f + 100f * squareRadius) + c;
 }
コード例 #21
0
ファイル: Grapher2.cs プロジェクト: imclab/MetaGlassesUW
 //need to get bottom half
 //1sheet hyperboloid, variable dimensions//r = radius, xr = x rad stretch, zr = z rad stretch, yr = y rad stretch
 private float Sheethyperboloid(Vector3 p, float t, float xr, float zr, float yr, float c)
 {
     function = FunctionOption.Sheethyperboloid;
     p.x = 2f * p.x - 1f;
     p.z = 2f * p.z - 1f;
     return Mathf.Sqrt((1f + ((p.z * p.z) / (zr * zr)) - ((p.x * p.x) / (xr * xr)))) * yr + c;
 }
コード例 #22
0
ファイル: Grapher2.cs プロジェクト: imclab/MetaGlassesUW
    //paraboloid, variable dim, xr is x radius modifyer, zr is z radius modifier, c is vertical shift,yr is vertical stretch
    private float Parabola(Vector3 p, float t, float xr, float zr, float yr, float c)
    {
        function = FunctionOption.Parabola;
        p.x = 2f * p.x - 1f;
        p.z = 2f * p.z - 1f;

        return c + ((p.x * p.x) / (xr * xr)) + ((p.z * p.z) / (zr * zr));
    }
コード例 #23
0
        public void TestFunctionFilterOption()
        {
            FunctionOption function = FunctionOption.START_WITH;

            var str = function.ToDescriptionString();
        }
コード例 #24
0
ファイル: AllNodesVisitor.cs プロジェクト: yaakoviyun/sqlskim
 public override void Visit(FunctionOption node) { this.action(node); }
コード例 #25
0
    /////////animated graphs are below:

    //1 variable sine plane, anim
    private float Sine(Vector3 p, float t, float c)
    {
        function = FunctionOption.Sine;
        return(0.5f + 0.5f * Mathf.Sin(2 * Mathf.PI * p.x + t) + c);
    }
コード例 #26
0
 public FunctionFilterExpression(FunctionOption option, QueryKeyValuePair pair)
 {
     this.Option = option;
     this.Pair   = pair;
 }