-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathVector.h
47 lines (38 loc) · 959 Bytes
/
Vector.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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
//
// Vector.h
// Tech1
//
// Created by Justin Hust on 12/29/13.
// Copyright (c) 2013 __MyCompanyName__. All rights reserved.
//
#ifndef Tech1_Vector_h
#define Tech1_Vector_h
class Vec3 {
public:
// DATA
float x;
float y;
float z;
// CREATORS
Vec3(void);
Vec3(float x_, float y_, float z_);
Vec3(float v[]);
Vec3(const Vec3 &v);
// MANIPULATORS
Vec3 & operator = (const Vec3 &v);
void operator += (const Vec3 &v);
void operator -= (const Vec3 &v);
void operator *= (float f);
void operator /= (float f);
Vec3 operator + (const Vec3 &v) const;
Vec3 operator - (const Vec3 &v) const;
Vec3 operator * (float f) const;
Vec3 operator / (float f) const;
void normalize(void);
// ACCESSORS
float mag(void) const;
bool operator == (const Vec3 &v) const;
bool operator != (const Vec3 &v) const;
float operator [] (unsigned int i) const;
};
#endif