Share via


Mesh.Split(Mesh,Int32[],Int32,MeshFlags,GraphicsStream,GraphicsStream,GraphicsStream) Method (Microsoft.DirectX.Direct3D)

Splits a mesh into multiple meshes that are smaller than the specified size.

Definition

Visual Basic Public Shared Function Split( _
    ByVal mesh As Mesh, _
    ByVal adjacencyIn() As Integer, _
    ByVal maxSize As Integer, _
    ByVal options As MeshFlags, _
    ByRef adjacencyArrayOut As GraphicsStream, _
    ByRef faceRemapArrayOut As GraphicsStream, _
    ByRef vertRemapArrayOut As GraphicsStream _
) As Mesh()
C# public static Mesh[] Split(
    Mesh mesh,
    int[] adjacencyIn,
    int maxSize,
    MeshFlags options,
    out GraphicsStream adjacencyArrayOut,
    out GraphicsStream faceRemapArrayOut,
    out GraphicsStream vertRemapArrayOut
);
C++ public:
static array<Mesh^>^ Split(
    Meshmesh,
    array<int>^ adjacencyIn,
    int maxSize,
    MeshFlags options,
    [Out] GraphicsStream^% adjacencyArrayOut,
    [Out] GraphicsStream^% faceRemapArrayOut,
    [Out] GraphicsStream^% vertRemapArrayOut
);
JScript public static function Split(
    mesh : Mesh,
    adjacencyIn : int[],
    maxSize : int,
    options : MeshFlags,
    adjacencyArrayOut : GraphicsStream,
    faceRemapArrayOut : GraphicsStream,
    vertRemapArrayOut : GraphicsStream
) : Mesh[];

Parameters

mesh Microsoft.DirectX.Direct3D.Mesh
A Mesh object that represents the source mesh.
adjacencyIn System.Int32[]
Array of three Int32Leave Site values per face that specify the three neighbors for each face in the mesh to be simplified.
maxSize System.Int32
Maximum number of vertices in the resulting mesh.
options Microsoft.DirectX.Direct3D.MeshFlags
One or more of the Option*MeshFlags for the new meshes.
adjacencyArrayOut Microsoft.DirectX.GraphicsStream
A GraphicsStream that contains adjacency arrays (Int32Leave Site values) for the new meshes.
faceRemapArrayOut Microsoft.DirectX.GraphicsStream
A GraphicsStream that contains an array of face remap arrays (Int32Leave Site values) for the new meshes.
vertRemapArrayOut Microsoft.DirectX.GraphicsStream
A GraphicsStream that contains an array of vertex remap arrays for the new meshes.

Return Value

Microsoft.DirectX.Direct3D.Mesh[]
Array of Mesh objects for the new meshes. For a source mesh split into n meshes, the ret_MeshA value is an array of nMesh objects.

Remarks

This method is commonly used to split a mesh with 32-bit indices (more than 65,535 vertices) into multiple meshes, each of which has 16-bit indices.

The param_GraphicsStreamR_adjacencyArrayOut, param_GraphicsStreamR_vertRemapArrayOut, and param_GraphicsStreamR_faceRemapArrayOut arrays have two dimensions. The first dimension specifies the mesh, and the second specifies the data. For example, to obtain the face remap information for face 3 in mesh 2, the following C# code could be used, assuming the face remap data is returned in a variable named faceRemapArrayOut.

[C#]int remap = FaceRemapArrayOut[2][3];

Exceptions

InvalidCallException

The method call is invalid. For example, a method's parameter might contain an invalid value.

InvalidDataException

The data is invalid.

OutOfMemoryExceptionLeave Site

Microsoft Direct3D could not allocate sufficient memory to complete the call.