Monad Engine da02fba2
> Undercity Codex_
Loading...
Searching...
No Matches
mnd Namespace Reference

Namespaces

namespace  vk
 

Classes

struct  AnimationClip
 A named, playable animation containing one or more transform tracks. More...
 
class  AnimationComponent
 Drives transform animation on a hierarchy of GameObjects. More...
 
class  Application
 Interface that every runnable game or lab must implement. More...
 
class  Audio
 Single playable audio clip backed by a decoded miniaudio stream. More...
 
class  AudioComponent
 Plays one or more named audio clips, attached to a GameObject. More...
 
class  AudioListenerComponent
 Marks its GameObject as the 3D audio listener. More...
 
class  AudioManager
 Global audio backend wrapper. More...
 
struct  Bone
 
struct  BoneTrack
 
class  BoxCollider
 Axis-aligned box collider; extents are half-sizes. More...
 
class  Builder
 Factory that generates MeshData for common geometric primitives. More...
 
class  CameraComponent
 Perspective camera — provides view and projection matrices each frame. More...
 
struct  CameraData
 Per-frame camera matrices and world-space position. More...
 
class  CapsuleCollider
 Y-axis capsule collider (cylinder + hemispherical caps). More...
 
class  Collider
 Abstract owner of a btCollisionShape. More...
 
class  CollisionObject
 
class  Component
 
class  ComponentCreator
 
class  ComponentCreatorBase
 
class  ComponentFactory
 
struct  DamageInfo
 
class  Editor
 ImGui-based in-game editor overlay. More...
 
class  Engine
 Singleton façade that drives the full engine lifecycle. More...
 
class  FileReader
 Read helper bound to a single file path. More...
 
class  FileSystem
 Resolves asset paths and loads files into memory. More...
 
class  GameObject
 Node in the scene graph: a named transform that owns components and children. More...
 
class  GameObjectFactory
 
class  GraphicsAPI
 OpenGL 3.3 Core Profile abstraction layer. More...
 
class  HealthComponent
 
class  IContactListener
 
class  InputManager
 Stores per-frame keyboard and mouse input state. More...
 
struct  KeyFrameQuat
 
struct  KeyFrameVec3
 
class  KinematicCharacterController
 High-level capsule character controller: walks, jumps, detects ground. More...
 
class  LightComponent
 Point light that contributes position + colour to the render pass. More...
 
struct  LightData
 World-space position and RGB colour of a single point light. More...
 
struct  LogEntry
 
class  Material
 Shader + uniform storage that defines how a surface is rendered. More...
 
class  Mesh
 Immutable GPU mesh (VAO + VBO + optional EBO). More...
 
class  MeshComponent
 Makes a GameObject renderable by submitting its mesh each frame. More...
 
struct  MeshData
 CPU-side mesh bundle produced by Builder factory methods. More...
 
class  ModelImporter
 
struct  ObjectBinding
 Runtime binding from a TransformTrack to a live child GameObject. More...
 
struct  ObjectCreator
 
struct  ObjectCreatorBase
 
class  OpenGLRendererBackend
 
struct  Particle
 
class  ParticleEmitterComponent
 
class  ParticleSystem
 
class  PhysicsComponent
 Component bridge between a GameObject and the physics world. More...
 
class  PhysicsManager
 Owns the Bullet btDiscreteDynamicsWorld and all auxiliary collision structures (broadphase, dispatcher, solver). More...
 
class  PlayerControllerComponent
 
struct  Pose
 Per-frame pose state for a Skeleton. More...
 
class  PostProcess
 
struct  RayHit
 Hit information returned by PhysicsManager::Raycast. More...
 
struct  RenderCommand
 One draw call unit: a Mesh + Material + world-space transform. More...
 
class  RendererBackend
 
class  RenderQueue
 Accumulates RenderCommands during Update and draws them in one pass. More...
 
struct  RenderSettings
 
class  RenderTarget
 Offscreen FBO with MRT colour + sampleable depth for low-resolution rendering. More...
 
class  RigidBody
 Owning wrapper around btRigidBody; holds a shared Collider, mass, friction, and body type. More...
 
class  Scene
 Container for the entire game object graph. More...
 
class  ShaderProgram
 Linked GLSL program with cached uniform locations. More...
 
struct  SkeletalAnimationClip
 
class  Skeleton
 
class  SkinnedMeshComponent
 
class  SphereCollider
 Sphere collider of the given radius. More...
 
class  SpriteRenderer
 
class  Texture
 2D OpenGL texture object wrapping a GL_TEXTURE_2D handle. More...
 
class  TextureManager
 Path-keyed cache that prevents the same image from being uploaded twice. More...
 
