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