Kale
Loading...
Searching...
No Matches
Namespaces | Classes | Typedefs | Enumerations | Functions | Variables
Kale Namespace Reference

Namespaces

namespace  OpenGL
 
namespace  Vulkan
 

Classes

class  Application
 
struct  Circle
 
class  Collidable
 
struct  CubicBezier
 
class  EventHandler
 
struct  Geometry
 
struct  Line
 
class  Logger
 
class  Matrix
 
class  Node
 
class  Path
 
class  PathNode
 
struct  Ray
 
struct  Rect
 
struct  RotatedRect
 
class  Scene
 
class  SkeletalAnimatable
 
struct  Skeleton
 
class  StateAnimatable
 
class  Transform
 
class  Transformable
 
class  Tree
 
class  Vector2
 
class  Vector3
 
class  Vector4
 
class  Window
 

Typedefs

using JSON = nlohmann::json
 
typedef Matrix< 2, 2, int > Matrix2i
 
typedef Matrix< 2, 2, long > Matrix2l
 
typedef Matrix< 2, 2, float > Matrix2f
 
typedef Matrix< 2, 2, double > Matrix2d
 
typedef Matrix< 3, 3, int > Matrix3i
 
typedef Matrix< 3, 3, long > Matrix3l
 
typedef Matrix< 3, 3, float > Matrix3f
 
typedef Matrix< 3, 3, double > Matrix3d
 
typedef Matrix< 4, 4, int > Matrix4i
 
typedef Matrix< 4, 4, long > Matrix4l
 
typedef Matrix< 4, 4, float > Matrix4f
 
typedef Matrix< 4, 4, double > Matrix4d
 
template<size_t w, size_t h>
using MatrixI = Matrix<w, h, int>
 
template<size_t w, size_t h>
using MatrixL = Matrix<w, h, long>
 
template<size_t w, size_t h>
using MatrixF = Matrix<w, h, float>
 
template<size_t w, size_t h>
using MatrixD = Matrix<w, h, double>
 
typedef Transform Camera
 
typedef Vector2< char > Vector2c
 
typedef Vector2< unsigned char > Vector2uc
 
typedef Vector2< int > Vector2i
 
typedef Vector2< unsigned int > Vector2ui
 
typedef Vector2< short > Vector2s
 
typedef Vector2< unsigned short > Vector2us
 
typedef Vector2< long > Vector2l
 
typedef Vector2< unsigned long > Vector2ul
 
typedef Vector2< long long > Vector2ll
 
typedef Vector2< unsigned long long > Vector2ull
 
typedef Vector2< size_t > Vector2st
 
typedef Vector2< uint32_t > Vector2ui32
 
typedef Vector2< float > Vector2f
 
typedef Vector2< double > Vector2d
 
typedef Vector3< char > Vector3c
 
typedef Vector3< unsigned char > Vector3uc
 
typedef Vector3< int > Vector3i
 
typedef Vector3< unsigned int > Vector3ui
 
typedef Vector3< short > Vector3s
 
typedef Vector3< unsigned short > Vector3us
 
typedef Vector3< long > Vector3l
 
typedef Vector3< unsigned long > Vector3ul
 
typedef Vector3< long long > Vector3ll
 
typedef Vector3< unsigned long long > Vector3ull
 
typedef Vector3< size_t > Vector3st
 
typedef Vector3< uint32_t > Vector3ui32
 
typedef Vector3< float > Vector3f
 
typedef Vector3< double > Vector3d
 
typedef Vector4< char > Vector4c
 
typedef Vector4< unsigned char > Vector4uc
 
typedef Vector4< int > Vector4i
 
typedef Vector4< unsigned int > Vector4ui
 
typedef Vector4< short > Vector4s
 
typedef Vector4< unsigned short > Vector4us
 
typedef Vector4< long > Vector4l
 
typedef Vector4< unsigned long > Vector4ul
 
typedef Vector4< long long > Vector4ll
 
typedef Vector4< unsigned long long > Vector4ull
 
typedef Vector4< size_t > Vector4st
 
typedef Vector4< uint32_t > Vector4ui32
 
typedef Vector4< float > Vector4f
 
typedef Vector4< double > Vector4d
 
typedef Vector4f Color
 

Enumerations

