Go to the documentation of this file.
19 static const std::string& s_class() {
20 static const std::string s_v(
"tools::vec4");
25 static T
zero() {
return T();}
33 mem::increment(s_class().c_str());
42 mem::increment(s_class().c_str());
49 vec4(
const T& a0,
const T& a1,
const T& a2,
const T& a3
55 if(a_inc) mem::increment(s_class().c_str());
64 mem::decrement(s_class().c_str());
70 mem::increment(s_class().c_str());
90 void v0(
const T& a_value) {
m_data[0] = a_value;}
91 void v1(
const T& a_value) {
m_data[1] = a_value;}
92 void v2(
const T& a_value) {
m_data[2] = a_value;}
93 void v3(
const T& a_value) {
m_data[3] = a_value;}
100 void set_value(
const T& a0,
const T& a1,
const T& a2,
const T& a3) {
112 void value(T& a0,T& a1,T& a2,T& a3)
const {
120 if(a_index>=4)
return false;
121 m_data[a_index] = a_value;
131 if(norme==T())
return T();
146 for(
unsigned int i=0;i<4;i++,tp++,ap++) {
147 T
diff = (*tp) - (*ap);
149 if(
diff>=a_epsil)
return false;
160 for(
unsigned int i=0;i<4;i++,tp++,ap++) {
161 if( ((*tp)==
zero()) && ((*ap)==
zero())) {
163 }
else if( ((*tp)!=
zero()) && ((*ap)==
zero())) {
165 }
else if( ((*tp)==
zero()) && ((*ap)!=
zero())) {
169 a_factor = (*ap)/(*tp);
172 if((*ap)!=(*tp)*a_factor)
return false;
187 if(a_T==T())
return false;
202 void add(
const T& a0,
const T& a1,
const T& a2,
const T& a3) {
216 void subtract(
const T& a0,
const T& a1,
const T& a2,
const T& a3) {
263 private:
static void check_instantiation() {
vec4<float> v;}
279 a_out <<
"x = " << a_this.
v0()
280 <<
",y = " << a_this.
v1()
281 <<
",z = " << a_this.
v2()
282 <<
",t = " << a_this.
v3();