|
Deki 1.3.0
Modular C++ 2D engine for embedded displays and desktop
|
Singleton providing current render context for scene view. More...
#include <SceneView.h>
Public Member Functions | |
| float | GetScreenX () const |
| Screen X position of object center. | |
| float | GetScreenY () const |
| Screen Y position of object center. | |
| float | GetWorldX () const |
| World X position. | |
| float | GetWorldY () const |
| World Y position. | |
| float | GetScaleX () const |
| World scale X. | |
| float | GetScaleY () const |
| World scale Y. | |
| float | GetRotation () const |
| Rotation in radians (engine convention). | |
| float | GetZoom () const |
| View zoom level (editor wheel zoom * dpi only — no PPM). | |
| float | GetPixelsPerMeter () const |
| Pixels per meter for the active project camera (world scale). | |
| float | GetWorldToScreenScale () const |
| World meters to screen pixels (= zoom * pixelsPerMeter). | |
| float | GetDisplayWidth () const |
| Display width (for current component). | |
| float | GetDisplayHeight () const |
| Display height (for current component). | |
| bool | IsCurrentObjectSelected () const |
| Whether current object is selected. | |
| DekiObject * | GetCurrentObject () const |
| Get current object being rendered. | |
| int | GetTargetWidth () const |
| Project render target width in pixels (DisplaySettings.targetWidth). | |
| int | GetTargetHeight () const |
| Project render target height in pixels (DisplaySettings.targetHeight). | |
| void | SetTargetSize (int width, int height) |
| Set project render target size (called by SceneViewPanel). | |
| void | DrawLine (float x0, float y0, float x1, float y1, uint32_t rgba, float thickness=1.0f) |
| void | DrawRect (float x0, float y0, float x1, float y1, uint32_t rgba, float thickness=1.0f, float rounding=0.0f) |
| void | DrawRectFilled (float x0, float y0, float x1, float y1, uint32_t rgba, float rounding=0.0f) |
| void | DrawCircle (float cx, float cy, float radius, uint32_t rgba, float thickness=1.0f) |
| void | DrawCircleFilled (float cx, float cy, float radius, uint32_t rgba) |
| void | BeginObject (const SceneViewContext &ctx) |
| Begin rendering an object (called by SceneObjectRenderer). | |
| void | EndObject () |
| End rendering an object. | |
Static Public Member Functions | |
| static SceneView & | Get () |
| Get singleton instance. | |
| static uint32_t | Rgba (uint8_t r, uint8_t g, uint8_t b, uint8_t a=255) |
| Pack an RGBA color (components 0-255) for the Draw* methods. | |
Singleton providing current render context for scene view.
Unity-like static access for gizmo implementations: auto& view = SceneView::Get(); float halfW = sprite->width * view.GetScaleX() * view.GetZoom() * 0.5f;
The SceneViewPanel calls BeginObject/EndObject to set up context for gizmo rendering. Visual content is rendered via DekiRenderSystem.
|
static |
Get singleton instance.
|
inline |
Screen X position of object center.
|
inline |
Screen Y position of object center.
|
inline |
World X position.
|
inline |
World Y position.
|
inline |
World scale X.
|
inline |
World scale Y.
|
inline |
Rotation in radians (engine convention).
|
inline |
View zoom level (editor wheel zoom * dpi only — no PPM).
|
inline |
Pixels per meter for the active project camera (world scale).
|
inline |
World meters to screen pixels (= zoom * pixelsPerMeter).
Use this for any gizmo dimension that originates in world units (e.g. CameraComponent::GetVisibleWidth, or an emission shape's radius). For fixed-screen-size accents (crosshairs, handle dots) use GetZoom().
|
inline |
Display width (for current component).
|
inline |
Display height (for current component).
|
inline |
Whether current object is selected.
|
inline |
Get current object being rendered.
|
inline |
Project render target width in pixels (DisplaySettings.targetWidth).
|
inline |
Project render target height in pixels (DisplaySettings.targetHeight).
|
inline |
Set project render target size (called by SceneViewPanel).
|
inlinestatic |
Pack an RGBA color (components 0-255) for the Draw* methods.
| void DekiEditor::SceneView::DrawLine | ( | float | x0, |
| float | y0, | ||
| float | x1, | ||
| float | y1, | ||
| uint32_t | rgba, | ||
| float | thickness = 1.0f ) |
| void DekiEditor::SceneView::DrawRect | ( | float | x0, |
| float | y0, | ||
| float | x1, | ||
| float | y1, | ||
| uint32_t | rgba, | ||
| float | thickness = 1.0f, | ||
| float | rounding = 0.0f ) |
| void DekiEditor::SceneView::DrawRectFilled | ( | float | x0, |
| float | y0, | ||
| float | x1, | ||
| float | y1, | ||
| uint32_t | rgba, | ||
| float | rounding = 0.0f ) |
| void DekiEditor::SceneView::DrawCircle | ( | float | cx, |
| float | cy, | ||
| float | radius, | ||
| uint32_t | rgba, | ||
| float | thickness = 1.0f ) |
| void DekiEditor::SceneView::DrawCircleFilled | ( | float | cx, |
| float | cy, | ||
| float | radius, | ||
| uint32_t | rgba ) |
| void DekiEditor::SceneView::BeginObject | ( | const SceneViewContext & | ctx | ) |
Begin rendering an object (called by SceneObjectRenderer).
| ctx | Context containing all render parameters |
| void DekiEditor::SceneView::EndObject | ( | ) |
End rendering an object.