CubbyFlow v0.71
Core
Ray
Ray2-Impl.h
Go to the documentation of this file.
1
/*************************************************************************
2
> File Name: Ray2-Impl.h
3
> Project Name: CubbyFlow
4
> Author: Dongmin Kim
5
> Purpose: Class for 2-D ray.
6
> Created Time: 2017/03/25
7
> Copyright (c) 2018, Dongmin Kim
8
*************************************************************************/
9
#ifndef CUBBYFLOW_RAY2_IMPL_H
10
#define CUBBYFLOW_RAY2_IMPL_H
11
12
namespace
CubbyFlow
13
{
14
template
<
typename
T>
15
Ray<T, 2>::Ray
() :
16
Ray
(
Vector2
<T>(),
Vector2
<T>(1, 0))
17
{
18
// Do nothing
19
}
20
21
template
<
typename
T>
22
Ray<T, 2>::Ray
(
const
Vector2<T>
& newOrigin,
const
Vector2<T>
& newDirection) :
23
origin(newOrigin), direction(newDirection.Normalized())
24
{
25
// Do nothing
26
}
27
28
template
<
typename
T>
29
Ray<T, 2>::Ray
(
const
Ray
& other) :
30
origin(other.origin), direction(other.direction)
31
{
32
// Do nothing
33
}
34
35
template
<
typename
T>
36
Vector2<T>
Ray<T, 2>::PointAt
(T t)
const
37
{
38
return
origin + t * direction;
39
}
40
}
41
42
#endif
CubbyFlow::Ray
Class for ray.
Definition:
Ray.h:23
CubbyFlow
Definition:
pybind11Utils.h:24
CubbyFlow::Vector< T, 2 >
2-D vector class.
Definition:
Vector2.h:26
Generated on Sun Apr 22 2018 23:43:22 for CubbyFlow by
1.8.14