Class DestructionData

Contains the computed fracture data for a mesh.

DestructionData holds all the pieces generated by fracturing a mesh, along with metadata about the original mesh and fracture settings. This data can be used at runtime to spawn debris when a destructable object is destroyed.

Hierarchy

  • FrameworkObject
    • DestructionData

Constructors

  • Parameters

    • OptionalisInternalConstructor: boolean

    Returns DestructionData

Accessors

  • get averageMass(): number
  • Gets the average mass across all pieces. Used for damage threshold calculation.

    Returns number

  • get averageVolume(): number
  • Gets the average volume across all pieces. Used for damage threshold calculation.

    Returns number

  • get interiorMaterial(): Material
  • Gets the interior material used for cut surfaces.

    Returns Material

  • get isValid(): boolean
  • Determines if this destruction data is valid and ready to use.

    Returns boolean

  • get pieceCount(): number
  • Gets the number of pieces.

    Returns number

  • get topLevelPieceCount(): number
  • Gets the count of top-level pieces (pieces stored directly, not as children).

    Returns number

  • get totalMass(): number
  • Gets the total mass of all pieces combined.

    Returns number

  • get totalVolume(): number
  • Gets the total volume of all pieces combined.

    Returns number

Methods

  • Activates render and physics meshes for ALL pieces recursively.

    Returns void

    Warning: For deep hierarchies this creates many GPU resources upfront. Prefer ActivateTopLevelMeshes() + FracturePiece::ActivateChildMeshes() for runtime. This method is useful for editor preview or simple cases.

  • Activates render and physics meshes for top-level pieces only.

    Returns void

    Use this for lazy activation - call on first damage to prepare only the pieces that might immediately break off. When a piece breaks, call FracturePiece::ActivateChildMeshes() to prepare the next level.

  • Returns true if top-level meshes have been activated.

    Returns boolean

  • Clears all fracture data, resetting to empty state.

    Returns void