Monad Engine da02fba2
> Undercity Codex_
Loading...
Searching...
No Matches
Constants.h File Reference

Engine-wide compile-time tunables and ANSI colour codes. More...

#include <cstddef>
#include "Types.h"
+ Include dependency graph for Constants.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Variables

constexpr mnd::i32 kDefaultWindowWidth = 1280
 
constexpr mnd::i32 kDefaultWindowHeight = 720
 
constexpr const char * kDefaultWindowTitle = "GL Game Engine"
 
constexpr std::size_t kMaxLogEntries = 1024
 
constexpr std::size_t kLogMessageBufSize = 1024
 
constexpr std::size_t kLogFullBufSize = 1280
 
constexpr mnd::i32 kLogPrefixBufSize = 256
 
constexpr const char * kAnsiReset = "\033[0m"
 
constexpr const char * kAnsiInfo = "\033[32m"
 
constexpr const char * kAnsiWarn = "\033[33m"
 
constexpr const char * kAnsiError = "\033[31m"
 
constexpr const char * kAnsiFatal = "\033[1;31m"
 
constexpr mnd::i32 kDefaultInternalWidth = 1920
 
constexpr mnd::i32 kDefaultInternalHeight = 1080
 
constexpr mnd::f32 kDefaultAmbient = 0.35F
 
constexpr mnd::i32 kInternalPresetTinyW = 160
 
constexpr mnd::i32 kInternalPresetTinyH = 120
 
constexpr mnd::i32 kInternalPresetLowW = 320
 
constexpr mnd::i32 kInternalPresetLowH = 240
 
constexpr mnd::i32 kInternalPresetMedW = 640
 
constexpr mnd::i32 kInternalPresetMedH = 480
 
constexpr mnd::i32 kInternalResMin = 16
 
constexpr mnd::i32 kInternalResMax = 4096
 
constexpr const char * kGlslVersionDirective = "#version 330 core"
 
constexpr mnd::i32 kShaderInfoLogSize = 512
 
constexpr mnd::i32 kStandardVertexFloats = 11
 
constexpr mnd::f32 kPI = 3.14159265358979323846f
 
constexpr mnd::i32 kMaxKeys = 512
 
constexpr mnd::i32 kMaxMouseButtons = 16
 
constexpr mnd::f32 kGravity = -13.81F
 
constexpr mnd::f32 kDefaultCapsuleRadius = 0.4F
 
constexpr mnd::f32 kDefaultCapsuleHeight = 1.2F
 
constexpr mnd::f32 kDefaultStepHeight = 0.35F
 
constexpr mnd::f32 kPitchLimitDegrees = 90.0F
 
constexpr mnd::f32 kCameraFov = 60.0F
 
constexpr mnd::f32 kCameraNearPlane = 0.01F
 
constexpr mnd::f32 kCameraFarPlane = 1000.0F
 
constexpr mnd::f32 kDefaultMouseSensitivity = 25.0F
 
constexpr mnd::f32 kDefaultMoveSpeed = 7.5F
 
constexpr mnd::f32 kDefaultJumpSpeed = 0.6F
 
constexpr mnd::f32 kQuakeGroundAccel = 10.0F
 sv_accelerate.
 
constexpr mnd::f32 kQuakeAirAccel = 10.0F
 sv_airaccelerate (HL1 = 10; Q3 = 1).
 
constexpr mnd::f32 kQuakeFriction = 4.0F
 sv_friction.
 
constexpr mnd::f32 kQuakeStopSpeed = 2.5F
 sv_stopspeed (100 ups).
 
constexpr mnd::f32 kQuakeAirCap = 30.0F
 
constexpr mnd::f32 kFixedTimeStep = 1.0F / 60.0F
 
constexpr mnd::i32 kMaxSubSteps = 4
 
constexpr const char * kAssetsDirName = "assets"
 
constexpr const char * kJsonKeyName = "name"
 
constexpr const char * kJsonKeyType = "type"
 
constexpr const char * kJsonKeyPath = "path"
 
constexpr const char * kJsonKeyPosition = "position"
 
constexpr const char * kJsonKeyRotation = "rotation"
 
constexpr const char * kJsonKeyScale = "scale"
 
constexpr const char * kJsonKeyComponents = "components"
 
constexpr const char * kJsonKeyChildren = "children"
 
constexpr const char * kJsonKeyObjects = "objects"
 
