Ejemplo n.º 1
0
        public void SetTexCoord1(int idx, StructList <Vector4> uvs)
        {
            if (idx < 0 || idx > shapes.size)
            {
                return;
            }
            GeometryShape shape = shapes[idx];

            Array.Copy(uvs.array, 0, texCoord1.array, shape.vertexStart, shape.vertexCount);
        }
Ejemplo n.º 2
0
        public void GetTextureCoord1(int idx, StructList <Vector4> retn)
        {
            if (idx < 0 || idx > shapes.size)
            {
                return;
            }

            GeometryShape shape = shapes[idx];

            retn.EnsureCapacity(shape.vertexCount);
            Array.Copy(texCoord1.array, shape.vertexStart, retn.array, 0, shape.vertexCount);
            retn.size = shape.vertexCount;
        }
Ejemplo n.º 3
0
        public int GetTextureCoord1(int idx, ref Vector4[] retn)
        {
            if (idx < 0 || idx > shapes.size)
            {
                return(0);
            }

            GeometryShape shape = shapes[idx];

            retn = retn ?? new Vector4[shape.vertexCount];
            if (retn.Length < shape.vertexCount)
            {
                Array.Resize(ref retn, shape.vertexCount);
            }

            Array.Copy(texCoord1.array, shape.vertexStart, retn, 0, shape.vertexCount);
            return(shape.vertexCount);
        }
Ejemplo n.º 4
0
        public bool SetNormals(int shapeIdx, Vector3 normal)
        {
            if (shapeIdx < 0 || shapeIdx > shapes.size)
            {
                return(false);
            }

            GeometryShape shape = shapes[shapeIdx];
            int           start = shape.vertexStart;
            int           end   = start + shape.vertexCount;

            Vector3[] c = this.normals.array;
            for (int i = start; i < end; i++)
            {
                c[i] = normal;
            }

            return(true);
        }
Ejemplo n.º 5
0
        public bool SetVertexColors(int shapeIdx, Color color)
        {
            if (shapeIdx < 0 || shapeIdx > shapes.size)
            {
                return(false);
            }

            GeometryShape shape = shapes[shapeIdx];
            int           start = shape.vertexStart;
            int           end   = start + shape.vertexCount;

            Color[] c = this.colors.array;
            for (int i = start; i < end; i++)
            {
                c[i] = color;
            }

            return(true);
        }