// Copyright (c) Wojciech Figat. All rights reserved. #pragma once #include "Engine/Scripting/ScriptingType.h" struct RenderContext; class Texture; class SceneRenderTask; class Actor; /// /// Editor viewports icons rendering service. /// API_CLASS(Static, Namespace="FlaxEditor") class FLAXENGINE_API ViewportIconsRenderer { DECLARE_SCRIPTING_TYPE_NO_SPAWN(ViewportIconsRenderer); public: /// /// Global scale of the icons. /// API_FIELD() static float Scale; /// /// The minimum size of the icons. /// API_FIELD() static Real MinSize; /// /// The maximum size of the icons. /// API_FIELD() static Real MaxSize; /// /// The distance to the camera at which the icons will be drawn at their maximum size. /// API_FIELD() static Real MaxSizeDistance; /// /// Draws the icons for the actors in the given scene (or actor tree). /// /// The icon position. /// The viewer position. /// The computed bounds for the icon. API_FUNCTION() static void GetBounds(API_PARAM(Ref) const Vector3& position, API_PARAM(Ref) const Vector3& viewPosition, API_PARAM(Out) BoundingSphere& bounds); /// /// Draws the icons for the actors in the given scene (or actor tree). /// /// The rendering context. /// The actor (use scene for faster rendering). API_FUNCTION() static void DrawIcons(API_PARAM(Ref) RenderContext& renderContext, Actor* actor); /// /// Adds icon to the custom actor. /// /// The actor type. /// The icon texture to draw. API_FUNCTION() static void AddCustomIcon(const ScriptingTypeHandle& type, Texture* iconTexture); /// /// Adds actor to the viewport icon rendering. /// /// The actor to register for icon drawing. API_FUNCTION() static void AddActor(Actor* actor); /// /// Adds actor to the viewport icon rendering. /// /// The actor to register for icon drawing. /// The icon texture to draw. API_FUNCTION() static void AddActorWithTexture(Actor* actor, Texture* iconTexture); /// /// Removes actor from the viewport icon rendering. /// /// The actor to unregister for icon drawing. API_FUNCTION() static void RemoveActor(Actor* actor); };