ToyMaker Game Engine 0.0.2
ToyMaker is a game engine developed and maintained by Zoheb Shujauddin.
Loading...
Searching...
No Matches

Topics

 Entity Component System
 Resource Database
 Signals

Files

file  ToyMaker_Main/include/toymaker/engine/registrator.hpp
 Contains the definition for the Registrator<T> utility class, used anywhere that automatic registration of some kind during the static initialization phase of a program is required.
file  ToyMaker_Main/include/toymaker/engine/util.hpp
 Contains a couple of classes not tied to any part of the engine in particular, but useful to those parts all the same.

Classes

class  ToyMaker::Registrator< TRegisterable >
 Helper class for registering a class at program startup. More...
class  ToyMaker::RangeMapperLinear
 A simple linear interpolation implementation between a fixed input and output range. More...

Functions

glm::mat4 ToyMaker::buildModelMatrix (glm::vec4 position, glm::quat orientation, glm::vec3 scale=glm::vec3{1.f, 1.f, 1.f})
 Converts a position, orientation and scale into its model matrix equivalent.
float ToyMaker::squareDistance (const glm::vec3 &vector)
 Returns the square of the length of a 3 component vector.
bool ToyMaker::isFinite (float number)
 Tests whether a given number is finite.
bool ToyMaker::isFinite (const glm::vec3 &vector)
 Tests whether a set of 3 numbers is finite.
bool ToyMaker::isPositiveStrict (float number)
 Tests whether a number is strictly positive.
bool ToyMaker::isPositiveStrict (const glm::vec3 &vector)
 Tests whether a set of 3 numbers is strictly positive.
bool ToyMaker::isNumber (float number)
 Tests whether a float is really a number (as opposed to a special error representation).
bool ToyMaker::isNumber (const glm::vec3 &vector)
 Tests whether a set of 3 numbers are really numbers (as opposed to special error representations).
bool ToyMaker::isNonNegative (float number)
 Tests whether a number is non-negative.
bool ToyMaker::isNonNegative (const glm::vec3 &vector)
 Tests whether a set of numbers is non-negative.
glm::quat ToyMaker::getRotation (const glm::vec3 &from, const glm::vec3 &to)
 Returns the rotation between two vectors represented as a quaternion.
bool ToyMaker::isSensible (const glm::mat3 &matrix)
 Determines whether a particular matrix is valid and finite.
glm::mat4 ToyMaker::getScaleMatrix (const glm::mat4 &fromTransform)
 Given a transform, returns scale matrix that was used to compose the transform.
glm::mat4 ToyMaker::getRotationMatrix (const glm::mat4 &fromTransform)
 Given a transform, returns rotation matrix that was used to compose the transform.
glm::mat4 ToyMaker::getTranslationMatrix (const glm::mat4 &fromTransform)
 Given a transform, returns translation matrix that was used to compose the transform.

Detailed Description

Function Documentation

◆ buildModelMatrix()

glm::mat4 ToyMaker::buildModelMatrix ( glm::vec4 position,
glm::quat orientation,
glm::vec3 scale = glm::vec3{1.f, 1.f, 1.f} )

Converts a position, orientation and scale into its model matrix equivalent.

Parameters
positionThe position offset to apply to a mesh.
orientationThe rotation applied to a mesh, expressed as a quaternion.
scaleThe factor along each direction by which to scale a mesh.
Returns
glm::mat4 The matrix representation of the argument values.

◆ getRotationMatrix()

glm::mat4 ToyMaker::getRotationMatrix ( const glm::mat4 & fromTransform)

Given a transform, returns rotation matrix that was used to compose the transform.

Warning
This only works for scene objects with positive scale values.

◆ getScaleMatrix()

glm::mat4 ToyMaker::getScaleMatrix ( const glm::mat4 & fromTransform)

Given a transform, returns scale matrix that was used to compose the transform.

Warning
This only works for transforms with positive scale values.

◆ isFinite() [1/2]

bool ToyMaker::isFinite ( const glm::vec3 & vector)
inline

Tests whether a set of 3 numbers is finite.

Parameters
vectorThe numbers being tested.
Return values
trueThe numbers are (all) finite;
falseOne or more numbers are not finite;

◆ isFinite() [2/2]

bool ToyMaker::isFinite ( float number)
inline

Tests whether a given number is finite.

Parameters
numberThe number being tested.
Return values
trueThe number is finite;
falseThe number is not finite;

◆ isNonNegative() [1/2]

bool ToyMaker::isNonNegative ( const glm::vec3 & vector)
inline

Tests whether a set of numbers is non-negative.

Parameters
vectorThe numbers being tested.
Return values
trueThe numbers are (all) non-negative.
falseOne or more of the numbers are negative.

◆ isNonNegative() [2/2]

bool ToyMaker::isNonNegative ( float number)
inline

Tests whether a number is non-negative.

Parameters
numberThe number being tested.
Return values
trueThe number is non-negative;
falseThe number is negative;

◆ isPositiveStrict() [1/2]

bool ToyMaker::isPositiveStrict ( const glm::vec3 & vector)
inline

Tests whether a set of 3 numbers is strictly positive.

Parameters
vectorThe numbers being tested.
Return values
trueThe numbers are (all) strictly positive;
falseOne or more numbers are not positive;

◆ isPositiveStrict() [2/2]

bool ToyMaker::isPositiveStrict ( float number)
inline

Tests whether a number is strictly positive.

Parameters
numberThe number being tested.
Return values
trueThe number is strictly positive;
falseThe number is not positive;