Added OpenGL test.

This commit is contained in:
Angelo Papenhoff
2015-01-17 21:51:04 +01:00
parent c0fab82c52
commit fc40bbdffe
17 changed files with 2283 additions and 0 deletions

39
tests/gl/math/vec4.h Executable file
View File

@@ -0,0 +1,39 @@
#ifndef MATH_VECTOR4_H
#define MATH_VECTOR4_H
#include <iostream>
#include <cmath>
class Vec3;
class Quat;
class Vec4 {
public:
float x, y, z, w;
Vec4(void);
Vec4(float x, float y, float z, float w);
Vec4(float *v);
Vec4(const Vec3 &v, float w = 0.0f);
Vec4(const Quat &w);
float *ptr(void);
Vec4 operator-(void) const;
Vec4 operator+(const Vec4 &rhs) const;
Vec4 operator-(const Vec4 &rhs) const;
Vec4 operator*(float rhs) const;
Vec4 operator/(float rhs) const;
Vec4 &operator+=(const Vec4 &rhs);
Vec4 &operator-=(const Vec4 &rhs);
Vec4 &operator*=(float rhs);
Vec4 &operator/=(float rhs);
bool operator==(const Vec4 &rhs) const;
bool operator!=(const Vec4 &rhs) const;
float norm(void) const;
float normsq(void) const;
Vec4 normalized(void) const;
float dot(const Vec4 &rhs) const;
void print(std::ostream &of) const;
};
#endif