Pioneer
Sphere.h
Go to the documentation of this file.
1 // Copyright © 2008-2023 Pioneer Developers. See AUTHORS.txt for details
2 // Licensed under the terms of the GPL v3. See licenses/GPL-3.txt
3 
4 #pragma once
5 
6 #ifndef _SPHERE_H
7 #define _SPHERE_H
8 
9 #include <SDL_stdinc.h>
10 
11 #include "vector3.h"
12 
13 struct SSphere {
14  SSphere() :
15  m_centre(vector3d(0.0)),
16  m_radius(1.0) {}
17  SSphere(const double rad) :
18  m_centre(vector3d(0.0)),
19  m_radius(rad) {}
21  double m_radius;
22 
23  // Adapted from Ysaneya here: http://www.gamedev.net/blog/73/entry-1666972-horizon-culling/
24  bool HorizonCulling(const vector3d &view, const SSphere &obj) const;
25 };
26 
27 #endif /* _SPHERE_H */
Definition: Sphere.h:13
SSphere(const double rad)
Definition: Sphere.h:17
bool HorizonCulling(const vector3d &view, const SSphere &obj) const
Definition: Sphere.cpp:20
vector3d m_centre
Definition: Sphere.h:20
SSphere()
Definition: Sphere.h:14
double m_radius
Definition: Sphere.h:21