Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * File: vec3.h
- * Author: peixinho
- *
- * Created on March 15, 2011, 10:19 AM
- */
- #ifndef VEC3_H
- #define VEC3_H
- #include <sstream>
- #include <iostream>
- #include <math.h>
- namespace SelFish3D {
- using namespace std;
- class vec3 {
- public:
- float x,y,z;
- vec3();
- vec3(const float &x, const float &y, const float &z);
- float dotProduct(const vec3 &v) const;
- float magnitude() const;
- float magnitudeSQR() const;
- float distance(const vec3 &v) const;
- float distanceSQR(const vec3 &v) const;
- vec3 cross(const vec3 &v) const;
- vec3 normalize() const;
- vec3 clone() const;
- vec3 negate() const;
- string toString() const;
- vec3 operator+(const vec3 &v) const;
- vec3 operator-(const vec3 &v) const;
- vec3 operator*(const vec3 &v) const;
- vec3 operator/(const vec3 &v) const;
- vec3 operator+(const float &f) const;
- vec3 operator-(const float &f) const;
- vec3 operator*(const float &f) const;
- vec3 operator/(const float &f) const;
- void operator+=(const vec3 &v);
- void operator-=(const vec3 &v);
- void operator*=(const vec3 &v);
- void operator/=(const vec3 &v);
- void operator+=(const float &f);
- void operator-=(const float &f);
- void operator*=(const float &f);
- void operator/=(const float &f);
- bool operator==(const vec3 &v) const;
- virtual ~vec3();
- private:
- };
- }
- #endif /* VEC3_H */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement