-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRay.h
More file actions
62 lines (49 loc) · 1.41 KB
/
Ray.h
File metadata and controls
62 lines (49 loc) · 1.41 KB
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
// *********************************************************
// Ray Class
// Author : Tamy Boubekeur (boubek@gmail.com).
// Copyright (C) 2010 Tamy Boubekeur.
// All rights reserved.
// *********************************************************
#ifndef RAY_H
#define RAY_H
#include <iostream>
#include <vector>
#include "Vec3D.h"
#include "BoundingBox.h"
#include "Vertex.h"
#include "Surfel.h"
#define EPSILON 0.00000000000000000000001
class Ray {
public:
inline Ray () {}
inline Ray (const Vec3Df & origin, const Vec3Df & direction)
: origin (origin), direction (direction) {}
inline virtual ~Ray () {}
inline const Vec3Df & getOrigin () const { return origin; }
inline Vec3Df & getOrigin () { return origin; }
inline const Vec3Df & getDirection () const { return direction; }
inline Vec3Df & getDirection () { return direction; }
bool intersect (const BoundingBox & bbox, Vec3Df & intersectionPoint) const;
bool intersect (
const Vertex& v0,
const Vertex& v1,
const Vertex& v2,
float& t,
float& u,
float& v
) const;
bool intersect (
const Surfel& iSurfel,
Vec3Df& oPosition
) const;
private:
Vec3Df origin;
Vec3Df direction;
};
#endif // RAY_H
// Some Emacs-Hints -- please don't remove:
//
// Local Variables:
// mode:C++
// tab-width:4
// End: