guillaume 1.0.0
Guillaume is a component-based UI framework library built around a primitive rendering system. It's designed for building user interfaces across XR platforms and traditional platforms with custom rendering backends and input handling. The framework is lightweight, flexible, and easy to integrate into existing projects.
Loading...
Searching...
No Matches
point.hpp
1/*
2 Copyright (c) 2025 ETIB Corporation
3
4 Permission is hereby granted, free of charge, to any person obtaining a copy of
5 this software and associated documentation files (the "Software"), to deal in
6 the Software without restriction, including without limitation the rights to
7 use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
8 of the Software, and to permit persons to whom the Software is furnished to do
9 so, subject to the following conditions:
10
11 The above copyright notice and this permission notice shall be included in all
12 copies or substantial portions of the Software.
13
14 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20 SOFTWARE.
21 */
22
23#pragma once
24
25#include "vector.hpp"
26
35class Point : public Vector<float, 3> {
36public:
40 Point(void) : Vector<float, 3>({0.0f, 0.0f, 0.0f}) {}
41
51 Point(float x, float y) : Vector<float, 3>({x, y, 0.0f}) {}
52
62 Point(float x, float y, float z) : Vector<float, 3>({x, y, z}) {}
63
67 Point(const Vector<float, 3> &v) : Vector<float, 3>(v) {}
68
74 float x(void) const { return (*this)[0]; }
75
81 float y(void) const { return (*this)[1]; }
82
88 float z(void) const { return (*this)[2]; }
89
95 float getX(void) const { return x(); }
96
102 float getY(void) const { return y(); }
103
109 float getZ(void) const { return z(); }
110};
Represents a point in 3D space.
Definition point.hpp:35
float getY(void) const
Get the y-coordinate of the point (alias for y())
Definition point.hpp:102
float x(void) const
Access the x-coordinate of the point.
Definition point.hpp:74
Point(float x, float y)
Constructor from 2D coordinates.
Definition point.hpp:51
Point(float x, float y, float z)
Constructor from coordinates.
Definition point.hpp:62
float z(void) const
Access the z-coordinate of the point.
Definition point.hpp:88
Point(void)
Default constructor - initializes point at the origin (0,0,0)
Definition point.hpp:40
Point(const Vector< float, 3 > &v)
Construct from a Vector<float,3> (implicit conversion)
Definition point.hpp:67
float getZ(void) const
Get the z-coordinate of the point (alias for z())
Definition point.hpp:109
float y(void) const
Access the y-coordinate of the point.
Definition point.hpp:81
float getX(void) const
Get the x-coordinate of the point (alias for x())
Definition point.hpp:95
A generic N-dimensional vector class template.
Definition vector.hpp:39