enum class  ControllerAxis { Left , Right }
 
enum class  ControllerButton {
  LeftJoystick , RightJoystick , DPadUp , DPadRight ,
  DPadDown , DPadLeft , LeftMenu , RightMenu ,
  A , B , X , Y ,
  R1 , L1
}
 
enum class  Key {
  Escape , F1 , F2 , F3 ,
  F4 , F5 , F6 , F7 ,
  F8 , F9 , F10 , F11 ,
  F12 , Backtick , One , Two ,
  Three , Four , Five , Six ,
  Seven , Eight , Nine , Zero ,
  Minus , Equals , Backspace , Tab ,
  Q , W , E , R ,
  T , Y , U , I ,
  O , P , LeftBracket , RightBracket ,
  Backslash , A , S , D ,
  F , G , H , J ,
  K , L , Semicolon , Apostrophe ,
  Enter , LeftShift , Z , X ,
  C , V , B , N ,
  M , Comma , Period , Slash ,
  RightShift , Control , Alt , Space ,
  Up , Down , Left , Right
}
 
enum class  AngleUnit : bool { Degree , Radian }
 

Functions

std::pair< std::vector< Vector2f >, std::vector< unsigned int > > triangulatePath (const Vector2f *begin, const Vector2f *end)
 
std::pair< std::vector< float >, std::vector< unsigned int > > triangulatePathFloat (const Vector2f *begin, const Vector2f *end)
 
template<size_t w, size_t h, typename T >
std::ostream & operator<< (std::ostream &os, const Kale::Matrix< w, h, T > &mat)
 
template<size_t w, size_t h, typename T >
void from_json (const JSON &j, Matrix< w, h, T > &p)
 
template<size_t w, size_t h, typename T >
void to_json (JSON &j, const Matrix< w, h, T > &p)
 
std::ostream & operator<< (std::ostream &os, const CubicBezier &bezier)
 
std::ostream & operator<< (std::ostream &os, const Path &path)
 
void from_json (const JSON &j, CubicBezier &p)
 
void to_json (JSON &j, const CubicBezier &p)
 
void from_json (const JSON &j, Path &p)
 
void to_json (JSON &j, const Path &p)
 
void from_json (const JSON &j, Transform &p)
 
void to_json (JSON &j, const Transform &p)
 
constexpr float degToRad (float deg)
 
constexpr float radToDeg (float rad)
 
template<typename T >
bool isFloating0 (T num, T epsilon=std::numeric_limits< T >::epsilon())
 
template<typename T >
bool isFloatingEqual (T num1, T num2, T epsilon=std::numeric_limits< T >::epsilon())
 
template<typename T >
int sign (T val)
 
template<typename T >
std::enable_if< std::is_floating_point< T >::value, T >::type randomRange (T min, T max)
 
template<typename T >
std::enable_if< std::is_integral< T >::value, T >::type randomRange (T min, T max)
 
template<typename T >
std::ostream & operator<< (std::ostream &os, const Kale::Vector2< T > &vec)
 
template<typename T >
std::ostream & operator<< (std::ostream &os, const Kale::Vector3< T > &vec)
 
template<typename T >
std::ostream & operator<< (std::ostream &os, const Kale::Vector4< T > &vec)
 
template<typename T >
void from_json (const JSON &j, Vector2< T > &p)
 
template<typename T >
void to_json (JSON &j, const Vector2< T > &p)
 
template<typename T >
void from_json (const JSON &j, Vector3< T > &p)
 
template<typename T >
void to_json (JSON &j, const Vector3< T > &p)
 
template<typename T >
void from_json (const JSON &j, Vector4< T > &p)
 
template<typename T >
void to_json (JSON &j, const Vector4< T > &p)
 

Variables

ApplicationmainApp = nullptr
 
Logger console
 
constexpr float PI = 3.14159265358979f
 
constexpr float E = 2.71828182845904f
 

Typedef Documentation

◆ Camera

Represents a camera for viewing scenes (This is just a typedef of Transform)

Definition at line 332 of file Transform.hpp.

◆ Color

Definition at line 631 of file Vector.hpp.

◆ JSON

typedef nlohmann::json Kale::JSON = nlohmann::json

Javascript Standard Object Notation allows for saving and using permanent configuration files, via the nlohmann/json C++ library.

