3DRadSpace 0.1.0Alpha
3DRadSpace is a free, simple to use, rapid application development game engine.
Loading...
Searching...
No Matches
Engine3DRadSpace.Math Namespace Reference

Namespaces

namespace  Colors
 This namespace contains a set of predefined colors.

Classes

struct  BoundingBox
 Represents a axis aligned bounding box in 3D space defined by position and scale. More...
struct  BoundingPlane
 Represents a plane with the equation p(x,y,z) = Normal.X * x + Normal.Y * y + Normal.Z * z + D. More...
struct  BoundingSphere
 Represents an bounding sphere defined by a center point and a radius. More...
struct  Color
 Represents a Unit RGBA color. More...
struct  Matrix3x3
 Represents a row-major 3x3 matrix. Used for 2D affine transformations and 3D rotations. More...
struct  Matrix4x4
 Represents a row-major 4x4 matrix. Used for 3D affine transformations, rotations, and projections. More...
struct  Point
 Represents a 2D point with integer coordinates. More...
struct  Point3
 Represents a 3D point with integer coordinates. More...
struct  Point4
 Represents a 4D point with integer coordinates. More...
struct  Quaternion
 A quaternion is a hyper-complex number that represents 3D rotations the same way 2D rotations can be represented by a complex number. More...
struct  Ray
 Represents an ray in 3D space, defined by an origin and direction vector. More...
struct  Rectangle
 Represents an axis-aligned rectangle in 2D space, defined by its top-left corner (X, Y) and its dimensions (Width, Height). More...
struct  RectangleF
 Floating point version of the Rectangle structure, representing an axis-aligned rectangle in 2D space with floating-point precision. It is defined by its top-left corner (X, Y) and its dimensions (Width, Height). More...
struct  Size
 Represents a size in 2D space with width (X) and height (Y). More...
struct  Triangle
 Represents a triangle made up of three points in 3D space. More...
struct  UPoint
 Represents a 2D point with unsigned integer coordinates. More...
struct  UPoint3
 Represents a 3D point with unsigned integer coordinates. More...
struct  UPoint4
 Represents a 4D point with unsigned integer coordinates. More...
struct  Vector2
 A 2D vector. More...
struct  Vector3
struct  Vector4
class  ViewingFrustum
 Represents a viewing frustum. More...

Functions

template<typename T>
constexpr T ToRadians (T degrees)
 Converts degrees to radians.
template<typename T>
constexpr T ToDegrees (T radians)
 Converts radians to degrees.
constexpr double E3DRSP_MATH_EXPORT CatmullRom (double value1, double value2, double value3, double value4, double amount)
 Performs a Catmull-Rom interpolation.
constexpr double E3DRSP_MATH_EXPORT Hermite (double value1, double tangent1, double value2, double tangent2, double amount)
 Performs a Hermite spline interpolation between two values with specified tangents.
constexpr bool E3DRSP_MATH_EXPORT AABB (float p1, float w1, float p2, float w2)
 Axis aligned bounding box check for one single axis.
constexpr bool E3DRSP_MATH_EXPORT AABB (double p1, double w1, double p2, double w2)
 Axis aligned bounding box check for one single axis.
constexpr double E3DRSP_MATH_EXPORT SmoothStep (double value1, double value2, double amount)
 Performs a smooth step interpolation between two values.
constexpr double E3DRSP_MATH_EXPORT ReLU (double x)
 Rectified Linear Unit. Activation function usually used in neural networks, but it is a shortcut to max(0, x).
constexpr bool E3DRSP_MATH_EXPORT WithinEpsilon (float a, float b)
Matrix3x3 E3DRSP_MATH_EXPORT operator* (float s, const Matrix3x3 &m) noexcept
Matrix3x3 E3DRSP_MATH_EXPORT operator/ (float s, const Matrix3x3 &m)
Matrix4x4 E3DRSP_MATH_EXPORT operator* (float scalar, const Matrix4x4 &m) noexcept
 Multiplies a matrix by a scalar.
Matrix4x4 E3DRSP_MATH_EXPORT operator/ (float f, const Matrix4x4 &m)
 Divides a scalar by a matrix, computed as the scalar multiplied by the inverse of the matrix.
Quaternion E3DRSP_MATH_EXPORT operator/ (float f, const Quaternion &q)
Quaternion E3DRSP_MATH_EXPORT operator* (float s, const Quaternion &q) noexcept
Vector2 E3DRSP_MATH_EXPORT operator* (float s, const Vector2 &v)
 Multiplies a vector by a scalar.
Vector2 E3DRSP_MATH_EXPORT operator/ (float s, const Vector2 &v)
 Divides a scalar by a vector, component-wise.
Vector3 E3DRSP_MATH_EXPORT operator* (float s, const Vector3 &v)
 Multiplies a vector by a scalar.
Vector3 E3DRSP_MATH_EXPORT operator/ (float s, const Vector3 &v)
 Divides a scalar by a vector, component-wise.
Vector4 E3DRSP_MATH_EXPORT operator* (float scalar, const Vector4 &v)
 Multiplies a vector by a scalar.
Vector4 E3DRSP_MATH_EXPORT operator/ (float scalar, const Vector4 &v)
 Divides a scalar by a vector, component-wise.

Function Documentation

◆ AABB() [1/2]

bool Engine3DRadSpace::Math::AABB ( double p1,
double w1,
double p2,
double w2 )
constexpr

