Beispiel #1
0
        public static fPolylineGameObject CreatePolylineGO(string sName, List <Vector3f> vVertices, Colorf color, float fLineWidth)
        {
            GameObject go = new GameObject(sName);
            CurveRendererImplementation curveRen = CurveRendererSource.Build();

            curveRen.initialize(go, new Colorf(Colorf.Black, 0.75f));
            fPolylineGameObject fgo = new fPolylineGameObject(go, curveRen);

            fgo.SetColor(color);
            fgo.SetLineWidth(fLineWidth);
            fgo.SetVertices(vVertices);
            return(fgo);
        }
Beispiel #2
0
        public static fPolylineGameObject CreatePolylineGO(string sName, List <Vector3f> vVertices, fMaterial material, bool bSharedMaterial, float fLineWidth, LineWidthType widthType)
        {
            GameObject go = new GameObject(sName);
            CurveRendererImplementation curveRen = CurveRendererSource.Build(widthType);

            curveRen.initialize(go, material, bSharedMaterial);
            fPolylineGameObject fgo = new fPolylineGameObject(go, curveRen);

            fgo.SetLineWidth(fLineWidth);
            if (vVertices != null)
            {
                fgo.SetVertices(vVertices);
            }
            return(fgo);
        }
Beispiel #3
0
        public void Create(SOMaterial useMaterial, fGameObject parent, int nLayer = -1)
        {
            if (curve == null)
            {
                curve = new DCurve3()
                {
                    Closed = closed
                }
            }
            ;

            curveObject = GameObjectFactory.CreatePolylineGO("preview_curve", null, useMaterial.RGBColor, 0.05f, LineWidthType.World);
            if (nLayer >= 0)
            {
                curveObject.SetLayer(nLayer);
            }

            bUpdatePending = true;

            parent.AddChild(curveObject, false);
        }