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

40
tests/gl/math/vec3.h Executable file
View File

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