Definition at line 39 of file Scene.hpp.

◆ Matrix2d

typedef Matrix<2, 2, double> Kale::Matrix2d

Definition at line 503 of file Matrix.hpp.

◆ Matrix2f

typedef Matrix<2, 2, float> Kale::Matrix2f

Definition at line 502 of file Matrix.hpp.

◆ Matrix2i

typedef Matrix<2, 2, int> Kale::Matrix2i

Definition at line 500 of file Matrix.hpp.

◆ Matrix2l

typedef Matrix<2, 2, long> Kale::Matrix2l

Definition at line 501 of file Matrix.hpp.

◆ Matrix3d

typedef Matrix<3, 3, double> Kale::Matrix3d

Definition at line 508 of file Matrix.hpp.

◆ Matrix3f

typedef Matrix<3, 3, float> Kale::Matrix3f

Definition at line 507 of file Matrix.hpp.

◆ Matrix3i

typedef Matrix<3, 3, int> Kale::Matrix3i

Definition at line 505 of file Matrix.hpp.

◆ Matrix3l

typedef Matrix<3, 3, long> Kale::Matrix3l

Definition at line 506 of file Matrix.hpp.

◆ Matrix4d

typedef Matrix<4, 4, double> Kale::Matrix4d

Definition at line 513 of file Matrix.hpp.

◆ Matrix4f

typedef Matrix<4, 4, float> Kale::Matrix4f

Definition at line 512 of file Matrix.hpp.

◆ Matrix4i

typedef Matrix<4, 4, int> Kale::Matrix4i

Definition at line 510 of file Matrix.hpp.

◆ Matrix4l

typedef Matrix<4, 4, long> Kale::Matrix4l

Definition at line 511 of file Matrix.hpp.

◆ MatrixD

template<size_t w, size_t h>
using Kale::MatrixD = Matrix<w, h, double>

Definition at line 518 of file Matrix.hpp.

◆ MatrixF

template<size_t w, size_t h>
using Kale::MatrixF = Matrix<w, h, float>

Definition at line 517 of file Matrix.hpp.

◆ MatrixI

template<size_t w, size_t h>
using Kale::MatrixI = Matrix<w, h, int>

Definition at line 515 of file Matrix.hpp.

◆ MatrixL

template<size_t w, size_t h>
using Kale::MatrixL = Matrix<w, h, long>

Definition at line 516 of file Matrix.hpp.

◆ Vector2c

typedef Vector2<char> Kale::Vector2c

Definition at line 586 of file Vector.hpp.

◆ Vector2d

typedef Vector2<double> Kale::Vector2d

Definition at line 599 of file Vector.hpp.

◆ Vector2f

typedef Vector2<float> Kale::Vector2f

Definition at line 598 of file Vector.hpp.

◆ Vector2i

typedef Vector2<int> Kale::Vector2i

Definition at line 588 of file Vector.hpp.

◆ Vector2l

typedef Vector2<long> Kale::Vector2l

Definition at line 592 of file Vector.hpp.

◆ Vector2ll

typedef Vector2<long long> Kale::Vector2ll

Definition at line 594 of file Vector.hpp.

◆ Vector2s

typedef Vector2<short> Kale::Vector2s

Definition at line 590 of file Vector.hpp.

◆ Vector2st

typedef Vector2<size_t> Kale::Vector2st

Definition at line 596 of file Vector.hpp.

◆ Vector2uc

typedef Vector2<unsigned char> Kale::Vector2uc

Definition at line 587 of file Vector.hpp.

◆ Vector2ui

typedef Vector2<unsigned int> Kale::Vector2ui

Definition at line 589 of file Vector.hpp.

◆ Vector2ui32

typedef Vector2<uint32_t> Kale::Vector2ui32

Definition at line 597 of file Vector.hpp.

◆ Vector2ul

typedef Vector2<unsigned long> Kale::Vector2ul

Definition at line 593 of file Vector.hpp.

◆ Vector2ull

typedef Vector2<unsigned long long> Kale::Vector2ull

Definition at line 595 of file Vector.hpp.

◆ Vector2us

typedef Vector2<unsigned short> Kale::Vector2us

Definition at line 591 of file Vector.hpp.

◆ Vector3c