Axis aligned bounding box check for one single axis.

Parameters
p1The position of the first box.
w1The width of the first box.
p2The position of the second box.
w2The width of the second box.
Returns
True if the boxes overlap, false otherwise.

◆ AABB() [2/2]

bool Engine3DRadSpace::Math::AABB ( float p1,
float w1,
float p2,
float w2 )
constexpr

Axis aligned bounding box check for one single axis.

Parameters
p1The position of the first box.
w1The width of the first box.
p2The position of the second box.
w2The width of the second box.
Returns
True if the boxes overlap, false otherwise.

◆ CatmullRom()

double Engine3DRadSpace::Math::CatmullRom ( double value1,
double value2,
double value3,
double value4,
double amount )
constexpr

Performs a Catmull-Rom interpolation.

Parameters
value1The first value.
value2The second value.
value3The third value.
value4The fourth value.
amountThe interpolation amount.
Returns
The interpolated value.

◆ Hermite()

double Engine3DRadSpace::Math::Hermite ( double value1,
double tangent1,
double value2,
double tangent2,
double amount )
constexpr

Performs a Hermite spline interpolation between two values with specified tangents.

Parameters
value1The first value.
tangent1The tangent of the first value.
value2The second value.
tangent2The tangent of the second value.
amountThe interpolation amount.
Returns
The interpolated value.

◆ operator*() [1/6]

Matrix3x3 Engine3DRadSpace::Math::operator* ( float s,
const Matrix3x3 & m )
noexcept

◆ operator*() [2/6]

Quaternion Engine3DRadSpace::Math::operator* ( float s,
const Quaternion & q )
noexcept

◆ operator*() [3/6]

Vector2 Engine3DRadSpace::Math::operator* ( float s,
const Vector2 & v )

Multiplies a vector by a scalar.

Parameters
sThe scalar value.
vThe vector to multiply.
Returns
The resulting scaled vector.

◆ operator*() [4/6]

Vector3 Engine3DRadSpace::Math::operator* ( float s,
const Vector3 & v )

Multiplies a vector by a scalar.

Parameters
sThe scalar value.
vThe vector to multiply.
Returns
The resulting scaled vector.

◆ operator*() [5/6]

Matrix4x4 Engine3DRadSpace::Math::operator* ( float scalar,
const Matrix4x4 & m )
noexcept

Multiplies a matrix by a scalar.

Parameters
scalarThe scalar value to multiply with.
mThe matrix to multiply.
Returns
The resulting scaled matrix.

◆ operator*() [6/6]

Vector4 Engine3DRadSpace::Math::operator* ( float scalar,
const Vector4 & v )

Multiplies a vector by a scalar.

Parameters
scalarThe scalar value.
vThe vector to multiply.
Returns
The resulting scaled vector.

◆ operator/() [1/6]

Matrix4x4 Engine3DRadSpace::Math::operator/ ( float f,
const Matrix4x4 & m )

Divides a scalar by a matrix, computed as the scalar multiplied by the inverse of the matrix.

Parameters
fThe scalar value.
mThe matrix to invert and multiply with.
Returns
The resulting matrix.

◆ operator/() [2/6]

Quaternion Engine3DRadSpace::Math::operator/ ( float f,
const Quaternion & q )

◆ operator/() [3/6]

Matrix3x3 Engine3DRadSpace::Math::operator/ ( float s,
const Matrix3x3 & m )

◆ operator/() [4/6]

Vector2 Engine3DRadSpace::Math::operator/ ( float s,
const Vector2 & v )

Divides a scalar by a vector, component-wise.

Parameters
sThe scalar value.
vThe vector to divide by.
Returns
The resulting vector.

◆ operator/() [5/6]

Vector3 Engine3DRadSpace::Math::operator/ ( float s,
const Vector3 & v )

Divides a scalar by a vector, component-wise.

Parameters
sThe scalar value.
vThe vector to divide by.
Returns
The resulting vector.

◆ operator/() [6/6]

Vector4 Engine3DRadSpace::Math::operator/ ( float scalar,
const Vector4 & v )

Divides a scalar by a vector, component-wise.

Parameters
scalarThe scalar value.
vThe vector to divide by.
Returns
The resulting vector.

◆ ReLU()

double Engine3DRadSpace::Math::ReLU ( double x)
constexpr

Rectified Linear Unit. Activation function usually used in neural networks, but it is a shortcut to max(0, x).

Parameters
xInput.
Returns
If x > 0 otherwise 0.

◆ SmoothStep()

double Engine3DRadSpace::Math::SmoothStep ( double value1,
double value2,
double amount )
constexpr

Performs a smooth step interpolation between two values.

Same as Hermite(value1, 0, value2, 0, result).

Parameters
value1The first value.
value2The second value.
amountThe interpolation amount.
Returns
The interpolated value.

◆ ToDegrees()

template<typename T>
T Engine3DRadSpace::Math::ToDegrees ( T radians)
constexpr

Converts radians to degrees.

Template Parameters
TFloating type
Parameters
radiansAngle in radians
Returns
Angle in degrees

◆ ToRadians()

template<typename T>
T Engine3DRadSpace::Math::ToRadians ( T degrees)
constexpr

Converts degrees to radians.

Template Parameters
TFloating type
Parameters
degreesAngle in degrees
Returns
Angle in radians

◆ WithinEpsilon()

bool Engine3DRadSpace::Math::WithinEpsilon ( float a,
float b )
constexpr