Jet
v1.3.3
jet
ray2.h
Go to the documentation of this file.
1
// Copyright (c) 2018 Doyub Kim
2
//
3
// I am making my contributions/submissions to this project solely in my
4
// personal capacity and am not conveying any rights to any intellectual
5
// property of any third parties.
6
7
#ifndef INCLUDE_JET_RAY2_H_
8
#define INCLUDE_JET_RAY2_H_
9
10
#include <
jet/vector2.h
>
11
#include <
jet/ray.h
>
12
13
namespace
jet
{
14
20
template
<
typename
T>
21
class
Ray
<T, 2> final {
22
public
:
23
static_assert(
24
std::is_floating_point<T>::value,
25
"Ray only can be instantiated with floating point types"
);
26
28
Vector2<T>
origin
;
29
31
Vector2<T>
direction
;
32
34
Ray
();
35
37
Ray
(
const
Vector2<T>
& newOrigin,
const
Vector2<T>
& newDirection);
38
40
Ray
(
const
Ray
& other);
41
43
Vector2<T>
pointAt
(T t)
const
;
44
};
45
47
template
<
typename
T>
using
Ray2
=
Ray<T, 2>
;
48
50
typedef
Ray2<float>
Ray2F
;
51
53
typedef
Ray2<double>
Ray2D
;
54
55
}
// namespace jet
56
57
#include "detail/ray2-inl.h"
58
59
#endif // INCLUDE_JET_RAY2_H_
jet::Ray< T, 2 >::Ray
Ray(const Ray &other)
Copy constructor.
jet::Ray2D
Ray2< double > Ray2D
Double-type 2-D ray.
Definition:
ray2.h:53
jet::Ray< T, 2 >
Class for 2-D ray.
Definition:
ray2.h:21
ray.h
jet::Ray< T, 2 >::origin
Vector2< T > origin
The origin of the ray.
Definition:
ray2.h:25
jet::Ray< T, 2 >::Ray
Ray()
Constructs an empty ray that points (1, 0) from (0, 0).
jet::Ray
Class for ray.
Definition:
ray.h:21
jet
Definition:
advection_solver2.h:18
vector2.h
jet::Vector< T, 2 >
2-D vector class.
Definition:
vector2.h:24
jet::Ray2F
Ray2< float > Ray2F
Float-type 2-D ray.
Definition:
ray2.h:50
jet::Ray< T, 2 >::pointAt
Vector2< T > pointAt(T t) const
Returns a point on the ray at distance t.
jet::Ray< T, 2 >::Ray
Ray(const Vector2< T > &newOrigin, const Vector2< T > &newDirection)
Constructs a ray with given origin and riection.
jet::Ray< T, 2 >::direction
Vector2< T > direction
The direction of the ray.
Definition:
ray2.h:31
Generated by
1.8.18