~ubuntu-branches/ubuntu/utopic/blender/utopic-proposed

« back to all changes in this revision

Viewing changes to extern/eltopo/eltopo3d/broadphase.h

  • Committer: Package Import Robot
  • Author(s): Matteo F. Vescovi
  • Date: 2012-04-28 12:11:12 UTC
  • mto: (14.1.6 experimental) (1.5.1)
  • mto: This revision was merged to the branch mainline in revision 34.
  • Revision ID: package-import@ubuntu.com-20120428121112-2zi0vp8b6vejda8i
Tags: upstream-2.63
ImportĀ upstreamĀ versionĀ 2.63

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
//  broadphase.h
4
4
//  Tyson Brochu 2008
5
5
//  
6
 
//  Interface for abstract broad phase collision detector class.  
7
 
//  Used to avoid performing collision detection between all 
8
 
//  primitives. Abstract so we can try different strategies.
 
6
//  Interface for abstract broad phase collision detector class.  The main function of a broad phase is to avoid performing 
 
7
//  collision detection between all primitives. Abstract so we can try different strategies, however only BroadPhaseGrid is 
 
8
//  currently implemented.
9
9
//
10
10
// ---------------------------------------------------------
11
11
 
12
 
#ifndef BROADPHASE_H
13
 
#define BROADPHASE_H
 
12
#ifndef EL_TOPO_BROADPHASE_H
 
13
#define EL_TOPO_BROADPHASE_H
14
14
 
15
15
// ---------------------------------------------------------
16
16
// Nested includes
25
25
class DynamicSurface;
26
26
 
27
27
// ---------------------------------------------------------
28
 
//  Interface declarations
 
28
//  Class definitions
29
29
// ---------------------------------------------------------
30
30
 
