clanCore Math

Classes

struct  clan::RectPacker::AllocatedRect
 
class  clan::Angle
 Angle class. More...
 
class  clan::AxisAlignedBoundingBox
 
class  clan::Base64Decoder
 Base64 decoder class. More...
 
class  clan::Base64Encoder
 Base64 encoder class. More...
 
class  clan::BezierCurve
 Bezier curve generator. More...
 
class  clan::BigInt
 Big Integer class. More...
 
class  clan::Circle
 Circle - Integer. More...
 
class  clan::Circled
 Circle - Double. More...
 
class  clan::Circlef
 Circle - Float. More...
 
class  clan::Circlex< Type >
 Circle. More...
 
class  clan::DelauneyTriangulator
 Delauney triangulator. More...
 
class  clan::DelauneyTriangulator_Triangle
 Triangle generated from a delauney triangulation. More...
 
class  clan::DelauneyTriangulator_Vertex
 Vertex in the delauney triangulation. More...
 
class  clan::EarClipResult
 Ear clipping triangulation result structure. More...
 
class  clan::EarClipTriangulator
 Ear-clipping triangulator. More...
 
class  clan::EarClipTriangulator_Triangle
 EarClipTriangulator_Triangle. More...
 
class  clan::HalfFloat
 
class  clan::IntersectionTest
 
class  clan::Line2
 2D line - Integer More...
 
class  clan::Line2d
 2D line - Double More...
 
class  clan::Line2f
 2D line - Float More...
 
class  clan::Line2x< Type >
 2D line More...
 
class  clan::Line3
 3D line - Integer More...
 
class  clan::Line3d
 3D line - Double More...
 
class  clan::Line3f
 3D line - Float More...
 
class  clan::Line3x< Type >
 3D line More...
 
class  clan::LineMath
 Math operations on 2D lines. More...
 
class  clan::LineRay2
 2D line ray - Integer More...
 
class  clan::LineRay2d
 2D line ray - Double More...
 
class  clan::LineRay2f
 2D line ray - Float More...
 
class  clan::LineRay2x< Type >
 2D line ray More...
 
class  clan::LineRay3
 3D line ray - Integer More...
 
class  clan::LineRay3d
 3D line ray - Double More...
 
class  clan::LineRay3f
 3D line ray - Float More...
 
class  clan::LineRay3x< Type >
 3D line ray More...
 
class  clan::LineSegment2
 2D line segment - Integer More...
 
class  clan::LineSegment2d
 2D line segment - Double More...
 
class  clan::LineSegment2f
 2D line segment - Float More...
 
class  clan::LineSegment2x< Type >
 2D line segment More...
 
class  clan::LineSegment3
 3D line segment - Integer More...
 
class  clan::LineSegment3d
 3D line segment - Double More...
 
class  clan::LineSegment3f
 3D line segment - Float More...
 
class  clan::LineSegment3x< Type >
 3D line segment More...
 
singleton  clan::Mat2< Type >
 2D matrix More...
 
singleton  clan::Mat3< Type >
 3D matrix More...
 
singleton  clan::Mat4< Type >
 4D matrix More...
 
class  clan::OrientedBoundingBox
 
class  clan::OutlineTriangulator
 Polygon Tesselator. More...
 
class  clan::Point
 2D (x,y) point structure - Integer More...
 
class  clan::Pointd
 2D (x,y) point structure - Double More...
 
class  clan::Pointf
 2D (x,y) point structure - Float More...
 
class  clan::PointSetMath
 Math operations related to point sets. More...
 
singleton  clan::Pointx< Type >
 2D (x,y) point structure. More...
 
class  clan::Quad
 2D quad structure - Integer More...
 
class  clan::Quadd
 2D quad structure - Double More...
 
class  clan::Quadf
 2D quad structure - Float More...
 
class  clan::Quadx< Type >
 2D quad structure. More...
 
class  clan::Quaterniond
 Quaternion - Double. More...
 
class  clan::Quaternionf
 Quaternion - Float. More...
 
class  clan::Quaternionx< Type >
 Quaternion. More...
 
class  clan::Rect
 2D (left,top,right,bottom) rectangle structure - Integer More...
 
class  clan::Rectd
 2D (left,top,right,bottom) rectangle structure - Double More...
 
class  clan::Rectf
 2D (left,top,right,bottom) rectangle structure - Float More...
 
class  clan::RectPacker
 Generic rect packer class. Implements an algorithm to pack rects into groups efficiently. More...
 
class  clan::Rectx< Type >
 2D (left,top,right,bottom) rectangle structure. More...
 
class  clan::Size
 2D (width,height) size structure - Integer More...
 
class  clan::Sized
 2D (width,height) size structure - Double More...
 
class  clan::Sizef
 2D (width,height) size structure - Float More...
 
singleton  clan::Sizex< Type >
 2D (width,height) size structure. More...
 
class  clan::Triangle
 Triangles - Integer. More...
 
class  clan::Triangled
 Triangles - Double. More...
 
class  clan::Trianglef
 Triangles - Float. More...
 
class  clan::Trianglex< Type >
 Triangles. More...
 