typedef Vector3<char> Kale::Vector3c

Definition at line 601 of file Vector.hpp.

◆ Vector3d

typedef Vector3<double> Kale::Vector3d

Definition at line 614 of file Vector.hpp.

◆ Vector3f

typedef Vector3<float> Kale::Vector3f

Definition at line 613 of file Vector.hpp.

◆ Vector3i

typedef Vector3<int> Kale::Vector3i

Definition at line 603 of file Vector.hpp.

◆ Vector3l

typedef Vector3<long> Kale::Vector3l

Definition at line 607 of file Vector.hpp.

◆ Vector3ll

typedef Vector3<long long> Kale::Vector3ll

Definition at line 609 of file Vector.hpp.

◆ Vector3s

typedef Vector3<short> Kale::Vector3s

Definition at line 605 of file Vector.hpp.

◆ Vector3st

typedef Vector3<size_t> Kale::Vector3st

Definition at line 611 of file Vector.hpp.

◆ Vector3uc

typedef Vector3<unsigned char> Kale::Vector3uc

Definition at line 602 of file Vector.hpp.

◆ Vector3ui

typedef Vector3<unsigned int> Kale::Vector3ui

Definition at line 604 of file Vector.hpp.

◆ Vector3ui32

typedef Vector3<uint32_t> Kale::Vector3ui32

Definition at line 612 of file Vector.hpp.

◆ Vector3ul

typedef Vector3<unsigned long> Kale::Vector3ul

Definition at line 608 of file Vector.hpp.

◆ Vector3ull

typedef Vector3<unsigned long long> Kale::Vector3ull

Definition at line 610 of file Vector.hpp.

◆ Vector3us

typedef Vector3<unsigned short> Kale::Vector3us

Definition at line 606 of file Vector.hpp.

◆ Vector4c

typedef Vector4<char> Kale::Vector4c

Definition at line 616 of file Vector.hpp.

◆ Vector4d

typedef Vector4<double> Kale::Vector4d

Definition at line 629 of file Vector.hpp.

◆ Vector4f

typedef Vector4<float> Kale::Vector4f

Definition at line 628 of file Vector.hpp.

◆ Vector4i

typedef Vector4<int> Kale::Vector4i

Definition at line 618 of file Vector.hpp.

◆ Vector4l

typedef Vector4<long> Kale::Vector4l

Definition at line 622 of file Vector.hpp.

◆ Vector4ll

typedef Vector4<long long> Kale::Vector4ll

Definition at line 624 of file Vector.hpp.

◆ Vector4s

typedef Vector4<short> Kale::Vector4s

Definition at line 620 of file Vector.hpp.

◆ Vector4st

typedef Vector4<size_t> Kale::Vector4st

Definition at line 626 of file Vector.hpp.

◆ Vector4uc

typedef Vector4<unsigned char> Kale::Vector4uc

Definition at line 617 of file Vector.hpp.

◆ Vector4ui

typedef Vector4<unsigned int> Kale::Vector4ui

Definition at line 619 of file Vector.hpp.

◆ Vector4ui32

typedef Vector4<uint32_t> Kale::Vector4ui32

Definition at line 627 of file Vector.hpp.

◆ Vector4ul

typedef Vector4<unsigned long> Kale::Vector4ul

Definition at line 623 of file Vector.hpp.

◆ Vector4ull

typedef Vector4<unsigned long long> Kale::Vector4ull

Definition at line 625 of file Vector.hpp.

◆ Vector4us

typedef Vector4<unsigned short> Kale::Vector4us

Definition at line 621 of file Vector.hpp.

Enumeration Type Documentation

◆ AngleUnit

enum class Kale::AngleUnit : bool
strong

Specifies whether an angle is in radians or degrees. You will often see functions taking this enum as an input to determine whether you're inputting radians/degrees.

Enumerator
Degree 
Radian 

Definition at line 30 of file Utils.hpp.

◆ ControllerAxis

enum class Kale::ControllerAxis
strong

Represents a single axis in a game controller

Enumerator
Left 
Right 

Definition at line 26 of file Events.hpp.

◆ ControllerButton

enum class Kale::ControllerButton
strong

Represents a single button on the game controller