31
31
// --------------------------------------------------------
37
37
class BroadPhase
38
38
{   
39
39
public:
40
 
   
41
 
   virtual ~BroadPhase() 
42
 
   {}
43
 
   
44
 
   /// Rebuild the broad phase using current vertex positions
45
 
   ///
46
 
   virtual void update_broad_phase_static( const DynamicSurface& surface ) = 0;
47
 
 
48
 
   /// Rebuild the broad phase using current and predicted vertex positions
49
 
   ///
50
 
   virtual void update_broad_phase_continuous( const DynamicSurface& surface ) = 0;
51
 
 
52
 
   virtual void add_vertex( unsigned int index, const Vec3d& aabb_low, const Vec3d& aabb_high ) = 0; 
53
 
   virtual void add_edge( unsigned int index, const Vec3d& aabb_low, const Vec3d& aabb_high ) = 0; 
54
 
   virtual void add_triangle( unsigned int index, const Vec3d& aabb_low, const Vec3d& aabb_high ) = 0; 
55
 
 
56
 
   virtual void update_vertex( unsigned int index, const Vec3d& aabb_low, const Vec3d& aabb_high ) = 0; 
57
 
   virtual void update_edge( unsigned int index, const Vec3d& aabb_low, const Vec3d& aabb_high ) = 0; 
58
 
   virtual void update_triangle( unsigned int index, const Vec3d& aabb_low, const Vec3d& aabb_high ) = 0; 
59
 
   
60
 
   virtual void remove_vertex( unsigned int index ) = 0; 
61
 
   virtual void remove_edge( unsigned int index ) = 0; 
62
 
   virtual void remove_triangle( unsigned int index ) = 0; 
63
 
   
64
 
   /// Get the set of vertices whose bounding volumes overlap the specified bounding volume
65
 
   ///
66
 
   virtual void get_potential_vertex_collisions( const Vec3d& query_low, const Vec3d& query_high, std::vector<unsigned int>& overlapping_vertices ) = 0;
67
 
 
68
 
   /// Get the set of edges whose bounding volumes overlap the specified bounding volume
69
 
   ///
70
 
   virtual void get_potential_edge_collisions( const Vec3d& query_low, const Vec3d& query_high, std::vector<unsigned int>& overlapping_triangles ) = 0;
71
 
   
72
 
   /// Get the set of triangles whose bounding volumes overlap the specified bounding volume
73
 
   ///
74
 
   virtual void get_potential_triangle_collisions( const Vec3d& query_low, const Vec3d& query_high, std::vector<unsigned int>& overlapping_triangles ) = 0;
75
 
   
 
40
    
 
41
    virtual ~BroadPhase() 
 
42
    {}
 
43
    
 
44
    /// Rebuild the broad phase
 
45
    ///
 
46
    virtual void update_broad_phase( const DynamicSurface& surface, bool continuous ) = 0;
 
47
    
 
48
    
 
49
    /// Add a vertex with the specified bounding box to the broad phase
 
50
    ///
 
51
    virtual void add_vertex( size_t index,
 
52
                            const Vec3d& aabb_low,
 
53
                            const Vec3d& aabb_high,
 
54
                            bool is_solid ) = 0;
 
55
 
 
56
    /// Add an edge with the specified bounding box to the broad phase
 
57
    ///
 
58
    virtual void add_edge( size_t index,
 
59
                          const Vec3d& aabb_low,
 
60
                          const Vec3d& aabb_high,
 
61
                          bool is_solid ) = 0;
 
62
 
 
63
    /// Add a triangle with the specified bounding box to the broad phase
 
64
    ///
 
65
    virtual void add_triangle( size_t index,
 
66
                              const Vec3d& aabb_low,
 
67
                              const Vec3d& aabb_high,
 
68
                              bool is_solid ) = 0;
 
69
 
 
70
    /// Update a vertex's broad phase entry
 
71
    ///
 
72
    virtual void update_vertex( size_t index,
 
73
                               const Vec3d& aabb_low,
 
74
                               const Vec3d& aabb_high,
 
75
                               bool is_solid ) = 0;
 
76
 
 
77
    /// Update an edges's broad phase entry
 
78
    ///
 
79
    virtual void update_edge( size_t index,
 
80
                             const Vec3d& aabb_low,
 
81
                             const Vec3d& aabb_high,
 
82
                             bool is_solid ) = 0;
 
83
    
 
84
    /// Update a triangle's broad phase entry
 
85
    ///
 
86
    virtual void update_triangle( size_t index,
 
87
                                 const Vec3d& aabb_low,
 
88
                                 const Vec3d& aabb_high,
 
89
                                 bool is_solid ) = 0;
 
90
    
 
91
    /// Remove a vertex from the broad phase
 
92
    ///
 
93
    virtual void remove_vertex( size_t index ) = 0;
 
94
    
 
95
    /// Remove an edge from the broad phase
 
96
    ///
 
97
    virtual void remove_edge( size_t index ) = 0;
 
98
    
 
99
    /// Remove a triangle from the broad phase
 
100
    ///
 
101
    virtual void remove_triangle( size_t index ) = 0; 
 
102
    
 
103
    /// Get the stored axis-aligned bounding box of a vertex
 
104
    ///
 
105
    virtual void get_vertex_aabb( size_t index, bool is_solid, Vec3d& aabb_low, Vec3d& aabb_high ) = 0;
 
106
    
 
107
    /// Get the stored axis-aligned bounding box of an edge
 
108
    ///    
 
109
    virtual void get_edge_aabb( size_t index, bool is_solid, Vec3d& aabb_low, Vec3d& aabb_high ) = 0;
 
110
    
 
111
    /// Get the stored axis-aligned bounding box of a triangle
 
112
    ///        
 
113
    virtual void get_triangle_aabb( size_t index, bool is_solid, Vec3d& aabb_low, Vec3d& aabb_high ) = 0;
 
114
    
 
115
    /// Get the set of vertices whose bounding volumes overlap the specified bounding volume
 
116
    ///
 
117
    virtual void get_potential_vertex_collisions( const Vec3d& aabb_low, 
 
118
                                                 const Vec3d& aabb_high,
 
119
                                                 bool return_solid,
 
120
                                                 bool return_dynamic,
 
121
                                                 std::vector<size_t>& overlapping_vertices ) = 0;
 
122
    
 
123
    /// Get the set of edges whose bounding volumes overlap the specified bounding volume
 
124
    ///
 
125
    virtual void get_potential_edge_collisions( const Vec3d& aabb_low, 
 
126
                                               const Vec3d& aabb_high, 
 
127
                                               bool return_solid,
 
128
                                               bool return_dynamic,
 
129
                                               std::vector<size_t>& overlapping_edges ) = 0;
 
130
    
 
131
    /// Get the set of triangles whose bounding volumes overlap the specified bounding volume
 
132
    ///
 
133
    virtual void get_potential_triangle_collisions( const Vec3d& aabb_low, 
 
134
                                                   const Vec3d& aabb_high,
 
135
                                                   bool return_solid,
 
136
                                                   bool return_dynamic,
 
137
                                                   std::vector<size_t>& overlapping_triangles ) = 0;
 
138
    
76
139
};
77
140
 
78
141