-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvector3.h
More file actions
36 lines (28 loc) · 966 Bytes
/
Copy pathvector3.h
File metadata and controls
36 lines (28 loc) · 966 Bytes
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
#pragma once
#include <iostream>
#include "transformation.h"
namespace libMesh {
struct Vector3 {
public:
Vector3();
Vector3(float x, float y, float z);
Vector3(const Vector3& other);
float x;
float y;
float z;
static Vector3 XAxis;
static Vector3 YAxis;
static Vector3 ZAxis;
float dot(Vector3 other);
Vector3 cross(Vector3 other);
void transform(Transformation t);
Vector3 transformed(Transformation t);
void scale(float value);
Vector3 scaled(float value);
bool operator ==(const Vector3& other) const;
bool operator !=(const Vector3& other) const;
friend std::ostream& operator <<(std::ostream& os, const Vector3& v) {
return os << "Vector3(" << v.x << ", " << v.y << ", " << v.z << ")";
}
};
}