coal  3.0.1
Coal, The Collision Detection Library. Previously known as HPP-FCL, fork of FCL -- The Flexible Collision Library
coal::Halfspace Class Reference

Half Space: this is equivalent to the Plane in ODE. A Half space has a priviledged direction: the direction of the normal. The separation plane is defined as n * x = d; Points in the negative side of the separation plane (i.e. {x | n * x < d}) are inside the half space and points in the positive side of the separation plane (i.e. {x | n * x > d}) are outside the half space. Note: prefer using a Halfspace instead of a Plane if possible, it has better behavior w.r.t. collision detection algorithms. More...

#include <coal/shape/geometric_shapes.h>

Inheritance diagram for coal::Halfspace:
Collaboration diagram for coal::Halfspace:

Public Member Functions

 Halfspace (const Vec3s &n_, Scalar d_)
 Construct a half space with normal direction and offset. More...
 
 Halfspace (Scalar a, Scalar b, Scalar c, Scalar d_)
 Construct a plane with normal direction and offset. More...
 
 Halfspace ()
 
 Halfspace (const Halfspace &other)
 
Halfspaceoperator= (const Halfspace &other)
 operator = More...
 
virtual Halfspaceclone () const
 Clone *this into a new Halfspace. More...
 
Scalar signedDistance (const Vec3s &p) const
 
Scalar distance (const Vec3s &p) const
 
void computeLocalAABB ()
 Compute AABB. More...
 
NODE_TYPE getNodeType () const
 Get node type: a half space. More...
 
Scalar minInflationValue () const
 
std::pair< Halfspace, Transform3sinflated (const Scalar value) const
 Inflate the halfspace by an amount given by value. This value can be positive or negative but must always >= minInflationValue(). More...
 
- Public Member Functions inherited from coal::ShapeBase
 ShapeBase ()
 
 ShapeBase (const ShapeBase &other)
   More...
 
ShapeBaseoperator= (const ShapeBase &other)=default
 
virtual ~ShapeBase ()
 
OBJECT_TYPE getObjectType () const
 Get object type: a geometric shape. More...
 
void setSweptSphereRadius (Scalar radius)
 Set radius of sphere swept around the shape. Must be >= 0. More...
 
Scalar getSweptSphereRadius () const
 Get radius of sphere swept around the shape. This radius is always >= 0. More...
 
- Public Member Functions inherited from coal::CollisionGeometry
 CollisionGeometry ()
 
 CollisionGeometry (const CollisionGeometry &other)=default
 Copy constructor. More...
 
virtual ~CollisionGeometry ()
 
bool operator== (const CollisionGeometry &other) const
 Equality operator. More...
 
bool operator!= (const CollisionGeometry &other) const
 Difference operator. More...
 
void * getUserData () const
 get user data in geometry More...
 
void setUserData (void *data)
 set user data in geometry More...
 
bool isOccupied () const
 whether the object is completely occupied More...
 
bool isFree () const
 whether the object is completely free More...
 
bool isUncertain () const
 whether the object has some uncertainty More...
 
virtual Vec3s computeCOM () const
 compute center of mass More...
 
virtual Matrix3s computeMomentofInertia () const
 compute the inertia matrix, related to the origin More...
 
virtual Scalar computeVolume () const
 compute the volume More...
 
virtual Matrix3s computeMomentofInertiaRelatedToCOM () const
 compute the inertia matrix, related to the com More...
 

Public Attributes

Vec3s n
 Plane normal. More...
 
Scalar d
 Plane offset. More...
 
- Public Attributes inherited from coal::CollisionGeometry
Vec3s aabb_center
 AABB center in local coordinate. More...
 
Scalar aabb_radius
 AABB radius. More...
 
AABB aabb_local
 AABB in local coordinate, used for tight AABB when only translation transform. More...
 
void * user_data
 pointer to user defined data specific to this object More...
 
Scalar cost_density
 collision cost for unit volume More...
 
Scalar threshold_occupied
 threshold for occupied ( >= is occupied) More...
 
Scalar threshold_free
 threshold for free (<= is free) More...
 

Protected Member Functions

void unitNormalTest ()
 Turn non-unit normal into unit. More...
 

Additional Inherited Members

- Protected Attributes inherited from coal::ShapeBase
Scalar m_swept_sphere_radius {0}
 Radius of the sphere swept around the shape. Default value is 0. Note: this property differs from inflated method of certain derived classes (e.g. Box, Sphere, Ellipsoid, Capsule, Cone, Cylinder) in the sense that inflated returns a new shape which can be inflated but also deflated. Also, an inflated shape is not rounded. It simply has a different size. Sweeping a shape with a sphere is a different operation (a Minkowski sum), which rounds the sharp corners of a shape. The swept sphere radius is a property of the shape itself and can be manually updated between collision checks. More...
 

Detailed Description

Half Space: this is equivalent to the Plane in ODE. A Half space has a priviledged direction: the direction of the normal. The separation plane is defined as n * x = d; Points in the negative side of the separation plane (i.e. {x | n * x < d}) are inside the half space and points in the positive side of the separation plane (i.e. {x | n * x > d}) are outside the half space. Note: prefer using a Halfspace instead of a Plane if possible, it has better behavior w.r.t. collision detection algorithms.


The documentation for this class was generated from the following file: