当前位置: 首页>>代码示例>>C#>>正文


C# MegaShape.CalcLength方法代码示例

本文整理汇总了C#中MegaShape.CalcLength方法的典型用法代码示例。如果您正苦于以下问题:C# MegaShape.CalcLength方法的具体用法?C# MegaShape.CalcLength怎么用?C# MegaShape.CalcLength使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在MegaShape的用法示例。


在下文中一共展示了MegaShape.CalcLength方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: importData

    public void importData(string svgdata, MegaShape shape, float scale, bool clear, int start)
    {
        LoadXML(svgdata, shape, clear, start);
        for ( int i = start; i < splineindex; i++ )
        {
            float area = shape.splines[i].Area();
            if ( area < 0.0f )
                shape.splines[i].reverse = false;
            else
                shape.splines[i].reverse = true;
        }

        //shape.Centre(0.01f, new Vector3(-1.0f, 1.0f, 1.0f));
        shape.Centre(scale, new Vector3(-1.0f, 1.0f, 1.0f), start);
        shape.CalcLength();	//10);
    }
开发者ID:jsr2k1,项目名称:gato-book-test,代码行数:16,代码来源:MegaShapeSVG.cs

示例2: DisplaySpline

	void DisplaySpline(MegaShape shape, MegaSpline spline)
	{
		bool closed = EditorGUILayout.Toggle("Closed", spline.closed);

		if ( closed != spline.closed )
		{
			spline.closed = closed;
			shape.CalcLength();	//10);
			EditorUtility.SetDirty(target);
			//shape.BuildMesh();
		}

		spline.reverse = EditorGUILayout.Toggle("Reverse", spline.reverse);

		EditorGUILayout.LabelField("Length ", spline.length.ToString("0.000"));
		spline.twistmode = (MegaShapeEase)EditorGUILayout.EnumPopup("Twist Mode", spline.twistmode);

		showknots = EditorGUILayout.Foldout(showknots, "Knots");

		if ( showknots )
		{
			for ( int i = 0; i < spline.knots.Count; i++ )
			{
				DisplayKnot(shape, spline, spline.knots[i], i);
				//EditorGUILayout.Separator();
			}
		}
	}
开发者ID:Gounemond,项目名称:BretarisDemo,代码行数:28,代码来源:MegaShapeEditor.cs

示例3: DisplayKnot

	void DisplayKnot(MegaShape shape, MegaSpline spline, MegaKnot knot, int i)
	{
		bool recalc = false;

		Vector3 p = EditorGUILayout.Vector3Field("Knot [" + i + "] Pos", knot.p);
		delta = p - knot.p;

		knot.invec += delta;
		knot.outvec += delta;

		if ( knot.p != p )
		{
			recalc = true;
			knot.p = p;
		}

		if ( recalc )
		{
			shape.CalcLength();	//10);
		}
		knot.twist = EditorGUILayout.FloatField("Twist", knot.twist);
		knot.id = EditorGUILayout.IntField("ID", knot.id);
	}
开发者ID:Gounemond,项目名称:BretarisDemo,代码行数:23,代码来源:MegaShapeEditor.cs

示例4: DisplaySpline

    void DisplaySpline(MegaShape shape, MegaSpline spline)
    {
        bool closed = EditorGUILayout.Toggle("Closed", spline.closed);

        if ( closed != spline.closed )
        {
            spline.closed = closed;
            shape.CalcLength();	//10);
            EditorUtility.SetDirty(target);
            //shape.BuildMesh();
        }

        spline.reverse = EditorGUILayout.Toggle("Reverse", spline.reverse);

        EditorGUILayout.LabelField("Length ", spline.length.ToString("0.000"));

        //if ( GUILayout.Button("Outline") )
        //{
        //	shape.OutlineSpline(shape, shape.selcurve, outline, true);
        //	EditorUtility.SetDirty(target);
        //	buildmesh = true;
        //}

        showknots = EditorGUILayout.Foldout(showknots, "Knots");

        if ( showknots )
        {
            for ( int i = 0; i < spline.knots.Count; i++ )
            {
                DisplayKnot(shape, spline, spline.knots[i]);
                //EditorGUILayout.Separator();
            }
        }
    }
开发者ID:jsr2k1,项目名称:gato-book-test,代码行数:34,代码来源:MegaShapeEditor.cs

示例5: DisplayKnot

    void DisplayKnot(MegaShape shape, MegaSpline spline, MegaKnot knot)
    {
        bool recalc = false;

        Vector3 p = EditorGUILayout.Vector3Field("Pos", knot.p);
        delta = p - knot.p;

        knot.invec += delta;
        knot.outvec += delta;

        if ( knot.p != p )
        {
            recalc = true;
            knot.p = p;
        }

        if ( recalc )
        {
            shape.CalcLength();	//10);
        }
    }
开发者ID:jsr2k1,项目名称:gato-book-test,代码行数:21,代码来源:MegaShapeEditor.cs

示例6: DisplaySpline

    void DisplaySpline(MegaShape shape, MegaSpline spline)
    {
        bool closed = EditorGUILayout.Toggle("Closed", spline.closed);

        if ( closed != spline.closed )
        {
            spline.closed = closed;
            shape.CalcLength(10);
            EditorUtility.SetDirty(target);
        }

        EditorGUILayout.LabelField("Length ", spline.length.ToString("0.000"));

        showknots = EditorGUILayout.Foldout(showknots, "Knots");

        if ( showknots )
        {
            for ( int i = 0; i < spline.knots.Count; i++ )
            {
                DisplayKnot(shape, spline, spline.knots[i]);
                //EditorGUILayout.Separator();
            }
        }
    }
开发者ID:schonstal,项目名称:madness,代码行数:24,代码来源:MegaShapeEditor.cs

示例7: DisplayKnot

    void DisplayKnot(MegaShape shape, MegaSpline spline, MegaKnot knot)
    {
        bool recalc = false;

        Vector3 p = EditorGUILayout.Vector3Field("Pos", knot.p);
        #if false
        Vector3 invec = EditorGUILayout.Vector3Field("In", knot.invec);
        //Vector3 outvec = EditorGUILayout.Vector3Field("Out", knot.outvec);

        if ( invec != knot.invec )
        {
            if ( shape.lockhandles )
            {
                Vector3 d = invec - knot.invec;
                knot.outvec -= d;
            }

            knot.invec = invec;
            recalc = true;
        }

        Vector3 outvec = EditorGUILayout.Vector3Field("Out", knot.outvec);

        if ( outvec != knot.outvec )
        {
            if ( shape.lockhandles )
            {
                Vector3 d = outvec - knot.outvec;
                knot.invec -= d;
            }

            knot.outvec = outvec;
            recalc = true;
        }

        //Vector3 p = EditorGUILayout.Vector3Field("Pos", knot.p);
        #endif
        delta = p - knot.p;

        knot.invec += delta;
        knot.outvec += delta;

        if ( knot.p != p )
        {
            recalc = true;
            knot.p = p;
        }

        if ( recalc )
        {
            shape.CalcLength(10);
        }
    }
开发者ID:schonstal,项目名称:madness,代码行数:53,代码来源:MegaShapeEditor.cs


注:本文中的MegaShape.CalcLength方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。