Euphoria
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
libs
base
src
base
vec4.cc
Go to the documentation of this file.
1
#include "
base/vec4.h
"
2
3
4
namespace
eu
5
{
6
vec4f::vec4f
(
float
a)
7
: x(a)
8
, y(a)
9
, z(a)
10
, w(a)
11
{
12
}
13
14
15
vec4f::vec4f
(
float
ax,
float
ay,
float
az,
float
aw)
16
: x(ax)
17
, y(ay)
18
, z(az)
19
, w(aw)
20
{
21
}
22
23
24
vec4f::vec4f
(
const
vec3f
& a,
float
aw)
25
: x(a.x)
26
, y(a.y)
27
, z(a.z)
28
, w(aw)
29
{
30
}
31
32
33
vec4f::vec4f
(
const
Scale3f
& a)
34
: x(a.x)
35
, y(a.y)
36
, z(a.z)
37
, w(1)
38
{
39
}
40
41
42
vec4f::vec4f
(
const
float
* a)
43
: x(a[0])
44
, y(a[1])
45
, z(a[2])
46
, w(a[3])
47
{
48
}
49
50
51
vec3f
52
vec4f::to_vec3
(
float
ww)
const
53
{
54
ASSERTX
(
is_equal
(
w
, ww),
w
, ww);
55
return
{
x
,
y
,
z
};
56
}
57
58
59
vec3f
60
vec4f::to_vec3
()
const
61
{
62
return
{
x
,
y
,
z
};
63
}
64
65
66
float
*
67
vec4f::get_data_ptr
()
68
{
69
return
&
x
;
70
}
71
72
73
const
float
*
74
vec4f::get_data_ptr
()
const
75
{
76
return
&
x
;
77
}
78
79
80
std::string
to_string
(
const
vec4f
& v)
81
{
82
return
fmt::format(
"({}, {}, {}, {})"
, v.x, v.y, v.z, v.w);
83
}
84
}
ASSERTX
#define ASSERTX(x,...)
Definition:
assert.h:48
eu
Definition:
assert.h:90
eu::to_string
std::string to_string(const Aabb &a)
Definition:
aabb.cc:110
eu::is_equal
bool is_equal(int lhs, int rhs)
Definition:
numeric.cc:13
eu::Scale3f
Definition:
vec3.h:27
eu::vec3f
Definition:
vec3.h:48
eu::vec4f
Definition:
vec4.h:14
eu::vec4f::get_data_ptr
float * get_data_ptr()
Definition:
vec4.cc:67
eu::vec4f::w
float w
Definition:
vec4.h:18
eu::vec4f::x
float x
Definition:
vec4.h:15
eu::vec4f::y
float y
Definition:
vec4.h:16
eu::vec4f::z
float z
Definition:
vec4.h:17
eu::vec4f::to_vec3
vec3f to_vec3() const
Definition:
vec4.cc:60
eu::vec4f::vec4f
vec4f(float a)
Definition:
vec4.cc:6
vec4.h