![]() |
Blamite Game Engine - blam!
00453.06.08.26.0624.blamite
The core library for the Blamite Game Engine.
|
#include "../rendering.h"#include <bgfx/bgfx.h>#include <bx/math.h>#include <bx/timer.h>#include <Strings/components/utils/io/io.h>#include <Strings/components/classes/events/game_engine_events/NewFrame/NewFrameEvent.h>#include "components/diagnostics/profiler/stats.h"#include "components/3rdparty/imgui/formats/bgfx/imgui.h"#include "components/resources/engine_globals/globals.h"#include "components/ui/imgui/imgui.h"#include "components/diagnostics/logger/logger.h"#include "components/core/tick/tick.h"#include "components/settings/config/config.h"#include "components/core/director/director.h"#include "components/ui/blam/ui.h"#include "components/rendering/bgfx/passes/passes.h"#include "components/content/tags/scenario.h"#include "components/core/input/keyboard.h"#include "api/v1/types/tags/classes/camera.h"#include "version_data.h"#include "BlamBgfxCallbacks.h"#include "core.h"
Include dependency graph for bgfx.cpp:Classes | |
| struct | mouse_info |
| struct | screen_vertex |
Functions | |
| bool | UsingBgfx () |
| BlamVector3 | CalculateLookAtTarget (BlamVector3 camera_position, BlamVector3 camera_rotation) |
| Calculates a look-at target position from a camera position and Euler rotation. More... | |
Variables | |
| bool | __using_bgfx = false |
| mouse_info | mouse = mouse_info() |
| uint32_t | reset_flags = BGFX_RESET_VSYNC |
| BlamBgfxCallbacks | callbacks_struct = BlamBgfxCallbacks() |
| BlamVector2 | viewport_size = { 640, 480 } |
| float | delta_time = 0.0f |
| uint64_t | state_flags_2d = BGFX_STATE_WRITE_RGB | BGFX_STATE_MSAA | BGFX_STATE_CULL_CCW | BGFX_STATE_BLEND_ALPHA |
| float | view_matrix_3d [16] |
| float | projection_3d [16] |
| bool | shader_reload_hack = false |
| BlamVector3 | bgfx_mouse_pos_3d = { 0, 0, 0 } |
| BlamVector3 | bgfx_gizmo_pos_3d = { 0, 0, 0 } |
| BlamVector2 | bgfx_ortho_window_size = { 320, 240 } |
| float | bgfx_last_zoom_level = 0.0f |
| bool | is_viewport_2d = false |
| bgfx::VertexBufferHandle | screen_quad_vb = BGFX_INVALID_HANDLE |
| bgfx::VertexLayout | screen_quad_layout |
| std::vector< BlamRenderPass * > | passes = std::vector<BlamRenderPass*>() |
| bgfx::ViewId | next_view_id = 0 |
| BlamVector3 CalculateLookAtTarget | ( | BlamVector3 | camera_position, |
| BlamVector3 | camera_rotation | ||
| ) |
Calculates a look-at target position from a camera position and Euler rotation.
The returned vec3 is intended to be passed as the _at parameter of bx::mtxLookAt. Rotation is interpreted as (pitch, yaw, roll) in degrees, where pitch rotates around the X axis and yaw rotates around the Y axis. Roll does not affect the look-at target itself - it would instead be baked into the up vector passed to bx::mtxLookAt.
The forward direction is built assuming a Y-up coordinate system. The resulting target sits exactly one unit ahead of the camera along its forward vector, which is all bx::mtxLookAt needs to derive the view basis.
| camera_position | Pointer to the camera's world-space position. |
| camera_rotation | Pointer to the camera's Euler rotation in degrees (pitch, yaw, roll). |
Here is the caller graph for this function:| bool UsingBgfx | ( | ) |
| bool __using_bgfx = false |
| BlamVector3 bgfx_gizmo_pos_3d = { 0, 0, 0 } |
| float bgfx_last_zoom_level = 0.0f |
| BlamVector3 bgfx_mouse_pos_3d = { 0, 0, 0 } |
| BlamVector2 bgfx_ortho_window_size = { 320, 240 } |
| BlamBgfxCallbacks callbacks_struct = BlamBgfxCallbacks() |
| float delta_time = 0.0f |
| bool is_viewport_2d = false |
| mouse_info mouse = mouse_info() |
| bgfx::ViewId next_view_id = 0 |
| std::vector<BlamRenderPass*> passes = std::vector<BlamRenderPass*>() |
| float projection_3d[16] |
| uint32_t reset_flags = BGFX_RESET_VSYNC |
| bgfx::VertexLayout screen_quad_layout |
| bgfx::VertexBufferHandle screen_quad_vb = BGFX_INVALID_HANDLE |
| bool shader_reload_hack = false |
| uint64_t state_flags_2d = BGFX_STATE_WRITE_RGB | BGFX_STATE_MSAA | BGFX_STATE_CULL_CCW | BGFX_STATE_BLEND_ALPHA |
| float view_matrix_3d[16] |
| BlamVector2 viewport_size = { 640, 480 } |