![]() |
Lysa
0.0
Lysa 3D Engine
|
Typedefs | |
| using | event_type = std::string |
| using | EventHandlerCallback = std::function< void (Event &)> |
| using | uint8 = std::uint8_t |
| using | uint16 = std::uint16_t |
| using | uint32 = std::uint32_t |
| using | uint64 = std::uint64_t |
| using | int8 = std::int8_t |
| using | int16 = std::int16_t |
| using | int32 = std::int32_t |
| using | int64 = std::int64_t |
| using | size_t = std::size_t |
| using | unique_id = int64 |
| using | pipeline_id = uint32 |
| using | collision_layer = uint32 |
Enums | |
| enum class | InputEventType : uint8 { KEY = 0, MOUSE_MOTION = 1, MOUSE_BUTTON = 2, GAMEPAD_BUTTON = 3, TEXT_INPUT = 4 } |
| enum class | KeyModifier : uint8 { SHIFT = 0x0001, CONTROL = 0x0002, ALT = 0x0004, SUPER = 0x0008 } |
| enum | Key : uint32 { KEY_NONE = 0, KEY_SPACE = 1, KEY_DASH = 2, KEY_PIPE = 3, KEY_APOSTROPHE = 4, KEY_COMMA = 5, KEY_PERIOD = 6, KEY_QUESTIONMARK = 7, KEY_0 = 8, KEY_1 = 9, KEY_2 = 10, KEY_3 = 11, KEY_4 = 12, KEY_5 = 13, KEY_6 = 14, KEY_7 = 15, KEY_8 = 16, KEY_9 = 17, KEY_SEMICOLON = 18, KEY_EQUAL = 19, KEY_A = 20, KEY_B = 21, KEY_C = 22, KEY_D = 23, KEY_E = 24, KEY_F = 25, KEY_G = 26, KEY_H = 27, KEY_I = 28, KEY_J = 29, KEY_K = 30, KEY_L = 31, KEY_M = 32, KEY_N = 33, KEY_O = 34, KEY_P = 35, KEY_Q = 36, KEY_R = 37, KEY_S = 38, KEY_T = 39, KEY_U = 40, KEY_V = 41, KEY_W = 42, KEY_X = 43, KEY_Y = 44, KEY_Z = 45, KEY_LEFT_BRACKET = 46, KEY_BACKSLASH = 47, KEY_RIGHT_BRACKET = 48, KEY_GRAVE_ACCENT = 49, KEY_ESCAPE = 50, KEY_ENTER = 51, KEY_TAB = 52, KEY_BACKSPACE = 53, KEY_INSERT = 54, KEY_DELETE = 55, KEY_RIGHT = 56, KEY_LEFT = 57, KEY_DOWN = 58, KEY_UP = 59, KEY_PAGE_UP = 60, KEY_PAGE_DOWN = 61, KEY_HOME = 62, KEY_END = 63, KEY_CAPS_LOCK = 64, KEY_SCROLL_LOCK = 65, KEY_NUM_LOCK = 66, KEY_PRINT_SCREEN = 67, KEY_PAUSE = 68, KEY_F1 = 69, KEY_F2 = 70, KEY_F3 = 71, KEY_F4 = 72, KEY_F5 = 73, KEY_F6 = 74, KEY_F7 = 75, KEY_F8 = 76, KEY_F9 = 77, KEY_F10 = 78, KEY_F11 = 79, KEY_F12 = 80, KEY_KP_0 = 81, KEY_KP_1 = 82, KEY_KP_2 = 83, KEY_KP_3 = 84, KEY_KP_4 = 85, KEY_KP_5 = 86, KEY_KP_6 = 87, KEY_KP_7 = 88, KEY_KP_8 = 89, KEY_KP_9 = 90, KEY_KP_PERIOD = 91, KEY_KP_DIVIDE = 92, KEY_KP_MULTIPLY = 93, KEY_KP_SUBTRACT = 94, KEY_KP_ADD = 95, KEY_KP_ENTER = 96, KEY_KP_EQUAL = 97, KEY_LEFT_SHIFT = 98, KEY_LEFT_CONTROL = 99, KEY_LEFT_ALT = 100, KEY_LEFT_SUPER = 101, KEY_RIGHT_SHIFT = 102, KEY_RIGHT_CONTROL = 103, KEY_RIGHT_ALT = 104, KEY_RIGHT_SUPER = 105 } |
| enum class | MouseButton : uint8 { NONE = 0b0000, LEFT = 0b0001, RIGHT = 0b0010, MIDDLE = 0b0100, WHEEL = 0b1000 } |
| enum class | GamepadButton : uint8 { A = 0, CROSS = A, B = 1, CIRCLE = B, X = 2, SQUARE = X, Y = 3, TRIANGLE = Y, LB = 4, L1 = LB, RB = 5, R1 = RB, BACK = 6, SHARE = BACK, START = 7, MENU = START, LT = 8, L2 = LT, RT = 9, R2 = RT, DPAD_UP = 10, DPAD_RIGHT = 11, DPAD_DOWN = 12, DPAD_LEFT = 13, LAST = DPAD_LEFT } |
| enum class | GamepadAxisJoystick : uint8 { LEFT = 0, RIGHT = 1 } |
| enum class | GamepadAxis : uint8 { LEFT_X = 0, LEFT_Y = 1, RIGHT_X = 2, RIGHT_Y = 3, LEFT_TRIGGER = 4, RIGHT_TRIGGER = 5, LAST = RIGHT_TRIGGER } |
| enum class | PhysicsEngineType { JOLT, PHYSX } |
| enum class | CombineMode { AVERAGE = 0, MIN = 1, MAX = 2, MULTIPLY = 3 } |
| enum class | RendererType : uint8 { FORWARD = 0, DEFERRED = 1 } |
| enum class | ToneMappingType : uint8 { NONE = 0, REINHARD = 1, ACES = 2 } |
| enum class | PostProcessAntiAliasingType : uint8 { NONE = 0, FXAA = 1, SMAA = 2 } |
| enum class | AnimationType : uint8 { TRANSLATION = 1, ROTATION = 2, SCALE = 3 } |
| enum class | AnimationInterpolation : uint8 { LINEAR = 0, STEP = 1 } |
| enum class | AnimationLoopMode : uint8 { NONE = 0, LINEAR = 1 } |
| enum class | LightType : int8 { LIGHT_UNKNOWN = -1, LIGHT_DIRECTIONAL = 0, LIGHT_OMNI = 1, LIGHT_SPOT = 2 } |
| enum class | Transparency { DISABLED = 0, ALPHA = 1 } |
| enum class | MouseMode : uint8 { VISIBLE = 0, VISIBLE_CAPTURED = 1, HIDDEN = 2, HIDDEN_CAPTURED = 3 } |
| enum class | MouseCursor : uint8 { ARROW = 0, WAIT = 1, RESIZE_H = 2, RESIZE_V = 3 } |
| enum class | RenderingWindowMode : uint32 { WINDOWED = 0, WINDOWED_MAXIMIZED = 1, WINDOWED_FULLSCREEN = 2, FULLSCREEN = 3 } |
| enum | LoggingMode : uint32 { LOGGING_MODE_NONE = 0, LOGGING_MODE_WINDOW = 0x001, LOGGING_MODE_FILE = 0x010, LOGGING_MODE_STDOUT = 0x100 } |
| enum class | LogLevel : int32 { TRACE = -1, DEBUG = 0, INFO = 1, GAME1 = 2, GAME2 = 3, GAME3 = 4, WARNING = 5, ERROR = 6, CRITICAL = 7, INTERNAL = 100 } |
Functions | |
| void | vireoDebugCallback (const vireo::DebugLevel level, const std::string &message) |
| constexpr Context & | ctx () |
| template<typename Expr > | |
| constexpr void | assert (Expr &&, const std::string_view, const std::source_location &=std::source_location::current ()) noexcept |
| 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 ¢er, 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 | add (const float2 &a, const float2 &b) |
| float3 | add (const float3 &a, const float3 &b) |
| float4 | add (const float4 &a, const float4 &b) |
| consteval bool | is_windows () |
| float | get_current_time_milliseconds () |
| std::string | sanitize_name (const std::string &name) |
| bool | dir_exists (const std::string &dirName) |
| float3 | to_float3 (const std::string &str) |
| float4 | to_float4 (const std::string &str) |
| std::vector< std::string_view > | split (std::string_view str, char delimiter) |
| std::string | to_hexstring (const void *ptr) |
| std::string | to_hexstring (uint32 ptr) |
| std::string | to_string (const wchar_t *wstr) |
| std::string | to_string (const float3 &vec) |
| std::string | to_string (const float2 &vec) |
| std::string | to_string (const quaternion &vec) |
| std::string | to_string (const float4 &vec) |
| std::u32string | to_utf32 (const std::string &utf8) |
| std::string | to_lower (const std::string &str) |
| float | halton_sequence (const uint32 index, const uint32 base) |
Variables | |
| 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 |
| constexpr uint32 | PHYSX_MAX_COLLISIONS_LAYERS {100} |
| const float3 | DEFAULT_CLEAR_COLOR {0.0f, 0.0f, 0.0f} |
| constexpr float | VECTOR_2D_SCREEN_SIZE {1000.0f} |
| constexpr int | SHADER_MATERIAL_MAX_PARAMETERS {4} |
| constexpr pipeline_id | DEFAULT_PIPELINE_ID {0} |
| constexpr unique_id | INVALID_ID {-1} |
| constexpr bool | ENABLE_LOG = true |
| Indicates at compile-time that logging is enabled. More... | |
| constexpr Rect | RECT_FULLSCREEN {0.0f, 0.0f, -1.0f, -1.0f} |
| using collision_layer = uint32 |
| using event_type = std::string |
Alias representing an application-defined event kind.
| using EventHandlerCallback = std::function<void(Event&)> |
Callback signature for event handlers.
| using int16 = std::int16_t |
| using int32 = std::int32_t |
| using int64 = std::int64_t |
| using int8 = std::int8_t |
| using pipeline_id = uint32 |
| using size_t = std::size_t |
| using uint16 = std::uint16_t |
| using uint32 = std::uint32_t |
| using uint64 = std::uint64_t |
| using uint8 = std::uint8_t |
|
strong |
|
strong |
Animation loop mode
| Enum Values | Documentation |
|---|---|
| NONE | No loop (default) |
| LINEAR | Restart from the start of the track |
|
strong |
Animation type for an animation track
|
strong |
|
strong |
|
strong |
|
strong |
Gamepas buttons
|
strong |
Key codes, QWERTY layout to keep the WASD keys
|
strong |
Light type
| Enum Values | Documentation |
|---|---|
| LIGHT_UNKNOWN | Unknown light type |
| LIGHT_DIRECTIONAL | Directional light |
| LIGHT_OMNI | Omni (point) light |
| LIGHT_SPOT | Spot light |
| enum LoggingMode : uint32 |
Where to log messages
| Enum Values | Documentation |
|---|---|
| LOGGING_MODE_NONE | Disable logging. |
| LOGGING_MODE_WINDOW | Open an external Window (on the first screen if you have multiple screen) to display the log messages. Log message appearance in the Window can be deferred to the next frame if the log message is sent from a thread different from the main thread |
| LOGGING_MODE_FILE | Log the messages into a file named 'log.txt' |
| LOGGING_MODE_STDOUT | Log the messages to std::cout. WIN32 applications needs to be linked with |
Log levels
| Enum Values | Documentation |
|---|---|
| TRACE | |
| DEBUG | |
| INFO | |
| GAME1 | |
| GAME2 | |
| GAME3 | |
| WARNING | |
| ERROR | |
| CRITICAL | |
| INTERNAL |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
Rendering Window mode
|
strong |
|
strong |
A Material transparency mode Any transparency mode other than Transparency::DISABLED has a greater performance impact compared to opaque rendering.
| Enum Values | Documentation |
|---|---|
| DISABLED | The material will not use transparency. This is the fastest to render. |
| ALPHA | The material will use the texture's alpha values for transparency. |
| float2 lysa::add | ( | const float2 & | a, |
| const float2 & | b | ||
| ) |
| float3 lysa::add | ( | const float3 & | a, |
| const float3 & | b | ||
| ) |
| float4 lysa::add | ( | const float4 & | a, |
| const float4 & | b | ||
| ) |
|
inline |
Compare two floating-point values with a relative tolerance.
Uses max(abs(a), abs(b)) scaled by 1e-4 as tolerance.
| f1 | First value. |
| f2 | Second value. |
|
inline |
Approximate equality for quaternions.
Each component is compared using almostEquals(float, float).
| f1 | First quaternion. |
| f2 | Second quaternion. |
|
constexprnoexcept |
No-op placeholder for release builds.
|
constexpr |
| bool lysa::dir_exists | ( | const std::string & | dirName | ) |
Tests whether a directory exists at the given path.
| dirName | OS path to check. |
| float3 lysa::euler_angles | ( | quaternion | q | ) |
Convert a unit quaternion to Euler angles (XYZ order).
The returned angles are in radians and follow the conventional pitch (X), yaw (Y), roll (Z) ordering.
| q | Input quaternion. It does not need to be normalized; the function normalizes it internally. |
| float lysa::get_current_time_milliseconds | ( | ) |
Returns the current time in milliseconds.
Returns a number in a halton sequence
| consteval bool lysa::is_windows | ( | ) |
| float4x4 lysa::look_at | ( | const float3 & | eye, |
| const float3 & | center, | ||
| const float3 & | up | ||
| ) |
Build a right-handed look-at view matrix.
| eye | Camera position in world space. |
| center | Target point the camera looks at. |
| up | World up direction. |
| float2 lysa::mul | ( | const float | a, |
| const float2 & | b | ||
| ) |
| float3 lysa::mul | ( | const float | a, |
| const float3 & | b | ||
| ) |
| float4 lysa::mul | ( | const float | a, |
| const float4 & | b | ||
| ) |
| float2 lysa::mul | ( | const float2 & | a, |
| const float | b | ||
| ) |
| float3 lysa::mul | ( | const float3 & | a, |
| const float | b | ||
| ) |
| float4 lysa::mul | ( | const float4 & | a, |
| const float | b | ||
| ) |
| float4x4 lysa::orthographic | ( | float | left, |
| float | right, | ||
| float | top, | ||
| float | bottom, | ||
| float | znear, | ||
| float | zfar | ||
| ) |
Build a right-handed orthographic projection matrix.
| left | Left plane. |
| right | Right plane. |
| top | Top plane. |
| bottom | Bottom plane. |
| znear | Near clipping plane. |
| zfar | Far clipping plane. |
| float4x4 lysa::perspective | ( | float | fov, |
| float | aspect, | ||
| float | near, | ||
| float | far | ||
| ) |
Build a right-handed perspective projection matrix.
| fov | Vertical field of view in radians. |
| aspect | Aspect ratio (width/height). |
| near | Near clipping plane distance (> 0). |
| far | Far clipping plane distance (> near). |
| float lysa::radians | ( | const float | angle | ) |
Convert a scalar angle in degrees to radians.
Convenience overload that forwards to the vectorized version.
| angle | Angle in degrees. |
| float lysa::randomf | ( | float | max | ) |
Generate a random float in [0.0f, max].
| max | Inclusive upper bound. |
Generate a random unsigned integer in [0, max].
| max | Inclusive upper bound. |
| std::string lysa::sanitize_name | ( | const std::string & | name | ) |
Produces a sanitized version of a name suitable for identifiers or paths.
Typical sanitization removes or replaces characters that are not alphanumeric, underscore, hyphen or dot, and collapses whitespace.
| name | Input name to sanitize. |
| std::vector<std::string_view> lysa::split | ( | std::string_view | str, |
| char | delimiter | ||
| ) |
Splits a string view into sub‑views using a single‑character delimiter.
The returned views reference the original memory in str; no allocations are performed for the tokens themselves. Callers must ensure that the lifetime of the original string outlives the returned views.
Consecutive delimiters yield empty tokens.
| str | Source string view to split. |
| delimiter | Delimiter character (e.g., ','). |
| float3 lysa::to_float3 | ( | const std::string & | str | ) |
Parses a float3 from a textual representation.
Expected formats typically include:
| str | Input string containing three floating‑point numbers. |
| float4 lysa::to_float4 | ( | const std::string & | str | ) |
Parses a float4 from a textual representation.
Expected formats typically include:
| str | Input string containing four floating‑point numbers. |
| std::string lysa::to_hexstring | ( | const void * | ptr | ) |
Returns a hexadecimal textual representation of a memory address.
| ptr | Pointer value to format. |
| std::string lysa::to_hexstring | ( | uint32 | ptr | ) |
Returns a hexadecimal textual representation of an integer value.
| ptr | Integer value to format in hex. |
| std::string lysa::to_lower | ( | const std::string & | str | ) |
Returns a lowercase copy of the input ASCII/UTF‑8 string.
Locale‑dependent rules may not be applied; intended for identifiers and case‑insensitive comparisons in engine code.
| str | Source string. |
| quaternion lysa::to_quaternion | ( | const float4x4 & | m | ) |
Extract a quaternion from a 4x4 rotation matrix.
Converts the upper-left 3x3 rotation part of the 4x4 matrix into a unit quaternion.
| m | Input 4x4 matrix. |
| std::string lysa::to_string | ( | const float2 & | vec | ) |
Returns a human‑readable string for a float2.
| vec | Vector to print. |
| std::string lysa::to_string | ( | const float3 & | vec | ) |
Returns a human‑readable string for a float3.
| vec | Vector to print. |
| std::string lysa::to_string | ( | const float4 & | vec | ) |
Returns a human‑readable string for a float4.
| vec | Vector to print. |
| std::string lysa::to_string | ( | const quaternion & | vec | ) |
Returns a human‑readable string for a quaternion (x, y, z, w order).
| vec | Quaternion to print. |
| std::string lysa::to_string | ( | const wchar_t * | wstr | ) |
Converts a wide‑character C‑string to a UTF‑8 std::string.
| wstr | Null‑terminated wide string. |
| std::u32string lysa::to_utf32 | ( | const std::string & | utf8 | ) |
Converts a UTF‑8 string to UTF‑32 (char32_t) string.
| utf8 | Source string encoded in UTF‑8. |
| void lysa::vireoDebugCallback | ( | const vireo::DebugLevel | level, |
| const std::string & | message | ||
| ) |
| const float3 AXIS_BACK = {0.0f, 0.0f, 1.0f} |
BACK Axis
| const float3 AXIS_DOWN = {0.0f, -1.0f, 0.0f} |
DOWN Axis
| const float3 AXIS_FRONT = {0.0f, 0.0f, -1.0f} |
FRONT Axis
| const float3 AXIS_LEFT = {-1.0f, 0.0f, 0.0f} |
LEFT Axis
| const float3 AXIS_RIGHT = {1.0f, 0.0f, 0.0f} |
RIGHT Axis
| const float3 AXIS_UP = {0.0f, 1.0f, 0.0f} |
UP Axis
| const float3 AXIS_X {1.0f, 0.0f, 0.0f} |
X Axis
| const float3 AXIS_Y {0.0f, 1.0f, 0.0f} |
Y Axis
| const float3 AXIS_Z {0.0f, 0.0f, 1.0f} |
Z Axis
| const float3 DEFAULT_CLEAR_COLOR {0.0f, 0.0f, 0.0f} |
Default clear color for windows and color frame buffers
|
constexpr |
|
constexpr |
Indicates at compile-time that logging is enabled.
| const float2 FLOAT2ZERO {0.0f} |
2D zero initialized vector
| const float3 FLOAT3ZERO {0.0f} |
3D zero initialized vector
| const float4 FLOAT4ZERO {0.0f} |
4D zero initialized vector
|
constexpr |
|
constexpr |
|
constexpr |
| const quaternion QUATERNION_IDENTITY {0.0f, 0.0f, 0.0f, 1.0f} |
Unit quaternion with no rotation
|
constexpr |
|
constexpr |
| const float3x3 TRANSFORM_BASIS {1.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 1.0f} |
The Basis of 3D transform. It is composed of 3 axes (Basis.x, Basis.y, and Basis.z). Together, these represent the transform's rotation, scale, and shear.
|
constexpr |
The screen size for the 2D vector renderer