diff options
Diffstat (limited to 'extern/solid/src/complex')
-rw-r--r-- | extern/solid/src/complex/DT_BBoxTree.cpp | 90 | ||||
-rw-r--r-- | extern/solid/src/complex/DT_BBoxTree.h | 540 | ||||
-rw-r--r-- | extern/solid/src/complex/DT_CBox.h | 134 | ||||
-rw-r--r-- | extern/solid/src/complex/DT_Complex.cpp | 327 | ||||
-rw-r--r-- | extern/solid/src/complex/DT_Complex.h | 94 | ||||
-rw-r--r-- | extern/solid/src/complex/Makefile | 42 |
6 files changed, 0 insertions, 1227 deletions
diff --git a/extern/solid/src/complex/DT_BBoxTree.cpp b/extern/solid/src/complex/DT_BBoxTree.cpp deleted file mode 100644 index 4f10f61f2e2..00000000000 --- a/extern/solid/src/complex/DT_BBoxTree.cpp +++ /dev/null @@ -1,90 +0,0 @@ -/* - * SOLID - Software Library for Interference Detection - * - * Copyright (C) 2001-2003 Dtecta. All rights reserved. - * - * This library may be distributed under the terms of the Q Public License - * (QPL) as defined by Trolltech AS of Norway and appearing in the file - * LICENSE.QPL included in the packaging of this file. - * - * This library may be distributed and/or modified under the terms of the - * GNU General Public License (GPL) version 2 as published by the Free Software - * Foundation and appearing in the file LICENSE.GPL included in the - * packaging of this file. - * - * This library is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE - * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - * - * Commercial use or any other use of this library not covered by either - * the QPL or the GPL requires an additional license from Dtecta. - * Please contact info@dtecta.com for enquiries about the terms of commercial - * use of this library. - */ - -#include "DT_BBoxTree.h" - -inline DT_CBox getBBox(int first, int last, const DT_CBox *boxes, const DT_Index *indices) -{ - assert(last - first >= 1); - - DT_CBox bbox = boxes[indices[first]]; - int i; - for (i = first; i < last; ++i) - { - bbox = bbox.hull(boxes[indices[i]]); - } - - return bbox; -} - -DT_BBoxNode::DT_BBoxNode(int first, int last, int& node, DT_BBoxNode *free_nodes, const DT_CBox *boxes, DT_Index *indices, const DT_CBox& bbox) -{ - assert(last - first >= 2); - - int axis = bbox.longestAxis(); - MT_Scalar abscissa = bbox.getCenter()[axis]; - int i = first, mid = last; - while (i < mid) - { - if (boxes[indices[i]].getCenter()[axis] < abscissa) - { - ++i; - } - else - { - --mid; - std::swap(indices[i], indices[mid]); - } - } - - if (mid == first || mid == last) - { - mid = (first + last) / 2; - } - - m_lbox = getBBox(first, mid, boxes, indices); - m_rbox = getBBox(mid, last, boxes, indices); - m_flags = 0x0; - - if (mid - first == 1) - { - m_flags |= LLEAF; - m_lchild = indices[first]; - } - else - { - m_lchild = node++; - new(&free_nodes[m_lchild]) DT_BBoxNode(first, mid, node, free_nodes, boxes, indices, m_lbox); - } - - if (last - mid == 1) - { - m_flags |= RLEAF; - m_rchild = indices[mid]; - } - else - { - m_rchild = node++; - new(&free_nodes[m_rchild]) DT_BBoxNode(mid, last, node, free_nodes, boxes, indices, m_rbox); - } -} diff --git a/extern/solid/src/complex/DT_BBoxTree.h b/extern/solid/src/complex/DT_BBoxTree.h deleted file mode 100644 index 3d9da6e34ba..00000000000 --- a/extern/solid/src/complex/DT_BBoxTree.h +++ /dev/null @@ -1,540 +0,0 @@ -/* - * SOLID - Software Library for Interference Detection - * - * Copyright (C) 2001-2003 Dtecta. All rights reserved. - * - * This library may be distributed under the terms of the Q Public License - * (QPL) as defined by Trolltech AS of Norway and appearing in the file - * LICENSE.QPL included in the packaging of this file. - * - * This library may be distributed and/or modified under the terms of the - * GNU General Public License (GPL) version 2 as published by the Free Software - * Foundation and appearing in the file LICENSE.GPL included in the - * packaging of this file. - * - * This library is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE - * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - * - * Commercial use or any other use of this library not covered by either - * the QPL or the GPL requires an additional license from Dtecta. - * Please contact info@dtecta.com for enquiries about the terms of commercial - * use of this library. - */ - -#ifndef DT_BBOXTREE_H -#define DT_BBOXTREE_H - -#include <new> -#include <algorithm> - -#include "DT_Convex.h" -#include "DT_CBox.h" - - -class DT_BBoxTree { -public: - enum NodeType { INTERNAL = 0, LEAF = 1 }; - - DT_BBoxTree() {} - DT_BBoxTree(const DT_CBox& cbox, DT_Index index, NodeType type) - : m_cbox(cbox), - m_index(index), - m_type(type) - {} - - DT_CBox m_cbox; - DT_Index m_index; - NodeType m_type; -}; - - - -class DT_BBoxNode { -public: - DT_BBoxNode() {} - DT_BBoxNode(int first, int last, int& node, DT_BBoxNode *free_nodes, const DT_CBox *boxes, DT_Index *indices, const DT_CBox& bbox); - - void makeChildren(DT_BBoxTree& ltree, DT_BBoxTree& rtree) const; - void makeChildren(const DT_CBox& added, DT_BBoxTree& ltree, DT_BBoxTree& rtree) const; - - DT_CBox hull() const { return m_lbox.hull(m_rbox); } - - enum FlagType { LLEAF = 0x80, RLEAF = 0x40 }; - - DT_CBox m_lbox; - DT_CBox m_rbox; - DT_Index m_lchild; - DT_Index m_rchild; - unsigned char m_flags; -}; - -inline void DT_BBoxNode::makeChildren(DT_BBoxTree& ltree, DT_BBoxTree& rtree) const -{ - new (<ree) DT_BBoxTree(m_lbox, m_lchild, (m_flags & LLEAF) ? DT_BBoxTree::LEAF : DT_BBoxTree::INTERNAL); - new (&rtree) DT_BBoxTree(m_rbox, m_rchild, (m_flags & RLEAF) ? DT_BBoxTree::LEAF : DT_BBoxTree::INTERNAL); - -} - -inline void DT_BBoxNode::makeChildren(const DT_CBox& added, DT_BBoxTree& ltree, DT_BBoxTree& rtree) const -{ - new (<ree) DT_BBoxTree(m_lbox + added, m_lchild, (m_flags & LLEAF) ? DT_BBoxTree::LEAF : DT_BBoxTree::INTERNAL); - new (&rtree) DT_BBoxTree(m_rbox + added, m_rchild, (m_flags & RLEAF) ? DT_BBoxTree::LEAF : DT_BBoxTree::INTERNAL); -} - - -template <typename Shape> -class DT_RootData { -public: - DT_RootData(const DT_BBoxNode *nodes, - const Shape *leaves) - : m_nodes(nodes), - m_leaves(leaves) - {} - - const DT_BBoxNode *m_nodes; - const Shape *m_leaves; -}; - -template <typename Shape1, typename Shape2> -class DT_ObjectData : public DT_RootData<Shape1> { -public: - DT_ObjectData(const DT_BBoxNode *nodes, - const Shape1 *leaves, - const MT_Transform& xform, - Shape2 plus) - : DT_RootData<Shape1>(nodes, leaves), - m_xform(xform), - m_inv_xform(xform.inverse()), - m_plus(plus), - m_added(computeCBox(plus, m_inv_xform)) - {} - - const MT_Transform& m_xform; - MT_Transform m_inv_xform; - Shape2 m_plus; - DT_CBox m_added; -}; - -template <typename Shape1, typename Shape2> -class DT_Pack { -public: - DT_Pack(const DT_ObjectData<Shape1, Shape2>& a, const DT_Convex& b) - : m_a(a), - m_b(b), - m_b_cbox(b.bbox(m_a.m_inv_xform)) - {} - - DT_ObjectData<Shape1, Shape2> m_a; - const DT_Convex& m_b; - DT_CBox m_b_cbox; -}; - -template <typename Shape1, typename Shape2> -class DT_HybridPack : public DT_Pack<Shape1, Shape2> { -public: - DT_HybridPack(const DT_ObjectData<Shape1, Shape2>& a, const DT_Convex& b, MT_Scalar margin) - : DT_Pack<Shape1, Shape2>(a, b), - m_margin(margin) - { - this->m_b_cbox += computeCBox(margin, this->m_a.m_inv_xform); - } - - MT_Scalar m_margin; -}; - -template <typename Shape1, typename Shape2> -class DT_DuoPack { -public: - DT_DuoPack(const DT_ObjectData<Shape1, Shape2>& a, const DT_ObjectData<Shape1, Shape2>& b) - : m_a(a), - m_b(b) - { - m_b2a = a.m_inv_xform * b.m_xform; - m_a2b = b.m_inv_xform * a.m_xform; - m_abs_b2a = m_b2a.getBasis().absolute(); - m_abs_a2b = m_a2b.getBasis().absolute(); - } - - DT_ObjectData<Shape1, Shape2> m_a, m_b; - MT_Transform m_b2a, m_a2b; - MT_Matrix3x3 m_abs_b2a, m_abs_a2b; -}; - - -template <typename Shape> -inline void refit(DT_BBoxNode& node, const DT_RootData<Shape>& rd) -{ - node.m_lbox = (node.m_flags & DT_BBoxNode::LLEAF) ? - computeCBox(rd.m_leaves[node.m_lchild]) : - rd.m_nodes[node.m_lchild].hull(); - node.m_rbox = (node.m_flags & DT_BBoxNode::RLEAF) ? - computeCBox(rd.m_leaves[node.m_rchild]) : - rd.m_nodes[node.m_rchild].hull(); -} - - -template <typename Shape> -bool ray_cast(const DT_BBoxTree& a, const DT_RootData<Shape>& rd, - const MT_Point3& source, const MT_Point3& target, - MT_Scalar& lambda, MT_Vector3& normal) -{ - if (!a.m_cbox.overlapsLineSegment(source, source.lerp(target, lambda))) - { - return false; - } - - if (a.m_type == DT_BBoxTree::LEAF) - { - return ray_cast(rd, a.m_index, source, target, lambda, normal); - } - else - { - DT_BBoxTree ltree, rtree; - rd.m_nodes[a.m_index].makeChildren(ltree, rtree); - - bool lresult = ray_cast(ltree, rd, source, target, lambda, normal); - bool rresult = ray_cast(rtree, rd, source, target, lambda, normal); - return lresult || rresult; - } -} - - -#ifdef STATISTICS -int num_box_tests = 0; -#endif - -template <typename Shape1, typename Shape2> -inline bool intersect(const DT_CBox& a, const DT_CBox& b, const DT_DuoPack<Shape1, Shape2>& pack) -{ -#ifdef STATISTICS - ++num_box_tests; -#endif - - - MT_Vector3 abs_pos_b2a = (pack.m_b2a(b.getCenter()) - a.getCenter()).absolute(); - MT_Vector3 abs_pos_a2b = (pack.m_a2b(a.getCenter()) - b.getCenter()).absolute(); - return (a.getExtent()[0] + pack.m_abs_b2a[0].dot(b.getExtent()) >= abs_pos_b2a[0]) && - (a.getExtent()[1] + pack.m_abs_b2a[1].dot(b.getExtent()) >= abs_pos_b2a[1]) && - (a.getExtent()[2] + pack.m_abs_b2a[2].dot(b.getExtent()) >= abs_pos_b2a[2]) && - (b.getExtent()[0] + pack.m_abs_a2b[0].dot(a.getExtent()) >= abs_pos_a2b[0]) && - (b.getExtent()[1] + pack.m_abs_a2b[1].dot(a.getExtent()) >= abs_pos_a2b[1]) && - (b.getExtent()[2] + pack.m_abs_a2b[2].dot(a.getExtent()) >= abs_pos_a2b[2]); -} - - - - -template <typename Shape1, typename Shape2> -bool intersect(const DT_BBoxTree& a, const DT_Pack<Shape1, Shape2>& pack, MT_Vector3& v) -{ - if (!a.m_cbox.overlaps(pack.m_b_cbox)) - { - return false; - } - - if (a.m_type == DT_BBoxTree::LEAF) - { - return intersect(pack, a.m_index, v); - } - else - { - DT_BBoxTree a_ltree, a_rtree; - pack.m_a.m_nodes[a.m_index].makeChildren(pack.m_a.m_added, a_ltree, a_rtree); - return intersect(a_ltree, pack, v) || intersect(a_rtree, pack, v); - } -} - -template <typename Shape1, typename Shape2> -bool intersect(const DT_BBoxTree& a, const DT_BBoxTree& b, const DT_DuoPack<Shape1, Shape2>& pack, MT_Vector3& v) -{ - if (!intersect(a.m_cbox, b.m_cbox, pack)) - { - return false; - } - - if (a.m_type == DT_BBoxTree::LEAF && b.m_type == DT_BBoxTree::LEAF) - { - return intersect(pack, a.m_index, b.m_index, v); - } - else if (a.m_type == DT_BBoxTree::LEAF || - (b.m_type != DT_BBoxTree::LEAF && a.m_cbox.size() < b.m_cbox.size())) - { - DT_BBoxTree b_ltree, b_rtree; - pack.m_b.m_nodes[b.m_index].makeChildren(pack.m_b.m_added, b_ltree, b_rtree); - - return intersect(a, b_ltree, pack, v) || intersect(a, b_rtree, pack, v); - } - else - { - DT_BBoxTree a_ltree, a_rtree; - pack.m_a.m_nodes[a.m_index].makeChildren(pack.m_a.m_added, a_ltree, a_rtree); - return intersect(a_ltree, b, pack, v) || intersect(a_rtree, b, pack, v); - } -} - -template <typename Shape1, typename Shape2> -bool common_point(const DT_BBoxTree& a, const DT_Pack<Shape1, Shape2>& pack, - MT_Vector3& v, MT_Point3& pa, MT_Point3& pb) -{ - if (!a.m_cbox.overlaps(pack.m_b_cbox)) - { - return false; - } - - if (a.m_type == DT_BBoxTree::LEAF) - { - return common_point(pack, a.m_index, v, pa, pb); - } - else - { - DT_BBoxTree a_ltree, a_rtree; - pack.m_a.m_nodes[a.m_index].makeChildren(pack.m_a.m_added, a_ltree, a_rtree); - return common_point(a_ltree, pack, v, pa, pb) || - common_point(a_rtree, pack, v, pa ,pb); - } -} - -template <typename Shape1, typename Shape2> -bool common_point(const DT_BBoxTree& a, const DT_BBoxTree& b, const DT_DuoPack<Shape1, Shape2>& pack, - MT_Vector3& v, MT_Point3& pa, MT_Point3& pb) -{ - if (!intersect(a.m_cbox, b.m_cbox, pack)) - { - return false; - } - - if (a.m_type == DT_BBoxTree::LEAF && b.m_type == DT_BBoxTree::LEAF) - { - return common_point(pack, a.m_index, b.m_index, v, pa, pb); - } - else if (a.m_type == DT_BBoxTree::LEAF || - (b.m_type != DT_BBoxTree::LEAF && a.m_cbox.size() < b.m_cbox.size())) - { - DT_BBoxTree b_ltree, b_rtree; - pack.m_b.m_nodes[b.m_index].makeChildren(pack.m_b.m_added, b_ltree, b_rtree); - return common_point(a, b_ltree, pack, v, pa, pb) || - common_point(a, b_rtree, pack, v, pa, pb); - } - else - { - DT_BBoxTree a_ltree, a_rtree; - pack.m_a.m_nodes[a.m_index].makeChildren(pack.m_a.m_added, a_ltree, a_rtree); - return common_point(a_ltree, b, pack, v, pa, pb) || - common_point(a_rtree, b, pack, v, pa ,pb); - } -} - - -template <typename Shape1, typename Shape2> -bool penetration_depth(const DT_BBoxTree& a, const DT_HybridPack<Shape1, Shape2>& pack, - MT_Vector3& v, MT_Point3& pa, MT_Point3& pb, MT_Scalar& max_pen_len) -{ - if (!a.m_cbox.overlaps(pack.m_b_cbox)) - { - return false; - } - - if (a.m_type == DT_BBoxTree::LEAF) - { - if (penetration_depth(pack, a.m_index, v, pa, pb)) - { - max_pen_len = pa.distance2(pb); - return true; - } - else - { - return false; - } - } - else - { - DT_BBoxTree a_ltree, a_rtree; - pack.m_a.m_nodes[a.m_index].makeChildren(pack.m_a.m_added, a_ltree, a_rtree); - if (penetration_depth(a_ltree, pack, v, pa, pb, max_pen_len)) - { - MT_Vector3 rv; - MT_Point3 rpa, rpb; - MT_Scalar rmax_pen_len; - if (penetration_depth(a_rtree, pack, rv, rpa, rpb, rmax_pen_len) && - (max_pen_len < rmax_pen_len)) - { - max_pen_len = rmax_pen_len; - v = rv; - pa = rpa; - pb = rpb; - } - return true; - } - else - { - return penetration_depth(a_rtree, pack, v, pa, pb, max_pen_len); - } - } -} - -template <typename Shape1, typename Shape2> -bool penetration_depth(const DT_BBoxTree& a, const DT_BBoxTree& b, const DT_DuoPack<Shape1, Shape2>& pack, - MT_Vector3& v, MT_Point3& pa, MT_Point3& pb, MT_Scalar& max_pen_len) -{ - if (!intersect(a.m_cbox, b.m_cbox, pack)) - { - return false; - } - - if (a.m_type == DT_BBoxTree::LEAF && b.m_type == DT_BBoxTree::LEAF) - { - if (penetration_depth(pack, a.m_index, b.m_index, v, pa, pb)) - { - max_pen_len = pa.distance2(pb); - return true; - } - else - { - return false; - } - } - else if (a.m_type == DT_BBoxTree::LEAF || - (b.m_type != DT_BBoxTree::LEAF && a.m_cbox.size() < b.m_cbox.size())) - { - DT_BBoxTree b_ltree, b_rtree; - pack.m_b.m_nodes[b.m_index].makeChildren(pack.m_b.m_added, b_ltree, b_rtree); - if (penetration_depth(a, b_ltree, pack, v, pa, pb, max_pen_len)) - { - MT_Point3 rpa, rpb; - MT_Scalar rmax_pen_len; - if (penetration_depth(a, b_rtree, pack, v, rpa, rpb, rmax_pen_len) && - (max_pen_len < rmax_pen_len)) - { - max_pen_len = rmax_pen_len; - pa = rpa; - pb = rpb; - } - return true; - } - else - { - return penetration_depth(a, b_rtree, pack, v, pa, pb, max_pen_len); - } - } - else - { - DT_BBoxTree a_ltree, a_rtree; - pack.m_a.m_nodes[a.m_index].makeChildren(pack.m_a.m_added, a_ltree, a_rtree); - if (penetration_depth(a_ltree, b, pack, v, pa, pb, max_pen_len)) - { - MT_Point3 rpa, rpb; - MT_Scalar rmax_pen_len; - if (penetration_depth(a_rtree, b, pack, v, rpa, rpb, rmax_pen_len) && - (max_pen_len < rmax_pen_len)) - { - max_pen_len = rmax_pen_len; - pa = rpa; - pb = rpb; - } - return true; - } - else - { - return penetration_depth(a_rtree, b, pack, v, pa, pb, max_pen_len); - } - } -} - - -// Returns a lower bound for the distance for quick rejection in closest_points -inline MT_Scalar distance2(const DT_CBox& a, const MT_Transform& a2w, - const DT_CBox& b, const MT_Transform& b2w) -{ - MT_Vector3 v = b2w(b.getCenter()) - a2w(a.getCenter()); - MT_Scalar dist2 = v.length2(); - if (dist2 > MT_Scalar(0.0)) - { - MT_Vector3 w = b2w(b.support(-v * b2w.getBasis())) - a2w(a.support(v * a2w.getBasis())); - MT_Scalar delta = v.dot(w); - return delta > MT_Scalar(0.0) ? delta * delta / dist2 : MT_Scalar(0.0); - } - return MT_Scalar(0.0); -} - - -template <typename Shape1, typename Shape2> -MT_Scalar closest_points(const DT_BBoxTree& a, const DT_Pack<Shape1, Shape2>& pack, - MT_Scalar max_dist2, MT_Point3& pa, MT_Point3& pb) -{ - if (a.m_type == DT_BBoxTree::LEAF) - { - return closest_points(pack, a.m_index, max_dist2, pa, pb); - } - else - { - DT_BBoxTree a_ltree, a_rtree; - pack.m_a.m_nodes[a.m_index].makeChildren(pack.m_a.m_added, a_ltree, a_rtree); - MT_Scalar ldist2 = distance2(a_ltree.m_cbox, pack.m_a.m_xform, pack.m_b_cbox, pack.m_a.m_xform); - MT_Scalar rdist2 = distance2(a_rtree.m_cbox, pack.m_a.m_xform, pack.m_b_cbox, pack.m_a.m_xform); - if (ldist2 < rdist2) - { - MT_Scalar dist2 = ldist2 < max_dist2 ? closest_points(a_ltree, pack, max_dist2, pa, pb) : MT_INFINITY; - GEN_set_min(max_dist2, dist2); - return rdist2 < max_dist2 ? GEN_min(dist2, closest_points(a_rtree, pack, max_dist2, pa, pb)) : dist2; - } - else - { - MT_Scalar dist2 = rdist2 < max_dist2 ? closest_points(a_rtree, pack, max_dist2, pa, pb) : MT_INFINITY; - GEN_set_min(max_dist2, dist2); - return ldist2 < max_dist2 ? GEN_min(dist2, closest_points(a_ltree, pack, max_dist2, pa, pb)) : dist2; - } - } -} - - -template <typename Shape1, typename Shape2> -MT_Scalar closest_points(const DT_BBoxTree& a, const DT_BBoxTree& b, const DT_DuoPack<Shape1, Shape2>& pack, - MT_Scalar max_dist2, MT_Point3& pa, MT_Point3& pb) -{ - if (a.m_type == DT_BBoxTree::LEAF && b.m_type == DT_BBoxTree::LEAF) - { - return closest_points(pack, a.m_index, b.m_index, max_dist2, pa, pb); - } - else if (a.m_type == DT_BBoxTree::LEAF || - (b.m_type != DT_BBoxTree::LEAF && a.m_cbox.size() < b.m_cbox.size())) - { - DT_BBoxTree b_ltree, b_rtree; - pack.m_b.m_nodes[b.m_index].makeChildren(pack.m_b.m_added, b_ltree, b_rtree); - MT_Scalar ldist2 = distance2(a.m_cbox, pack.m_a.m_xform, b_ltree.m_cbox, pack.m_b.m_xform); - MT_Scalar rdist2 = distance2(a.m_cbox, pack.m_a.m_xform, b_rtree.m_cbox, pack.m_b.m_xform); - if (ldist2 < rdist2) - { - MT_Scalar dist2 = ldist2 < max_dist2 ? closest_points(a, b_ltree, pack, max_dist2, pa, pb): MT_INFINITY;; - GEN_set_min(max_dist2, dist2); - return rdist2 < max_dist2 ? GEN_min(dist2, closest_points(a, b_rtree, pack, max_dist2, pa, pb)) : dist2; - } - else - { - MT_Scalar dist2 = rdist2 < max_dist2 ? closest_points(a, b_rtree, pack, max_dist2, pa, pb) : MT_INFINITY;; - GEN_set_min(max_dist2, dist2); - return ldist2 < max_dist2 ? GEN_min(dist2, closest_points(a, b_ltree, pack, max_dist2, pa, pb)) : dist2; - } - } - else - { - DT_BBoxTree a_ltree, a_rtree; - pack.m_a.m_nodes[a.m_index].makeChildren(pack.m_a.m_added, a_ltree, a_rtree); - MT_Scalar ldist2 = distance2(a_ltree.m_cbox, pack.m_a.m_xform, b.m_cbox, pack.m_b.m_xform); - MT_Scalar rdist2 = distance2(a_rtree.m_cbox, pack.m_a.m_xform, b.m_cbox, pack.m_b.m_xform); - if (ldist2 < rdist2) - { - MT_Scalar dist2 = ldist2 < max_dist2 ? closest_points(a_ltree, b, pack, max_dist2, pa, pb) : MT_INFINITY;; - GEN_set_min(max_dist2, dist2); - return rdist2 < max_dist2 ? GEN_min(dist2,closest_points(a_rtree, b, pack, max_dist2, pa, pb)) : dist2; - } - else - { - MT_Scalar dist2 = rdist2 < max_dist2 ? closest_points(a_rtree, b, pack, max_dist2, pa, pb) : MT_INFINITY; - GEN_set_min(max_dist2, dist2); - return ldist2 < max_dist2 ? GEN_min(dist2, closest_points(a_ltree, b, pack, max_dist2, pa, pb)) : dist2; - } - } -} - -#endif - diff --git a/extern/solid/src/complex/DT_CBox.h b/extern/solid/src/complex/DT_CBox.h deleted file mode 100644 index 7fc7c5df4db..00000000000 --- a/extern/solid/src/complex/DT_CBox.h +++ /dev/null @@ -1,134 +0,0 @@ -/* - * SOLID - Software Library for Interference Detection - * - * Copyright (C) 2001-2003 Dtecta. All rights reserved. - * - * This library may be distributed under the terms of the Q Public License - * (QPL) as defined by Trolltech AS of Norway and appearing in the file - * LICENSE.QPL included in the packaging of this file. - * - * This library may be distributed and/or modified under the terms of the - * GNU General Public License (GPL) version 2 as published by the Free Software - * Foundation and appearing in the file LICENSE.GPL included in the - * packaging of this file. - * - * This library is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE - * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - * - * Commercial use or any other use of this library not covered by either - * the QPL or the GPL requires an additional license from Dtecta. - * Please contact info@dtecta.com for enquiries about the terms of commercial - * use of this library. - */ - -#ifndef DT_CBOX_H -#define DT_CBOX_H - -#include "MT_BBox.h" - -struct DT_CBox { - DT_CBox() {} - DT_CBox(const MT_Point3& center, const MT_Vector3& extent) - : m_center(center), - m_extent(extent) - {} - - explicit DT_CBox(const MT_BBox& bbox) { set(bbox); } - - const MT_Point3& getCenter() const { return m_center; } - const MT_Vector3& getExtent() const { return m_extent; } - - void set(const MT_BBox& bbox) - { - m_center = bbox.getCenter(); - m_extent = bbox.getExtent(); - } - - MT_BBox get() const - { - return MT_BBox(m_center - m_extent, m_center + m_extent); - } - - MT_Scalar size() const - { - return GEN_max(GEN_max(m_extent[0], m_extent[1]), m_extent[2]); - } - - - DT_CBox& operator+=(const DT_CBox& box) - { - m_center += box.getCenter(); - m_extent += box.getExtent(); - return *this; - } - - int longestAxis() const { return m_extent.closestAxis(); } - - DT_CBox hull(const DT_CBox& b) const - { - return DT_CBox(this->get().hull(b.get())); - } - - bool overlaps(const DT_CBox& b) const - { - return MT_abs(m_center[0] - b.m_center[0]) <= m_extent[0] + b.m_extent[0] && - MT_abs(m_center[1] - b.m_center[1]) <= m_extent[1] + b.m_extent[1] && - MT_abs(m_center[2] - b.m_center[2]) <= m_extent[2] + b.m_extent[2]; - } - - bool overlapsLineSegment(const MT_Point3& p, const MT_Point3& q) const - { - MT_Vector3 r = q - p; - MT_Vector3 r_abs = r.absolute(); - - if (!overlaps(DT_CBox(p + r * MT_Scalar(0.5), r_abs * MT_Scalar(0.5)))) - { - return false; - } - - MT_Vector3 s = p - m_center; - - if (MT_abs(r[2] * s[1] - r[1] * s[2]) > r_abs[2] * m_extent[1] + r_abs[1] * m_extent[2]) - { - return false; - } - - if (MT_abs(r[0] * s[2] - r[2] * s[0]) > r_abs[0] * m_extent[2] + r_abs[2] * m_extent[0]) - { - return false; - } - - if (MT_abs(r[1] * s[0] - r[0] * s[1]) > r_abs[1] * m_extent[0] + r_abs[0] * m_extent[1]) - { - return false; - } - - return true; - } - - MT_Point3 support(const MT_Vector3& v) const - { - return m_center + MT_Vector3(v[0] < MT_Scalar(0.0) ? -m_extent[0] : m_extent[0], - v[1] < MT_Scalar(0.0) ? -m_extent[1] : m_extent[1], - v[2] < MT_Scalar(0.0) ? -m_extent[2] : m_extent[2]); - - } - -private: - MT_Point3 m_center; - MT_Vector3 m_extent; -}; - -inline DT_CBox operator+(const DT_CBox& b1, const DT_CBox& b2) -{ - return DT_CBox(b1.getCenter() + b2.getCenter(), - b1.getExtent() + b2.getExtent()); -} - -inline DT_CBox operator-(const DT_CBox& b1, const DT_CBox& b2) -{ - return DT_CBox(b1.getCenter() - b2.getCenter(), - b1.getExtent() + b2.getExtent()); -} - -#endif diff --git a/extern/solid/src/complex/DT_Complex.cpp b/extern/solid/src/complex/DT_Complex.cpp deleted file mode 100644 index 023383a8427..00000000000 --- a/extern/solid/src/complex/DT_Complex.cpp +++ /dev/null @@ -1,327 +0,0 @@ -/* - * SOLID - Software Library for Interference Detection - * - * Copyright (C) 2001-2003 Dtecta. All rights reserved. - * - * This library may be distributed under the terms of the Q Public License - * (QPL) as defined by Trolltech AS of Norway and appearing in the file - * LICENSE.QPL included in the packaging of this file. - * - * This library may be distributed and/or modified under the terms of the - * GNU General Public License (GPL) version 2 as published by the Free Software - * Foundation and appearing in the file LICENSE.GPL included in the - * packaging of this file. - * - * This library is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE - * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - * - * Commercial use or any other use of this library not covered by either - * the QPL or the GPL requires an additional license from Dtecta. - * Please contact info@dtecta.com for enquiries about the terms of commercial - * use of this library. - */ - -#include <new> -#include <fstream> - -#include "DT_Complex.h" -#include "DT_Minkowski.h" -#include "DT_Sphere.h" -#include "DT_Transform.h" - -DT_Complex::DT_Complex(const DT_VertexBase *base) - : m_base(base), - m_count(0), - m_leaves(0), - m_nodes(0) -{ - assert(base); - base->addComplex(this); -} - - -DT_Complex::~DT_Complex() -{ - DT_Index i; - for (i = 0; i != m_count; ++i) - { - delete m_leaves[i]; - } - delete [] m_leaves; - delete [] m_nodes; - - m_base->removeComplex(this); - if (m_base->isOwner()) - { - delete m_base; - } -} - -void DT_Complex::finish(DT_Count n, const DT_Convex *p[]) -{ - m_count = n; - - - assert(n >= 1); - - m_leaves = new const DT_Convex *[n]; - assert(m_leaves); - - DT_CBox *boxes = new DT_CBox[n]; - DT_Index *indices = new DT_Index[n]; - assert(boxes); - - DT_Index i; - for (i = 0; i != n; ++i) - { - m_leaves[i] = p[i]; - boxes[i].set(p[i]->bbox()); - indices[i] = i; - } - - m_cbox = boxes[0]; - for (i = 1; i != n; ++i) - { - m_cbox = m_cbox.hull(boxes[i]); - } - - if (n == 1) - { - m_nodes = 0; - m_type = DT_BBoxTree::LEAF; - } - else - { - m_nodes = new DT_BBoxNode[n - 1]; - assert(m_nodes); - - int num_nodes = 0; - new(&m_nodes[num_nodes++]) DT_BBoxNode(0, n, num_nodes, m_nodes, boxes, indices, m_cbox); - - assert(num_nodes == n - 1); - - m_type = DT_BBoxTree::INTERNAL; - } - - delete [] boxes; -} - - -MT_BBox DT_Complex::bbox(const MT_Transform& t, MT_Scalar margin) const -{ - MT_Matrix3x3 abs_b = t.getBasis().absolute(); - MT_Point3 center = t(m_cbox.getCenter()); - MT_Vector3 extent(margin + abs_b[0].dot(m_cbox.getExtent()), - margin + abs_b[1].dot(m_cbox.getExtent()), - margin + abs_b[2].dot(m_cbox.getExtent())); - - return MT_BBox(center - extent, center + extent); -} - -inline DT_CBox computeCBox(const DT_Convex *p) -{ - return DT_CBox(p->bbox()); -} - -inline DT_CBox computeCBox(MT_Scalar margin, const MT_Transform& xform) -{ - const MT_Matrix3x3& basis = xform.getBasis(); - return DT_CBox(MT_Point3(MT_Scalar(0.0), MT_Scalar(0.0), MT_Scalar(0.0)), - MT_Vector3(basis[0].length() * margin, - basis[1].length() * margin, - basis[2].length() * margin)); -} - -void DT_Complex::refit() -{ - DT_RootData<const DT_Convex *> rd(m_nodes, m_leaves); - DT_Index i = m_count - 1; - while (i--) - { - ::refit(m_nodes[i], rd); - } - m_cbox = m_type == DT_BBoxTree::LEAF ? computeCBox(m_leaves[0]) : m_nodes[0].hull(); -} - -inline bool ray_cast(const DT_RootData<const DT_Convex *>& rd, DT_Index index, const MT_Point3& source, const MT_Point3& target, - MT_Scalar& lambda, MT_Vector3& normal) -{ - return rd.m_leaves[index]->ray_cast(source, target, lambda, normal); -} - -bool DT_Complex::ray_cast(const MT_Point3& source, const MT_Point3& target, - MT_Scalar& lambda, MT_Vector3& normal) const -{ - DT_RootData<const DT_Convex *> rd(m_nodes, m_leaves); - - return ::ray_cast(DT_BBoxTree(m_cbox, 0, m_type), rd, source, target, lambda, normal); -} - -inline bool intersect(const DT_Pack<const DT_Convex *, MT_Scalar>& pack, DT_Index a_index, MT_Vector3& v) -{ - DT_Transform ta = DT_Transform(pack.m_a.m_xform, *pack.m_a.m_leaves[a_index]); - MT_Scalar a_margin = pack.m_a.m_plus; - return ::intersect((a_margin > MT_Scalar(0.0) ? - static_cast<const DT_Convex&>(DT_Minkowski(ta, DT_Sphere(a_margin))) : - static_cast<const DT_Convex&>(ta)), - pack.m_b, v); -} - -bool intersect(const DT_Complex& a, const MT_Transform& a2w, MT_Scalar a_margin, - const DT_Convex& b, MT_Vector3& v) -{ - DT_Pack<const DT_Convex *, MT_Scalar> pack(DT_ObjectData<const DT_Convex *, MT_Scalar>(a.m_nodes, a.m_leaves, a2w, a_margin), b); - - return intersect(DT_BBoxTree(a.m_cbox + pack.m_a.m_added, 0, a.m_type), pack, v); -} - -inline bool intersect(const DT_DuoPack<const DT_Convex *, MT_Scalar>& pack, DT_Index a_index, DT_Index b_index, MT_Vector3& v) -{ - DT_Transform ta = DT_Transform(pack.m_a.m_xform, *pack.m_a.m_leaves[a_index]); - MT_Scalar a_margin = pack.m_a.m_plus; - DT_Transform tb = DT_Transform(pack.m_b.m_xform, *pack.m_b.m_leaves[b_index]); - MT_Scalar b_margin = pack.m_b.m_plus; - return ::intersect((a_margin > MT_Scalar(0.0) ? - static_cast<const DT_Convex&>(DT_Minkowski(ta, DT_Sphere(a_margin))) : - static_cast<const DT_Convex&>(ta)), - (b_margin > MT_Scalar(0.0) ? - static_cast<const DT_Convex&>(DT_Minkowski(tb, DT_Sphere(b_margin))) : - static_cast<const DT_Convex&>(tb)), - v); -} - -bool intersect(const DT_Complex& a, const MT_Transform& a2w, MT_Scalar a_margin, - const DT_Complex& b, const MT_Transform& b2w, MT_Scalar b_margin, MT_Vector3& v) -{ - DT_DuoPack<const DT_Convex *, MT_Scalar> pack(DT_ObjectData<const DT_Convex *, MT_Scalar>(a.m_nodes, a.m_leaves, a2w, a_margin), - DT_ObjectData<const DT_Convex *, MT_Scalar>(b.m_nodes, b.m_leaves, b2w, b_margin)); - - - return intersect(DT_BBoxTree(a.m_cbox + pack.m_a.m_added, 0, a.m_type), - DT_BBoxTree(b.m_cbox + pack.m_b.m_added, 0, b.m_type), pack, v); -} - -inline bool common_point(const DT_Pack<const DT_Convex *, MT_Scalar>& pack, DT_Index a_index, MT_Vector3& v, MT_Point3& pa, MT_Point3& pb) -{ - DT_Transform ta = DT_Transform(pack.m_a.m_xform, *pack.m_a.m_leaves[a_index]); - MT_Scalar a_margin = pack.m_a.m_plus; - return ::common_point((a_margin > MT_Scalar(0.0) ? - static_cast<const DT_Convex&>(DT_Minkowski(ta, DT_Sphere(a_margin))) : - static_cast<const DT_Convex&>(ta)), - pack.m_b, v, pa, pb); -} - -bool common_point(const DT_Complex& a, const MT_Transform& a2w, MT_Scalar a_margin, - const DT_Convex& b, MT_Vector3& v, MT_Point3& pa, MT_Point3& pb) -{ - DT_Pack<const DT_Convex *, MT_Scalar> pack(DT_ObjectData<const DT_Convex *, MT_Scalar>(a.m_nodes, a.m_leaves, a2w, a_margin), b); - - return common_point(DT_BBoxTree(a.m_cbox + pack.m_a.m_added, 0, a.m_type), pack, v, pb, pa); -} - -inline bool common_point(const DT_DuoPack<const DT_Convex *, MT_Scalar>& pack, DT_Index a_index, DT_Index b_index, MT_Vector3& v, MT_Point3& pa, MT_Point3& pb) -{ - DT_Transform ta = DT_Transform(pack.m_a.m_xform, *pack.m_a.m_leaves[a_index]); - MT_Scalar a_margin = pack.m_a.m_plus; - DT_Transform tb = DT_Transform(pack.m_b.m_xform, *pack.m_b.m_leaves[b_index]); - MT_Scalar b_margin = pack.m_b.m_plus; - return ::common_point((a_margin > MT_Scalar(0.0) ? - static_cast<const DT_Convex&>(DT_Minkowski(ta, DT_Sphere(a_margin))) : - static_cast<const DT_Convex&>(ta)), - (b_margin > MT_Scalar(0.0) ? - static_cast<const DT_Convex&>(DT_Minkowski(tb, DT_Sphere(b_margin))) : - static_cast<const DT_Convex&>(tb)), - v, pa, pb); -} - -bool common_point(const DT_Complex& a, const MT_Transform& a2w, MT_Scalar a_margin, - const DT_Complex& b, const MT_Transform& b2w, MT_Scalar b_margin, - MT_Vector3& v, MT_Point3& pa, MT_Point3& pb) -{ - DT_DuoPack<const DT_Convex *, MT_Scalar> pack(DT_ObjectData<const DT_Convex *, MT_Scalar>(a.m_nodes, a.m_leaves, a2w, a_margin), - DT_ObjectData<const DT_Convex *, MT_Scalar>(b.m_nodes, b.m_leaves, b2w, b_margin)); - - return common_point(DT_BBoxTree(a.m_cbox + pack.m_a.m_added, 0, a.m_type), - DT_BBoxTree(b.m_cbox + pack.m_b.m_added, 0, b.m_type), pack, v, pa, pb); -} - -inline bool penetration_depth(const DT_HybridPack<const DT_Convex *, MT_Scalar>& pack, DT_Index a_index, MT_Vector3& v, MT_Point3& pa, MT_Point3& pb) -{ - DT_Transform ta = DT_Transform(pack.m_a.m_xform, *pack.m_a.m_leaves[a_index]); - return ::hybrid_penetration_depth(ta, pack.m_a.m_plus, pack.m_b, pack.m_margin, v, pa, pb); -} - -bool penetration_depth(const DT_Complex& a, const MT_Transform& a2w, MT_Scalar a_margin, - const DT_Convex& b, MT_Scalar b_margin, MT_Vector3& v, MT_Point3& pa, MT_Point3& pb) -{ - DT_HybridPack<const DT_Convex *, MT_Scalar> pack(DT_ObjectData<const DT_Convex *, MT_Scalar>(a.m_nodes, a.m_leaves, a2w, a_margin), b, b_margin); - - MT_Scalar max_pen_len = MT_Scalar(0.0); - return penetration_depth(DT_BBoxTree(a.m_cbox + pack.m_a.m_added, 0, a.m_type), pack, v, pa, pb, max_pen_len); -} - -inline bool penetration_depth(const DT_DuoPack<const DT_Convex *, MT_Scalar>& pack, DT_Index a_index, DT_Index b_index, MT_Vector3& v, MT_Point3& pa, MT_Point3& pb) -{ - DT_Transform ta = DT_Transform(pack.m_a.m_xform, *pack.m_a.m_leaves[a_index]); - DT_Transform tb = DT_Transform(pack.m_b.m_xform, *pack.m_b.m_leaves[b_index]); - return ::hybrid_penetration_depth(ta, pack.m_a.m_plus, tb, pack.m_a.m_plus, v, pa, pb); -} - -bool penetration_depth(const DT_Complex& a, const MT_Transform& a2w, MT_Scalar a_margin, - const DT_Complex& b, const MT_Transform& b2w, MT_Scalar b_margin, - MT_Vector3& v, MT_Point3& pa, MT_Point3& pb) -{ - DT_DuoPack<const DT_Convex *, MT_Scalar> pack(DT_ObjectData<const DT_Convex *, MT_Scalar>(a.m_nodes, a.m_leaves, a2w, a_margin), - DT_ObjectData<const DT_Convex *, MT_Scalar>(b.m_nodes, b.m_leaves, b2w, b_margin)); - - MT_Scalar max_pen_len = MT_Scalar(0.0); - return penetration_depth(DT_BBoxTree(a.m_cbox + pack.m_a.m_added, 0, a.m_type), - DT_BBoxTree(b.m_cbox + pack.m_b.m_added, 0, b.m_type), pack, v, pa, pb, max_pen_len); -} - - - -inline MT_Scalar closest_points(const DT_Pack<const DT_Convex *, MT_Scalar>& pack, DT_Index a_index, MT_Scalar max_dist2, MT_Point3& pa, MT_Point3& pb) -{ - DT_Transform ta = DT_Transform(pack.m_a.m_xform, *pack.m_a.m_leaves[a_index]); - MT_Scalar a_margin = pack.m_a.m_plus; - return ::closest_points((a_margin > MT_Scalar(0.0) ? - static_cast<const DT_Convex&>(DT_Minkowski(ta, DT_Sphere(a_margin))) : - static_cast<const DT_Convex&>(ta)), - pack.m_b, max_dist2, pa, pb); -} - -MT_Scalar closest_points(const DT_Complex& a, const MT_Transform& a2w, MT_Scalar a_margin, - const DT_Convex& b, MT_Point3& pa, MT_Point3& pb) -{ - DT_Pack<const DT_Convex *, MT_Scalar> pack(DT_ObjectData<const DT_Convex *, MT_Scalar>(a.m_nodes, a.m_leaves, a2w, a_margin), b); - - return closest_points(DT_BBoxTree(a.m_cbox + pack.m_a.m_added, 0, a.m_type), pack, MT_INFINITY, pa, pb); -} - -inline MT_Scalar closest_points(const DT_DuoPack<const DT_Convex *, MT_Scalar>& pack, DT_Index a_index, DT_Index b_index, MT_Scalar max_dist2, MT_Point3& pa, MT_Point3& pb) -{ - DT_Transform ta = DT_Transform(pack.m_a.m_xform, *pack.m_a.m_leaves[a_index]); - MT_Scalar a_margin = pack.m_a.m_plus; - DT_Transform tb = DT_Transform(pack.m_b.m_xform, *pack.m_b.m_leaves[b_index]); - MT_Scalar b_margin = pack.m_b.m_plus; - return ::closest_points((a_margin > MT_Scalar(0.0) ? - static_cast<const DT_Convex&>(DT_Minkowski(ta, DT_Sphere(a_margin))) : - static_cast<const DT_Convex&>(ta)), - (b_margin > MT_Scalar(0.0) ? - static_cast<const DT_Convex&>(DT_Minkowski(tb, DT_Sphere(b_margin))) : - static_cast<const DT_Convex&>(tb)), max_dist2, pa, pb); -} - -MT_Scalar closest_points(const DT_Complex& a, const MT_Transform& a2w, MT_Scalar a_margin, - const DT_Complex& b, const MT_Transform& b2w, MT_Scalar b_margin, - MT_Point3& pa, MT_Point3& pb) -{ - DT_DuoPack<const DT_Convex *, MT_Scalar> pack(DT_ObjectData<const DT_Convex *, MT_Scalar>(a.m_nodes, a.m_leaves, a2w, a_margin), - DT_ObjectData<const DT_Convex *, MT_Scalar>(b.m_nodes, b.m_leaves, b2w, b_margin)); - - return closest_points(DT_BBoxTree(a.m_cbox + pack.m_a.m_added, 0, a.m_type), - DT_BBoxTree(b.m_cbox + pack.m_b.m_added, 0, b.m_type), pack, MT_INFINITY, pa, pb); -} - - diff --git a/extern/solid/src/complex/DT_Complex.h b/extern/solid/src/complex/DT_Complex.h deleted file mode 100644 index ae08a05d4c9..00000000000 --- a/extern/solid/src/complex/DT_Complex.h +++ /dev/null @@ -1,94 +0,0 @@ -/* - * SOLID - Software Library for Interference Detection - * - * Copyright (C) 2001-2003 Dtecta. All rights reserved. - * - * This library may be distributed under the terms of the Q Public License - * (QPL) as defined by Trolltech AS of Norway and appearing in the file - * LICENSE.QPL included in the packaging of this file. - * - * This library may be distributed and/or modified under the terms of the - * GNU General Public License (GPL) version 2 as published by the Free Software - * Foundation and appearing in the file LICENSE.GPL included in the - * packaging of this file. - * - * This library is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE - * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - * - * Commercial use or any other use of this library not covered by either - * the QPL or the GPL requires an additional license from Dtecta. - * Please contact info@dtecta.com for enquiries about the terms of commercial - * use of this library. - */ - -#ifndef DT_COMPLEX_H -#define DT_COMPLEX_H - -#include <algorithm> - -#include "MT_Transform.h" -#include "DT_VertexBase.h" - -#include "DT_Shape.h" -#include "DT_CBox.h" -#include "DT_BBoxTree.h" - -class DT_Convex; - -class DT_Complex : public DT_Shape { -public: - DT_Complex(const DT_VertexBase *base); - virtual ~DT_Complex(); - - void finish(DT_Count n, const DT_Convex *p[]); - - virtual DT_ShapeType getType() const { return COMPLEX; } - - virtual MT_BBox bbox(const MT_Transform& t, MT_Scalar margin) const; - - virtual bool ray_cast(const MT_Point3& source, const MT_Point3& target, - MT_Scalar& lambda, MT_Vector3& normal) const; - - void refit(); - - - friend bool intersect(const DT_Complex& a, const MT_Transform& a2w, MT_Scalar a_margin, - const DT_Convex& b, MT_Vector3& v); - - friend bool intersect(const DT_Complex& a, const MT_Transform& a2w, MT_Scalar a_margin, - const DT_Complex& b, const MT_Transform& b2w, MT_Scalar b_margin, - MT_Vector3& v); - - friend bool common_point(const DT_Complex& a, const MT_Transform& a2w, MT_Scalar a_margin, - const DT_Convex& b, MT_Vector3& v, MT_Point3& pa, MT_Point3& pb); - - friend bool common_point(const DT_Complex& a, const MT_Transform& a2w, MT_Scalar a_margin, - const DT_Complex& b, const MT_Transform& b2w, MT_Scalar b_margin, - MT_Vector3& v, MT_Point3& pa, MT_Point3& pb); - - friend bool penetration_depth(const DT_Complex& a, const MT_Transform& a2w, MT_Scalar a_margin, - const DT_Convex& b, MT_Scalar b_margin, MT_Vector3& v, MT_Point3& pa, MT_Point3& pb); - - friend bool penetration_depth(const DT_Complex& a, const MT_Transform& a2w, MT_Scalar a_margin, - const DT_Complex& b, const MT_Transform& b2w, MT_Scalar b_margin, - MT_Vector3& v, MT_Point3& pa, MT_Point3& pb); - - friend MT_Scalar closest_points(const DT_Complex& a, const MT_Transform& a2w, MT_Scalar a_margin, - const DT_Convex& b, MT_Point3& pa, MT_Point3& pb); - - friend MT_Scalar closest_points(const DT_Complex& a, const MT_Transform& a2w, MT_Scalar a_margin, - const DT_Complex& b, const MT_Transform& b2w, MT_Scalar b_margin, - MT_Point3& pa, MT_Point3& pb); - - const DT_VertexBase *m_base; - DT_Count m_count; - const DT_Convex **m_leaves; - DT_BBoxNode *m_nodes; - DT_CBox m_cbox; - DT_BBoxTree::NodeType m_type; -}; - -#endif - - - diff --git a/extern/solid/src/complex/Makefile b/extern/solid/src/complex/Makefile deleted file mode 100644 index e8df4df51a3..00000000000 --- a/extern/solid/src/complex/Makefile +++ /dev/null @@ -1,42 +0,0 @@ -# -# $Id$ -# -# ***** BEGIN GPL LICENSE BLOCK ***** -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# -# The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. -# All rights reserved. -# -# The Original Code is: all of this file. -# -# Contributor(s): none yet. -# -# ***** END GPL LICENSE BLOCK ***** -# -# - -LIBNAME = solid_complex -DIR = $(OCGDIR)/extern/$(LIBNAME) - -CCFLAGS += $(LEVEL_1_CPP_WARNINGS) - -CPPFLAGS += -I../../include -I$(NAN_QHULL)/include -CPPFLAGS += -I../convex -CPPFLAGS += -DQHULL -DUSE_DOUBLES - -include nan_compile.mk - - |