Class Decal
Actor that draws the can be used to draw a custom decals on top of the other objects.
Inherited Members
Assembly: FlaxEngine.dll
File: Engine/Level/Actors/Decal.h
Syntax
public class Decal : public Actor
Fields
DrawMinScreenSize
The minimum screen size for the decal drawing. If the decal size on the screen is smaller than this value then decal will be culled. Set it to higher value to make culling more aggressive.
Declaration
public float DrawMinScreenSize = 0.02f
Field Value
float
|
Material
The decal material. Must have domain mode to Decal type.
Declaration
public AssetReference<MaterialBase> Material
Field Value
AssetReference<MaterialBase>
|
SortOrder
The decal rendering order. The higher values are render later (on top).
Declaration
public int32 SortOrder = 0
Field Value
int32
|
Methods
CreateAndSetVirtualMaterialInstance()
Utility to crate a new virtual Material Instance asset, set its parent to the currently applied material, and assign it to the decal. Can be used to modify the decal material parameters from code.
Declaration
public MaterialInstance* CreateAndSetVirtualMaterialInstance()
Returns
MaterialInstance
The created virtual material instance. |
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
Draw(RenderContext& renderContext)
Draws this actor. Called by Scene Rendering service. This call is more optimized than generic Draw (eg. geometry is rendered during all pass types but other actors are drawn only during GBufferFill pass).
Declaration
public virtual void Draw(RenderContext& renderContext) override
Parameters
RenderContext
renderContext
The rendering context. |
Overrides
GetEditorBox()
Gets actor bounding box (single actor, no children included) for editor tools.
Declaration
public virtual BoundingBox GetEditorBox() const override
Returns
BoundingBox
|
Overrides
GetSize()
Gets the decal bounds size (in local space).
Declaration
public Vector3 GetSize() const
Returns
Vector3
|
IntersectsItself(const Ray& ray, Real& distance, Vector3& normal)
Determines if there is an intersection between the current object and a ray.
Declaration
public virtual bool IntersectsItself(const Ray& ray, Real& distance, Vector3& normal) override
Parameters
Ray
ray
The ray to test. |
Real
distance
When the method completes, contains the distance of the intersection (if any valid). |
Vector3
normal
When the method completes, contains the intersection surface normal vector (if any valid). |
Returns
bool
True whether the two objects intersected, otherwise false. |
Overrides
OnDebugDrawSelected()
Draws debug shapes for the selected actor and all child scripts.
Declaration
public virtual void OnDebugDrawSelected() override
Overrides
OnDisable()
Called when actor gets removed from game systems. Occurs on EndPlay event or when actor gets inactivated in hierarchy. Use this event to unregister object from other game system (eg. audio).
Declaration
protected virtual void OnDisable() override
Overrides
OnEnable()
Called when actor gets added to game systems. Occurs on BeginPlay event or when actor gets activated in hierarchy. Use this event to register object to other game system (eg. audio).
Declaration
protected virtual void OnEnable() override
Overrides
OnLayerChanged()
Called when layer gets changed.
Declaration
public virtual void OnLayerChanged() override
Overrides
OnTransformChanged()
Called when actor transform gets changed.
Declaration
protected virtual void OnTransformChanged() override
Overrides
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
SetSize(const Vector3& value)
Sets the decal bounds size (in local space).
Declaration
public void SetSize(const Vector3& value)
Parameters
Vector3
value
|