38 #ifndef FCL_TRAVERSAL_SHAPECONSERVATIVEADVANCEMENTTRAVERSALNODE_INL_H 39 #define FCL_TRAVERSAL_SHAPECONSERVATIVEADVANCEMENTTRAVERSALNODE_INL_H 41 #include "fcl/narrowphase/detail/traversal/distance/shape_conservative_advancement_traversal_node.h" 50 template <
typename Shape1,
typename Shape2,
typename NarrowPhaseSolver>
51 ShapeConservativeAdvancementTraversalNode<Shape1, Shape2, NarrowPhaseSolver>::
52 ShapeConservativeAdvancementTraversalNode()
53 : ShapeDistanceTraversalNode<Shape1, Shape2, NarrowPhaseSolver>()
64 template <
typename Shape1,
typename Shape2,
typename NarrowPhaseSolver>
75 Vector3<S> closest_p1 = Vector3<S>::Zero();
76 Vector3<S> closest_p2 = Vector3<S>::Zero();
77 this->nsolver->shapeDistance(*(this->model1), this->
tf1, *(this->model2), this->
tf2, &distance, &closest_p1, &closest_p2);
79 Vector3<S> n = this->
tf2 * closest_p2 - this->
tf1 * closest_p1;
83 S bound1 = motion1->computeMotionBound(mb_visitor1);
84 S bound2 = motion2->computeMotionBound(mb_visitor2);
86 S bound = bound1 + bound2;
89 if(bound <= distance) cur_delta_t = 1;
90 else cur_delta_t = distance / bound;
92 if(cur_delta_t < delta_t)
93 delta_t = cur_delta_t;
97 template <
typename Shape1,
typename Shape2,
typename NarrowPhaseSolver>
100 const Shape1& shape1,
101 const Transform3<typename Shape1::S>&
tf1,
102 const Shape2& shape2,
103 const Transform3<typename Shape1::S>&
tf2,
104 const NarrowPhaseSolver* nsolver)
106 using S =
typename Shape1::S;
108 node.model1 = &shape1;
110 node.model2 = &shape2;
112 node.nsolver = nsolver;
114 computeBV(shape1, Transform3<S>::Identity(), node.model1_bv);
115 computeBV(shape2, Transform3<S>::Identity(), node.model2_bv);
Main namespace.
Definition: broadphase_bruteforce-inl.h:45
Transform3< BV::S > tf2
configuration of second object
Definition: traversal_node_base.h:88
Definition: shape_conservative_advancement_traversal_node.h:50
Definition: tbv_motion_bound_visitor.h:65
void computeBV(const Shape &s, const Transform3< typename BV::S > &tf, BV &bv)
calculate a bounding volume for a shape in a specific configuration
Definition: utility-inl.h:1049
void leafTesting(int, int) const
Leaf test between node b1 and b2, if they are both leafs.
Definition: shape_conservative_advancement_traversal_node-inl.h:66
Transform3< BV::S > tf1
configuation of first object
Definition: traversal_node_base.h:85
S distance(const Eigen::MatrixBase< DerivedA > &R0, const Eigen::MatrixBase< DerivedB > &T0, const kIOS< S > &b1, const kIOS< S > &b2, Vector3< S > *P, Vector3< S > *Q)
Approximate distance between two kIOS bounding volumes.
Definition: kIOS-inl.h:266