Search Results for

    Show / Hide Table of Contents

    Struct FoliageInstance

    Foliage instanced mesh instance. Packed data with very little of logic. Managed by the foliage chunks and foliage actor itself.

    Assembly: FlaxEngine.dll
    File: Engine/Foliage/FoliageInstance.h
    Syntax
    public struct FoliageInstance

    Fields

    Bounds

    The cached instance bounds (in world space).

    Declaration
    public BoundingSphere Bounds
    Field Value
    BoundingSphere

    CachedDrawWorld

    Cached local-to-world transformation matrix for the instance used during rendering. Relative to the last rendering context origin. Valid only if CachedDrawWorldValid flag is set.

    Declaration
    public Matrix CachedDrawWorld
    Field Value
    Matrix

    CachedDrawWorldValid

    Flag used to indicate whether CachedDrawWorld contains valid data.

    Declaration
    public byte CachedDrawWorldValid = 0
    Field Value
    byte

    CullDistance

    The cull distance for this instance.

    Declaration
    public float CullDistance
    Field Value
    float

    DrawStateLODTransition

    The LOD transition timer.

    Declaration
    public byte DrawStateLODTransition = 255
    Field Value
    byte

    DrawStatePrevFrame

    The previous frame index. In sync with Engine::FrameCount used to detect new frames and rendering gaps to reset state.

    Declaration
    public uint64 DrawStatePrevFrame = 0
    Field Value
    uint64

    DrawStatePrevLOD

    The previous frame model LOD index used. It's locked during LOD transition to cache the transition start LOD.

    Declaration
    public char DrawStatePrevLOD = -1
    Field Value
    char

    LightmapTextureIndex

    The lightmap index for the foliage instance. -1 if unused.

    Declaration
    public int8 LightmapTextureIndex = -1
    Field Value
    int8

    LightmapUVsArea

    Lightmap UVs area that entry occupies (packed Rectangle into Half4).

    Declaration
    public Half4 LightmapUVsArea
    Field Value
    Half4

    Random

    The per-instance random value from range [0;1].

    Declaration
    public float Random
    Field Value
    float

    Transform

    The local-space transformation of the mesh relative to the foliage actor.

    Declaration
    public Transform Transform
    Field Value
    Transform

    Type

    The foliage type index. Foliage types are hold in foliage actor and shared by instances using the same model.

    Declaration
    public uint16 Type
    Field Value
    uint16

    Methods

    HasLightmap()

    Determines whether this foliage instance has valid lightmap data.

    Declaration
    public bool HasLightmap() const
    Returns
    bool

    operator==(const FoliageInstance& v)

    Declaration
    public bool operator==(const FoliageInstance& v) const
    Parameters
    FoliageInstance v

    Returns
    bool

    RemoveLightmap()

    Removes the lightmap data from the foliage instance.

    Declaration
    public void RemoveLightmap()
    Returns
    void

    • Improve this Doc
    • View Source
    In This Article
    Back to top Copyright © 2012-2026 Wojciech Figat