struct  TransformTrack
 Animation data for one GLTF node: position, rotation, and scale tracks. More...
 
struct  VertexElement
 Describes one interleaved vertex attribute within a VBO. More...
 
struct  VertexLayout
 Complete description of how vertex data is packed in a VBO. More...
 

Typedefs

using u8 = uint8_t
 Unsigned 8-bit integer.
 
using u16 = uint16_t
 Unsigned 16-bit integer.
 
using u32 = uint32_t
 Unsigned 32-bit integer — also the GL index type.
 
using u64 = uint64_t
 Unsigned 64-bit integer.
 
using i8 = int8_t
 Signed 8-bit integer.
 
using i16 = int16_t
 Signed 16-bit integer.
 
using i32 = int32_t
 Signed 32-bit integer — used for GL enums and sizes.
 
using i64 = int64_t
 Signed 64-bit integer.
 
using f32 = float
 32-bit IEEE float — the standard GL scalar type.
 
using f64 = double
 64-bit double — used for high-precision timing.
 
using usize = size_t
 Platform-native unsigned size type.
 
using str = std::string
 Convenience alias for std::string.
 
using vec2 = glm::vec2
 2-component float vector (e.g. UV coordinates, mouse position).
 
using vec3 = glm::vec3
 3-component float vector (e.g. world position, RGB colour, normals).
 
using vec4 = glm::vec4
 4-component float vector (e.g. RGBA colour, homogeneous coords).
 
using ivec2 = glm::ivec2
 2-component signed integer vector.
 
using ivec3 = glm::ivec3
 3-component signed integer vector.
 
using ivec4 = glm::ivec4
 4-component signed integer vector.
 
using uvec2 = glm::uvec2
 2-component unsigned integer vector.
 
using uvec3 = glm::uvec3
 3-component unsigned integer vector.
 
using uvec4 = glm::uvec4
 4-component unsigned integer vector.
 
using mat3 = glm::mat3
 3×3 column-major float matrix (e.g. normal matrix).
 
using mat4 = glm::mat4
 4×4 column-major float matrix (model/view/projection).
 
using quat = glm::quat
 Unit quaternion for rotation (avoids gimbal lock).
 

Enumerations

enum class  DebugView : int { DebugView::Color = 0 , DebugView::Normal = 1 , DebugView::Depth = 2 }
 Renderer tuning struct passed to the post-process shader each frame. More...
 
enum class  BlitMode : int { Color = 0 , SplatRed = 1 , DecodeNrm = 2 }
 Blit modes for BlitNearest. More...
 
enum class  Key : i16 {
  Key::Unknown = -1 , Key::Space = 32 , Key::Apostrophe = 39 , Key::Comma = 44 ,
  Key::Minus = 45 , Key::Period = 46 , Key::Slash = 47 , Key::Num0 = 48 ,
  Key::Num1 = 49 , Key::Num2 = 50 , Key::Num3 = 51 , Key::Num4 = 52 ,
  Key::Num5 = 53 , Key::Num6 = 54 , Key::Num7 = 55 , Key::Num8 = 56 ,
  Key::Num9 = 57 , Key::Semicolon = 59 , Key::Equal = 61 , Key::A = 65 ,
  Key::B = 66 , Key::C = 67 , Key::D = 68 , Key::E = 69 ,
  Key::F = 70 , Key::G = 71 , Key::H = 72 , Key::I = 73 ,
  Key::J = 74 , Key::K = 75 , Key::L = 76 , Key::M = 77 ,
  Key::N = 78 , Key::O = 79 , Key::P = 80 , Key::Q = 81 ,
  Key::R = 82 , Key::S = 83 , Key::T = 84 , Key::U = 85 ,
  Key::V = 86 , Key::W = 87 , Key::X = 88 , Key::Y = 89 ,
  Key::Z = 90 , Key::LeftBracket = 91 , Key::Backslash = 92 , Key::RightBracket = 93 ,
  Key::GraveAccent = 96 , Key::Escape = 256 , Key::Enter = 257 , Key::Tab = 258 ,
  Key::Backspace = 259 , Key::Insert = 260 , Key::Delete = 261 , Key::Right = 262 ,
  Key::Left = 263 , Key::Down = 264 , Key::Up = 265 , Key::PageUp = 266 ,
  Key::PageDown = 267 , Key::Home = 268 , Key::End = 269 , Key::CapsLock = 280 ,
  Key::ScrollLock = 281 , Key::NumLock = 282 , Key::PrintScreen = 283 , Key::Pause = 284 ,
  Key::F1 = 290 , Key::F2 = 291 , Key::F3 = 292 , Key::F4 = 293 ,
  Key::F5 = 294 , Key::F6 = 295 , Key::F7 = 296 , Key::F8 = 297 ,
  Key::F9 = 298 , Key::F10 = 299 , Key::F11 = 300 , Key::F12 = 301 ,
  Key::Kp0 = 320 , Key::Kp1 = 321 , Key::Kp2 = 322 , Key::Kp3 = 323 ,
  Key::Kp4 = 324 , Key::Kp5 = 325 , Key::Kp6 = 326 , Key::Kp7 = 327 ,
  Key::Kp8 = 328 , Key::Kp9 = 329 , Key::KpDecimal = 330 , Key::KpDivide = 331 ,
  Key::KpMultiply = 332 , Key::KpSubtract = 333 , Key::KpAdd = 334 , Key::KpEnter = 335 ,
  Key::KpEqual = 336 , Key::LeftShift = 340 , Key::LeftControl = 341 , Key::LeftAlt = 342 ,
  Key::LeftSuper = 343 , Key::RightShift = 344 , Key::RightControl = 345 , Key::RightAlt = 346 ,
  Key::RightSuper = 347 , Key::Menu = 348
}
 Keyboard key + mouse button identifier (GLFW-compatible values). More...
 
