Practical Tools for Simple Design
Loading...
Searching...
No Matches
Util::PTSDPosition Struct Reference

A class representing a position in a Cartesian coordinates. More...

#include <Position.hpp>

Public Member Functions

 PTSDPosition (float x, float y)
 
 PTSDPosition (glm::vec2 v)
 
PTSDPosition operator+ (const glm::vec2) const
 
PTSDPosition operator- (const glm::vec2 vec2) const
 
 operator glm::vec2 () const
 
SDLPosition ToSDLPosition () const
 

Static Public Member Functions

static PTSDPosition FromSDL (int sdlx, int sdly)
 

Public Attributes

float x {}
 
float y {}
 

Detailed Description

A class representing a position in a Cartesian coordinates.

This class is used to store the X and Y coordinates of a point in a Cartesian coordinate system where:

  • The origin (0, 0) is at the center of the window.
  • X increases to the right.
  • Y increases upwards.

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