Support Forum       G3D Web Page     
Public Member Functions | List of all members
G3D::Cylinder Class Reference


Right cylinder More...

Public Member Functions

 Cylinder ()
 Uninitialized. More...
 
 Cylinder (class BinaryInput &b)
 
 Cylinder (const Vector3 &_p1, const Vector3 &_p2, float _r)
 
 Cylinder (const Any &a)
 
float area () const
 
Line axis () const
 The line down the center of the Cylinder. More...
 
Vector3 center () const
 Center of mass. More...
 
bool contains (const Vector3 &p) const
 
Returns true if the point is inside the Cylinder or on its surface. More...
 
void deserialize (class BinaryInput &b)
 
void getBounds (AABox &out) const
 
Get close 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
 
A reference frame in which the center of mass is at the origin and the Y-axis is the cylinder's axis. More...
 
size_t hashCode () const
 
float height () const
 
bool operator== (const Cylinder &other) const
 
const Vector3point (int i) const
 Returns point 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
 
Any toAny () const
 
float volume () const
 

Detailed Description


Right cylinder

Constructor & Destructor Documentation

◆ Cylinder() [1/4]

G3D::Cylinder::Cylinder ( )

Uninitialized.

◆ Cylinder() [2/4]

G3D::Cylinder::Cylinder ( class BinaryInput b)

◆ Cylinder() [3/4]

G3D::Cylinder::Cylinder ( const Vector3 _p1,
const Vector3 _p2,
float  _r 
)

◆ Cylinder() [4/4]

G3D::Cylinder::Cylinder ( const Any a)

Member Function Documentation

◆ area()

float G3D::Cylinder::area ( ) const

◆ axis()

Line G3D::Cylinder::axis ( ) const

The line down the center of the Cylinder.

◆ center()

Vector3 G3D::Cylinder::center ( ) const
inline

◆ contains()

bool G3D::Cylinder::contains ( const Vector3 p) const


Returns true if the point is inside the Cylinder or on its surface.

◆ deserialize()

void G3D::Cylinder::deserialize ( class BinaryInput b)

◆ getBounds()

void G3D::Cylinder::getBounds ( AABox out) const


Get close axis aligned bounding box.

With vertical world orientation, the top and bottom might not be very tight.

Referenced by G3D::CylinderShape::boundingAABox().

◆ getRandomSurfacePoint()

void G3D::Cylinder::getRandomSurfacePoint ( Vector3 P,
Vector3 N,
Random rnd = Random::common() 
) const

Random world space point with outward facing normal.

Referenced by G3D::CylinderShape::getRandomSurfacePoint().

◆ getReferenceFrame()

void G3D::Cylinder::getReferenceFrame ( class CoordinateFrame cframe) const


A reference frame in which the center of mass is at the origin and the Y-axis is the cylinder's axis.

If the cylinder is transformed, this reference frame may freely rotate around its axis.

◆ hashCode()

size_t G3D::Cylinder::hashCode ( ) const

◆ height()

float G3D::Cylinder::height ( ) const
inline

◆ operator==()

bool G3D::Cylinder::operator== ( const Cylinder other) const

◆ point()

const Vector3& G3D::Cylinder::point ( int  i) const
inline

Returns point 0 or 1.

◆ radius()

float G3D::Cylinder::radius ( ) const

◆ randomInteriorPoint()

Vector3 G3D::Cylinder::randomInteriorPoint ( Random rnd = Random::common()) const

Point selected uniformly at random over the volume.

Referenced by G3D::CylinderShape::randomInteriorPoint().

◆ serialize()

void G3D::Cylinder::serialize ( class BinaryOutput b) const

◆ toAny()

Any G3D::Cylinder::toAny ( ) const

◆ volume()

float G3D::Cylinder::volume ( ) const

documentation generated on Wed Nov 24 2021 08:01:54 using doxygen 1.8.15