singleton  clan::Vec2< Type >
 2D vector More...
 
class  clan::Vec2hf
 2D half-float vector More...
 
singleton  clan::Vec3< Type >
 3D vector More...
 
class  clan::Vec3hf
 3D half-float vector More...
 
class  clan::Vec4< Type >
 4D vector More...
 
class  clan::Vec4hf
 4D half-float vector More...
 

Typedefs

typedef Mat2< double > clan::Mat2d
 
typedef Mat2< float > clan::Mat2f
 
typedef Mat2< int > clan::Mat2i
 
typedef Mat3< double > clan::Mat3d
 
typedef Mat3< float > clan::Mat3f
 
typedef Mat3< int > clan::Mat3i
 
typedef Mat4< double > clan::Mat4d
 
typedef Mat4< float > clan::Mat4f
 
typedef Mat4< int > clan::Mat4i
 
typedef Vec2< char > clan::Vec2b
 
typedef Vec2< double > clan::Vec2d
 
typedef Vec2< float > clan::Vec2f
 
typedef Vec2< int > clan::Vec2i
 
typedef Vec2< short > clan::Vec2s
 
typedef Vec2< unsigned char > clan::Vec2ub
 
typedef Vec2< unsigned int > clan::Vec2ui
 
typedef Vec2< unsigned short > clan::Vec2us
 
typedef Vec3< char > clan::Vec3b
 
typedef Vec3< double > clan::Vec3d
 
typedef Vec3< float > clan::Vec3f
 
typedef Vec3< int > clan::Vec3i
 
typedef Vec3< short > clan::Vec3s
 
typedef Vec3< unsigned char > clan::Vec3ub
 
typedef Vec3< unsigned int > clan::Vec3ui
 
typedef Vec3< unsigned short > clan::Vec3us
 
typedef Vec4< char > clan::Vec4b
 
typedef Vec4< double > clan::Vec4d
 
typedef Vec4< float > clan::Vec4f
 
typedef Vec4< int > clan::Vec4i
 
typedef Vec4< short > clan::Vec4s
 
typedef Vec4< unsigned char > clan::Vec4ub
 
typedef Vec4< unsigned int > clan::Vec4ui
 
typedef Vec4< unsigned short > clan::Vec4us
 

Enumerations

enum  clan::RectPacker::AllocationPolicy { clan::RectPacker::create_new_group, clan::RectPacker::search_previous_groups, clan::RectPacker::fail_if_full }
 Allocation policy. More...
 
enum  clan::AngleUnit { clan::angle_degrees, clan::angle_radians }
 Angle unit. More...
 
enum  clan::ClipZRange { clan::clip_negative_positive_w, clan::clip_zero_positive_w }
 
enum  clan::EulerOrder {
  clan::order_XYZ, clan::order_XZY, clan::order_YZX, clan::order_YXZ,
  clan::order_ZXY, clan::order_ZYX
}
 Euler angle rotation order. More...
 
enum  clan::Handedness { clan::handed_left, clan::handed_right }
 
enum  clan::Origin {
  clan::origin_top_left, clan::origin_top_center, clan::origin_top_right, clan::origin_center_left,
  clan::origin_center, clan::origin_center_right, clan::origin_bottom_left, clan::origin_bottom_center,
  clan::origin_bottom_right
}
 Alignment origins. More...
 
enum  clan::IntersectionTest::OverlapResult { clan::IntersectionTest::disjoint, clan::IntersectionTest::overlap }
 
enum  clan::PolygonOrientation { clan::cl_clockwise, clan::cl_counter_clockwise }
 Polygon orientations. More...
 
enum  clan::IntersectionTest::Result { clan::IntersectionTest::outside, clan::IntersectionTest::inside, clan::IntersectionTest::intersecting }
 

Functions

 clan::Rectx< Type >::Rectx (const Rectx< int > &rect)
 Constructs an rectangle. More...
 
 clan::Rectx< Type >::Rectx (const Rectx< float > &rect)
 Constructs an rectangle. More...
 
 clan::Rectx< Type >::Rectx (const Rectx< double > &rect)
 Constructs an rectangle. More...
 
 clan::Vec2hf::Vec2hf (const Vec3hf &copy)
 
 clan::Vec2hf::Vec2hf (const Vec4hf &copy)
 
 clan::Vec3hf::Vec3hf (const Vec4hf &copy)
 
static Mat3< Type > clan::Mat3< Type >::add (const Mat3< Type > &matrix_1, const Mat3< Type > &matrix_2)
 Add 2 matrices. More...
 
static Mat4< Type > clan::Mat4< Type >::add (const Mat4< Type > &matrix_1, const Mat4< Type > &matrix_2)
 Add 2 matrices. More...
 
static Mat3< Type > clan::Mat3< Type >::adjoint (const Mat3< Type > &matrix)
 Calculate the adjoint (or known as Adjugate or Conjugate Transpose) of a matrix. More...
 
static Mat4< Type > clan::Mat4< Type >::adjoint (const Mat4< Type > &matrix)
 Calculate the adjoint (or known as Adjugate or Conjugate Transpose) of a matrix. More...
 
