Lysa  0.0
Lysa 3D Engine
Math.ixx File Reference

Classes

struct  Ray
 
struct  RayHit
 

Namespaces

namespace  lysa
 

Macros

#define HLSLPP_MODULE_DECLARATION
 
#define HLSLPP_FEATURE_TRANSFORM
 

Typedefs

using int32 = int32_t
 
using uint32 = uint32_t
 

Functions

float3 euler_angles (quaternion q)
 
float radians (const float angle)
 
bool almost_equals (const float f1, const float f2)
 
bool almost_equals (const quaternion &f1, const quaternion &f2)
 
float4x4 look_at (const float3 &eye, const float3 &center, const float3 &up)
 
float4x4 perspective (float fov, float aspect, float near, float far)
 
float4x4 orthographic (float left, float right, float top, float bottom, float znear, float zfar)
 
quaternion to_quaternion (const float4x4 &m)
 
uint32 randomi (uint32 max)
 
float randomf (float max)
 
float2 mul (const float2 &a, const float b)
 
float3 mul (const float3 &a, const float b)
 
float4 mul (const float4 &a, const float b)
 
float2 mul (const float a, const float2 &b)
 
float3 mul (const float a, const float3 &b)
 
float4 mul (const float a, const float4 &b)
 
float2 mul (const float2 &a, const float2 &b)
 
float3 mul (const float3 &a, const float3 &b)
 
float4 mul (const float4 &a, const float4 &b)
 
float2 add (const float2 &a, const float2 &b)
 
float3 add (const float3 &a, const float3 &b)
 
float4 add (const float4 &a, const float4 &b)
 
float2 sub (const float2 &a, const float2 &b)
 
float3 sub (const float3 &a, const float3 &b)
 
float4 sub (const float4 &a, const float4 &b)
 
std::optional< RayHit > ray_triangle (const Ray &ray, const float3 &v0, const float3 &v1, const float3 &v2)
 

Variables

 module
 
export module lysa math
 
export import std
 
export import lysa types
 
const float3 AXIS_X {1.0f, 0.0f, 0.0f}
 
const float3 AXIS_Y {0.0f, 1.0f, 0.0f}
 
const float3 AXIS_Z {0.0f, 0.0f, 1.0f}
 
const float3 AXIS_UP = {0.0f, 1.0f, 0.0f}
 
const float3 AXIS_DOWN = {0.0f, -1.0f, 0.0f}
 
const float3 AXIS_FRONT = {0.0f, 0.0f, -1.0f}
 
const float3 AXIS_BACK = {0.0f, 0.0f, 1.0f}
 
const float3 AXIS_RIGHT = {1.0f, 0.0f, 0.0f}
 
const float3 AXIS_LEFT = {-1.0f, 0.0f, 0.0f}
 
const float2 FLOAT2ZERO {0.0f}
 
const float3 FLOAT3ZERO {0.0f}
 
const float4 FLOAT4ZERO {0.0f}
 
const quaternion QUATERNION_IDENTITY {0.0f, 0.0f, 0.0f, 1.0f}
 
const float3x3 TRANSFORM_BASIS {1.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 1.0f}
 
constexpr float HALF_PI = std::numbers::pi_v<float> / 2.0f
 

Macro Definition Documentation

#define HLSLPP_FEATURE_TRANSFORM
#define HLSLPP_MODULE_DECLARATION

Math helpers built on top of hlsl++ types.

This module provides common math utilities and matrix/quaternion helpers used across the engine, including view/projection matrix builders, a quaternion-to-Euler conversion, tolerant comparisons, and simple random number generation utilities.

Typedef Documentation

using int32 = int32_t
using uint32 = uint32_t

Variable Documentation

export module lysa math
module
export import std
export import lysa types