Main Page
Namespaces
Classes
Files
File List
File Members
include
Mathematics
GteIntrSphere3Frustum3.h
Go to the documentation of this file.
1
// David Eberly, Geometric Tools, Redmond WA 98052
2
// Copyright (c) 1998-2017
3
// Distributed under the Boost Software License, Version 1.0.
4
// http://www.boost.org/LICENSE_1_0.txt
5
// http://www.geometrictools.com/License/Boost/LICENSE_1_0.txt
6
// File Version: 3.0.0 (2016/06/19)
7
8
#pragma once
9
10
#include <
Mathematics/GteDistPoint3Frustum3.h
>
11
#include <
Mathematics/GteHypersphere.h
>
12
#include <
Mathematics/GteTIQuery.h
>
13
14
namespace
gte
15
{
16
17
template
<
typename
Real>
18
class
TIQuery
<Real,
Sphere3
<Real>,
Frustum3
<Real>>
19
{
20
public
:
21
struct
Result
22
{
23
bool
intersect
;
24
};
25
26
Result
operator()
(
Sphere3<Real>
const
& sphere,
27
Frustum3<Real>
const
& frustum);
28
};
29
30
31
template
<
typename
Real>
32
typename
TIQuery<Real, Sphere3<Real>
,
Frustum3<Real>
>::Result
33
TIQuery<Real, Sphere3<Real>
,
Frustum3<Real>
>::operator()(
34
Sphere3<Real>
const
& sphere,
Frustum3<Real>
const
& frustum)
35
{
36
Result
result
;
37
DCPQuery<Real, Vector3<Real>
,
Frustum3<Real>
> vfQuery;
38
Real
distance
= vfQuery(sphere.center, frustum).distance;
39
result.intersect = (distance <= sphere.radius);
40
return
result
;
41
}
42
43
44
}
gte::TIQuery
Definition:
GteTIQuery.h:18
GteTIQuery.h
distance
GLsizei GLsizei GLfloat distance
Definition:
glext.h:9704
GteDistPoint3Frustum3.h
gte::TIQuery< Real, Sphere3< Real >, Frustum3< Real > >::Result::intersect
bool intersect
Definition:
GteIntrSphere3Frustum3.h:23
gte::Frustum3
Definition:
GteFrustum3.h:24
gte
Definition:
GLX/GteWICFileIO.h:16
gte::Hypersphere
Definition:
GteHypersphere.h:20
GteHypersphere.h
gte::TIQuery::operator()
Result operator()(Type0 const &primitive0, Type1 const &primitive1)
result
GLuint64EXT * result
Definition:
glext.h:10003
gte::DCPQuery
Definition:
GteDCPQuery.h:17
geometric_tools_engine
Author(s): Yijiang Huang
autogenerated on Thu Jul 18 2019 04:00:00