AeonGUI
A portable video game graphic user interface library.
Loading...
Searching...
No Matches
DOMPointReadOnly.hpp
1/*
2Copyright (C) 2025,2026 Rodrigo Jose Hernandez Cordoba
3
4Licensed under the Apache License, Version 2.0 (the "License");
5you may not use this file except in compliance with the License.
6You may obtain a copy of the License at
7
8http://www.apache.org/licenses/LICENSE-2.0
9
10Unless required by applicable law or agreed to in writing, software
11distributed under the License is distributed on an "AS IS" BASIS,
12WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13See the License for the specific language governing permissions and
14limitations under the License.
15*/
16#ifndef AEONGUI_DOMPOINTREADONLY_HPP
17#define AEONGUI_DOMPOINTREADONLY_HPP
18
19#include "aeongui/Platform.hpp"
20#include "DOMString.hpp"
21
22namespace AeonGUI
23{
24 namespace DOM
25 {
33 {
34 public:
41 DOMPointReadOnly ( float x = 0.0f, float y = 0.0f, float z = 0.0f, float w = 1.0f );
46 float x() const;
49 float y() const;
52 float z() const;
55 float w() const;
56
62 template <typename T>
63 static DOMPointReadOnly fromPoint ( const T& point )
64 {
65 return DOMPointReadOnly ( point.x(), point.y(), point.z(), point.w() );
66 }
67
71 DOMPointReadOnly matrixTransform ( const DOMMatrixReadOnly& matrix ) const;
75 DOMString toJSON() const;
76 protected:
77 float mX{};
78 float mY{};
79 float mZ{};
80 float mW{};
81 };
82 }
83}
84
85#endif
Platform-specific DLL import/export macros and compiler helpers.
Immutable 4x4 transformation matrix.
Definition DOMMatrixReadOnly.hpp:38
Immutable 3D point with a perspective component.
Definition DOMPointReadOnly.hpp:33
float mW
W (perspective) component.
Definition DOMPointReadOnly.hpp:80
float z() const
Get the Z coordinate.
Definition DOMPointReadOnly.cpp:37
float mZ
Z coordinate.
Definition DOMPointReadOnly.hpp:79
static DOMPointReadOnly fromPoint(const T &point)
Create a DOMPointReadOnly from any point-like object.
Definition DOMPointReadOnly.hpp:63
virtual ~DOMPointReadOnly()
Destructor.
float y() const
Get the Y coordinate.
Definition DOMPointReadOnly.cpp:33
float x() const
Get the X coordinate.
Definition DOMPointReadOnly.cpp:29
float mY
Y coordinate.
Definition DOMPointReadOnly.hpp:78
float w() const
Get the W (perspective) component.
Definition DOMPointReadOnly.cpp:41
DOMPointReadOnly(float x=0.0f, float y=0.0f, float z=0.0f, float w=1.0f)
Construct a point.
Definition DOMPointReadOnly.cpp:24
float mX
X coordinate.
Definition DOMPointReadOnly.hpp:77