template<typename A , typename B , typename C >
clan::clamp (A val, B minval, C maxval)
 
static Mat3< Type > clan::Mat3< Type >::identity ()
 
static Mat4< Type > clan::Mat4< Type >::identity ()
 Create the identity matrix. More...
 
static Mat3< Type > clan::Mat3< Type >::inverse (const Mat3< Type > &matrix)
 Calculate the matrix inverse of a matrix. More...
 
static Mat4< Type > clan::Mat4< Type >::inverse (const Mat4< Type > &matrix)
 Calculate the matrix inverse of a matrix. More...
 
Type clan::Vec2< Type >::length () const
 Returns the length (magnitude) of this vector. More...
 
Type clan::Vec3< Type >::length () const
 Returns the length (magnitude) of this vector. More...
 
*Type clan::Vec4< Type >::length3 () const
 Returns the length (magnitude) of this vector (not taking into account the w ordinate). More...
 
*Type clan::Vec4< Type >::length4 () const
 Returns the length (magnitude) of this vector (taking into account the w ordinate). More...
 
template<typename T , typename... Args>
std::unique_ptr< T > clan::make_unique (Args &&...args)
 
template<typename A , typename B >
clan::max (A a, B b)
 
template<typename Type >
Vec2< Type > clan::max (Vec2< Type > a, Vec2< Type > b)
 
template<typename Type >
Vec3< Type > clan::max (Vec3< Type > a, Vec3< Type > b)
 
template<typename Type >
Vec4< Type > clan::max (Vec4< Type > a, Vec4< Type > b)
 
template<typename A , typename B >
clan::min (A a, B b)
 
template<typename Type >
Vec2< Type > clan::min (Vec2< Type > a, Vec2< Type > b)
 
template<typename Type >
Vec3< Type > clan::min (Vec3< Type > a, Vec3< Type > b)
 
template<typename Type >
Vec4< Type > clan::min (Vec4< Type > a, Vec4< Type > b)
 
template<typename A , typename B , typename C >
clan::mix (A a, B b, C mix)
 
static Mat3< Type > clan::Mat3< Type >::multiply (const Mat3< Type > &matrix_1, const Mat3< Type > &matrix_2)
 Multiply 2 matrices. More...
 
static Mat4< Type > clan::Mat4< Type >::multiply (const Mat4< Type > &matrix_1, const Mat4< Type > &matrix_2)
 Multiply 2 matrices. More...
 
static Vec2< Type > clan::Vec2< Type >::normalize (const Vec2< Type > &vector)
 Normalizes a vector. More...
 
static Vec3< Type > clan::Vec3< Type >::normalize (const Vec3< Type > &vector)
 Normalizes a vector. More...
 
Vec3< Type > & clan::Vec3< Type >::normalize ()
 Normalizes this vector. More...
 
Vec2< Type > & clan::Vec2< Type >::normalize ()
 Normalizes this vector. More...
 
static Mat3< Type > clan::Mat3< Type >::null ()
 
static Mat4< Type > clan::Mat4< Type >::null ()
 Create a zero matrix. More...
 
template<typename Type >
Vec3< Type > clan::operator* (const Vec3< Type > &v1, const Vec3< Type > &v2)
 
  • operator.
More...
 
template<typename Type >
Vec3< Type > clan::operator* (Type s, const Vec3< Type > &v)
 
  • operator.
More...
 
template<typename Type >
Vec3< Type > clan::operator* (const Vec3< Type > &v, Type s)
 
  • operator.
More...
 
template<typename Type >
Vec2< Type > clan::operator* (const Vec2< Type > &v1, const Vec2< Type > &v2)
 
  • operator.
More...
 
template<typename Type >
Vec2< Type > clan::operator* (Type s, const Vec2< Type > &v)
 
  • operator.
More...
 
template<typename Type >
Vec2< Type > clan::operator* (const Vec2< Type > &v, Type s)
 
  • operator.
More...
 
template<typename Type >
Vec3< Type > clan::operator* (const Vec3< Type > &v, const Mat3< Type > &matrix)
 
template<typename Type >
Vec2< Type > clan::operator* (const Vec2< Type > &v, const Mat2< Type > &matrix)
 
template<typename Type >
Vec3< Type > clan::operator* (const Mat3< Type > &matrix, const Vec3< Type > &v)
 
template<typename Type >
Vec2< Type > clan::operator* (const Mat2< Type > &matrix, const Vec2< Type > &v)
 
template<typename Type >
Vec4< Type > clan::operator* (const Vec4< Type > &v1, const Vec4< Type > &v2)
 
  • operator.
More...
 
template<typename Type >
Vec4< Type > clan::operator* (Type s, const Vec4< Type > &v)
 
  • operator.
More...
 
template<typename Type >
Vec4< Type > clan::operator* (const Vec4< Type > &v, Type s)
 
  • operator.
More...
 
template<typename Type >
Vec4< Type > clan::operator* (const Vec4< Type > &v, const Mat4< Type > &matrix)
 
template<typename Type >
Vec4< Type > clan::operator* (const Mat4< Type > &matrix, const Vec4< Type > &v)
 
template<typename Type >
Vec3< Type > clan::operator+ (const Vec3< Type > &v1, const Vec3< Type > &v2)
 
  • operator.
More...
 
template<typename Type >
Vec3< Type > clan::operator+ (Type s, const Vec3< Type > &v)
 
  • operator.
More...
 
template<typename Type >
Vec3< Type > clan::operator+ (const Vec3< Type > &v, Type s)
 
  • operator.
More...
 
template<typename Type >
Vec2< Type > clan::operator+ (const Vec2< Type > &v1, const Vec2< Type > &v2)
 
  • operator.
More...
 
template<typename Type >
Vec2< Type > clan::operator+ (Type s, const Vec2< Type > &v)
 
  • operator.
More...
 
template<typename Type >
Vec2< Type > clan::operator+ (const Vec2< Type > &v, Type s)
 
  • operator.
More...
 
template<typename Type >
Vec4< Type > clan::operator+ (const Vec4< Type > &v1, const Vec4< Type > &v2)
 
  • operator.
More...
 
template<typename Type >
Vec4< Type > clan::operator+ (Type s, const Vec4< Type > &v)
 
  • operator.
More...
 
template<typename Type >
Vec4< Type > clan::operator+ (const Vec4< Type > &v, Type s)
 
  • operator.
More...
 
template<typename Type >
Vec3< Type > clan::operator- (const Vec3< Type > &v1, const Vec3< Type > &v2)
 
  • operator.
More...
 
template<typename Type >
Vec3< Type > clan::operator- (Type s, const Vec3< Type > &v)
 
  • operator.
More...
 
template<typename Type >
Vec3< Type > clan::operator- (const Vec3< Type > &v, Type s)
 
  • operator.
More...
 
template<typename Type >
Vec2< Type > clan::operator- (const Vec2< Type > &v1, const Vec2< Type > &v2)
 
  • operator.
More...
 
template<typename Type >
Vec2< Type > clan::operator- (Type s, const Vec2< Type > &v)
 
  • operator.
More...
 
template<typename Type >
Vec2< Type > clan::operator- (const Vec2< Type > &v, Type s)
 
  • operator.
More...
 
template<typename Type >
Vec4< Type > clan::operator- (const Vec4< Type > &v1, const Vec4< Type > &v2)
 
  • operator.
More...
 
template<typename Type >
Vec4< Type > clan::operator- (Type s, const Vec4< Type > &v)
 
  • operator.
More...
 
template<typename Type >
Vec4< Type > clan::operator- (const Vec4< Type > &v, Type s)
 
  • operator.
More...
 
template<typename Type >
Vec3< Type > clan::operator/ (const Vec3< Type > &v1, const Vec3< Type > &v2)
 / operator. More...
 
template<typename Type >
Vec3< Type > clan::operator/ (Type s, const Vec3< Type > &v)
 / operator. More...
 
template<typename Type >
Vec3< Type > clan::operator/ (const Vec3< Type > &v, Type s)
 / operator. More...
 
template<typename Type >
Vec2< Type > clan::operator/ (const Vec2< Type > &v1, const Vec2< Type > &v2)
 / operator. More...
 
template<typename Type >
Vec2< Type > clan::operator/ (Type s, const Vec2< Type > &v)
 / operator. More...
 
template<typename Type >
Vec2< Type > clan::operator/ (const Vec2< Type > &v, Type s)
 / operator. More...
 
template<typename Type >
Vec4< Type > clan::operator/ (const Vec4< Type > &v1, const Vec4< Type > &v2)
 / operator. More...
 
template<typename Type >
Vec4< Type > clan::operator/ (Type s, const Vec4< Type > &v)
 / operator. More...
 
template<typename Type >
Vec4< Type > clan::operator/ (const Vec4< Type > &v, Type s)
 / operator. More...
 
template<typename T >
clan::pow2 (T value)
 
Rectd clan::RectdPS (double x, double y, double width, double height)
 
Rectf clan::RectfPS (float x, float y, float width, float height)
 
Rect clan::RectPS (int x, int y, int width, int height)
 
int clan::sign (int x)
 
float clan::sign (float x)
 
double clan::sign (double x)
 
template<typename Type >
Vec2< Type > clan::sign (const Vec2< Type > &x)
 
template<typename Type >
Vec3< Type > clan::sign (const Vec3< Type > &x)
 
template<typename Type >
Vec4< Type > clan::sign (const Vec4< Type > &x)
 
template<typename A , typename B , typename C >
clan::smoothstep (A edge0, B edge1, C x)
 
int clan::step (int edge, int x)
 
long long clan::step (long long edge, long long x)
 
float clan::step (float edge, float x)
 
double clan::step (double edge, double x)
 
template<typename Type >
Vec2< Type > clan::step (const Vec2< Type > &edge, const Vec2< Type > &x)
 
template<typename Type >
Vec3< Type > clan::step (const Vec3< Type > &edge, const Vec3< Type > &x)
 
template<typename Type >
Vec4< Type > clan::step (const Vec4< Type > &edge, const Vec4< Type > &x)
 
static Mat3< Type > clan::Mat3< Type >::subtract (const Mat3< Type > &matrix_1, const Mat3< Type > &matrix_2)
 Subtract 2 matrices. More...
 
static Mat4< Type > clan::Mat4< Type >::subtract (const Mat4< Type > &matrix_1, const Mat4< Type > &matrix_2)
 Subtract 2 matrices. More...
 
static Mat3< Type > clan::Mat3< Type >::transpose (const Mat3< Type > &matrix)
 Calculate the transpose of a matrix. More...
 
static Mat4< Type > clan::Mat4< Type >::transpose (const Mat4< Type > &matrix)
 Calculate the transpose of a matrix. More...
 

Detailed Description

Typedef Documentation

typedef Mat2<double> clan::Mat2d
typedef Mat2<float> clan::Mat2f
typedef Mat2<int> clan::Mat2i
typedef Mat3<double> clan::Mat3d
typedef Mat3<float> clan::Mat3f
typedef Mat3<int> clan::Mat3i
typedef Mat4<double> clan::Mat4d
typedef Mat4<float> clan::Mat4f
typedef Mat4<int> clan::Mat4i
typedef Vec2<char> clan::Vec2b
typedef Vec2<double> clan::Vec2d
typedef Vec2<float> clan::Vec2f
typedef Vec2<int> clan::Vec2i
typedef Vec2<short> clan::Vec2s
typedef Vec2<unsigned char> clan::Vec2ub
typedef Vec2<unsigned int> clan::Vec2ui
typedef Vec2<unsigned short> clan::Vec2us
typedef Vec3<char> clan::Vec3b
typedef Vec3<double> clan::Vec3d
typedef Vec3<float> clan::Vec3f
typedef Vec3<int> clan::Vec3i
typedef Vec3<short> clan::Vec3s
typedef Vec3<unsigned char> clan::Vec3ub
typedef Vec3<unsigned int> clan::Vec3ui
typedef Vec3<unsigned short> clan::Vec3us
typedef Vec4<char> clan::Vec4b
typedef Vec4<double> clan::Vec4d
typedef Vec4<float> clan::Vec4f
typedef Vec4<int> clan::Vec4i
typedef Vec4<short> clan::Vec4s
typedef Vec4<unsigned char> clan::Vec4ub
typedef Vec4<unsigned int> clan::Vec4ui
typedef Vec4<unsigned short> clan::Vec4us

Enumeration Type Documentation

Allocation policy.

Enumerator
create_new_group 
search_previous_groups 
fail_if_full 

Angle unit.

Enumerator
angle_degrees 
angle_radians 
Enumerator
clip_negative_positive_w 
clip_zero_positive_w 

Euler angle rotation order.

Enumerator
order_XYZ 
order_XZY 
order_YZX 
order_YXZ 
order_ZXY 
order_ZYX 
Enumerator
handed_left 
handed_right 

Alignment origins.

Enumerator
origin_top_left 
origin_top_center 
origin_top_right 
origin_center_left 
origin_center 
origin_center_right 
origin_bottom_left 
origin_bottom_center 
origin_bottom_right 
Enumerator
disjoint 
overlap 

Polygon orientations.

Enumerator
cl_clockwise 
cl_counter_clockwise 
Enumerator
outside 
inside 
intersecting 

Function Documentation

template<typename Type>
clan::Rectx< Type >::Rectx ( const Rectx< int > &  rect)
inline

Constructs an rectangle.

Parameters
rectInitial rectangle position and size.

References clan::left, and clan::right.

template<typename Type>
clan::Rectx< Type >::Rectx ( const Rectx< float > &  rect)
inline

Constructs an rectangle.

Parameters
rectInitial rectangle position and size.

References clan::left, and clan::right.

template<typename Type>
clan::Rectx< Type >::Rectx ( const Rectx< double > &  rect)
inline

Constructs an rectangle.

Parameters
rectInitial rectangle position and size.

References clan::left, and clan::right.

clan::Vec2hf::Vec2hf ( const Vec3hf copy)
inlineexplicit

References clan::x, and clan::y.

clan::Vec2hf::Vec2hf ( const Vec4hf copy)
inlineexplicit

References clan::x, and clan::y.

clan::Vec3hf::Vec3hf ( const Vec4hf copy)
inlineexplicit

References clan::x, clan::y, and clan::z.

template<typename Type>
Mat3< Type > clan::Mat3< Type >::add ( const Mat3< Type > &  matrix_1,
const Mat3< Type > &  matrix_2 
)
inlinestatic

Add 2 matrices.

This adds the matrix as follows: result = matrix1 + matrix2

Parameters
matrix_1= First Matrix to add
matrix_2= Second Matrix to add
Returns
The matrix
template<typename Type >
Mat4< Type > clan::Mat4< Type >::add ( const Mat4< Type > &  matrix_1,
const Mat4< Type > &  matrix_2 
)
inlinestatic

Add 2 matrices.

This adds the matrix as follows: result = matrix1 + matrix2

Parameters
matrix_1= First Matrix to add
matrix_2= Second Matrix to add
Returns
The matrix
template<typename Type>
Mat3< Type > clan::Mat3< Type >::adjoint ( const Mat3< Type > &  matrix)
inlinestatic

Calculate the adjoint (or known as Adjugate or Conjugate Transpose) of a matrix.

Parameters
matrix= The matrix to use
Returns
The adjoint matrix
template<typename Type >
Mat4< Type > clan::Mat4< Type >::adjoint ( const Mat4< Type > &  matrix)
inlinestatic

Calculate the adjoint (or known as Adjugate or Conjugate Transpose) of a matrix.

Parameters
matrix= The matrix to use
Returns
The adjoint matrix

References clan::Mat4< Type >::adjoint().

Referenced by clan::Mat4< Type >::adjoint().

template<typename A , typename B , typename C >
C clan::clamp ( val,
minval,
maxval 
)
inline

References clan::max(), and clan::min().

Referenced by clan::smoothstep().

template<typename Type >
Mat3< Type > clan::Mat3< Type >::identity ( )
inlinestatic

References clan::m, and clan::null.

template<typename Type >
Mat4< Type > clan::Mat4< Type >::identity ( )
inlinestatic

Create the identity matrix.

Returns
The matrix

References clan::m, clan::Mat4< Type >::matrix, and clan::null.

template<typename Type>
Mat3< Type > clan::Mat3< Type >::inverse ( const Mat3< Type > &  matrix)
inlinestatic

Calculate the matrix inverse of a matrix.

Creates a zero matrix if the determinent == 0

Parameters
matrix= The matrix to use
Returns
The inversed matrix
template<typename Type >
Mat4< Type > clan::Mat4< Type >::inverse ( const Mat4< Type > &  matrix)
inlinestatic

Calculate the matrix inverse of a matrix.

Creates a zero matrix if the determinent == 0

Parameters
matrix= The matrix to use
Returns
The inversed matrix

References clan::Mat4< Type >::inverse().

Referenced by clan::Mat4< Type >::inverse().

template<typename Type >
Type clan::Vec2< Type >::length ( ) const
inline

Returns the length (magnitude) of this vector.

Operates in the native datatype

Returns
the length of the vector

References clan::f, clan::x, and clan::y.

template<typename Type >
Type clan::Vec3< Type >::length ( ) const
inline

Returns the length (magnitude) of this vector.

Operates in the native datatype

Returns
the length of the vector

References clan::f, clan::x, clan::y, and clan::z.

template<typename Type >
Type clan::Vec4< Type >::length3 ( ) const
inline

Returns the length (magnitude) of this vector (not taking into account the w ordinate).

Operates in the native datatype

Returns
the length of the vector

References clan::f, clan::x, clan::y, and clan::z.

template<typename Type >
Type clan::Vec4< Type >::length4 ( ) const
inline

Returns the length (magnitude) of this vector (taking into account the w ordinate).

Operates in the native datatype

Returns
the length of the vector

References clan::f, clan::w, clan::x, clan::y, and clan::z.

template<typename T , typename... Args>
std::unique_ptr<T> clan::make_unique ( Args &&...  args)
template<typename A , typename B >
A clan::max ( a,
b 
)
inline
template<typename Type >
Vec2<Type> clan::max ( Vec2< Type >  a,
Vec2< Type >  b 
)
inline
template<typename Type >
Vec3<Type> clan::max ( Vec3< Type >  a,
Vec3< Type >  b 
)
inline
template<typename Type >
Vec4<Type> clan::max ( Vec4< Type >  a,
Vec4< Type >  b 
)
inline
template<typename A , typename B >
A clan::min ( a,
b 
)
inline
template<typename Type >
Vec2<Type> clan::min ( Vec2< Type >  a,
Vec2< Type >  b 
)
inline
template<typename Type >
Vec3<Type> clan::min ( Vec3< Type >  a,
Vec3< Type >  b 
)
inline
template<typename Type >
Vec4<Type> clan::min ( Vec4< Type >  a,
Vec4< Type >  b 
)
inline
template<typename A , typename B , typename C >
A clan::mix ( a,
b,
mix 
)
inline
template<typename Type>
Mat3< Type > clan::Mat3< Type >::multiply ( const Mat3< Type > &  matrix_1,
const Mat3< Type > &  matrix_2 
)
inlinestatic

Multiply 2 matrices.

This multiplies the matrix as follows: result = matrix1 * matrix2
Matrix is multiplied in the Column-Major matrix format (opengl native)

Parameters
matrix_1= First Matrix to multiply
matrix_2= Second Matrix to multiply
Returns
The matrix
template<typename Type >
Mat4< Type > clan::Mat4< Type >::multiply ( const Mat4< Type > &  matrix_1,
const Mat4< Type > &  matrix_2 
)
inlinestatic

Multiply 2 matrices.

This multiplies the matrix as follows: result = matrix1 * matrix2
Matrix is multiplied in the Column-Major matrix format (opengl native)

Parameters
matrix_1= First Matrix to multiply
matrix_2= Second Matrix to multiply
Returns
The matrix
template<typename Type>
Vec2< Type > clan::Vec2< Type >::normalize ( const Vec2< Type > &  vector)
inlinestatic

Normalizes a vector.

Operates in the native datatype

