Class Halfspace

Inheritance Relationships

Base Type

Class Documentation

class Halfspace : public coal::ShapeBase

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.

Public Functions

inline Halfspace(const Vec3s &n_, CoalScalar d_)

Construct a half space with normal direction and offset.

inline Halfspace(CoalScalar a, CoalScalar b, CoalScalar c, CoalScalar d_)

Construct a plane with normal direction and offset.

inline Halfspace()
inline Halfspace(const Halfspace &other)
inline Halfspace &operator=(const Halfspace &other)

operator =

inline virtual Halfspace *clone() const

Clone *this into a new Halfspace.

inline CoalScalar signedDistance(const Vec3s &p) const
inline CoalScalar distance(const Vec3s &p) const
virtual void computeLocalAABB()

Compute AABB.

inline virtual NODE_TYPE getNodeType() const

Get node type: a half space.

inline CoalScalar minInflationValue() const
inline std::pair<Halfspace, Transform3s> inflated(const CoalScalar value) const

Inflate the halfspace by an amount given by value. This value can be positive or negative but must always >= minInflationValue().

Parameters:

value[in] of the shape inflation.

Returns:

a new inflated halfspace and the related transform to account for the change of shape frame

Public Members

Vec3s n

Plane normal.

CoalScalar d

Plane offset.

Protected Functions

void unitNormalTest()

Turn non-unit normal into unit.