Search Results for

    Show / Hide Table of Contents

    Class FoliageType

    Foliage mesh instances type descriptor. Defines the shared properties of the spawned mesh instances.

    Inheritance
    Object
    ScriptingObject
    FoliageType
    Inherited Members
    ScriptingObject::_gcHandle
    ScriptingObject::_id
    ScriptingObject::_type
    ScriptingObject::CanCast(const ScriptingTypeHandle& from, const ScriptingTypeHandle& to)
    ScriptingObject::CanCast(const MClass* from, const MClass* to)
    ScriptingObject::Cast(ScriptingObject* obj)
    ScriptingObject::ChangeID(const Guid& newId)
    ScriptingObject::CreateManaged()
    ScriptingObject::CreateManagedInternal()
    ScriptingObject::Deleted
    Object::DeleteObject(float timeToLive = 0.0f, bool useGameTime=false)
    Object::DeleteObjectNow()
    ISerializable::DeserializeIfExists(DeserializeStream& stream, const char* memberName, ISerializeModifier* modifier)
    FoliageType
    ScriptingObject::DestroyManaged()
    Object::Flags
    ScriptingObject::FromInterface(void* interfaceObj, const ScriptingTypeHandle& interfaceType)
    ScriptingObject::FromInterface(T* interfaceObj)
    ScriptingObject::GetClass()
    ScriptingObject::GetID()
    ScriptingObject::GetManagedInstance()
    ScriptingObject::GetOrCreateManagedInstance()
    ScriptingObject::GetType()
    ScriptingObject::GetTypeHandle()
    ScriptingObject::HasManagedInstance()
    ScriptingObject::Is(const ScriptingTypeHandle& type)
    ScriptingObject::Is(const MClass* type)
    ScriptingObject::Is()
    ScriptingObject::IsRegistered()
    ScriptingObject::NewObject(const ScriptingTypeHandle& typeHandle)
    ScriptingObject::NewObject()
    ScriptingObject::OnDeleteObject()
    ScriptingObject::OnManagedInstanceDeleted()
    ScriptingObject::OnScriptingDispose()
    ScriptingObject::RegisterObject()
    ScriptingObject::ScriptingObject(const SpawnParams& params)
    FoliageType
    FoliageType
    ScriptingObject::SetManagedInstance(MObject* instance)
    FoliageType
    ScriptingObject::ToInterface(ScriptingObject* obj, const ScriptingTypeHandle& interfaceType)
    ScriptingObject::ToInterface(ScriptingObject* obj)
    ScriptingObject::ToManaged(const ScriptingObject* obj)
    ScriptingObject::ToNative(MObject* obj)
    ScriptingObject::ToString()
    ScriptingObject::UnregisterObject()
    ISerializable::~ISerializable()
    Object::~Object()
    ScriptingObject::~ScriptingObject()
    Assembly: FlaxEngine.dll
    File: Engine/Foliage/FoliageType.h
    Syntax
    public class FoliageType : public ScriptingObject, public ISerializable

    Constructors

    FoliageType()

    Initializes a new instance of the FoliageType class.

    Declaration
    public FoliageType()

    FoliageType(const FoliageType& other)

    Declaration
    public FoliageType(const FoliageType& other)
    Parameters
    FoliageType other

    Fields

    Clusters

    The allocated foliage clusters. It's read-only.

    Declaration
    public ChunkedArray<FoliageCluster, FOLIAGE_CLUSTER_CHUNKS_SIZE> Clusters
    Field Value
    ChunkedArray<FoliageCluster, FOLIAGE_CLUSTER_CHUNKS_SIZE>

    CullDistance

    The per-instance cull distance.

    Declaration
    public float CullDistance = 10000.0f
    Field Value
    float

    CullDistanceRandomRange

    The per-instance cull distance randomization range (randomized per instance and added to master CullDistance value).

    Declaration
    public float CullDistanceRandomRange = 1000.0f
    Field Value
    float

    DensityScalingScale

    The density scaling scale applied to the global scale for the foliage instances of this type. Can be used to boost or reduce density scaling effect on this foliage type. Default is 1.

    Declaration
    public float DensityScalingScale = 1.0f
    Field Value
    float

    DrawModes

    The draw passes to use for rendering this foliage type.

    Declaration
    public DrawPass DrawModes = DrawPass::Depth | DrawPass::GBuffer | DrawPass::Forward
    Field Value
    DrawPass

    Entries

    The shared model instance entries.

    Declaration
    public ModelInstanceEntries Entries
    Field Value
    ModelInstanceEntries

    Foliage

    The parent foliage actor.

    Declaration
    public Foliage* Foliage
    Field Value
    Foliage

    Index

    The foliage type index.

    Declaration
    public int32 Index
    Field Value
    int32

    Model

    The model to draw by the instances.

    Declaration
    public AssetReference<Model> Model
    Field Value
    AssetReference<Model>

    PaintDensity

    The foliage instances density defined in instances count per 1000x1000 units area.

    Declaration
    public float PaintDensity = 1.0f
    Field Value
    float

    PaintGroundSlopeAngleMax

    The maximum ground slope angle to paint foliage on it (in degrees).

    Declaration
    public float PaintGroundSlopeAngleMax = 45.0f
    Field Value
    float

    PaintGroundSlopeAngleMin

    The minimum ground slope angle to paint foliage on it (in degrees).

    Declaration
    public float PaintGroundSlopeAngleMin = 0.0f
    Field Value
    float

    PaintRadius

    The minimum radius between foliage instances.

    Declaration
    public float PaintRadius = 0.0f
    Field Value
    float

    PaintScaleMax

    The scale maximum values per axis.

    Declaration
    public Float3 PaintScaleMax = Float3::One
    Field Value
    Float3

    PaintScaleMin

    The scale minimum values per axis.

    Declaration
    public Float3 PaintScaleMin = Float3::One
    Field Value
    Float3

    PaintScaling

    The scaling mode.

    Declaration
    public FoliageScalingModes PaintScaling = FoliageScalingModes::Uniform
    Field Value
    FoliageScalingModes

    PlacementAlignToNormal

    If checked, instances will be aligned to normal of the placed surface.

    Declaration
    public int8 PlacementAlignToNormal
    Field Value
    int8

    PlacementOffsetY

    The per-instance random offset range on axis Y.

    Declaration
    public Float2 PlacementOffsetY = Float2::Zero
    Field Value
    Float2

    PlacementRandomPitchAngle

    The random pitch angle range (uniform in both ways around normal vector).

    Declaration
    public float PlacementRandomPitchAngle = 0.0f
    Field Value
    float

    PlacementRandomRollAngle

    The random roll angle range (uniform in both ways around normal vector).

    Declaration
    public float PlacementRandomRollAngle = 0.0f
    Field Value
    float

    PlacementRandomYaw

    If checked, instances will use randomized yaw when placed. Random yaw uses will rotation range over the Y axis.

    Declaration
    public int8 PlacementRandomYaw
    Field Value
    int8

    ReceiveDecals

    Determines whenever this meshes can receive decals.

    Declaration
    public int8 ReceiveDecals
    Field Value
    int8

    Root

    The root cluster. Contains all the instances and it's the starting point of the quad-tree hierarchy. Null if no foliage added. It's read-only.

    Declaration
    public FoliageCluster* Root = nullptr
    Field Value
    FoliageCluster

    ScaleInLightmap

    The scale in lightmap (for instances of this foliage type). Can be used to adjust static lighting quality for the foliage instances.

    Declaration
    public float ScaleInLightmap = 1.0f
    Field Value
    float

    ShadowsMode

    The shadows casting mode.

    Declaration
    public ShadowsCastingMode ShadowsMode = ShadowsCastingMode::All
    Field Value
    ShadowsCastingMode

    UseDensityScaling

    Flag used to determinate whenever use global foliage density scaling for instances of this foliage type.

    Declaration
    public int8 UseDensityScaling
    Field Value
    int8

    Methods

    Deserialize(DeserializeStream& stream, ISerializeModifier* modifier)

    Deserializes object from the input stream.

    Declaration
    public virtual void Deserialize(DeserializeStream& stream, ISerializeModifier* modifier) override
    Parameters
    DeserializeStream stream

    The input stream.

    ISerializeModifier modifier

    The deserialization modifier object. Always valid.

    Overrides
    ISerializable::Deserialize(DeserializeStream& stream, ISerializeModifier* modifier)

    GetMaterials()

    Gets the foliage instance type materials buffer (overrides).

    Declaration
    public Array<MaterialBase* > GetMaterials() const
    Returns
    Array<MaterialBase >

    GetRandomScale()

    Gets the random scale for the foliage instance of this type.

    Declaration
    public Float3 GetRandomScale() const
    Returns
    Float3

    IsReady()

    Determines whether this instance is ready (model is loaded).

    Declaration
    public bool IsReady() const
    Returns
    bool

    operator=(const FoliageType& other)

    Declaration
    public FoliageType operator=(const FoliageType& other)
    Parameters
    FoliageType other

    Returns
    FoliageType

    Serialize(SerializeStream& stream, const void* otherObj)

    Serializes object to the output stream compared to the values of the other object instance (eg. default class object). If other object is null then serialize all properties.

    Declaration
    public virtual void Serialize(SerializeStream& stream, const void* otherObj) override
    Parameters
    SerializeStream stream

    The output stream.

    void otherObj

    The instance of the object to compare with and serialize only the modified properties. If null, then serialize all properties.

    Overrides
    ISerializable::Serialize(SerializeStream& stream, const void* otherObj)

    SetMaterials(const Array<MaterialBase* >& value)

    Sets the foliage instance type materials buffer (overrides).

    Declaration
    public void SetMaterials(const Array<MaterialBase* >& value)
    Parameters
    Array<MaterialBase > value

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