Parameters
vector= Vector to use
Returns
normalized vector
template<typename Type>
Vec3< Type > clan::Vec3< Type >::normalize ( const Vec3< Type > &  vector)
inlinestatic

Normalizes a vector.

Parameters
vector= Vector to use

Operates in the native datatype

template<typename Type>
Vec3< Type > & clan::Vec3< Type >::normalize ( )
inline

Normalizes this vector.

Operates in the native datatype

Returns
reference to this object

References clan::f, clan::length, clan::x, clan::y, and clan::z.

template<typename Type>
Vec2< Type > & clan::Vec2< Type >::normalize ( )
inline

Normalizes this vector.

Operates in the native datatype

Returns
reference to this object

References clan::f, clan::length, clan::x, and clan::y.

template<typename Type >
Mat3< Type > clan::Mat3< Type >::null ( )
inlinestatic

References clan::m.

template<typename Type >
Mat4< Type > clan::Mat4< Type >::null ( )
inlinestatic

Create a zero matrix.

Returns
The matrix

References clan::m, and clan::Mat4< Type >::matrix.

template<typename Type >
Vec3<Type> clan::operator* ( const Vec3< Type > &  v1,
const Vec3< Type > &  v2 
)

  • operator.

template<typename Type >
Vec3<Type> clan::operator* ( Type  s,
const Vec3< Type > &  v 
)

  • operator.

template<typename Type >
Vec3<Type> clan::operator* ( const Vec3< Type > &  v,
Type  s 
)

  • operator.

template<typename Type >
Vec2<Type> clan::operator* ( const Vec2< Type > &  v1,
const Vec2< Type > &  v2 
)

  • operator.

template<typename Type >
Vec2<Type> clan::operator* ( Type  s,
const Vec2< Type > &  v 
)

  • operator.

template<typename Type >
Vec2<Type> clan::operator* ( const Vec2< Type > &  v,
Type  s 
)

  • operator.

template<typename Type >
Vec3<Type> clan::operator* ( const Vec3< Type > &  v,
const Mat3< Type > &  matrix 
)

Matrix is assumed to be in the Column-Major matrix format (opengl native)
Note: "vec = vector * matrix" is different to "vec = matrix * vector"

template<typename Type >
Vec2<Type> clan::operator* ( const Vec2< Type > &  v,
const Mat2< Type > &  matrix 
)
template<typename Type >
Vec3<Type> clan::operator* ( const Mat3< Type > &  matrix,
const Vec3< Type > &  v 
)

Matrix is assumed to be in the Column-Major matrix format (opengl native)
Note: "vec = vector * matrix" is different to "vec = matrix * vector"

template<typename Type >
Vec2<Type> clan::operator* ( const Mat2< Type > &  matrix,
const Vec2< Type > &  v 
)
template<typename Type >
Vec4<Type> clan::operator* ( const Vec4< Type > &  v1,
const Vec4< Type > &  v2 
)

  • operator.

template<typename Type >
Vec4<Type> clan::operator* ( Type  s,
const Vec4< Type > &  v 
)

  • operator.

template<typename Type >
Vec4<Type> clan::operator* ( const Vec4< Type > &  v,
Type  s 
)

  • operator.

template<typename Type >
Vec4<Type> clan::operator* ( const Vec4< Type > &  v,
const Mat4< Type > &  matrix 
)
template<typename Type >
Vec4<Type> clan::operator* ( const Mat4< Type > &  matrix,
const Vec4< Type > &  v 
)
template<typename Type >
Vec3<Type> clan::operator+ ( const Vec3< Type > &  v1,
const Vec3< Type > &  v2 
)

  • operator.

template<typename Type >
Vec3<Type> clan::operator+ ( Type  s,
const Vec3< Type > &  v 
)

  • operator.

template<typename Type >
Vec3<Type> clan::operator+ ( const Vec3< Type > &  v,
Type  s 
)

  • operator.

template<typename Type >
Vec2<Type> clan::operator+ ( const Vec2< Type > &  v1,
const Vec2< Type > &  v2 
)

  • operator.

template<typename Type >
Vec2<Type> clan::operator+ ( Type  s,
const Vec2< Type > &  v 
)

  • operator.

template<typename Type >
Vec2<Type> clan::operator+ ( const Vec2< Type > &  v,
Type  s 
)

  • operator.

template<typename Type >
Vec4<Type> clan::operator+ ( const Vec4< Type > &  v1,
const Vec4< Type > &  v2 
)

  • operator.

template<typename Type >
Vec4<Type> clan::operator+ ( Type  s,
const Vec4< Type > &  v 
)

  • operator.

template<typename Type >
Vec4<Type> clan::operator+ ( const Vec4< Type > &  v,
Type  s 
)

  • operator.

template<typename Type >
Vec3<Type> clan::operator- ( const Vec3< Type > &  v1,
const Vec3< Type > &  v2 
)

  • operator.

template<typename Type >
Vec3<Type> clan::operator- ( Type  s,
const Vec3< Type > &  v 
)

  • operator.

template<typename Type >
Vec3<Type> clan::operator- ( const Vec3< Type > &  v,
Type  s 
)

  • operator.

