Deki 1.3.0
Modular C++ 2D engine for embedded displays and desktop
Loading...
Searching...
No Matches

Camera interface for coordinate conversion. More...

#include <ICamera.h>

Public Member Functions

virtual void ScreenToWorld (float screenX, float screenY, int bufferWidth, int bufferHeight, float &worldX, float &worldY) const =0
virtual void WorldToScreen (float worldX, float worldY, int bufferWidth, int bufferHeight, float &screenX, float &screenY) const =0
virtual void GetClearColor (uint8_t &r, uint8_t &g, uint8_t &b) const =0
virtual void SetClearColor (uint8_t r, uint8_t g, uint8_t b)=0
virtual float GetPixelsPerMeter () const =0
virtual void SetPixelsPerMeter (float pixelsPerMeter)=0
virtual ProjectionMode GetProjectionMode () const
virtual void SetProjectionMode (ProjectionMode)
virtual Mat4 GetProjectionMatrix (int bufferWidth, int bufferHeight) const
 Build a projection matrix for the requested logical-buffer size.
virtual ~ICamera ()=default

Static Public Attributes

static constexpr uint32_t InterfaceID = 0x43414D00

Detailed Description

Camera interface for coordinate conversion.

Packages implement this interface on their camera components. The editor queries it via DekiObject::FindInterface<ICamera>() without knowing the concrete camera type.

Coordinate model: world (meters, float) → screen pixels (float) via: screen = (world * pixelsPerMeter) + buffer_center The camera's pixelsPerMeter directly drives screen scale. Setting it equal to the project's pixelsPerMeter yields 1:1 visualization; larger values zoom in, smaller zoom out. The optional pixel-snap step lives in the renderer, not in the camera.

Constructor & Destructor Documentation

◆ ~ICamera()

virtual ICamera::~ICamera ( )
virtualdefault

Member Function Documentation

◆ ScreenToWorld()

virtual void ICamera::ScreenToWorld ( float screenX,
float screenY,
int bufferWidth,
int bufferHeight,
float & worldX,
float & worldY ) const
pure virtual

◆ WorldToScreen()

virtual void ICamera::WorldToScreen ( float worldX,
float worldY,
int bufferWidth,
int bufferHeight,
float & screenX,
float & screenY ) const
pure virtual

◆ GetClearColor()

virtual void ICamera::GetClearColor ( uint8_t & r,
uint8_t & g,
uint8_t & b ) const
pure virtual

◆ SetClearColor()

virtual void ICamera::SetClearColor ( uint8_t r,
uint8_t g,
uint8_t b )
pure virtual

◆ GetPixelsPerMeter()

virtual float ICamera::GetPixelsPerMeter ( ) const
pure virtual

◆ SetPixelsPerMeter()

virtual void ICamera::SetPixelsPerMeter ( float pixelsPerMeter)
pure virtual

◆ GetProjectionMode()

virtual ProjectionMode ICamera::GetProjectionMode ( ) const
inlinevirtual

◆ SetProjectionMode()

virtual void ICamera::SetProjectionMode ( ProjectionMode )
inlinevirtual

◆ GetProjectionMatrix()

virtual Mat4 ICamera::GetProjectionMatrix ( int bufferWidth,
int bufferHeight ) const
inlinevirtual

Build a projection matrix for the requested logical-buffer size.

Default returns an orthographic matrix matching the camera's pixelsPerMeter. Perspective is the camera implementor's job (returns identity by default). NOT consumed by Standard2DRenderer.

Member Data Documentation

◆ InterfaceID

uint32_t ICamera::InterfaceID = 0x43414D00
staticconstexpr

The documentation for this class was generated from the following file: