A cone class describing a cone by its angle and length. More...
#include "murl_math_cone.h"
Public Types | |
using | ValueType = DataType |
The template parameter value type. | |
Public Member Functions | |
Cone () | |
The default constructor. | |
Cone (DataType length, DataType angle) | |
Constructor taking cone length and angle. More... | |
Cone (const Frustum< DataType > &frustum) | |
Constructor taking a frustum. More... | |
template<class DataType2 > | |
Cone (const Cone< DataType2 > &c) | |
The copy constructor using a cone of different type. More... | |
DataType | GetLength () const |
Get the length. More... | |
DataType | GetAngle () const |
Get the angle. More... | |
void | Set (const Frustum< DataType > &frustum) |
Set the cone by a frustum. More... | |
Bool | IsIntersecting (const Sphere< DataType > &sphere) const |
Check if the cone is intersecting a sphere. More... | |
String | ToString () const |
Get the string representation of the object. More... | |
Protected Attributes | |
DataType | mLength |
The length of the cone. | |
DataType | mAngle |
The angle of the cone. | |
DataType | mSin |
The sine of the angle. | |
DataType | mCos |
The cosine of the angle. | |
DataType | mTan |
The tangent of the angle. | |
DataType | mShearX |
The X shear value. | |
DataType | mShearY |
The Y shear value. | |
Detailed Description
template<class DataType>
class Murl::Math::Cone< DataType >
A cone class describing a cone by its angle and length.
Constructor & Destructor Documentation
◆ Cone() [1/3]
|
inline |
Constructor taking cone length and angle.
- Parameters
-
length The length of the cone. angle The angle of the cone.
References Murl::Math::Cos(), Murl::Math::Cone< DataType >::mAngle, Murl::Math::Cone< DataType >::mCos, Murl::Math::Cone< DataType >::mSin, Murl::Math::Cone< DataType >::mTan, Murl::Math::Sin(), and Murl::Math::Tan().
◆ Cone() [2/3]
|
inline |
Constructor taking a frustum.
- Parameters
-
frustum The frustum.
References Murl::Math::Cone< DataType >::Set().
◆ Cone() [3/3]
|
inline |
The copy constructor using a cone of different type.
- Parameters
-
c The cone to copy.
References Murl::Math::Cos(), Murl::Math::Cone< DataType >::mAngle, Murl::Math::Cone< DataType >::mCos, Murl::Math::Cone< DataType >::mSin, Murl::Math::Cone< DataType >::mTan, Murl::Math::Sin(), and Murl::Math::Tan().
Member Function Documentation
◆ GetLength()
|
inline |
◆ GetAngle()
|
inline |
◆ Set()
|
inline |
Set the cone by a frustum.
- Parameters
-
frustum The frustum.
References Murl::Math::Abs(), Murl::Math::ArcTan(), Murl::Math::Cos(), Murl::Math::Frustum< DataType >::GetClipPlane(), Murl::Math::Plane< DataType >::mA, Murl::Math::Cone< DataType >::mAngle, Murl::Math::Plane< DataType >::mB, Murl::Math::Plane< DataType >::mC, Murl::Math::Cone< DataType >::mCos, Murl::Math::Plane< DataType >::mD, Murl::Math::Cone< DataType >::mLength, Murl::Math::Cone< DataType >::mShearX, Murl::Math::Cone< DataType >::mShearY, Murl::Math::Cone< DataType >::mSin, Murl::Math::Cone< DataType >::mTan, Murl::Math::Sin(), and Murl::Math::Sqrt().
Referenced by Murl::Math::Cone< DataType >::Cone().
◆ IsIntersecting()
|
inline |
Check if the cone is intersecting a sphere.
- Parameters
-
sphere The sphere to check.
- Returns
- true if the cone is intersecting the sphere.
References Murl::Math::Sphere< DataType >::GetCenter(), Murl::Math::Sphere< DataType >::GetRadius(), Murl::Math::Vector< DataType >::GetSquaredLength(), Murl::Math::Cone< DataType >::mCos, Murl::Math::Cone< DataType >::mShearX, Murl::Math::Cone< DataType >::mShearY, Murl::Math::Cone< DataType >::mSin, Murl::Math::Cone< DataType >::mTan, 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::Cone< DataType >::mAngle, and Murl::Util::PrintToString().
The documentation for this class was generated from the following files:
- murl_graph_types.h
- murl_math_cone.h