Gorgon Game Engine
Simple.h
Go to the documentation of this file.
1
#pragma once
2
3
#include "../Geometry/Point3D.h"
4
#include "../Geometry/Transform3D.h"
5
#include "../Geometry/Point.h"
6
7
8
namespace
Gorgon
{
namespace
GL {
9
10
class
QuadVertices
{
11
public
:
12
QuadVertices
() { }
13
14
QuadVertices
(
Geometry::Point3D
p1,
Geometry::Point3D
p2,
Geometry::Point3D
p3,
Geometry::Point3D
p4) {
15
Vertices
[0] = p1;
16
Vertices
[1] = p2;
17
Vertices
[2] = p3;
18
Vertices
[3] = p4;
19
}
20
21
Geometry::Point3D
&
operator[]
(
int
ind) {
22
return
Vertices
[ind];
23
}
24
25
const
Geometry::Point3D
&
operator[]
(
int
ind)
const
{
26
return
Vertices
[ind];
27
}
28
29
union
{
30
Geometry::Point3D
Vertices
[4];
31
float
Data
[12];
32
};
33
};
34
35
inline
QuadVertices
operator *
(
const
Geometry::Transform3D
&transform,
const
QuadVertices
&quad) {
36
QuadVertices
ret;
37
38
for
(
int
i=0; i<4; i++)
39
ret[i] = transform * quad[i];
40
41
return
ret;
42
}
43
44
class
QuadTextureCoords
{
45
public
:
46
QuadTextureCoords
() { };
47
48
QuadTextureCoords
(
Geometry::Pointf
p1,
Geometry::Pointf
p2,
Geometry::Pointf
p3,
Geometry::Pointf
p4) {
49
Coords
[0] = p1;
50
Coords
[1] = p2;
51
Coords
[2] = p3;
52
Coords
[3] = p4;
53
}
54
55
Geometry::Pointf
&
operator[]
(
int
ind) {
56
return
Coords
[ind];
57
}
58
59
const
Geometry::Pointf
&
operator[]
(
int
ind)
const
{
60
return
Coords
[ind];
61
}
62
63
void
FlipY
() {
64
Coords
[0].
Y
= 1-
Coords
[0].
Y
;
65
Coords
[1].
Y
= 1-
Coords
[1].
Y
;
66
Coords
[2].
Y
= 1-
Coords
[2].
Y
;
67
Coords
[3].
Y
= 1-
Coords
[3].
Y
;
68
}
69
70
union
{
71
Geometry::Pointf
Coords
[4];
72
float
Data
[8];
73
};
74
};
75
76
} }
Gorgon::GL::QuadVertices::operator[]
Geometry::Point3D & operator[](int ind)
Definition:
Simple.h:21
Gorgon::GL::QuadTextureCoords::Coords
Geometry::Pointf Coords[4]
Definition:
Simple.h:71
Gorgon::GL::QuadTextureCoords::Data
float Data[8]
Definition:
Simple.h:72
Gorgon::Geometry::basic_Point3D
Definition:
Point3D.h:12
Gorgon::GL::QuadTextureCoords::operator[]
Geometry::Pointf & operator[](int ind)
Definition:
Simple.h:55
Gorgon::GL::QuadTextureCoords::QuadTextureCoords
QuadTextureCoords(Geometry::Pointf p1, Geometry::Pointf p2, Geometry::Pointf p3, Geometry::Pointf p4)
Definition:
Simple.h:48
Gorgon::Geometry::basic_Transform3D
Definition:
Transform3D.h:12
Gorgon
Root namespace for Gorgon Game Engine.
Definition:
Any.h:19
Gorgon::GL::QuadVertices::Vertices
Geometry::Point3D Vertices[4]
Definition:
Simple.h:30
Gorgon::GL::QuadVertices::Data
float Data[12]
Definition:
Simple.h:31
Gorgon::Geometry::basic_Point
This class represents a 2D point.
Definition:
Point.h:32
Gorgon::GL::operator*
QuadVertices operator*(const Geometry::Transform3D &transform, const QuadVertices &quad)
Definition:
Simple.h:35
Gorgon::GL::QuadVertices::QuadVertices
QuadVertices(Geometry::Point3D p1, Geometry::Point3D p2, Geometry::Point3D p3, Geometry::Point3D p4)
Definition:
Simple.h:14
Gorgon::Geometry::basic_Point::Y
T_ Y
Y coordinate.
Definition:
Point.h:371
Gorgon::GL::QuadVertices::QuadVertices
QuadVertices()
Definition:
Simple.h:12
Gorgon::GL::QuadTextureCoords::FlipY
void FlipY()
Definition:
Simple.h:63
Gorgon::GL::QuadTextureCoords
Definition:
Simple.h:44
Gorgon::GL::QuadTextureCoords::QuadTextureCoords
QuadTextureCoords()
Definition:
Simple.h:46
Gorgon::GL::QuadVertices
Definition:
Simple.h:10
Gorgon
GL
Simple.h
Generated on Sun Nov 15 2020 14:36:03 for Gorgon Game Engine by
1.8.20