constexpr const char * kJsonKeyCamera = "camera"
 
constexpr const char * kJsonKeyX = "x"
 
constexpr const char * kJsonKeyY = "y"
 
constexpr const char * kJsonKeyZ = "z"
 
constexpr const char * kJsonKeyW = "w"
 
constexpr const char * kSceneTypeGltf = "gltf"
 
constexpr const char * kSceneTypeFbx = "fbx"
 
constexpr const char * kSceneTypeModel = "model"
 
constexpr const char * kDefaultObjectName = "Object"
 
constexpr const char * kDefaultSceneName = "noname"
 
constexpr const char * kRootObjectLabel = ""
 

Detailed Description

Engine-wide compile-time tunables and ANSI colour codes.

Defaults that several subsystems read at startup live here so you can adjust window size, gravity, internal-resolution presets, log buffer limits and a few other knobs in one place. All values are inline constexpr to give every translation unit zero-cost access without ODR worries.

physics.SetGravity({0.0F, kGravity, 0.0F});
constexpr mnd::i32 kDefaultWindowHeight
Definition Constants.h:26
constexpr mnd::i32 kDefaultWindowWidth
Definition Constants.h:25
constexpr mnd::f32 kGravity
Definition Constants.h:67

Definition in file Constants.h.

Variable Documentation

◆ kAnsiError

constexpr const char* kAnsiError = "\033[31m"
inlineconstexpr

Definition at line 39 of file Constants.h.

◆ kAnsiFatal

constexpr const char* kAnsiFatal = "\033[1;31m"
inlineconstexpr

Definition at line 40 of file Constants.h.

◆ kAnsiInfo

constexpr const char* kAnsiInfo = "\033[32m"
inlineconstexpr

Definition at line 37 of file Constants.h.

◆ kAnsiReset

constexpr const char* kAnsiReset = "\033[0m"
inlineconstexpr

Definition at line 36 of file Constants.h.

Referenced by mnd::LogEmit().

◆ kAnsiWarn

constexpr const char* kAnsiWarn = "\033[33m"
inlineconstexpr

Definition at line 38 of file Constants.h.

◆ kAssetsDirName

constexpr const char* kAssetsDirName = "assets"
inlineconstexpr

Definition at line 104 of file Constants.h.

Referenced by mnd::FileSystem::GetAssetsFolder().

◆ kCameraFarPlane

constexpr mnd::f32 kCameraFarPlane = 1000.0F
inlineconstexpr

Definition at line 76 of file Constants.h.

◆ kCameraFov

constexpr mnd::f32 kCameraFov = 60.0F
inlineconstexpr

Definition at line 74 of file Constants.h.

◆ kCameraNearPlane

constexpr mnd::f32 kCameraNearPlane = 0.01F
inlineconstexpr

Definition at line 75 of file Constants.h.

◆ kDefaultAmbient

constexpr mnd::f32 kDefaultAmbient = 0.35F
inlineconstexpr

Definition at line 45 of file Constants.h.

◆ kDefaultCapsuleHeight

constexpr mnd::f32 kDefaultCapsuleHeight = 1.2F
inlineconstexpr

Definition at line 69 of file Constants.h.

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

◆ kDefaultCapsuleRadius

constexpr mnd::f32 kDefaultCapsuleRadius = 0.4F
inlineconstexpr

Definition at line 68 of file Constants.h.

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

◆ kDefaultInternalHeight

constexpr mnd::i32 kDefaultInternalHeight = 1080
inlineconstexpr

Definition at line 44 of file Constants.h.

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

◆ kDefaultInternalWidth

constexpr mnd::i32 kDefaultInternalWidth = 1920
inlineconstexpr

Definition at line 43 of file Constants.h.

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

◆ kDefaultJumpSpeed

constexpr mnd::f32 kDefaultJumpSpeed = 0.6F
inlineconstexpr

Definition at line 86 of file Constants.h.

◆ kDefaultMouseSensitivity

constexpr mnd::f32 kDefaultMouseSensitivity = 25.0F
inlineconstexpr

Definition at line 80 of file Constants.h.

◆ kDefaultMoveSpeed

constexpr mnd::f32 kDefaultMoveSpeed = 7.5F
inlineconstexpr

Definition at line 83 of file Constants.h.

◆ kDefaultObjectName

constexpr const char* kDefaultObjectName = "Object"
inlineconstexpr

Definition at line 125 of file Constants.h.

