~ubuntu-branches/ubuntu/saucy/blender/saucy-proposed

« back to all changes in this revision

Viewing changes to extern/eltopo/common/fe_ccd_wrapper.cpp

  • Committer: Package Import Robot
  • Author(s): Jeremy Bicha
  • Date: 2013-03-06 12:08:47 UTC
  • mfrom: (1.5.1) (14.1.8 experimental)
  • Revision ID: package-import@ubuntu.com-20130306120847-frjfaryb2zrotwcg
Tags: 2.66a-1ubuntu1
* Resynchronize with Debian (LP: #1076930, #1089256, #1052743, #999024,
  #1122888, #1147084)
* debian/control:
  - Lower build-depends on libavcodec-dev since we're not
    doing the libav9 transition in Ubuntu yet

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
 
2
 
// ---------------------------------------------------------
3
 
//
4
 
//  fe_ccd_wrapper.cpp
5
 
//  Tyson Brochu 2009
6
 
//
7
 
//  Forward error analysis implementation of collision and intersection queries.
8
 
//
9
 
// ---------------------------------------------------------
10
 
 
11
 
#include <ccd_wrapper.h>
12
 
 
13
 
#ifdef USE_FORWARD_ERROR_CCD
14
 
 
15
 
#include <predicates.h>
16
 
#include <vec.h>
17
 
 
18
 
// --------------------------------------------------------------------------------------------------------------
19
 
 
20
 
 
21
 
bool point_triangle_collision(const Vec3d& x0, const Vec3d& xnew0, unsigned int index0,
22
 
                                       const Vec3d& x1, const Vec3d& xnew1, unsigned int index1,
23
 
                                       const Vec3d& x2, const Vec3d& xnew2, unsigned int index2,
24
 
                                       const Vec3d& x3, const Vec3d& xnew3, unsigned int index3 )
25
 
{
26
 
   assert( index1 < index2 && index2 < index3 );
27
 
   return fe_point_triangle_collision( x0, xnew0, x1, xnew1, x2, xnew2, x3, xnew3 );
28
 
}
29
 
 
30
 
 
31
 
// --------------------------------------------------------------------------------------------------------------
32
 
 
33
 
 
34
 
bool point_triangle_collision(const Vec3d& x0, const Vec3d& xnew0, unsigned int index0,
35
 
                                       const Vec3d& x1, const Vec3d& xnew1, unsigned int index1,
36
 
                                       const Vec3d& x2, const Vec3d& xnew2, unsigned int index2,
37
 
                                       const Vec3d& x3, const Vec3d& xnew3, unsigned int index3,
38
 
                                       double& bary1, double& bary2, double& bary3,
39
 
                                       Vec3d& normal,
40
 
                                       double& t,
41
 
                                       double& relative_normal_displacement,
42
 
                                       bool verbose )
43
 
{
44
 
   assert( index1 < index2 && index2 < index3 );
45
 
   return fe_point_triangle_collision( x0, xnew0, x1, xnew1, x2, xnew2, x3, xnew3, bary1, bary2, bary3, normal, t, relative_normal_displacement, verbose );
46
 
}
47
 
 
48
 
 
49
 
// --------------------------------------------------------------------------------------------------------------
50
 
 
51
 
 
52
 
bool segment_segment_collision(const Vec3d& x0, const Vec3d& xnew0, unsigned int index0,
53
 
                                        const Vec3d& x1, const Vec3d& xnew1, unsigned int index1,
54
 
                                        const Vec3d& x2, const Vec3d& xnew2, unsigned int index2,
55
 
                                        const Vec3d& x3, const Vec3d& xnew3, unsigned int index3)
56
 
{
57
 
   assert( index0 < index1 && index2 < index3 );
58
 
   return fe_segment_segment_collision( x0, xnew0, x1, xnew1, x2, xnew2, x3, xnew3 );
59
 
}
60
 
 
61
 
 
62
 
// --------------------------------------------------------------------------------------------------------------
63
 
 
64
 
 
65
 
 
66
 
bool segment_segment_collision(const Vec3d& x0, const Vec3d& xnew0, unsigned int index0,
67
 
                                        const Vec3d& x1, const Vec3d& xnew1, unsigned int index1,
68
 
                                        const Vec3d& x2, const Vec3d& xnew2, unsigned int index2,
69
 
                                        const Vec3d& x3, const Vec3d& xnew3, unsigned int index3,
70
 
                                        double& bary0, double& bary2,
71
 
                                        Vec3d& normal,
72
 
                                        double& t,
73
 
                                        double& relative_normal_displacement,
74
 
                                        bool verbose )
75
 
{
76
 
   assert( index0 < index1 && index2 < index3 );
77
 
   return fe_segment_segment_collision( x0, xnew0, x1, xnew1, x2, xnew2, x3, xnew3, bary0, bary2, normal, t, relative_normal_displacement, verbose );
78
 
}
79
 
 
80
 
 
81
 
#endif
82
 
 
83