| Support Forum G3D Web Page |
A shape formed by extruding a sphere along a line segment.
More...
Public Member Functions | |
| Capsule () | |
| Uninitialized. More... | |
| Capsule (class BinaryInput &b) | |
| Capsule (const Vector3 &_p1, const Vector3 &_p2, float _r) | |
| float | area () const |
| Line | axis () const |
| The line down the center of the capsule. More... | |
| Vector3 | center () const |
| bool | contains (const Vector3 &p) const |
Returns true if the point is inside the capsule or on its surface. More... | |
| void | deserialize (class BinaryInput &b) |
| void | getBounds (AABox &out) const |
| Get axis aligned bounding box. More... | |
| void | getRandomSurfacePoint (Vector3 &P, Vector3 &N, Random &rnd=Random::common()) const |
| Random world space point with outward facing normal. More... | |
| void | getReferenceFrame (class CoordinateFrame &cframe) const |
| Get a reference frame in which the center of mass is the origin and Y is the axis of the capsule. More... | |
| float | height () const |
| Distance between the sphere centers. More... | |
| Vector3 | point (int i) const |
| Argument may be 0 or 1. More... | |
| float | radius () const |
| Vector3 | randomInteriorPoint (Random &rnd=Random::common()) const |
| Point selected uniformly at random over the volume. More... | |
| void | serialize (class BinaryOutput &b) const |
| float | volume () const |
A shape formed by extruding a sphere along a line segment.
| G3D::Capsule::Capsule | ( | ) |
Uninitialized.
| G3D::Capsule::Capsule | ( | class BinaryInput & | b | ) |
| float G3D::Capsule::area | ( | ) | const |
Referenced by G3D::CapsuleShape::area().
| Line G3D::Capsule::axis | ( | ) | const |
The line down the center of the capsule.
|
inline |
Referenced by G3D::CapsuleShape::boundingSphere(), and G3D::CapsuleShape::center().
| bool G3D::Capsule::contains | ( | const Vector3 & | p | ) | const |
Returns true if the point is inside the capsule or on its surface.
| void G3D::Capsule::deserialize | ( | class BinaryInput & | b | ) |
| void G3D::Capsule::getBounds | ( | AABox & | out | ) | const |
Get axis aligned bounding box.
Referenced by G3D::CapsuleShape::boundingAABox().
| void G3D::Capsule::getRandomSurfacePoint | ( | Vector3 & | P, |
| Vector3 & | N, | ||
| Random & | rnd = Random::common() |
||
| ) | const |
Random world space point with outward facing normal.
Referenced by G3D::CapsuleShape::getRandomSurfacePoint().
| void G3D::Capsule::getReferenceFrame | ( | class CoordinateFrame & | cframe | ) | const |
Get a reference frame in which the center of mass is the origin and Y is the axis of the capsule.
|
inline |
Distance between the sphere centers.
The total extent of the cylinder is 2r + h.
|
inline |
Argument may be 0 or 1.
Referenced by G3D::CapsuleShape::boundingSphere().
|
inline |
Referenced by G3D::CapsuleShape::boundingSphere().
| Vector3 G3D::Capsule::randomInteriorPoint | ( | Random & | rnd = Random::common() | ) | const |
Point selected uniformly at random over the volume.
Referenced by G3D::CapsuleShape::randomInteriorPoint().
| void G3D::Capsule::serialize | ( | class BinaryOutput & | b | ) | const |
| float G3D::Capsule::volume | ( | ) | const |
Referenced by G3D::CapsuleShape::volume().
1.8.15