◆ kDefaultSceneName

constexpr const char* kDefaultSceneName = "noname"
inlineconstexpr

Definition at line 126 of file Constants.h.

Referenced by mnd::Scene::Load().

◆ kDefaultStepHeight

constexpr mnd::f32 kDefaultStepHeight = 0.35F
inlineconstexpr

◆ kDefaultWindowHeight

constexpr mnd::i32 kDefaultWindowHeight = 720
inlineconstexpr

Definition at line 26 of file Constants.h.

◆ kDefaultWindowTitle

constexpr const char* kDefaultWindowTitle = "GL Game Engine"
inlineconstexpr

Definition at line 27 of file Constants.h.

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

◆ kDefaultWindowWidth

constexpr mnd::i32 kDefaultWindowWidth = 1280
inlineconstexpr

Definition at line 25 of file Constants.h.

◆ kFixedTimeStep

constexpr mnd::f32 kFixedTimeStep = 1.0F / 60.0F
inlineconstexpr

Definition at line 100 of file Constants.h.

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

◆ kGlslVersionDirective

constexpr const char* kGlslVersionDirective = "#version 330 core"
inlineconstexpr

Definition at line 56 of file Constants.h.

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

◆ kGravity

constexpr mnd::f32 kGravity = -13.81F
inlineconstexpr

Definition at line 67 of file Constants.h.

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

◆ kInternalPresetLowH

constexpr mnd::i32 kInternalPresetLowH = 240
inlineconstexpr

Definition at line 50 of file Constants.h.

◆ kInternalPresetLowW

constexpr mnd::i32 kInternalPresetLowW = 320
inlineconstexpr

Definition at line 49 of file Constants.h.

◆ kInternalPresetMedH

constexpr mnd::i32 kInternalPresetMedH = 480
inlineconstexpr

Definition at line 52 of file Constants.h.

◆ kInternalPresetMedW

constexpr mnd::i32 kInternalPresetMedW = 640
inlineconstexpr

Definition at line 51 of file Constants.h.

◆ kInternalPresetTinyH

constexpr mnd::i32 kInternalPresetTinyH = 120
inlineconstexpr

Definition at line 48 of file Constants.h.

◆ kInternalPresetTinyW

constexpr mnd::i32 kInternalPresetTinyW = 160
inlineconstexpr

Definition at line 47 of file Constants.h.

◆ kInternalResMax

constexpr mnd::i32 kInternalResMax = 4096
inlineconstexpr

Definition at line 54 of file Constants.h.

◆ kInternalResMin

constexpr mnd::i32 kInternalResMin = 16
inlineconstexpr

Definition at line 53 of file Constants.h.

◆ kJsonKeyCamera

constexpr const char* kJsonKeyCamera = "camera"
inlineconstexpr

Definition at line 116 of file Constants.h.

Referenced by mnd::Scene::Load().

◆ kJsonKeyChildren

constexpr const char* kJsonKeyChildren = "children"
inlineconstexpr

Definition at line 114 of file Constants.h.

◆ kJsonKeyComponents

constexpr const char* kJsonKeyComponents = "components"
inlineconstexpr

Definition at line 113 of file Constants.h.

◆ kJsonKeyName

constexpr const char* kJsonKeyName = "name"
inlineconstexpr

Definition at line 107 of file Constants.h.

Referenced by mnd::Scene::Load().

◆ kJsonKeyObjects

constexpr const char* kJsonKeyObjects = "objects"
inlineconstexpr

Definition at line 115 of file Constants.h.

Referenced by mnd::Scene::Load().

◆ kJsonKeyPath

constexpr const char* kJsonKeyPath = "path"
inlineconstexpr

Definition at line 109 of file Constants.h.

◆ kJsonKeyPosition

constexpr const char* kJsonKeyPosition = "position"
inlineconstexpr

Definition at line 110 of file Constants.h.

◆ kJsonKeyRotation

constexpr const char* kJsonKeyRotation = "rotation"
inlineconstexpr

Definition at line 111 of file Constants.h.

◆ kJsonKeyScale

constexpr const char* kJsonKeyScale = "scale"
inlineconstexpr

Definition at line 112 of file Constants.h.

◆ kJsonKeyType

constexpr const char* kJsonKeyType = "type"
inlineconstexpr

Definition at line 108 of file Constants.h.

◆ kJsonKeyW

constexpr const char* kJsonKeyW = "w"
inlineconstexpr