Enumerator
LeftJoystick 
RightJoystick 
DPadUp 
DPadRight 
DPadDown 
DPadLeft 
LeftMenu 
RightMenu 
R1 
L1 

Definition at line 33 of file Events.hpp.

◆ Key

enum class Kale::Key
strong

Represents a single key on the keyboard

Enumerator
Escape 
F1 
F2 
F3 
F4 
F5 
F6 
F7 
F8 
F9 
F10 
F11 
F12 
Backtick 
One 
Two 
Three 
Four 
Five 
Six 
Seven 
Eight 
Nine 
Zero 
Minus 
Equals 
Backspace 
Tab 
LeftBracket 
RightBracket 
Backslash 
Semicolon 
Apostrophe 
Enter 
LeftShift 
Comma 
Period 
Slash 
RightShift 
Control 
Alt 
Space 
Up 
Down 
Left 
Right 

Definition at line 44 of file Events.hpp.

Function Documentation

◆ degToRad()

constexpr float Kale::degToRad ( float deg)
constexpr

Converts an angle in degrees to radians

Parameters
degThe angle in degrees
Returns
The angle in radians

Definition at line 39 of file Utils.hpp.

◆ from_json() [1/7]

void Kale::from_json ( const JSON & j,
CubicBezier & p )
inline

Creates a bezier from a json

Definition at line 167 of file Path.hpp.

◆ from_json() [2/7]

template<size_t w, size_t h, typename T >
void Kale::from_json ( const JSON & j,
Matrix< w, h, T > & p )

Creates a matrix from a json

Definition at line 539 of file Matrix.hpp.

◆ from_json() [3/7]

void Kale::from_json ( const JSON & j,
Path & p )
inline

Creates a path from a json

Definition at line 184 of file Path.hpp.

◆ from_json() [4/7]

void Kale::from_json ( const JSON & j,
Transform & p )
inline

Creates a matrix from a json

Definition at line 337 of file Transform.hpp.

◆ from_json() [5/7]

template<typename T >
void Kale::from_json ( const JSON & j,
Vector2< T > & p )

Creates a vector from a json

Definition at line 664 of file Vector.hpp.

◆ from_json() [6/7]

template<typename T >
void Kale::from_json ( const JSON & j,
Vector3< T > & p )

Creates a vector from a json

Definition at line 681 of file Vector.hpp.

◆ from_json() [7/7]

template<typename T >
void Kale::from_json ( const JSON & j,
Vector4< T > & p )

Creates a vector from a json

Definition at line 699 of file Vector.hpp.

◆ isFloating0()

template<typename T >
bool Kale::isFloating0 ( T num,
T epsilon = std::numeric_limits<T>::epsilon() )

Checks if a number is extremely close to 0 to account for floating point error

Parameters
numThe number to check for
epsilonThe epsilon (distance threshold) value to use. Default is std::numeric_limits<T>::epsilon()
Returns
Whether or not the number is extremely close to 0

Definition at line 58 of file Utils.hpp.

◆ isFloatingEqual()

template<typename T >
bool Kale::isFloatingEqual ( T num1,
T num2,
T epsilon = std::numeric_limits<T>::epsilon() )

Checks if two numbers are roughly equivalent accounting for floating point error

Parameters
num1The first number to compare
num2The second number to compare
epsilonThe epsilon (distance threshold) value to use. Default is std::numeric_limits<T>::epsilon()
Returns
Whether or not the two numbers are roughly equivalent

Definition at line 69 of file Utils.hpp.

◆ operator<<() [1/6]

std::ostream & Kale::operator<< ( std::ostream & os,
const CubicBezier & bezier )

Prints a bezier to an output stream

Definition at line 281 of file Path.cpp.

◆ operator<<() [2/6]

template<size_t w, size_t h, typename T >
std::ostream & Kale::operator<< ( std::ostream & os,
const Kale::Matrix< w, h, T > & mat )

Prints a matrix to an output stream

Definition at line 524 of file Matrix.hpp.

◆ operator<<() [3/6]

template<typename T >
std::ostream & Kale::operator<< ( std::ostream & os,
const Kale::Vector2< T > & vec )

Prints a vector to an output stream

Definition at line 637 of file Vector.hpp.

◆ operator<<() [4/6]

template<typename T >
std::ostream & Kale::operator<< ( std::ostream & os,
const Kale::Vector3< T > & vec )

