Example #1
0
        /// <summary>
        /// Gets the triangle vertices of the target geometry.
        /// </summary>
        public bool TryGetTriangles(out Vector3[] vertices, out ushort[] indices)
        {
            if (geometryPositions == null && source != null)
            {
                geometryPositions = new Vector3[source.CopyPositionsTo(null, 0)];
                source.CopyPositionsTo(geometryPositions, 0);

                geometryIndices = new ushort[source.CopyIndicesTo(null, 0)];
                source.CopyIndicesTo(geometryIndices, 0);
            }

            vertices = this.geometryPositions;
            indices  = this.geometryIndices;
            return(true);
        }