Class FracturePiece

Represents a single fractured piece of a mesh. Contains both rendering and physics data for the piece.

Physics and render meshes are stored directly, allowing them to be serialized and deserialized without reconstruction at activation time.

Hierarchy

  • FrameworkObject
    • FracturePiece

Constructors

  • Parameters

    • OptionalisInternalConstructor: boolean

    Returns FracturePiece

Accessors

  • get childCount(): number
  • Gets the direct child count.

    Returns number

  • get hierarchyLevel(): number
  • Sets the hierarchy level.

    Returns number

  • set hierarchyLevel(value): void
  • Parameters

    • value: number

    Returns void

  • get isDataActivated(): boolean
  • Returns true if the meshes have been activated.

    Returns boolean

  • get isPhysicsMeshDataAvailable(): boolean
  • Returns true if the piece has valid physics data.

    Returns boolean

  • get mass(): number
  • Sets the mass.

    Returns number

  • set mass(value): void
  • Parameters

    • value: number

    Returns void

  • get physicsMesh(): PhysicsMesh
  • Gets the activated physics mesh handle.

    Returns PhysicsMesh

    Only valid after ActivateMeshes() has been called.

  • get renderMesh(): Mesh
  • Gets the activated render mesh handle (LOD 0).

    Returns Mesh

    Only valid after ActivateMeshes() has been called.

  • get volume(): number
  • Sets the volume.

    Returns number

  • set volume(value): void
  • Parameters

    • value: number

    Returns void

Methods

  • Activates meshes for all immediate children.

    Returns void

    Call this when this piece is about to break to prepare the next level of hierarchy for rendering/physics. This is the lazy activation pattern - only activate one level ahead.

  • Activates the render and physics meshes from the stored mesh data. Creates HMesh handles for rendering and HPhysicsMesh for collision.

    Returns void

    This must be called before assigning to Renderable or Collider components.

  • Adds a child piece.

    Parameters

    Returns void

  • Gets the mesh data for the specified lod level.

    Parameters

    • lodIndex: number

    Returns MeshData

    Index 0 is highest detail (base mesh), subsequent indices are lower detail.

  • Gets the child count including children of children.

    Returns number

  • Returns true if this piece has children.

    Returns boolean