-
Notifications
You must be signed in to change notification settings - Fork 0
/
ONB.h
33 lines (24 loc) · 898 Bytes
/
ONB.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
#pragma once
#include "Vector3.h"
#include <iostream>
class ONB
{
public:
ONB() {};
ONB(const Vector3 &u, const Vector3 &v, const Vector3 &w) : u(u), v(v), w(w) { }
void InitFromU(const Vector3 &u);
void InitFromV(const Vector3 &v);
void InitFromW(const Vector3 &w);
void Set(const Vector3 &u, const Vector3 &v, const Vector3 &w) { this->v = v; this->u = u; this->w = w; }
void InitFromUV(const Vector3 &u, const Vector3 &v);
void InitFromVU(const Vector3 &v, const Vector3 &u);
void InitFromUW(const Vector3 &u, const Vector3 &w);
void InitFromWU(const Vector3 &w, const Vector3 &u);
void InitFromVW(const Vector3 &v, const Vector3 &w);
void InitFromWV(const Vector3 &w, const Vector3 &v);
public:
Vector3 u, v, w;
};
std::istream& operator>>(std::istream &is, ONB &t);
std::ostream& operator<<(std::ostream &os, const ONB &t);
bool operator==(const ONB &o1, const ONB &o2);