38 #ifndef FCL_SHAPE_HALFSPACE_INL_H 39 #define FCL_SHAPE_HALFSPACE_INL_H 56 Halfspace<double>
transform(
const Halfspace<double>& a,
const Transform3<double>& tf);
92 return std::abs(
n.dot(p) -
d);
101 if(
n[1] == (
S)0.0 &&
n[2] == (
S)0.0)
109 else if(
n[0] == (
S)0.0 &&
n[2] == (
S)0.0)
117 else if(
n[0] == (
S)0.0 &&
n[1] == (
S)0.0)
131 template <
typename S>
138 template <
typename S>
141 std::stringstream ss;
142 ss << std::setprecision(precision);
143 ss <<
"Halfspace<" << S_str <<
">(" <<
n[0] <<
", " <<
n[1] <<
", " <<
n[2]
144 <<
", " <<
d <<
");";
149 template <
typename S>
167 template <
typename S>
177 S d = a.
d + n.dot(tf.translation());
Vector3< S_ > aabb_center
AABB center in local coordinate.
NODE_TYPE
traversal node type: bounding volume (AABB, OBB, RSS, kIOS, OBBRSS, KDOP16, KDOP18, kDOP24), basic shape (box, sphere, ellipsoid, capsule, cone, cylinder, convex, plane, halfspace, triangle), and octree
Half Space: this is equivalent to the Planed in ODE. The separation plane is defined as n * x = d...
Base class for all basic geometric shapes.
S_ aabb_radius
AABB radius.
template Halfspace< double > transform(const Halfspace< double > &a, const Transform3< double > &tf)
static const char * value()
Eigen::Transform< S, 3, Eigen::Isometry > Transform3
S distance(const Vector3< S > &p) const
NODE_TYPE getNodeType() const override
Get node type: a half space.
Eigen::Matrix< S, 3, 1 > Vector3
void unitNormalTest()
Turn non-unit normal into unit.
template class FCL_EXPORT Halfspace< double >
AABB< S_ > aabb_local
AABB in local coordinate, used for tight AABB when only translation transform.
std::string representation(int precision=20) const
Create a string that should be sufficient to recreate this shape. This is akin to the repr() implemen...
void computeLocalAABB() override
Compute AABB.
Vector3< S > n
Planed normal.
S signedDistance(const Vector3< S > &p) const