~gimaker/peekabot/coord-sys-default

« back to all changes in this revision

Viewing changes to src/renderer/Frustum.hh

  • Committer: Staffan Gimåker
  • Date: 2009-06-29 10:09:26 UTC
  • mfrom: (665.1.39 renderer-redux)
  • Revision ID: staffan@gimaker.se-20090629100926-ju5kx8jwzy422rwu
Merged the renderer-redux branch.

This represents a major overhaul to the rendering engine, with a less contrived
design and better performance. Both memory and CPU utilization should be 
better in general.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
 
2
 * Copyright Staffan Gimåker 2007-2008.
 
3
 *
 
4
 * ---
 
5
 *
2
6
 * This file is part of peekabot.
3
7
 *
4
8
 * peekabot is free software; you can redistribute it and/or modify
15
19
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
16
20
 */
17
21
 
18
 
#ifndef __PEEKABOT_RENDERER_FRUSTUM_HH
19
 
#define __PEEKABOT_RENDERER_FRUSTUM_HH
 
22
#ifndef PEEKABOT_RENDERER_FRUSTUM_HH_INCLUDED
 
23
#define PEEKABOT_RENDERER_FRUSTUM_HH_INCLUDED
20
24
 
21
25
 
22
26
#include "../Types.hh"
27
31
{
28
32
    namespace renderer
29
33
    {
30
 
        namespace primitives
31
 
        {
32
 
            class Camera;
33
 
        }
 
34
        class Camera;
34
35
 
35
36
        class Frustum
36
37
        {
49
50
            };
50
51
 
51
52
 
52
 
            Frustum(const primitives::Camera &cam, float w_slack = 0, float h_slack = 0);
 
53
            Frustum(const Camera &cam, float w_slack = 0, float h_slack = 0);
53
54
 
54
55
            inline const Plane &operator[](size_t i) const
55
56
            {
62
63
            }
63
64
 
64
65
            IntersectionTestResult is_in_frustum(
65
 
                const BoundingSphere& bsphere, int &plane_mask) throw();
 
66
                const BoundingSphere& bsphere, int &plane_mask) const throw();
66
67
            
67
68
            IntersectionTestResult is_in_frustum(
68
 
                const BoundingSphere& bsphere) throw();
69
 
            
70
 
            IntersectionTestResult is_in_uncapped_frustum(
71
 
                const BoundingSphere& bsphere) throw();
72
 
            
73
 
            IntersectionTestResult is_in_uncapped_frustum(
74
 
                const BoundingSphere& bsphere, int &plane_mask) throw();
 
69
                const BoundingSphere& bsphere) const throw();
 
70
            
 
71
            IntersectionTestResult is_in_uncapped_frustum(
 
72
                const BoundingSphere& bsphere) const throw();
 
73
            
 
74
            IntersectionTestResult is_in_uncapped_frustum(
 
75
                const BoundingSphere& bsphere, int &plane_mask) const throw();
75
76
 
76
77
        private:
77
78
            void calculate_frustum_bsphere(
78
 
                const primitives::Camera &cam, float w_slack, float h_slack) throw();
 
79
                const Camera &cam, float w_slack, float h_slack) throw();
79
80
            
80
81
            void calculate_frustum_planes(
81
 
                const primitives::Camera &cam, float w_slack, float h_slack) throw();
 
82
                const Camera &cam, float w_slack, float h_slack) throw();
82
83
 
83
84
        private:
84
85
            /**
95
96
}
96
97
 
97
98
 
98
 
#endif // __PEEKABOT_RENDERER_FRUSTUM_HH
 
99
#endif // PEEKABOT_RENDERER_FRUSTUM_HH_INCLUDED