TDME2
1.9.121
src
tdme
engine
model
TextureCoordinate.cpp
Go to the documentation of this file.
1
#include <
tdme/tdme.h
>
2
#include <
tdme/engine/model/TextureCoordinate.h
>
3
4
#include <array>
5
6
using
std::array;
7
8
using
tdme::engine::model::TextureCoordinate
;
9
10
TextureCoordinate::TextureCoordinate()
11
{
12
data
.fill(0.0f);
13
}
14
15
TextureCoordinate::TextureCoordinate
(
const
TextureCoordinate
& textureCoordinate)
16
{
17
data
= textureCoordinate.
data
;
18
}
19
20
TextureCoordinate::TextureCoordinate
(
const
array<float, 2>& uv)
21
{
22
data
= uv;
23
}
24
25
TextureCoordinate::TextureCoordinate
(
float
u,
float
v)
26
{
27
data
[0] = u;
28
data
[1] = 1.0f - v;
29
}
30
31
TextureCoordinate
&
TextureCoordinate::set
(
const
TextureCoordinate
& textureCoordinate) {
32
data
= textureCoordinate.
data
;
33
return
*
this
;
34
}
35
36
TextureCoordinate
&
TextureCoordinate::set
(
const
array<float, 2>& uv) {
37
data
= uv;
38
return
*
this
;
39
}
40
41
TextureCoordinate
&
TextureCoordinate::set
(
float
u,
float
v) {
42
data
[0] = u;
43
data
[1] = 1.0f - v;
44
return
*
this
;
45
}
46
47
TextureCoordinate
TextureCoordinate::clone
()
48
{
49
return
TextureCoordinate
(
data
[0], 1.0f -
data
[1]);
50
}
TextureCoordinate.h
tdme::engine::model::TextureCoordinate
Class representing texture UV coordinates data.
Definition:
TextureCoordinate.h:19
tdme::engine::model::TextureCoordinate::data
array< float, 2 > data
Definition:
TextureCoordinate.h:21
tdme::engine::model::TextureCoordinate::TextureCoordinate
TextureCoordinate()
Public constructor.
Definition:
TextureCoordinate.cpp:10
tdme::engine::model::TextureCoordinate::set
TextureCoordinate & set(const TextureCoordinate &textureCoordinate)
Set texture coordinate.
Definition:
TextureCoordinate.cpp:31
tdme::engine::model::TextureCoordinate::clone
TextureCoordinate clone()
Clones the texture coordinate.
Definition:
TextureCoordinate.cpp:47
tdme.h
Generated by
1.9.3