A line-swept-cricle.
More...
#include <capsule.h>
|
| Capsule2 () |
| Empty.
|
|
| Capsule2 (const Vector2 &, const Vector2 &, const double &) |
| Creates a capsule.
|
|
| ~Capsule2 () |
| Empty.
|
|
bool | Inside (const Vector2 &) const |
| Check if a point is inside the capsule.
|
|
double | R (const Vector2 &) const |
| Computes the squared distance between a point and the capsule.
|
|
double | Signed (const Vector2 &) const |
| Computes the signed distance between a point and the capsule.
|
|
bool | Intersect (const Ray2 &) const |
| Check the intersection between a capsule and a ray.
|
|
int | Intersect (const Ray2 &, double &, double &) const |
| Compute the intersections between a capsule and a ray.
|
|
Box2 | GetBox () const |
| Computes the tight bounding box of the capsule.
|
|
double | Area () const |
| Compute the surface area.
|
|
void | Draw (QGraphicsScene &, const QPen &, const QBrush &) const |
| Draws a capsule.
|
|
Vector2 | Vertex (int) const |
| Return one of the end vertexes of the axis.
|
|
|
double | r = 1.0 |
| Radius.
|
|
Vector2 | b = Vector2(1.0, 0.0) |
| End vertexes of the axis.
|
|
Vector2 | axis = Vector2::X |
| Normalized axis vector.
|
|
double | length = 1.0 |
| Length of the axis.
|
|
◆ Capsule2()
Capsule2::Capsule2 |
( |
const Vector2 & | a, |
|
|
const Vector2 & | b, |
|
|
const double & | r ) |
|
explicit |
Creates a capsule.
- Parameters
-
◆ Draw()
void Capsule2::Draw |
( |
QGraphicsScene & | scene, |
|
|
const QPen & | pen, |
|
|
const QBrush & | brush ) const |
Draws a capsule.
- Parameters
-
scene | Graphics scene. |
pen | The pen. |
brush | The brush. |
◆ GetBox()
Box2 Capsule2::GetBox |
( |
| ) |
const |
◆ Inside()
bool Capsule2::Inside |
( |
const Vector2 & | p | ) |
const |
Check if a point is inside the capsule.
- Parameters
-
◆ Intersect() [1/2]
bool Capsule2::Intersect |
( |
const Ray2 & | ray | ) |
const |
Check the intersection between a capsule and a ray.
- Parameters
-
◆ Intersect() [2/2]
int Capsule2::Intersect |
( |
const Ray2 & | ray, |
|
|
double & | ta, |
|
|
double & | tb ) const |
Compute the intersections between a capsule and a ray.
- Parameters
-
ray | The ray. |
ta,tb | Intersection depths. |
◆ R()
double Capsule2::R |
( |
const Vector2 & | p | ) |
const |
Computes the squared distance between a point and the capsule.
- Parameters
-
◆ Signed()
double Capsule2::Signed |
( |
const Vector2 & | p | ) |
const |
Computes the signed distance between a point and the capsule.
- Parameters
-
◆ operator<<
std::ostream & operator<< |
( |
std::ostream & | s, |
|
|
const Capsule2 & | c ) |
|
friend |