enum class  MouseButton : i8 {
  Left = 0 , Right = 1 , Middle = 2 , Btn4 = 3 ,
  Btn5 = 4 , Btn6 = 5 , Btn7 = 6 , Btn8 = 7
}
 
enum class  LogLevel : u8 { Info , Warn , Error , Fatal }
 
enum class  CollisionObjectType { RigidBody , KinematicCharacterController }
 
enum class  BodyType { BodyType::Static , BodyType::Dynamic , BodyType::Kinematic }
 Simulation category for a RigidBody. More...
 

Functions

std::shared_ptr< SkeletalAnimationClipMakeBreathingIdleClip (const Skeleton &skeleton, f32 duration=4.0f, f32 ampScale=1.0f)
 Build a looping breathing/sway clip targeting whichever of the canonical arm bones exist in skeleton. Bones it doesn't find are silently skipped, so this works for full bodies, FPS arms-only rigs, and partial rigs alike.
 
void ResetPoseToBind (const Skeleton &skeleton, Pose &pose)
 Resize pose buffers to match skeleton and reset to bind pose.
 
void EvaluatePose (const SkeletalAnimationClip &clip, const Skeleton &skeleton, f32 time, Pose &pose)
 Sample clip at time and write each animated bone's TRS into pose.localTransforms.
 
void ComputePalette (const Skeleton &skeleton, Pose &pose)
 Concatenate parent transforms and apply offsetMatrix to produce the GPU palette.
 
static void InspectTransform (GameObject *obj)
 
static void InspectCamera (CameraComponent *c)
 
static void InspectLight (LightComponent *c)
 
static void InspectPlayer (PlayerControllerComponent *c)
 
static void InspectMesh (MeshComponent *)
 
void KeyCallback (GLFWwindow *window, int key, int, int action, int)
 
void MouseButtonCallback (GLFWwindow *window, int button, int action, int mods)
 
void CursorPositionCallback (GLFWwindow *window, f64 xpos, f64 ypos)
 
std::unique_ptr< RendererBackendCreateOpenGLRendererBackend (GraphicsAPI &graphicsAPI)
 
void BlitNearest (GLuint srcTexture, int dstW, int dstH, BlitMode mode)
 
static bool EditorSwallowsInput ()
 
