-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathv3.h
28 lines (26 loc) · 805 Bytes
/
v3.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#ifndef _V3_H
#define _V3_H
class v3
{
private:
double v[3];
public:
v3(double a =0,double b =0, double c=0);
~v3();
v3(const v3& rhs); //Copy Constructor
v3 & operator=(const v3 & rhs); //assignment operator
v3 operator +(const v3 & rhs); // sum operator
const v3 operator +(const v3 & rhs) const; // sum operator
v3 operator -( const v3 & rhs); // subtract operator
const v3 operator -( const v3 & rhs) const; // subtract operator
v3 operator /(double a) ; // divide operatorr
v3 operator * (double a);
v3 & operator-=(const v3 & rhs);
double dot(const v3 & rhs) const; // dot product
v3 cross(const v3 & rhs); // cross product
double getX() const;
double getY() const;
double getZ() const;
// void tranform(glm::mat4 &mat);
};
#endif