30 template <
typename Vector_t>
36 template <
typename Vector_t>
42 template <
typename Vector_t>
48 template <
typename Vector_t>
51 for (uint32 i = 0; i < m_min.dimension(); i++)
53 m_min[i] = ::cugar::min( bb1[0][i], bb2[0][i] );
54 m_max[i] = ::cugar::max( bb1[1][i], bb2[1][i] );
57 template <
typename Vector_t>
64 template <
typename Vector_t>
68 for (uint32 i = 0; i < m_min.dimension(); i++)
70 m_min[i] = ::cugar::min( m_min[i], v[i] );
71 m_max[i] = ::cugar::max( m_max[i], v[i] );
74 template <
typename Vector_t>
78 for (uint32 i = 0; i < m_min.dimension(); i++)
80 m_min[i] = ::cugar::min( m_min[i], bbox.
m_min[i] );
81 m_max[i] = ::cugar::max( m_max[i], bbox.
m_max[i] );
84 template <
typename Vector_t>
87 for (uint32 i = 0; i < m_min.dimension(); i++)
94 template <
typename Vector_t>
102 template <
typename Vector_t>
105 typedef typename Vector_t::value_type value_type;
107 const Vector_t edge( bbox[1] - bbox[0] );
109 value_type v = edge[0];
111 for (uint32 i = 1; i < edge.dimension(); i++)
125 template <
typename Vector_t>
128 return bbox[1] - bbox[0];
136 const Vector2f edge = bbox[1] - bbox[0];
137 return edge[0] * edge[1];
145 const Vector3f edge = bbox[1] - bbox[0];
146 return edge[0] * edge[1] + edge[2] * (edge[0] + edge[1]);
153 template <
typename Vector_t>
156 for (uint32 i = 0; i < p.dimension(); ++i)
158 if (p[i] < bbox[0][i] ||
169 template <
typename Vector_t>
172 for (uint32 i = 0; i < c[0].dimension(); ++i)
174 if (c[0][i] < bbox[0][i] ||
175 c[1][i] > bbox[1][i])
185 template <
typename Vector_t>
189 for (uint32 i = 0; i < p.dimension(); ++i)
191 const float dist = cugar::max( bbox[0][i] - p[i], 0.0f ) +
192 cugar::max( p[i] - bbox[1][i], 0.0f );
float sq_distance(const Bbox< Vector_t > &bbox, const Vector_t &p)
Definition: bbox_inline.h:186
Vector_t m_max
max corner
Definition: bbox.h:126
bool contains(const Bbox< Vector_t > &bbox, const Bbox< Vector_t > &c)
Definition: bbox_inline.h:170
Definition: numbers.h:1020
Vector_t m_min
min corner
Definition: bbox.h:125
Define a vector_view POD type and plain_view() for std::vector.
Definition: diff.h:38
uint32 largest_axis(const Bbox< Vector_t > &bbox)
Definition: bbox_inline.h:103
CUGAR_HOST_DEVICE float area(const Bbox2f &bbox)
Definition: bbox_inline.h:134
CUGAR_HOST CUGAR_DEVICE Bbox()
Definition: bbox_inline.h:31
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE Vector_t extents(const Bbox< Vector_t > &bbox)
Definition: bbox_inline.h:126