Ejemplo n.º 1
0
        bool?ProcessLineStripNoTint(NativeList <float4x2> lineBuffer)
        {
            var lPoints = points;
            var lColors = colors;

            if (lPoints.Length == 0)
            {
                return(null);
            }

            var p  = lPoints[0].Ros2Unity();
            var pc = lColors[0].ToUnityColor32();

            for (int i = 1; i < lPoints.Length; i++)
            {
                var q  = lPoints[i].Ros2Unity();
                var qc = lColors[i].ToUnityColor32();

                LineWithColor line = new LineWithColor(p, pc, q, qc);
                if (LineResource.IsElementValid(line))
                {
                    lineBuffer.Add(line.f);
                }

                p  = q;
                pc = qc;
            }

            return(null);
        }
Ejemplo n.º 2
0
        bool?ProcessLineStripSingleColor(NativeList <float4x2> lineBuffer)
        {
            var lPoints = points;

            if (lPoints.Length == 0)
            {
                return(color32.a < 255);
            }

            var   p            = lPoints[0].Ros2Unity();
            float colorAsFloat = PointWithColor.FloatFromColorBits(color32);

            for (int i = 1; i < lPoints.Length; i++)
            {
                var q = lPoints[i].Ros2Unity();

                LineWithColor line = new LineWithColor(p, colorAsFloat, q, colorAsFloat);
                if (LineResource.IsElementValid(line))
                {
                    lineBuffer.Add(line.f);
                }

                p = q;
            }

            return(color32.a < 255);
        }
Ejemplo n.º 3
0
        bool?ProcessLineListNoTint(NativeList <float4x2> lineBuffer)
        {
            var lPoints = points;
            var lColors = colors;

            for (int i = 0; i < lPoints.Length / 2; i++)
            {
                LineWithColor line = new LineWithColor(
                    lPoints[2 * i + 0].Ros2Unity(), lColors[2 * i + 0].ToUnityColor32(),
                    lPoints[2 * i + 1].Ros2Unity(), lColors[2 * i + 1].ToUnityColor32()
                    );
                if (LineResource.IsElementValid(line))
                {
                    lineBuffer.Add(line.f);
                }
            }

            return(null);
        }
Ejemplo n.º 4
0
        bool?ProcessLineListSingleColor(NativeList <float4x2> lineBuffer)
        {
            var lPoints = points;

            float colorAsFloat = PointWithColor.FloatFromColorBits(color32);

            for (int i = 0; i < lPoints.Length / 2; i++)
            {
                LineWithColor line = new LineWithColor(
                    lPoints[2 * i + 0].Ros2Unity(), colorAsFloat,
                    lPoints[2 * i + 1].Ros2Unity(), colorAsFloat
                    );
                if (LineResource.IsElementValid(line))
                {
                    lineBuffer.Add(line.f);
                }
            }

            return(color32.a < 255);
        }