#include <PaintBrush.h>
Public Member Functions | |
| AZ_RTTI (PaintBrush, "{D003175F-12BF-4E7E-BD51-2F4B010C9B5E}") | |
| AZ_CLASS_ALLOCATOR (PaintBrush, AZ::SystemAllocator) | |
| PaintBrush (const PaintBrush &)=delete | |
| PaintBrush & | operator= (const PaintBrush &)=delete |
| PaintBrush (const AZ::EntityComponentIdPair &entityComponentIdPair) | |
| void | BeginPaintMode () |
| Tell the PaintBrush to begin paint mode, which will send out the proper notifications to any listeners. | |
| void | EndPaintMode () |
| Tell the PaintBrush to end paint mode, which will send out the proper notifications to any listeners. | |
| bool | IsInPaintMode () const |
| void | BeginBrushStroke (const PaintBrushSettings &brushSettings) |
| Start a brush stroke with the given brush settings for color/intensity/opacity. | |
| void | EndBrushStroke () |
| End the current brush stroke. | |
| bool | IsInBrushStroke () const |
| void | ResetBrushStrokeTracking () |
| void | PaintToLocation (const AZ::Vector3 &brushCenter, const PaintBrushSettings &brushSettings) |
| void | SmoothToLocation (const AZ::Vector3 &brushCenter, const PaintBrushSettings &brushSettings) |
| AZ::Color | UseEyedropper (const AZ::Vector3 &brushCenter) |
PaintBrush contains the core logic for painting functionality. It handles all of the specific calculations for determining the correct values to paint or smooth as a brush moves across the world in a generic way. It relies on a listener to the PaintBrushNotificationBus to provide the other half of the logic for fetching and applying the values themselves.
The general painting flow consists of the following:
| bool AzFramework::PaintBrush::IsInBrushStroke | ( | ) | const |
Returns whether or not the brush is currently in a brush stroke.
| bool AzFramework::PaintBrush::IsInPaintMode | ( | ) | const |
Returns whether or not the paint mode is currently active.
| void AzFramework::PaintBrush::PaintToLocation | ( | const AZ::Vector3 & | brushCenter, |
| const PaintBrushSettings & | brushSettings | ||
| ) |
Apply a paint color to the underlying data based on brush movement and settings.
| brushCenter | The current center of the paintbrush. |
| brushSettings | The current paintbrush settings. |
| void AzFramework::PaintBrush::ResetBrushStrokeTracking | ( | ) |
Reset the brush tracking so that the next action will be considered the start of a stroke movement instead of a continuation. This is useful for handling discontinuous movement (like moving off the edge of the surface on one side and back on from a different side).
| void AzFramework::PaintBrush::SmoothToLocation | ( | const AZ::Vector3 & | brushCenter, |
| const PaintBrushSettings & | brushSettings | ||
| ) |
Smooth the underlying data based on brush movement and settings.
| brushCenter | The current center of the paintbrush. |
| brushSettings | The current paintbrush settings. |
| AZ::Color AzFramework::PaintBrush::UseEyedropper | ( | const AZ::Vector3 & | brushCenter | ) |
Get the color from the underlying data that's located at the brush center
| brushCenter | The current center of the paintbrush. |