Definition at line 120 of file Constants.h.

◆ kJsonKeyX

constexpr const char* kJsonKeyX = "x"
inlineconstexpr

Definition at line 117 of file Constants.h.

◆ kJsonKeyY

constexpr const char* kJsonKeyY = "y"
inlineconstexpr

Definition at line 118 of file Constants.h.

◆ kJsonKeyZ

constexpr const char* kJsonKeyZ = "z"
inlineconstexpr

Definition at line 119 of file Constants.h.

◆ kLogFullBufSize

constexpr std::size_t kLogFullBufSize = 1280
inlineconstexpr

Definition at line 32 of file Constants.h.

Referenced by mnd::LogEmit().

◆ kLogMessageBufSize

constexpr std::size_t kLogMessageBufSize = 1024
inlineconstexpr

Definition at line 31 of file Constants.h.

Referenced by mnd::LogEmit().

◆ kLogPrefixBufSize

constexpr mnd::i32 kLogPrefixBufSize = 256
inlineconstexpr

Definition at line 33 of file Constants.h.

Referenced by mnd::shortFile().

◆ kMaxKeys

constexpr mnd::i32 kMaxKeys = 512
inlineconstexpr

Definition at line 63 of file Constants.h.

◆ kMaxLogEntries

constexpr std::size_t kMaxLogEntries = 1024
inlineconstexpr

Definition at line 30 of file Constants.h.

Referenced by mnd::LogEmit().

◆ kMaxMouseButtons

constexpr mnd::i32 kMaxMouseButtons = 16
inlineconstexpr

Definition at line 64 of file Constants.h.

◆ kMaxSubSteps

constexpr mnd::i32 kMaxSubSteps = 4
inlineconstexpr

Definition at line 101 of file Constants.h.

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

◆ kPI

constexpr mnd::f32 kPI = 3.14159265358979323846f
inlineconstexpr

Definition at line 61 of file Constants.h.

Referenced by mnd::Mesh::CreateCapsule(), and mnd::Mesh::CreateSphere().

◆ kPitchLimitDegrees

constexpr mnd::f32 kPitchLimitDegrees = 90.0F
inlineconstexpr

Definition at line 73 of file Constants.h.

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

◆ kQuakeAirAccel

constexpr mnd::f32 kQuakeAirAccel = 10.0F
inlineconstexpr

sv_airaccelerate (HL1 = 10; Q3 = 1).

Definition at line 91 of file Constants.h.

◆ kQuakeAirCap

constexpr mnd::f32 kQuakeAirCap = 30.0F
inlineconstexpr

Definition at line 97 of file Constants.h.

◆ kQuakeFriction

constexpr mnd::f32 kQuakeFriction = 4.0F
inlineconstexpr

sv_friction.

Definition at line 92 of file Constants.h.

◆ kQuakeGroundAccel

constexpr mnd::f32 kQuakeGroundAccel = 10.0F
inlineconstexpr

sv_accelerate.

Definition at line 90 of file Constants.h.

◆ kQuakeStopSpeed

constexpr mnd::f32 kQuakeStopSpeed = 2.5F
inlineconstexpr

sv_stopspeed (100 ups).

Definition at line 93 of file Constants.h.

◆ kRootObjectLabel

constexpr const char* kRootObjectLabel = ""
inlineconstexpr

Definition at line 127 of file Constants.h.

Referenced by mnd::Scene::CreateObject().

◆ kSceneTypeFbx

constexpr const char* kSceneTypeFbx = "fbx"
inlineconstexpr

Definition at line 123 of file Constants.h.

◆ kSceneTypeGltf

constexpr const char* kSceneTypeGltf = "gltf"
inlineconstexpr

Definition at line 122 of file Constants.h.

◆ kSceneTypeModel

constexpr const char* kSceneTypeModel = "model"
inlineconstexpr

Definition at line 124 of file Constants.h.

◆ kShaderInfoLogSize

constexpr mnd::i32 kShaderInfoLogSize = 512
inlineconstexpr

Definition at line 57 of file Constants.h.

Referenced by mnd::GraphicsAPI::CreateShaderProgram().

◆ kStandardVertexFloats

constexpr mnd::i32 kStandardVertexFloats = 11
inlineconstexpr

Definition at line 60 of file Constants.h.

Referenced by mnd::Mesh::CreateBox(), and mnd::Mesh::CreateCube().