Prints a vector to an output stream

Definition at line 646 of file Vector.hpp.

◆ operator<<() [5/6]

template<typename T >
std::ostream & Kale::operator<< ( std::ostream & os,
const Kale::Vector4< T > & vec )

Prints a vector to an output stream

Definition at line 655 of file Vector.hpp.

◆ operator<<() [6/6]

std::ostream & Kale::operator<< ( std::ostream & os,
const Path & path )

Prints a path to an output stream

Definition at line 289 of file Path.cpp.

◆ radToDeg()

constexpr float Kale::radToDeg ( float rad)
constexpr

Converts an angle in radians to degrees

Parameters
radThe angle in radians
Returns
The angle in degrees

Definition at line 48 of file Utils.hpp.

◆ randomRange() [1/2]

template<typename T >
std::enable_if< std::is_floating_point< T >::value, T >::type Kale::randomRange ( T min,
T max )

Definition at line 83 of file Utils.hpp.

◆ randomRange() [2/2]

template<typename T >
std::enable_if< std::is_integral< T >::value, T >::type Kale::randomRange ( T min,
T max )

Definition at line 90 of file Utils.hpp.

◆ sign()

template<typename T >
int Kale::sign ( T val)

Returns the sign of the number, -1 for negatives, 0 for 0, 1 for positives

Parameters
valThe number to return the sign of
Returns
The sign of the number

Definition at line 79 of file Utils.hpp.

◆ to_json() [1/7]

void Kale::to_json ( JSON & j,
const CubicBezier & p )
inline

Populates a json from a bezier

Definition at line 177 of file Path.hpp.

◆ to_json() [2/7]

template<size_t w, size_t h, typename T >
void Kale::to_json ( JSON & j,
const Matrix< w, h, T > & p )

Populates a json from a matrix

Definition at line 547 of file Matrix.hpp.

◆ to_json() [3/7]

void Kale::to_json ( JSON & j,
const Path & p )
inline

Populates a json from a path

Definition at line 191 of file Path.hpp.

◆ to_json() [4/7]

void Kale::to_json ( JSON & j,
const Transform & p )
inline

Populates a json from a matrix

Definition at line 344 of file Transform.hpp.

◆ to_json() [5/7]

template<typename T >
void Kale::to_json ( JSON & j,
const Vector2< T > & p )

Populates a json from a vector

Definition at line 673 of file Vector.hpp.

◆ to_json() [6/7]

template<typename T >
void Kale::to_json ( JSON & j,
const Vector3< T > & p )

Populates a json from a vector

Definition at line 691 of file Vector.hpp.

◆ to_json() [7/7]

template<typename T >
void Kale::to_json ( JSON & j,
const Vector4< T > & p )

Populates a json from a vector

Definition at line 718 of file Vector.hpp.

◆ triangulatePath()

std::pair< std::vector< Vector2f >, std::vector< unsigned int > > Kale::triangulatePath ( const Vector2f * begin,
const Vector2f * end )

Triangulates the given path and returns both the vertices and indices

Parameters
beginThe beginning of the path to triangulate
endThe ending of the path to triangulate
Returns
A tuple of vectors for the vertices and indices

Definition at line 32 of file Utils.cpp.

◆ triangulatePathFloat()

std::pair< std::vector< float >, std::vector< unsigned int > > Kale::triangulatePathFloat ( const Vector2f * begin,
const Vector2f * end )

Triangulates the given path and returns both the vertices as floats and indices

Parameters
beginThe beginning of the path to triangulate
endThe ending of the path to triangulate
Returns
A tuple of vectors for the vertices and indices

Definition at line 65 of file Utils.cpp.

Variable Documentation

◆ console

Logger Kale::console
inline

The main console used for printing to the output

Definition at line 317 of file Logger.hpp.

◆ E

constexpr float Kale::E = 2.71828182845904f
constexpr

The euler's constant

Definition at line 29 of file Constants.hpp.

◆ mainApp

Application* Kale::mainApp = nullptr
inline

The main application instance

Definition at line 241 of file Application.hpp.

◆ PI

constexpr float Kale::PI = 3.14159265358979f
constexpr

The PI number

Definition at line 24 of file Constants.hpp.