void LogEmit (LogLevel level, const char *file, int line, const char *fmt,...) __attribute__((format(printf
 Emit a formatted log line to stdout/stderr and the ring buffer.
 
const std::deque< LogEntry > & LogGetEntries ()
 Snapshot of the in-memory log buffer (bounded ring).
 
void LogClear ()
 Clear the in-memory log buffer.
 
const char * shortFile (const char *file)
 
void ParseGLTFNode (cgltf_node *node, GameObject *parent, const std::filesystem::path &folder)
 

Variables

auto ReadScalar
 
auto ReadVec3
 
auto ReadQuat
 
auto ReadTimes
 
auto ReadOutputVec3
 
auto ReadOutputQuat
 
auto readFloats
 
auto readIndex
 

Enumeration Type Documentation

◆ BlitMode

enum class mnd::BlitMode : int
strong

Blit modes for BlitNearest.

Enumerator
Color 

Sample RGB straight through (default).

SplatRed 

Output (r,r,r,1) — used for visualising depth.

DecodeNrm 

Output rgb as-is from a packed-normal texture (no remap).

Definition at line 60 of file RenderTarget.h.

◆ CollisionObjectType

enum class mnd::CollisionObjectType
strong
Enumerator
RigidBody 
KinematicCharacterController 

Definition at line 14 of file CollisionObject.h.

◆ LogLevel

enum class mnd::LogLevel : u8
strong
Enumerator
Info 
Warn 
Error 
Fatal 

Definition at line 53 of file Log.h.

◆ MouseButton

enum class mnd::MouseButton : i8
strong
Enumerator
Left 
Right 
Middle 
Btn4 
Btn5 
Btn6 
Btn7 
Btn8 

Definition at line 148 of file Key.h.

Function Documentation

◆ BlitNearest()

void mnd::BlitNearest ( GLuint  srcTexture,
int  dstW,
int  dstH,
BlitMode  mode = BlitMode::Color 
)

Fullscreen nearest-neighbor blit of a 2D texture into the currently bound framebuffer. Lazily compiles its own vertex-less shader on first call. Safe to call every frame.

Definition at line 241 of file RenderTarget.cpp.

Referenced by mnd::Engine::Run().

◆ ComputePalette()

void mnd::ComputePalette ( const Skeleton skeleton,
Pose pose 
)

Concatenate parent transforms and apply offsetMatrix to produce the GPU palette.

Skeleton bones must be stored such that a parent comes before its children (topological order). ModelImporter guarantees this.

Definition at line 127 of file Pose.cpp.

References mnd::Pose::finalPalette, mnd::Skeleton::GetBones(), mnd::Pose::localTransforms, and ResetPoseToBind().

Referenced by mnd::AnimationComponent::Update().

◆ CreateOpenGLRendererBackend()

std::unique_ptr< RendererBackend > mnd::CreateOpenGLRendererBackend ( GraphicsAPI graphicsAPI)

Definition at line 18 of file OpenGLRendererBackend.cpp.

Referenced by mnd::Engine::Init().

◆ CursorPositionCallback()

void mnd::CursorPositionCallback ( GLFWwindow *  window,
f64  xpos,
f64  ypos 
)

◆ EditorSwallowsInput()

◆ EvaluatePose()

void mnd::EvaluatePose ( const SkeletalAnimationClip clip,
const Skeleton skeleton,
f32  time,
Pose pose 
)

Sample clip at time and write each animated bone's TRS into pose.localTransforms.

Bones not driven by the clip retain their bind-pose local transform.

Definition at line 96 of file Pose.cpp.

References mnd::Bone::bindPos, mnd::Bone::bindRot, mnd::Bone::bindScale, mnd::Skeleton::GetBones(), mnd::Pose::localTransforms, ResetPoseToBind(), and mnd::SkeletalAnimationClip::tracks.

Referenced by mnd::AnimationComponent::Update().

◆ InspectCamera()

◆ InspectLight()

static void mnd::InspectLight ( LightComponent c)
static

Definition at line 394 of file Editor.cpp.

References mnd::LightComponent::GetColor(), and mnd::LightComponent::SetColor().

◆ InspectMesh()

static void mnd::InspectMesh ( MeshComponent )
static

Definition at line 431 of file Editor.cpp.

◆ InspectPlayer()

◆ InspectTransform()

◆ KeyCallback()

void mnd::KeyCallback ( GLFWwindow *  window,
int  key,
int  ,
int  action,
int   
)

◆ LogClear()

void mnd::LogClear ( )

Clear the in-memory log buffer.

Definition at line 67 of file Log.cpp.

◆ LogEmit()

void mnd::LogEmit ( LogLevel  level,
const char *  file,
int  line,
const char *  fmt,
  ... 
)

Emit a formatted log line to stdout/stderr and the ring buffer.

Definition at line 37 of file Log.cpp.

References Info, kAnsiReset, kLogFullBufSize, kLogMessageBufSize, kMaxLogEntries, and shortFile().

◆ LogGetEntries()

void const std::deque< LogEntry > & mnd::LogGetEntries ( )

Snapshot of the in-memory log buffer (bounded ring).

Definition at line 62 of file Log.cpp.

◆ MakeBreathingIdleClip()

std::shared_ptr< SkeletalAnimationClip > mnd::MakeBreathingIdleClip ( const Skeleton skeleton,
f32  duration = 4.0f,
f32  ampScale = 1.0f 
)

Build a looping breathing/sway clip targeting whichever of the canonical arm bones exist in skeleton. Bones it doesn't find are silently skipped, so this works for full bodies, FPS arms-only rigs, and partial rigs alike.

Parameters
skeletonSource skeleton; bind-pose decomposition is read for fallback.
durationClip length in seconds (default 4 — a slow breath cycle).
Returns
Shared SkeletalAnimationClip tagged with name "idle".

Definition at line 50 of file IdleClip.cpp.

References mnd::BoneTrack::boneIndex, mnd::Skeleton::FindBoneIndex(), mnd::Skeleton::GetBones(), mnd::BoneTrack::rotations, and mnd::Skeleton::Size().

Referenced by mnd::ModelImporter::Import().

◆ MouseButtonCallback()

void mnd::MouseButtonCallback ( GLFWwindow *  window,
int  button,
int  action,
int  mods 
)

◆ ParseGLTFNode()

◆ ResetPoseToBind()

void mnd::ResetPoseToBind ( const Skeleton skeleton,
Pose pose 
)

Resize pose buffers to match skeleton and reset to bind pose.

Definition at line 84 of file Pose.cpp.

References mnd::Pose::finalPalette, mnd::Skeleton::GetBones(), and mnd::Pose::localTransforms.

Referenced by ComputePalette(), EvaluatePose(), and mnd::AnimationComponent::Play().

◆ shortFile()

const char * mnd::shortFile ( const char *  file)
inline

Definition at line 26 of file Log.h.

References kLogPrefixBufSize.

Referenced by LogEmit().

Variable Documentation

◆ readFloats

auto mnd::readFloats
Initial value:
= [](const cgltf_accessor *acc, cgltf_size i, float *out, int n)
{
std::fill(out, out + n, 0.0f);
return cgltf_accessor_read_float(acc, i, out, n) == 1;
}

Definition at line 218 of file GameObject.cpp.

Referenced by ParseGLTFNode().

◆ readIndex

auto mnd::readIndex
Initial value:
= [](const cgltf_accessor *acc, cgltf_size i)
{
cgltf_uint out = 0;
cgltf_bool ok = cgltf_accessor_read_uint(acc, i, &out, 1);
return ok ? static_cast<u32>(out) : 0;
}
uint32_t u32
Unsigned 32-bit integer — also the GL index type.
Definition Types.h:32

Definition at line 224 of file GameObject.cpp.

Referenced by ParseGLTFNode().

◆ ReadOutputQuat

auto mnd::ReadOutputQuat
Initial value:
= [](cgltf_accessor *acc, std::vector<glm::quat> &outValues)
{
outValues.resize(acc->count);
for (cgltf_size i = 0; i < acc->count; ++i)
{
outValues[i] = ReadQuat(acc, i);
}
}
auto ReadQuat

Definition at line 66 of file GameObject.cpp.

Referenced by mnd::GameObject::LoadGLTF().

◆ ReadOutputVec3

auto mnd::ReadOutputVec3
Initial value:
= [](cgltf_accessor *acc, std::vector<glm::vec3> &outValues)
{
outValues.resize(acc->count);
for (cgltf_size i = 0; i < acc->count; ++i)
{
outValues[i] = ReadVec3(acc, i);
}
}
auto ReadVec3

Definition at line 57 of file GameObject.cpp.

Referenced by mnd::GameObject::LoadGLTF().

◆ ReadQuat

auto mnd::ReadQuat
Initial value:
= [](cgltf_accessor *acc, cgltf_size index)
{
float res[4] = {0.0f, 0.0f, 0.0f, 1.0f};
cgltf_accessor_read_float(acc, index, res, 4);
return glm::quat(res[3], res[0], res[1], res[2]);
}

Definition at line 41 of file GameObject.cpp.

◆ ReadScalar

auto mnd::ReadScalar
Initial value:
= [](cgltf_accessor *acc, cgltf_size index)
{
float res = 0.0f;
cgltf_accessor_read_float(acc, index, &res, 1);
return res;
}

Definition at line 27 of file GameObject.cpp.

◆ ReadTimes

auto mnd::ReadTimes
Initial value:
= [](cgltf_accessor *acc, std::vector<float> &outTimes)
{
outTimes.resize(acc->count);
for (cgltf_size i = 0; i < acc->count; ++i)
{
outTimes[i] = ReadScalar(acc, i);
}
}
auto ReadScalar

Definition at line 48 of file GameObject.cpp.

Referenced by mnd::GameObject::LoadGLTF().

◆ ReadVec3

auto mnd::ReadVec3
Initial value:
= [](cgltf_accessor *acc, cgltf_size index)
{
glm::vec3 res;
cgltf_accessor_read_float(acc, index, glm::value_ptr(res), 3);
return res;
}

Definition at line 34 of file GameObject.cpp.

Referenced by mnd::ParticleEmitterComponent::LoadProperties().