Core 1.0
Public Member Functions | Protected Attributes | Friends | List of all members
ConeSphere Class Reference

Cone-Spheres, defined as rounded truncated cones. More...

#include <conesphere.h>

Inheritance diagram for ConeSphere:
Axis

Public Member Functions

 ConeSphere ()
 Empty.
 
 ConeSphere (const Vector &, const Vector &, const double &, const double &)
 Creates a cone-sphere characterized by its end-vertices and radii. More...
 
 ~ConeSphere ()
 Empty.
 
constexpr double Radius (int) const
 Gets either end-radius of the cone-sphere.
 
bool Inside (const Vector &) const
 Check if a point is inside or outside the cone-sphere. More...
 
double R (const Vector &) const
 Computes the distance between a point and the cone-sphere. More...
 
Vector Normal (const Vector &) const
 This function computes the vector distance between the cone-sphere and a point. More...
 
void Rotate (const Matrix &)
 Rotates the cone-sphere. More...
 
void Translate (const Vector &)
 Translates the cone-sphere. More...
 
void Scale (const double &)
 Uniformly scales the cone-sphere. More...
 
Box GetBox () const
 Compute the axis-aligned bounding box of the cone-sphere.
 
Vector Vertex (int) const
 Return one of the end vertexes of the axis.
 

Protected Attributes

double rb
 Radius of the cone at the first and second vertices of the axis, note that the first vertex should have the largest radius.
 
double rlength
 Internal parameter.
 
double conelength
 Side length of the cone.
 
Vector2 side
 Vector representing the side.
 
- Protected Attributes inherited from Axis
Vector b = Vector::Z
 End vertices of the axis.
 
Vector axis = Vector::Z
 Normalized axis vector.
 
double length = 1.0
 Length of the axis.
 

Friends

std::ostream & operator<< (std::ostream &, const ConeSphere &)
 Overloaded. More...
 

Additional Inherited Members

- Protected Member Functions inherited from Axis
double Radial (const Vector &, Vector &, Vector &) const
 Compute the radial coordinates of a point. More...
 
Vector2 Radial (const Vector &) const
 Compute the radial coordinates of a point. More...
 
 Axis ()
 Empty.
 
 Axis (const Vector &, const Vector &)
 Creates an axis given end vertices. More...
 
 ~Axis ()
 Empty.
 
void Rotate (const Matrix &)
 Rotates an axis. More...
 
void Translate (const Vector &)
 Translates an axis. More...
 
void Scale (const double &)
 Uniformly scales an axis. More...
 
void Scale (const Vector &)
 Scales an axis. More...
 
Quadric Equation (const Ray &) const
 Compute the polynomial equation of the Euclidean distance between a ray and the axis. More...
 
Vector Vertex (int) const
 Return one of the end vertexes of the axis.
 
Vector Point (const double &) const
 Compute a point on the axis.
 
Vector GetAxis () const
 Returns the normalized axis vector.
 
double Length () const
 Return the axis length.
 
Vector Symmetric (const Vector &) const
 Symmetric point. More...
 
Sphere Symmetric (const Sphere &) const
 Symmetric sphere. More...
 
Vector Normal (const Vector &) const
 Compute the normal vector between a point and its projection onto the edge. More...
 
double R (const Vector &) const
 Compute the squared distance to the segment. More...
 
double R (const Axis &) const
 Compute the squared distance between two axes. More...
 
double R (const Vector &, double &) const
 Compute the squared distance to the axis. More...
 
Matrix GetFrame () const
 Compute an orthonormal frame attached to the axis. More...
 
- Static Protected Member Functions inherited from Axis
static Matrix GetFrame (const Vector &)
 Compute an orthonormal frame attached to the axis. More...
 
static Vector BoxVector (const Vector &)
 Compute the box vector extent of a unit circle with a given axis. More...
 

Detailed Description

Cone-Spheres, defined as rounded truncated cones.

Constructor & Destructor Documentation

◆ ConeSphere()

ConeSphere::ConeSphere ( const Vector a,
const Vector b,
const double &  ra,
const double &  rb 
)
explicit

Creates a cone-sphere characterized by its end-vertices and radii.

Parameters
a,bEnd vertices of the axis.
ra,rbRadii.

Member Function Documentation

◆ Inside()

bool ConeSphere::Inside ( const Vector p) const

Check if a point is inside or outside the cone-sphere.

Parameters
pPoint.

◆ Normal()

Vector ConeSphere::Normal ( const Vector p) const

This function computes the vector distance between the cone-sphere and a point.

See also
Cone::Normal(const Vector&)
Parameters
pPoint.

◆ R()

double ConeSphere::R ( const Vector p) const

Computes the distance between a point and the cone-sphere.

Parameters
pPoint.

◆ Rotate()

void ConeSphere::Rotate ( const Matrix r)

Rotates the cone-sphere.

Parameters
rRotation matrix.

◆ Scale()

void ConeSphere::Scale ( const double &  s)

Uniformly scales the cone-sphere.

Parameters
sScaling factor.

◆ Translate()

void ConeSphere::Translate ( const Vector t)

Translates the cone-sphere.

Parameters
tTranslation vector.

Friends And Related Function Documentation

◆ operator<<

std::ostream & operator<< ( std::ostream &  s,
const ConeSphere conesphere 
)
friend

Overloaded.

Parameters
sStream.
conesphereThe cone-sphere.