Class FoliageType
Foliage mesh instances type descriptor. Defines the shared properties of the spawned mesh instances.
Inherited Members
Assembly: FlaxEngine.dll
File: Engine/Foliage/FoliageType.h
Syntax
public class FoliageType : public ScriptingObject, public ISerializable
Constructors
FoliageType()
FoliageType(const 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
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
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
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
|