template<typename Type >
Vec2<Type> clan::operator- ( const Vec2< Type > &  v1,
const Vec2< Type > &  v2 
)

  • operator.

template<typename Type >
Vec2<Type> clan::operator- ( Type  s,
const Vec2< Type > &  v 
)

  • operator.

template<typename Type >
Vec2<Type> clan::operator- ( const Vec2< Type > &  v,
Type  s 
)

  • operator.

template<typename Type >
Vec4<Type> clan::operator- ( const Vec4< Type > &  v1,
const Vec4< Type > &  v2 
)

  • operator.

template<typename Type >
Vec4<Type> clan::operator- ( Type  s,
const Vec4< Type > &  v 
)

  • operator.

template<typename Type >
Vec4<Type> clan::operator- ( const Vec4< Type > &  v,
Type  s 
)

  • operator.

template<typename Type >
Vec3<Type> clan::operator/ ( const Vec3< Type > &  v1,
const Vec3< Type > &  v2 
)

/ operator.

template<typename Type >
Vec3<Type> clan::operator/ ( Type  s,
const Vec3< Type > &  v 
)

/ operator.

template<typename Type >
Vec3<Type> clan::operator/ ( const Vec3< Type > &  v,
Type  s 
)

/ operator.

template<typename Type >
Vec2<Type> clan::operator/ ( const Vec2< Type > &  v1,
const Vec2< Type > &  v2 
)

/ operator.

template<typename Type >
Vec2<Type> clan::operator/ ( Type  s,
const Vec2< Type > &  v 
)

/ operator.

template<typename Type >
Vec2<Type> clan::operator/ ( const Vec2< Type > &  v,
Type  s 
)

/ operator.

template<typename Type >
Vec4<Type> clan::operator/ ( const Vec4< Type > &  v1,
const Vec4< Type > &  v2 
)

/ operator.

template<typename Type >
Vec4<Type> clan::operator/ ( Type  s,
const Vec4< Type > &  v 
)

/ operator.

template<typename Type >
Vec4<Type> clan::operator/ ( const Vec4< Type > &  v,
Type  s 
)

/ operator.

template<typename T >
T clan::pow2 ( value)
inline
Rectd clan::RectdPS ( double  x,
double  y,
double  width,
double  height 
)
inline
Rectf clan::RectfPS ( float  x,
float  y,
float  width,
float  height 
)
inline
Rect clan::RectPS ( int  x,
int  y,
int  width,
int  height 
)
inline
int clan::sign ( int  x)
inline

Referenced by clan::sign().

float clan::sign ( float  x)
inline

References clan::f.

double clan::sign ( double  x)
inline
template<typename Type >
Vec2<Type> clan::sign ( const Vec2< Type > &  x)
inline
template<typename Type >
Vec3<Type> clan::sign ( const Vec3< Type > &  x)
inline
template<typename Type >
Vec4<Type> clan::sign ( const Vec4< Type > &  x)
inline
template<typename A , typename B , typename C >
C clan::smoothstep ( edge0,
edge1,
x 
)
inline

References clan::clamp(), and clan::t.

int clan::step ( int  edge,
int  x 
)
inline

Referenced by clan::step().

long long clan::step ( long long  edge,
long long  x 
)
inline
float clan::step ( float  edge,
float  x 
)
inline
double clan::step ( double  edge,
double  x 
)
inline
template<typename Type >
Vec2<Type> clan::step ( const Vec2< Type > &  edge,
const Vec2< Type > &  x 
)
inline
template<typename Type >
Vec3<Type> clan::step ( const Vec3< Type > &  edge,
const Vec3< Type > &  x 
)
inline
template<typename Type >
Vec4<Type> clan::step ( const Vec4< Type > &  edge,
const Vec4< Type > &  x 
)
inline
template<typename Type>
Mat3< Type > clan::Mat3< Type >::subtract ( const Mat3< Type > &  matrix_1,
const Mat3< Type > &  matrix_2 
)
inlinestatic

Subtract 2 matrices.

This subtracts the matrix as follows: result = matrix1 - matrix2

Parameters
matrix_1= First Matrix to subtract
matrix_2= Second Matrix to subtract
Returns
The matrix
template<typename Type >
Mat4< Type > clan::Mat4< Type >::subtract ( const Mat4< Type > &  matrix_1,
const Mat4< Type > &  matrix_2 
)
inlinestatic

Subtract 2 matrices.

This subtracts the matrix as follows: result = matrix1 - matrix2

Parameters
matrix_1= First Matrix to subtract
matrix_2= Second Matrix to subtract
Returns
The matrix
template<typename Type>
Mat3< Type > clan::Mat3< Type >::transpose ( const Mat3< Type > &  matrix)
inlinestatic

Calculate the transpose of a matrix.

Parameters
matrix= The matrix to use
Returns
The transposed matrix
template<typename Type >
Mat4< Type > clan::Mat4< Type >::transpose ( const Mat4< Type > &  matrix)
inlinestatic

Calculate the transpose of a matrix.

Parameters
matrix= The matrix to use
Returns
The transposed matrix

References clan::Mat4< Type >::transpose().

Referenced by clan::Mat4< Type >::transpose().