示例#1
0
        void ProcessTintColor(NativeList <float4> pointBuffer)
        {
            float4 mRgba = new float4(color.r, color.g, color.b, color.a);

            for (int i = 0; i < points.Length; i++)
            {
                ColorRGBA c    = colors[i];
                float4    rgba = new float4(c.R, c.G, c.B, c.A);
                if (rgba.HasNaN())
                {
                    continue;
                }

                int4 rgbaAsInt = math.min(new int4(rgba * mRgba * 255), 255);

                PointWithColor point = new PointWithColor(
                    points[i].Ros2Unity(),
                    new Color32((byte)rgbaAsInt.x, (byte)rgbaAsInt.y, (byte)rgbaAsInt.z, (byte)rgbaAsInt.w)
                    );
                if (PointListResource.IsElementValid(point))
                {
                    pointBuffer.Add(point.f);
                }
            }
        }
示例#2
0
        void ProcessSingleColor(NativeList <float4> pointBuffer)
        {
            float colorAsFloat = PointWithColor.FloatFromColorBits(color);

            foreach (var rosPoint in points)
            {
                PointWithColor point = new PointWithColor(rosPoint.Ros2Unity(), colorAsFloat);
                if (PointListResource.IsElementValid(point))
                {
                    pointBuffer.Add(point.f);
                }
            }
        }