API reference
API reference
Select your platform
No SDKs available
No versions available

MeshSegmentationResult Struct

Contains the results of a mesh segmentation operation, including a list of mesh segments and a specially reserved segment.
The reserved segment is a portion of the mesh that will be kept as one segment and should be indestructible. The DestructibleGlobalMeshSpawner.OnSegmentationCompleted event is triggered when this data is available and it can be used to modify the segmentation results before they are instantiated by accessing the MeshSegmentationResult.segments and MeshSegmentationResult.reservedSegment properties.
This example shows how to modify the segmentation results before they are instantiated:
privatestatic DestructibleMeshComponent.MeshSegmentationResult ModifySegmentationResult(
    DestructibleMeshComponent.MeshSegmentationResult meshSegmentationResult)
{
    var newSegments = new List\<DestructibleMeshComponent.MeshSegment\>();
foreach (var segment in meshSegmentationResult.segments)
    {
        var newSegment = ModifyMeshSegment(segment);
        newSegments.Add(newSegment);
    }
    var newReservedSegment = ModifyMeshSegment(meshSegmentationResult.reservedSegment);
returnnew DestructibleMeshComponent.MeshSegmentationResult()
    {
        segments = newSegments,
        reservedSegment = newReservedSegment
    };
}

Fields

A list of resulting from the segmentation operation.
Each MeshSegment represents a distinct part of the original mesh.
A specially reserved segment that remains indestructible.
This segment is kept intact and is not subject to the usual segmentation process.
Did you find this page helpful?
Thumbs up icon
Thumbs down icon