A cylinder class describing a cylinder by its radius and length. More...
#include "murl_math_cylinder.h"
Public Types | |
using | ValueType = DataType |
The template parameter value type. | |
Public Member Functions | |
Cylinder () | |
The default constructor. | |
Cylinder (DataType length, DataType radius) | |
Constructor taking cylinder length and radius. More... | |
Cylinder (const Box< DataType > &box) | |
Constructor taking a box. More... | |
template<class DataType2 > | |
Cylinder (const Cylinder< DataType2 > &c) | |
The copy constructor using a cylinder of different type. More... | |
DataType | GetLength () const |
Get the length. More... | |
DataType | GetRadius () const |
Get the radius. More... | |
void | Set (const Box< DataType > &box) |
Set the cylinder by a box. More... | |
void | Set (const Box< DataType > &box, DataType shearX, DataType shearY) |
Set the cylinder from a sheared box. More... | |
Bool | IsIntersecting (const Sphere< DataType > &sphere) const |
Check if the cylinder is intersecting a sphere. More... | |
String | ToString () const |
Get the string representation of the object. More... | |
Protected Attributes | |
DataType | mLength |
The length of the cylinder. | |
DataType | mRadius |
The radius of the cylinder. | |
DataType | mOffsetX |
The X offset value. | |
DataType | mOffsetY |
The Y offset value. | |
DataType | mShearX |
The X shear value. | |
DataType | mShearY |
The Y shear value. | |
Detailed Description
template<class DataType>
class Murl::Math::Cylinder< DataType >
A cylinder class describing a cylinder by its radius and length.
Constructor & Destructor Documentation
◆ Cylinder() [1/3]
|
inline |
Constructor taking cylinder length and radius.
- Parameters
-
length The length of the cylinder. radius The radius of the cylinder.
◆ Cylinder() [2/3]
|
inline |
Constructor taking a box.
- Parameters
-
box The box.
References Murl::Math::Cylinder< DataType >::Set().
◆ Cylinder() [3/3]
|
inline |
The copy constructor using a cylinder of different type.
- Parameters
-
c The cylinder to copy.
Member Function Documentation
◆ GetLength()
|
inline |
◆ GetRadius()
|
inline |
◆ Set() [1/2]
|
inline |
Set the cylinder by a box.
- Parameters
-
box The box.
Referenced by Murl::Math::Cylinder< DataType >::Cylinder().
◆ Set() [2/2]
|
inline |
Set the cylinder from a sheared box.
- Parameters
-
box The box. shearX The shear value in X direction. shearY The shear value in Y direction.
References Murl::Math::Box< DataType >::GetMaximum(), Murl::Math::Box< DataType >::GetMinimum(), Murl::Math::Cylinder< DataType >::mLength, Murl::Math::Cylinder< DataType >::mOffsetX, Murl::Math::Cylinder< DataType >::mOffsetY, Murl::Math::Cylinder< DataType >::mRadius, Murl::Math::Cylinder< DataType >::mShearX, Murl::Math::Cylinder< DataType >::mShearY, Murl::Math::Sqrt(), Murl::Math::Vector< DataType >::x, Murl::Math::Vector< DataType >::y, and Murl::Math::Vector< DataType >::z.
◆ IsIntersecting()
|
inline |
Check if the cylinder is intersecting a sphere.
- Parameters
-
sphere The sphere to check.
- Returns
- true if the cylinder is intersecting the sphere.
References Murl::Math::Sphere< DataType >::GetCenter(), Murl::Math::Sphere< DataType >::GetRadius(), Murl::Math::Cylinder< DataType >::mLength, Murl::Math::Cylinder< DataType >::mOffsetX, Murl::Math::Cylinder< DataType >::mOffsetY, Murl::Math::Cylinder< DataType >::mRadius, Murl::Math::Cylinder< DataType >::mShearX, Murl::Math::Cylinder< DataType >::mShearY, Murl::Math::Vector< DataType >::x, Murl::Math::Vector< DataType >::y, and Murl::Math::Vector< DataType >::z.
◆ ToString()
|
inline |
Get the string representation of the object.
- Returns
- The string representation of the object.
References Murl::Math::Cylinder< DataType >::mRadius, and Murl::Util::PrintToString().
The documentation for this class was generated from the following files:
- murl_graph_types.h
- murl_math_cylinder.h